-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentsInitRequest.java
More file actions
358 lines (287 loc) · 12.2 KB
/
Copy pathDocumentsInitRequest.java
File metadata and controls
358 lines (287 loc) · 12.2 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.cloudpdf.api.resources.documents.requests;
import com.cloudpdf.api.core.ObjectMappers;
import com.cloudpdf.api.resources.documents.types.DocumentsInitRequestDedupMode;
import com.cloudpdf.api.resources.documents.types.DocumentsInitRequestUploadPreference;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = DocumentsInitRequest.Builder.class)
public final class DocumentsInitRequest {
private final double contentLength;
private final String contentSha256;
private final Optional<Map<String, Object>> metadata;
private final Optional<String> idempotencyKey;
private final Optional<DocumentsInitRequestDedupMode> dedupMode;
private final Optional<String> docId;
private final Optional<Double> uploadTtlSec;
private final Optional<DocumentsInitRequestUploadPreference> uploadPreference;
private final Map<String, Object> additionalProperties;
private DocumentsInitRequest(
double contentLength,
String contentSha256,
Optional<Map<String, Object>> metadata,
Optional<String> idempotencyKey,
Optional<DocumentsInitRequestDedupMode> dedupMode,
Optional<String> docId,
Optional<Double> uploadTtlSec,
Optional<DocumentsInitRequestUploadPreference> uploadPreference,
Map<String, Object> additionalProperties) {
this.contentLength = contentLength;
this.contentSha256 = contentSha256;
this.metadata = metadata;
this.idempotencyKey = idempotencyKey;
this.dedupMode = dedupMode;
this.docId = docId;
this.uploadTtlSec = uploadTtlSec;
this.uploadPreference = uploadPreference;
this.additionalProperties = additionalProperties;
}
@JsonProperty("contentLength")
public double getContentLength() {
return contentLength;
}
@JsonProperty("contentSha256")
public String getContentSha256() {
return contentSha256;
}
@JsonProperty("metadata")
public Optional<Map<String, Object>> getMetadata() {
return metadata;
}
@JsonProperty("idempotencyKey")
public Optional<String> getIdempotencyKey() {
return idempotencyKey;
}
/**
* @return always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.
*/
@JsonProperty("dedupMode")
public Optional<DocumentsInitRequestDedupMode> getDedupMode() {
return dedupMode;
}
@JsonProperty("docId")
public Optional<String> getDocId() {
return docId;
}
@JsonProperty("uploadTtlSec")
public Optional<Double> getUploadTtlSec() {
return uploadTtlSec;
}
@JsonProperty("uploadPreference")
public Optional<DocumentsInitRequestUploadPreference> getUploadPreference() {
return uploadPreference;
}
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof DocumentsInitRequest && equalTo((DocumentsInitRequest) other);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
private boolean equalTo(DocumentsInitRequest other) {
return contentLength == other.contentLength
&& contentSha256.equals(other.contentSha256)
&& metadata.equals(other.metadata)
&& idempotencyKey.equals(other.idempotencyKey)
&& dedupMode.equals(other.dedupMode)
&& docId.equals(other.docId)
&& uploadTtlSec.equals(other.uploadTtlSec)
&& uploadPreference.equals(other.uploadPreference);
}
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.contentLength,
this.contentSha256,
this.metadata,
this.idempotencyKey,
this.dedupMode,
this.docId,
this.uploadTtlSec,
this.uploadPreference);
}
@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}
public static ContentLengthStage builder() {
return new Builder();
}
public interface ContentLengthStage {
ContentSha256Stage contentLength(double contentLength);
Builder from(DocumentsInitRequest other);
}
public interface ContentSha256Stage {
_FinalStage contentSha256(@NotNull String contentSha256);
}
public interface _FinalStage {
DocumentsInitRequest build();
_FinalStage additionalProperty(String key, Object value);
_FinalStage additionalProperties(Map<String, Object> additionalProperties);
_FinalStage metadata(Optional<Map<String, Object>> metadata);
_FinalStage metadata(Map<String, Object> metadata);
_FinalStage idempotencyKey(Optional<String> idempotencyKey);
_FinalStage idempotencyKey(String idempotencyKey);
/**
* <p>always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.</p>
*/
_FinalStage dedupMode(Optional<DocumentsInitRequestDedupMode> dedupMode);
_FinalStage dedupMode(DocumentsInitRequestDedupMode dedupMode);
_FinalStage docId(Optional<String> docId);
_FinalStage docId(String docId);
_FinalStage uploadTtlSec(Optional<Double> uploadTtlSec);
_FinalStage uploadTtlSec(Double uploadTtlSec);
_FinalStage uploadPreference(Optional<DocumentsInitRequestUploadPreference> uploadPreference);
_FinalStage uploadPreference(DocumentsInitRequestUploadPreference uploadPreference);
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements ContentLengthStage, ContentSha256Stage, _FinalStage {
private double contentLength;
private String contentSha256;
private Optional<DocumentsInitRequestUploadPreference> uploadPreference = Optional.empty();
private Optional<Double> uploadTtlSec = Optional.empty();
private Optional<String> docId = Optional.empty();
private Optional<DocumentsInitRequestDedupMode> dedupMode = Optional.empty();
private Optional<String> idempotencyKey = Optional.empty();
private Optional<Map<String, Object>> metadata = Optional.empty();
@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();
private Builder() {}
@java.lang.Override
public Builder from(DocumentsInitRequest other) {
contentLength(other.getContentLength());
contentSha256(other.getContentSha256());
metadata(other.getMetadata());
idempotencyKey(other.getIdempotencyKey());
dedupMode(other.getDedupMode());
docId(other.getDocId());
uploadTtlSec(other.getUploadTtlSec());
uploadPreference(other.getUploadPreference());
return this;
}
@java.lang.Override
@JsonSetter("contentLength")
public ContentSha256Stage contentLength(double contentLength) {
this.contentLength = contentLength;
return this;
}
@java.lang.Override
@JsonSetter("contentSha256")
public _FinalStage contentSha256(@NotNull String contentSha256) {
this.contentSha256 = Objects.requireNonNull(contentSha256, "contentSha256 must not be null");
return this;
}
@java.lang.Override
public _FinalStage uploadPreference(DocumentsInitRequestUploadPreference uploadPreference) {
this.uploadPreference = Optional.ofNullable(uploadPreference);
return this;
}
@java.lang.Override
@JsonSetter(value = "uploadPreference", nulls = Nulls.SKIP)
public _FinalStage uploadPreference(Optional<DocumentsInitRequestUploadPreference> uploadPreference) {
this.uploadPreference = uploadPreference;
return this;
}
@java.lang.Override
public _FinalStage uploadTtlSec(Double uploadTtlSec) {
this.uploadTtlSec = Optional.ofNullable(uploadTtlSec);
return this;
}
@java.lang.Override
@JsonSetter(value = "uploadTtlSec", nulls = Nulls.SKIP)
public _FinalStage uploadTtlSec(Optional<Double> uploadTtlSec) {
this.uploadTtlSec = uploadTtlSec;
return this;
}
@java.lang.Override
public _FinalStage docId(String docId) {
this.docId = Optional.ofNullable(docId);
return this;
}
@java.lang.Override
@JsonSetter(value = "docId", nulls = Nulls.SKIP)
public _FinalStage docId(Optional<String> docId) {
this.docId = docId;
return this;
}
/**
* <p>always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage dedupMode(DocumentsInitRequestDedupMode dedupMode) {
this.dedupMode = Optional.ofNullable(dedupMode);
return this;
}
/**
* <p>always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.</p>
*/
@java.lang.Override
@JsonSetter(value = "dedupMode", nulls = Nulls.SKIP)
public _FinalStage dedupMode(Optional<DocumentsInitRequestDedupMode> dedupMode) {
this.dedupMode = dedupMode;
return this;
}
@java.lang.Override
public _FinalStage idempotencyKey(String idempotencyKey) {
this.idempotencyKey = Optional.ofNullable(idempotencyKey);
return this;
}
@java.lang.Override
@JsonSetter(value = "idempotencyKey", nulls = Nulls.SKIP)
public _FinalStage idempotencyKey(Optional<String> idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
@java.lang.Override
public _FinalStage metadata(Map<String, Object> metadata) {
this.metadata = Optional.ofNullable(metadata);
return this;
}
@java.lang.Override
@JsonSetter(value = "metadata", nulls = Nulls.SKIP)
public _FinalStage metadata(Optional<Map<String, Object>> metadata) {
this.metadata = metadata;
return this;
}
@java.lang.Override
public DocumentsInitRequest build() {
return new DocumentsInitRequest(
contentLength,
contentSha256,
metadata,
idempotencyKey,
dedupMode,
docId,
uploadTtlSec,
uploadPreference,
additionalProperties);
}
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
}
@java.lang.Override
public Builder additionalProperties(Map<String, Object> additionalProperties) {
this.additionalProperties.putAll(additionalProperties);
return this;
}
}
}