Repository navigation
Expand file tree
/
Copy pathDocumentsImportFromRequest.java
More file actions
370 lines (304 loc) · 14.3 KB
/
Copy pathDocumentsImportFromRequest.java
File metadata and controls
370 lines (304 loc) · 14.3 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
359
360
361
362
363
364
365
366
367
368
369
370
/**
* 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.DocumentsImportFromRequestDedupMode;
import com.cloudpdf.api.resources.documents.types.DocumentsImportFromRequestExpected;
import com.cloudpdf.api.resources.documents.types.DocumentsImportFromRequestMode;
import com.cloudpdf.api.resources.documents.types.DocumentsImportFromRequestSource;
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 = DocumentsImportFromRequest.Builder.class)
public final class DocumentsImportFromRequest {
private final DocumentsImportFromRequestSource source;
private final Optional<DocumentsImportFromRequestExpected> expected;
private final Optional<Map<String, Object>> metadata;
private final Optional<String> idempotencyKey;
private final Optional<DocumentsImportFromRequestDedupMode> dedupMode;
private final Optional<String> docId;
private final Optional<DocumentsImportFromRequestMode> mode;
private final Map<String, Object> additionalProperties;
private DocumentsImportFromRequest(
DocumentsImportFromRequestSource source,
Optional<DocumentsImportFromRequestExpected> expected,
Optional<Map<String, Object>> metadata,
Optional<String> idempotencyKey,
Optional<DocumentsImportFromRequestDedupMode> dedupMode,
Optional<String> docId,
Optional<DocumentsImportFromRequestMode> mode,
Map<String, Object> additionalProperties) {
this.source = source;
this.expected = expected;
this.metadata = metadata;
this.idempotencyKey = idempotencyKey;
this.dedupMode = dedupMode;
this.docId = docId;
this.mode = mode;
this.additionalProperties = additionalProperties;
}
/**
* @return Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.
*/
@JsonProperty("source")
public DocumentsImportFromRequestSource getSource() {
return source;
}
/**
* @return Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
*/
@JsonProperty("expected")
public Optional<DocumentsImportFromRequestExpected> getExpected() {
return expected;
}
@JsonProperty("metadata")
public Optional<Map<String, Object>> getMetadata() {
return metadata;
}
/**
* @return Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.
*/
@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<DocumentsImportFromRequestDedupMode> getDedupMode() {
return dedupMode;
}
@JsonProperty("docId")
public Optional<String> getDocId() {
return docId;
}
/**
* @return sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.
*/
@JsonProperty("mode")
public Optional<DocumentsImportFromRequestMode> getMode() {
return mode;
}
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof DocumentsImportFromRequest && equalTo((DocumentsImportFromRequest) other);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
private boolean equalTo(DocumentsImportFromRequest other) {
return source.equals(other.source)
&& expected.equals(other.expected)
&& metadata.equals(other.metadata)
&& idempotencyKey.equals(other.idempotencyKey)
&& dedupMode.equals(other.dedupMode)
&& docId.equals(other.docId)
&& mode.equals(other.mode);
}
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.source, this.expected, this.metadata, this.idempotencyKey, this.dedupMode, this.docId, this.mode);
}
@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}
public static SourceStage builder() {
return new Builder();
}
public interface SourceStage {
/**
* <p>Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.</p>
*/
_FinalStage source(@NotNull DocumentsImportFromRequestSource source);
Builder from(DocumentsImportFromRequest other);
}
public interface _FinalStage {
DocumentsImportFromRequest build();
_FinalStage additionalProperty(String key, Object value);
_FinalStage additionalProperties(Map<String, Object> additionalProperties);
/**
* <p>Integrity pins, enforced when present. When absent, the server-observed values become authoritative.</p>
*/
_FinalStage expected(Optional<DocumentsImportFromRequestExpected> expected);
_FinalStage expected(DocumentsImportFromRequestExpected expected);
_FinalStage metadata(Optional<Map<String, Object>> metadata);
_FinalStage metadata(Map<String, Object> metadata);
/**
* <p>Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.</p>
*/
_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<DocumentsImportFromRequestDedupMode> dedupMode);
_FinalStage dedupMode(DocumentsImportFromRequestDedupMode dedupMode);
_FinalStage docId(Optional<String> docId);
_FinalStage docId(String docId);
/**
* <p>sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.</p>
*/
_FinalStage mode(Optional<DocumentsImportFromRequestMode> mode);
_FinalStage mode(DocumentsImportFromRequestMode mode);
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements SourceStage, _FinalStage {
private DocumentsImportFromRequestSource source;
private Optional<DocumentsImportFromRequestMode> mode = Optional.empty();
private Optional<String> docId = Optional.empty();
private Optional<DocumentsImportFromRequestDedupMode> dedupMode = Optional.empty();
private Optional<String> idempotencyKey = Optional.empty();
private Optional<Map<String, Object>> metadata = Optional.empty();
private Optional<DocumentsImportFromRequestExpected> expected = Optional.empty();
@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();
private Builder() {}
@java.lang.Override
public Builder from(DocumentsImportFromRequest other) {
source(other.getSource());
expected(other.getExpected());
metadata(other.getMetadata());
idempotencyKey(other.getIdempotencyKey());
dedupMode(other.getDedupMode());
docId(other.getDocId());
mode(other.getMode());
return this;
}
/**
* <p>Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("source")
public _FinalStage source(@NotNull DocumentsImportFromRequestSource source) {
this.source = Objects.requireNonNull(source, "source must not be null");
return this;
}
/**
* <p>sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage mode(DocumentsImportFromRequestMode mode) {
this.mode = Optional.ofNullable(mode);
return this;
}
/**
* <p>sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.</p>
*/
@java.lang.Override
@JsonSetter(value = "mode", nulls = Nulls.SKIP)
public _FinalStage mode(Optional<DocumentsImportFromRequestMode> mode) {
this.mode = mode;
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(DocumentsImportFromRequestDedupMode 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<DocumentsImportFromRequestDedupMode> dedupMode) {
this.dedupMode = dedupMode;
return this;
}
/**
* <p>Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage idempotencyKey(String idempotencyKey) {
this.idempotencyKey = Optional.ofNullable(idempotencyKey);
return this;
}
/**
* <p>Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.</p>
*/
@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;
}
/**
* <p>Integrity pins, enforced when present. When absent, the server-observed values become authoritative.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage expected(DocumentsImportFromRequestExpected expected) {
this.expected = Optional.ofNullable(expected);
return this;
}
/**
* <p>Integrity pins, enforced when present. When absent, the server-observed values become authoritative.</p>
*/
@java.lang.Override
@JsonSetter(value = "expected", nulls = Nulls.SKIP)
public _FinalStage expected(Optional<DocumentsImportFromRequestExpected> expected) {
this.expected = expected;
return this;
}
@java.lang.Override
public DocumentsImportFromRequest build() {
return new DocumentsImportFromRequest(
source, expected, metadata, idempotencyKey, dedupMode, docId, mode, 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;
}
}
}