Skip to content

Commit 1d38e93

Browse files
author
Richard Lee
committed
Add all missing fields to ResponseItem and related classes.
Fix types to match Go code.
1 parent 528e676 commit 1d38e93

File tree

3 files changed

+42
-23
lines changed

3 files changed

+42
-23
lines changed

src/main/java/com/github/dockerjava/api/model/BuildResponseItem.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ public class BuildResponseItem extends ResponseItem {
1414

1515
private static final String BUILD_SUCCESS = "Successfully built";
1616

17-
@JsonProperty("stream")
18-
private String stream;
19-
20-
public String getStream() {
21-
return stream;
22-
}
23-
2417
/**
2518
* Returns whether the stream field indicates a successful build operation
2619
*/

src/main/java/com/github/dockerjava/api/model/PushResponseItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class PushResponseItem extends ResponseItem {
1818
*/
1919
@JsonIgnore
2020
public boolean isErrorIndicated() {
21-
if (getError() == null)
21+
if (getError() == null && getErrorDetail() == null)
2222
return false;
2323

2424
return true;

src/main/java/com/github/dockerjava/api/model/ResponseItem.java

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,83 @@ public class ResponseItem implements Serializable {
1616

1717
private static final long serialVersionUID = -5187169652557467828L;
1818

19+
@JsonProperty("stream")
20+
private String stream;
21+
1922
@JsonProperty("status")
2023
private String status;
2124

25+
@JsonProperty("progressDetail")
26+
private ProgressDetail progressDetail;
27+
2228
@JsonProperty("progress")
2329
private String progress;
2430

25-
@JsonProperty("progressDetail")
26-
private ProgressDetail progressDetail;
31+
@JsonProperty("id")
32+
private String id;
2733

28-
@JsonProperty("error")
29-
private String error;
34+
@JsonProperty("from")
35+
private String from;
36+
37+
@JsonProperty("time")
38+
private long time;
3039

3140
@JsonProperty("errorDetail")
3241
private ErrorDetail errorDetail;
3342

34-
@JsonProperty("id")
35-
private String id;
43+
@JsonProperty("error")
44+
private String error;
3645

37-
public String getStatus() {
38-
return status;
46+
public String getStream() {
47+
return stream;
3948
}
4049

41-
public String getProgress() {
42-
return progress;
50+
public String getStatus() {
51+
return status;
4352
}
4453

4554
public ProgressDetail getProgressDetail() {
4655
return progressDetail;
4756
}
4857

58+
@Deprecated
59+
public String getProgress() {
60+
return progress;
61+
}
62+
4963
public String getId() {
5064
return id;
5165
}
5266

53-
public String getError() {
54-
return error;
67+
public String getFrom() {
68+
return from;
69+
}
70+
71+
public long getTime() {
72+
return time;
5573
}
5674

5775
public ErrorDetail getErrorDetail() {
5876
return errorDetail;
5977
}
6078

79+
@Deprecated
80+
public String getError() {
81+
return error;
82+
}
83+
6184
@JsonIgnoreProperties(ignoreUnknown = false)
6285
public static class ProgressDetail implements Serializable {
6386
private static final long serialVersionUID = -1954994695645715264L;
6487

6588
@JsonProperty("current")
66-
int current;
89+
long current;
6790

6891
@JsonProperty("total")
69-
int total;
92+
long total;
93+
94+
@JsonProperty("start")
95+
long start;
7096

7197
@Override
7298
public String toString() {
@@ -79,7 +105,7 @@ public static class ErrorDetail implements Serializable {
79105
private static final long serialVersionUID = -9136704865403084083L;
80106

81107
@JsonProperty("code")
82-
String code;
108+
int code;
83109

84110
@JsonProperty("message")
85111
String message;

0 commit comments

Comments
 (0)