Repository navigation
Expand file tree
/
Copy pathdocuments.go
More file actions
5301 lines (4626 loc) · 182 KB
/
Copy pathdocuments.go
File metadata and controls
5301 lines (4626 loc) · 182 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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by Fern. DO NOT EDIT.
package cloudpdf
import (
json "encoding/json"
fmt "fmt"
internal "github.com/embedpdf/cloudpdf-sdk-go/v3/internal"
io "io"
big "math/big"
)
var (
documentsCommitRequestFieldTenantID = big.NewInt(1 << 0)
documentsCommitRequestFieldID = big.NewInt(1 << 1)
documentsCommitRequestFieldSha256 = big.NewInt(1 << 2)
)
type DocumentsCommitRequest struct {
TenantID string `json:"-" url:"-"`
ID string `json:"-" url:"-"`
Sha256 string `json:"sha256" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DocumentsCommitRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommitRequest) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(documentsCommitRequestFieldTenantID)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommitRequest) SetID(id string) {
d.ID = id
d.require(documentsCommitRequestFieldID)
}
// SetSha256 sets the Sha256 field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommitRequest) SetSha256(sha256 string) {
d.Sha256 = sha256
d.require(documentsCommitRequestFieldSha256)
}
func (d *DocumentsCommitRequest) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsCommitRequest
var body unmarshaler
if err := json.Unmarshal(data, &body); err != nil {
return err
}
*d = DocumentsCommitRequest(body)
return nil
}
func (d *DocumentsCommitRequest) MarshalJSON() ([]byte, error) {
type embed DocumentsCommitRequest
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
var (
deleteDocumentsRequestFieldTenantID = big.NewInt(1 << 0)
deleteDocumentsRequestFieldID = big.NewInt(1 << 1)
)
type DeleteDocumentsRequest struct {
TenantID string `json:"-" url:"-"`
ID string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DeleteDocumentsRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DeleteDocumentsRequest) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(deleteDocumentsRequestFieldTenantID)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DeleteDocumentsRequest) SetID(id string) {
d.ID = id
d.require(deleteDocumentsRequestFieldID)
}
var (
downloadDocumentsRequestFieldTenantID = big.NewInt(1 << 0)
downloadDocumentsRequestFieldID = big.NewInt(1 << 1)
)
type DownloadDocumentsRequest struct {
TenantID string `json:"-" url:"-"`
ID string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DownloadDocumentsRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DownloadDocumentsRequest) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(downloadDocumentsRequestFieldTenantID)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DownloadDocumentsRequest) SetID(id string) {
d.ID = id
d.require(downloadDocumentsRequestFieldID)
}
var (
getDocumentsRequestFieldTenantID = big.NewInt(1 << 0)
getDocumentsRequestFieldID = big.NewInt(1 << 1)
)
type GetDocumentsRequest struct {
TenantID string `json:"-" url:"-"`
ID string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (g *GetDocumentsRequest) require(field *big.Int) {
if g.explicitFields == nil {
g.explicitFields = big.NewInt(0)
}
g.explicitFields.Or(g.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetDocumentsRequest) SetTenantID(tenantID string) {
g.TenantID = tenantID
g.require(getDocumentsRequestFieldTenantID)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetDocumentsRequest) SetID(id string) {
g.ID = id
g.require(getDocumentsRequestFieldID)
}
var (
documentsImportFromRequestFieldTenantID = big.NewInt(1 << 0)
documentsImportFromRequestFieldSource = big.NewInt(1 << 1)
documentsImportFromRequestFieldExpected = big.NewInt(1 << 2)
documentsImportFromRequestFieldMetadata = big.NewInt(1 << 3)
documentsImportFromRequestFieldIdempotencyKey = big.NewInt(1 << 4)
documentsImportFromRequestFieldDedupMode = big.NewInt(1 << 5)
documentsImportFromRequestFieldDocID = big.NewInt(1 << 6)
documentsImportFromRequestFieldMode = big.NewInt(1 << 7)
)
type DocumentsImportFromRequest struct {
TenantID string `json:"-" url:"-"`
// 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.
Source *DocumentsImportFromRequestSource `json:"source" url:"-"`
// Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
Expected *DocumentsImportFromRequestExpected `json:"expected,omitempty" url:"-"`
Metadata map[string]any `json:"metadata,omitempty" url:"-"`
// Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.
IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"-"`
// 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.
DedupMode *DocumentsImportFromRequestDedupMode `json:"dedupMode,omitempty" url:"-"`
DocID *string `json:"docId,omitempty" url:"-"`
// 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.
Mode *DocumentsImportFromRequestMode `json:"mode,omitempty" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DocumentsImportFromRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(documentsImportFromRequestFieldTenantID)
}
// SetSource sets the Source field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetSource(source *DocumentsImportFromRequestSource) {
d.Source = source
d.require(documentsImportFromRequestFieldSource)
}
// SetExpected sets the Expected field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetExpected(expected *DocumentsImportFromRequestExpected) {
d.Expected = expected
d.require(documentsImportFromRequestFieldExpected)
}
// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetMetadata(metadata map[string]any) {
d.Metadata = metadata
d.require(documentsImportFromRequestFieldMetadata)
}
// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetIdempotencyKey(idempotencyKey *string) {
d.IdempotencyKey = idempotencyKey
d.require(documentsImportFromRequestFieldIdempotencyKey)
}
// SetDedupMode sets the DedupMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetDedupMode(dedupMode *DocumentsImportFromRequestDedupMode) {
d.DedupMode = dedupMode
d.require(documentsImportFromRequestFieldDedupMode)
}
// SetDocID sets the DocID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetDocID(docID *string) {
d.DocID = docID
d.require(documentsImportFromRequestFieldDocID)
}
// SetMode sets the Mode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsImportFromRequest) SetMode(mode *DocumentsImportFromRequestMode) {
d.Mode = mode
d.require(documentsImportFromRequestFieldMode)
}
func (d *DocumentsImportFromRequest) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsImportFromRequest
var body unmarshaler
if err := json.Unmarshal(data, &body); err != nil {
return err
}
*d = DocumentsImportFromRequest(body)
return nil
}
func (d *DocumentsImportFromRequest) MarshalJSON() ([]byte, error) {
type embed DocumentsImportFromRequest
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
var (
documentsInitRequestFieldTenantID = big.NewInt(1 << 0)
documentsInitRequestFieldContentLength = big.NewInt(1 << 1)
documentsInitRequestFieldContentSha256 = big.NewInt(1 << 2)
documentsInitRequestFieldMetadata = big.NewInt(1 << 3)
documentsInitRequestFieldIdempotencyKey = big.NewInt(1 << 4)
documentsInitRequestFieldDedupMode = big.NewInt(1 << 5)
documentsInitRequestFieldDocID = big.NewInt(1 << 6)
documentsInitRequestFieldUploadTTLSec = big.NewInt(1 << 7)
documentsInitRequestFieldUploadPreference = big.NewInt(1 << 8)
)
type DocumentsInitRequest struct {
TenantID string `json:"-" url:"-"`
ContentLength float64 `json:"contentLength" url:"-"`
ContentSha256 string `json:"contentSha256" url:"-"`
Metadata map[string]any `json:"metadata,omitempty" url:"-"`
IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"-"`
// 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.
DedupMode *DocumentsInitRequestDedupMode `json:"dedupMode,omitempty" url:"-"`
DocID *string `json:"docId,omitempty" url:"-"`
UploadTTLSec *float64 `json:"uploadTtlSec,omitempty" url:"-"`
UploadPreference *DocumentsInitRequestUploadPreference `json:"uploadPreference,omitempty" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DocumentsInitRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(documentsInitRequestFieldTenantID)
}
// SetContentLength sets the ContentLength field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetContentLength(contentLength float64) {
d.ContentLength = contentLength
d.require(documentsInitRequestFieldContentLength)
}
// SetContentSha256 sets the ContentSha256 field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetContentSha256(contentSha256 string) {
d.ContentSha256 = contentSha256
d.require(documentsInitRequestFieldContentSha256)
}
// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetMetadata(metadata map[string]any) {
d.Metadata = metadata
d.require(documentsInitRequestFieldMetadata)
}
// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetIdempotencyKey(idempotencyKey *string) {
d.IdempotencyKey = idempotencyKey
d.require(documentsInitRequestFieldIdempotencyKey)
}
// SetDedupMode sets the DedupMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetDedupMode(dedupMode *DocumentsInitRequestDedupMode) {
d.DedupMode = dedupMode
d.require(documentsInitRequestFieldDedupMode)
}
// SetDocID sets the DocID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetDocID(docID *string) {
d.DocID = docID
d.require(documentsInitRequestFieldDocID)
}
// SetUploadTTLSec sets the UploadTTLSec field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetUploadTTLSec(uploadTTLSec *float64) {
d.UploadTTLSec = uploadTTLSec
d.require(documentsInitRequestFieldUploadTTLSec)
}
// SetUploadPreference sets the UploadPreference field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsInitRequest) SetUploadPreference(uploadPreference *DocumentsInitRequestUploadPreference) {
d.UploadPreference = uploadPreference
d.require(documentsInitRequestFieldUploadPreference)
}
func (d *DocumentsInitRequest) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsInitRequest
var body unmarshaler
if err := json.Unmarshal(data, &body); err != nil {
return err
}
*d = DocumentsInitRequest(body)
return nil
}
func (d *DocumentsInitRequest) MarshalJSON() ([]byte, error) {
type embed DocumentsInitRequest
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
var (
listDocumentsRequestFieldTenantID = big.NewInt(1 << 0)
listDocumentsRequestFieldLimit = big.NewInt(1 << 1)
listDocumentsRequestFieldCursor = big.NewInt(1 << 2)
listDocumentsRequestFieldState = big.NewInt(1 << 3)
)
type ListDocumentsRequest struct {
TenantID string `json:"-" url:"-"`
Limit *int `json:"-" url:"limit,omitempty"`
Cursor *string `json:"-" url:"cursor,omitempty"`
State *ListDocumentsRequestState `json:"-" url:"state,omitempty"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (l *ListDocumentsRequest) require(field *big.Int) {
if l.explicitFields == nil {
l.explicitFields = big.NewInt(0)
}
l.explicitFields.Or(l.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListDocumentsRequest) SetTenantID(tenantID string) {
l.TenantID = tenantID
l.require(listDocumentsRequestFieldTenantID)
}
// SetLimit sets the Limit field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListDocumentsRequest) SetLimit(limit *int) {
l.Limit = limit
l.require(listDocumentsRequestFieldLimit)
}
// SetCursor sets the Cursor field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListDocumentsRequest) SetCursor(cursor *string) {
l.Cursor = cursor
l.require(listDocumentsRequestFieldCursor)
}
// SetState sets the State field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListDocumentsRequest) SetState(state *ListDocumentsRequestState) {
l.State = state
l.require(listDocumentsRequestFieldState)
}
var (
thumbnailDocumentsRequestFieldTenantID = big.NewInt(1 << 0)
thumbnailDocumentsRequestFieldID = big.NewInt(1 << 1)
)
type ThumbnailDocumentsRequest struct {
TenantID string `json:"-" url:"-"`
ID string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (t *ThumbnailDocumentsRequest) require(field *big.Int) {
if t.explicitFields == nil {
t.explicitFields = big.NewInt(0)
}
t.explicitFields.Or(t.explicitFields, field)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *ThumbnailDocumentsRequest) SetTenantID(tenantID string) {
t.TenantID = tenantID
t.require(thumbnailDocumentsRequestFieldTenantID)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *ThumbnailDocumentsRequest) SetID(id string) {
t.ID = id
t.require(thumbnailDocumentsRequestFieldID)
}
var (
documentsCommit200ResponseFieldDocument = big.NewInt(1 << 0)
)
type DocumentsCommit200Response struct {
Document *DocumentsCommit200ResponseDocument `json:"document" url:"document"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *DocumentsCommit200Response) GetDocument() *DocumentsCommit200ResponseDocument {
if d == nil {
return nil
}
return d.Document
}
func (d *DocumentsCommit200Response) GetExtraProperties() map[string]interface{} {
if d == nil {
return nil
}
return d.extraProperties
}
func (d *DocumentsCommit200Response) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetDocument sets the Document field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200Response) SetDocument(document *DocumentsCommit200ResponseDocument) {
d.Document = document
d.require(documentsCommit200ResponseFieldDocument)
}
func (d *DocumentsCommit200Response) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsCommit200Response
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DocumentsCommit200Response(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *DocumentsCommit200Response) MarshalJSON() ([]byte, error) {
type embed DocumentsCommit200Response
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (d *DocumentsCommit200Response) String() string {
if d == nil {
return "<nil>"
}
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
var (
documentsCommit200ResponseDocumentFieldID = big.NewInt(1 << 0)
documentsCommit200ResponseDocumentFieldTenantID = big.NewInt(1 << 1)
documentsCommit200ResponseDocumentFieldState = big.NewInt(1 << 2)
documentsCommit200ResponseDocumentFieldBaseSha = big.NewInt(1 << 3)
documentsCommit200ResponseDocumentFieldStorageSizeBytes = big.NewInt(1 << 4)
documentsCommit200ResponseDocumentFieldMetadata = big.NewInt(1 << 5)
documentsCommit200ResponseDocumentFieldIdempotencyKey = big.NewInt(1 << 6)
documentsCommit200ResponseDocumentFieldFailureReason = big.NewInt(1 << 7)
documentsCommit200ResponseDocumentFieldThumbnailState = big.NewInt(1 << 8)
documentsCommit200ResponseDocumentFieldThumbnailURL = big.NewInt(1 << 9)
documentsCommit200ResponseDocumentFieldCreatedAt = big.NewInt(1 << 10)
documentsCommit200ResponseDocumentFieldUpdatedAt = big.NewInt(1 << 11)
documentsCommit200ResponseDocumentFieldCreatedBy = big.NewInt(1 << 12)
)
type DocumentsCommit200ResponseDocument struct {
ID string `json:"id" url:"id"`
TenantID string `json:"tenantId" url:"tenantId"`
State DocumentsCommit200ResponseDocumentState `json:"state" url:"state"`
BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"`
StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"`
Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"`
IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"`
FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"`
ThumbnailState *DocumentsCommit200ResponseDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"`
ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"`
CreatedAt float64 `json:"createdAt" url:"createdAt"`
UpdatedAt float64 `json:"updatedAt" url:"updatedAt"`
CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *DocumentsCommit200ResponseDocument) GetID() string {
if d == nil {
return ""
}
return d.ID
}
func (d *DocumentsCommit200ResponseDocument) GetTenantID() string {
if d == nil {
return ""
}
return d.TenantID
}
func (d *DocumentsCommit200ResponseDocument) GetState() DocumentsCommit200ResponseDocumentState {
if d == nil {
return ""
}
return d.State
}
func (d *DocumentsCommit200ResponseDocument) GetBaseSha() *string {
if d == nil {
return nil
}
return d.BaseSha
}
func (d *DocumentsCommit200ResponseDocument) GetStorageSizeBytes() *float64 {
if d == nil {
return nil
}
return d.StorageSizeBytes
}
func (d *DocumentsCommit200ResponseDocument) GetMetadata() map[string]any {
if d == nil {
return nil
}
return d.Metadata
}
func (d *DocumentsCommit200ResponseDocument) GetIdempotencyKey() *string {
if d == nil {
return nil
}
return d.IdempotencyKey
}
func (d *DocumentsCommit200ResponseDocument) GetFailureReason() *string {
if d == nil {
return nil
}
return d.FailureReason
}
func (d *DocumentsCommit200ResponseDocument) GetThumbnailState() *DocumentsCommit200ResponseDocumentThumbnailState {
if d == nil {
return nil
}
return d.ThumbnailState
}
func (d *DocumentsCommit200ResponseDocument) GetThumbnailURL() *string {
if d == nil {
return nil
}
return d.ThumbnailURL
}
func (d *DocumentsCommit200ResponseDocument) GetCreatedAt() float64 {
if d == nil {
return 0
}
return d.CreatedAt
}
func (d *DocumentsCommit200ResponseDocument) GetUpdatedAt() float64 {
if d == nil {
return 0
}
return d.UpdatedAt
}
func (d *DocumentsCommit200ResponseDocument) GetCreatedBy() *string {
if d == nil {
return nil
}
return d.CreatedBy
}
func (d *DocumentsCommit200ResponseDocument) GetExtraProperties() map[string]interface{} {
if d == nil {
return nil
}
return d.extraProperties
}
func (d *DocumentsCommit200ResponseDocument) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetID(id string) {
d.ID = id
d.require(documentsCommit200ResponseDocumentFieldID)
}
// SetTenantID sets the TenantID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetTenantID(tenantID string) {
d.TenantID = tenantID
d.require(documentsCommit200ResponseDocumentFieldTenantID)
}
// SetState sets the State field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetState(state DocumentsCommit200ResponseDocumentState) {
d.State = state
d.require(documentsCommit200ResponseDocumentFieldState)
}
// SetBaseSha sets the BaseSha field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetBaseSha(baseSha *string) {
d.BaseSha = baseSha
d.require(documentsCommit200ResponseDocumentFieldBaseSha)
}
// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetStorageSizeBytes(storageSizeBytes *float64) {
d.StorageSizeBytes = storageSizeBytes
d.require(documentsCommit200ResponseDocumentFieldStorageSizeBytes)
}
// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetMetadata(metadata map[string]any) {
d.Metadata = metadata
d.require(documentsCommit200ResponseDocumentFieldMetadata)
}
// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetIdempotencyKey(idempotencyKey *string) {
d.IdempotencyKey = idempotencyKey
d.require(documentsCommit200ResponseDocumentFieldIdempotencyKey)
}
// SetFailureReason sets the FailureReason field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetFailureReason(failureReason *string) {
d.FailureReason = failureReason
d.require(documentsCommit200ResponseDocumentFieldFailureReason)
}
// SetThumbnailState sets the ThumbnailState field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetThumbnailState(thumbnailState *DocumentsCommit200ResponseDocumentThumbnailState) {
d.ThumbnailState = thumbnailState
d.require(documentsCommit200ResponseDocumentFieldThumbnailState)
}
// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetThumbnailURL(thumbnailURL *string) {
d.ThumbnailURL = thumbnailURL
d.require(documentsCommit200ResponseDocumentFieldThumbnailURL)
}
// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetCreatedAt(createdAt float64) {
d.CreatedAt = createdAt
d.require(documentsCommit200ResponseDocumentFieldCreatedAt)
}
// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetUpdatedAt(updatedAt float64) {
d.UpdatedAt = updatedAt
d.require(documentsCommit200ResponseDocumentFieldUpdatedAt)
}
// SetCreatedBy sets the CreatedBy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsCommit200ResponseDocument) SetCreatedBy(createdBy *string) {
d.CreatedBy = createdBy
d.require(documentsCommit200ResponseDocumentFieldCreatedBy)
}
func (d *DocumentsCommit200ResponseDocument) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsCommit200ResponseDocument
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DocumentsCommit200ResponseDocument(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *DocumentsCommit200ResponseDocument) MarshalJSON() ([]byte, error) {
type embed DocumentsCommit200ResponseDocument
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (d *DocumentsCommit200ResponseDocument) String() string {
if d == nil {
return "<nil>"
}
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type DocumentsCommit200ResponseDocumentState string
const (
DocumentsCommit200ResponseDocumentStatePending DocumentsCommit200ResponseDocumentState = "pending"
DocumentsCommit200ResponseDocumentStateReady DocumentsCommit200ResponseDocumentState = "ready"
DocumentsCommit200ResponseDocumentStateFailed DocumentsCommit200ResponseDocumentState = "failed"
DocumentsCommit200ResponseDocumentStateDeleting DocumentsCommit200ResponseDocumentState = "deleting"
)
func NewDocumentsCommit200ResponseDocumentStateFromString(s string) (DocumentsCommit200ResponseDocumentState, error) {
switch s {
case "pending":
return DocumentsCommit200ResponseDocumentStatePending, nil
case "ready":
return DocumentsCommit200ResponseDocumentStateReady, nil
case "failed":
return DocumentsCommit200ResponseDocumentStateFailed, nil
case "deleting":
return DocumentsCommit200ResponseDocumentStateDeleting, nil
}
var t DocumentsCommit200ResponseDocumentState
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (d DocumentsCommit200ResponseDocumentState) Ptr() *DocumentsCommit200ResponseDocumentState {
return &d
}
type DocumentsCommit200ResponseDocumentThumbnailState string
const (
DocumentsCommit200ResponseDocumentThumbnailStatePending DocumentsCommit200ResponseDocumentThumbnailState = "pending"
DocumentsCommit200ResponseDocumentThumbnailStateReady DocumentsCommit200ResponseDocumentThumbnailState = "ready"
DocumentsCommit200ResponseDocumentThumbnailStateLocked DocumentsCommit200ResponseDocumentThumbnailState = "locked"
DocumentsCommit200ResponseDocumentThumbnailStateFailed DocumentsCommit200ResponseDocumentThumbnailState = "failed"
)
func NewDocumentsCommit200ResponseDocumentThumbnailStateFromString(s string) (DocumentsCommit200ResponseDocumentThumbnailState, error) {
switch s {
case "pending":
return DocumentsCommit200ResponseDocumentThumbnailStatePending, nil
case "ready":
return DocumentsCommit200ResponseDocumentThumbnailStateReady, nil
case "locked":
return DocumentsCommit200ResponseDocumentThumbnailStateLocked, nil
case "failed":
return DocumentsCommit200ResponseDocumentThumbnailStateFailed, nil
}
var t DocumentsCommit200ResponseDocumentThumbnailState
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (d DocumentsCommit200ResponseDocumentThumbnailState) Ptr() *DocumentsCommit200ResponseDocumentThumbnailState {
return &d
}
var (
documentsGet200ResponseFieldDocument = big.NewInt(1 << 0)
)
type DocumentsGet200Response struct {
Document *DocumentsGet200ResponseDocument `json:"document" url:"document"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *DocumentsGet200Response) GetDocument() *DocumentsGet200ResponseDocument {
if d == nil {
return nil
}
return d.Document
}
func (d *DocumentsGet200Response) GetExtraProperties() map[string]interface{} {
if d == nil {
return nil
}
return d.extraProperties
}
func (d *DocumentsGet200Response) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetDocument sets the Document field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DocumentsGet200Response) SetDocument(document *DocumentsGet200ResponseDocument) {
d.Document = document
d.require(documentsGet200ResponseFieldDocument)
}
func (d *DocumentsGet200Response) UnmarshalJSON(data []byte) error {
type unmarshaler DocumentsGet200Response
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DocumentsGet200Response(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *DocumentsGet200Response) MarshalJSON() ([]byte, error) {
type embed DocumentsGet200Response
var marshaler = struct {
embed
}{
embed: embed(*d),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (d *DocumentsGet200Response) String() string {
if d == nil {
return "<nil>"
}
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
var (
documentsGet200ResponseDocumentFieldID = big.NewInt(1 << 0)
documentsGet200ResponseDocumentFieldTenantID = big.NewInt(1 << 1)