forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponseItem.java
More file actions
200 lines (157 loc) · 4.05 KB
/
Copy pathResponseItem.java
File metadata and controls
200 lines (157 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.annotation.CheckForNull;
import java.io.Serializable;
/**
* Represents a pull response stream item
*/
@EqualsAndHashCode
@ToString
public class ResponseItem implements Serializable {
private static final long serialVersionUID = -5187169652557467828L;
@JsonProperty("stream")
private String stream;
@JsonProperty("status")
private String status;
@JsonProperty("progressDetail")
private ProgressDetail progressDetail;
@Deprecated
@JsonProperty("progress")
private String progress;
@JsonProperty("id")
private String id;
@JsonProperty("from")
private String from;
@JsonProperty("time")
private Long time;
@JsonProperty("errorDetail")
private ErrorDetail errorDetail;
@Deprecated
@JsonProperty("error")
private String error;
/**
* @since {@link RemoteApiVersion#VERSION_1_22}
*/
@JsonProperty("aux")
private AuxDetail aux;
@CheckForNull
public String getStream() {
return stream;
}
@CheckForNull
public String getStatus() {
return status;
}
@CheckForNull
public ProgressDetail getProgressDetail() {
return progressDetail;
}
@CheckForNull
@Deprecated
public String getProgress() {
return progress;
}
@CheckForNull
public String getId() {
return id;
}
@CheckForNull
public String getFrom() {
return from;
}
@CheckForNull
public Long getTime() {
return time;
}
@CheckForNull
public ErrorDetail getErrorDetail() {
return errorDetail;
}
@Deprecated
public String getError() {
return error;
}
/**
* @see #aux
*/
@CheckForNull
public AuxDetail getAux() {
return aux;
}
/**
* Returns whether the error field indicates an error
*
* @returns true: the error field indicates an error, false: the error field doesn't indicate an error
*/
@JsonIgnore
public boolean isErrorIndicated() {
// check both the deprecated and current error fields, just in case
return getError() != null || getErrorDetail() != null;
}
@EqualsAndHashCode
@ToString
public static class ProgressDetail implements Serializable {
private static final long serialVersionUID = -1954994695645715264L;
@JsonProperty("current")
Long current;
@JsonProperty("total")
Long total;
@JsonProperty("start")
Long start;
@CheckForNull
public Long getCurrent() {
return current;
}
@CheckForNull
public Long getTotal() {
return total;
}
@CheckForNull
public Long getStart() {
return start;
}
}
@EqualsAndHashCode
@ToString
public static class ErrorDetail implements Serializable {
private static final long serialVersionUID = -9136704865403084083L;
@JsonProperty("code")
Integer code;
@JsonProperty("message")
String message;
@CheckForNull
public Integer getCode() {
return code;
}
@CheckForNull
public String getMessage() {
return message;
}
}
@EqualsAndHashCode
@ToString
public static class AuxDetail implements Serializable {
private static final long serialVersionUID = 1L;
@JsonProperty("Size")
private Integer size;
@JsonProperty("Tag")
private String tag;
@JsonProperty("Digest")
private String digest;
@CheckForNull
public Integer getSize() {
return size;
}
@CheckForNull
public String getTag() {
return tag;
}
@CheckForNull
public String getDigest() {
return digest;
}
}
}