-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_uploads.go
1523 lines (1343 loc) · 65.8 KB
/
api_uploads.go
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
/*
* IONOS Object Storage API for contract-owned buckets
*
* ## Overview The IONOS Object Storage API for contract-owned buckets is a REST-based API that allows developers and applications to interact directly with IONOS' scalable storage solution, leveraging the S3 protocol for object storage operations. Its design ensures seamless compatibility with existing tools and libraries tailored for S3 systems. ### API References - [S3 API Reference for contract-owned buckets](https://api.ionos.com/docs/s3-contract-owned-buckets/v2/) ### User documentation [IONOS Object Storage User Guide](https://docs.ionos.com/cloud/managed-services/s3-object-storage) * [Documentation on user-owned and contract-owned buckets](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/buckets) * [Documentation on S3 API Compatibility](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/s3-api-compatibility) * [S3 Tools](https://docs.ionos.com/cloud/managed-services/s3-object-storage/s3-tools) ## Endpoints for contract-owned buckets | Location | Region Name | Bucket Type | Endpoint | | --- | --- | --- | --- | | **Berlin, Germany** | **eu-central-3** | Contract-owned | `https://s3.eu-central-3.ionoscloud.com` | ## Changelog - 30.05.2024 Initial version
*
* API version: 2.0.2
* Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package ionoscloud
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"time"
)
// UploadsApiService UploadsApi service
type UploadsApiService service
type ApiAbortMultipartUploadRequest struct {
ctx context.Context
ApiService *UploadsApiService
bucket string
key string
uploadId *string
}
// Upload ID that identifies the multipart upload.
func (r ApiAbortMultipartUploadRequest) UploadId(uploadId string) ApiAbortMultipartUploadRequest {
r.uploadId = &uploadId
return r
}
func (r ApiAbortMultipartUploadRequest) Execute() (map[string]interface{}, *APIResponse, error) {
return r.ApiService.AbortMultipartUploadExecute(r)
}
/*
AbortMultipartUpload AbortMultipartUpload
<p>This operation aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts. </p>
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bucket
@param key Key of the object for which the multipart upload was initiated. <p> **Possible values:** length ≥ 1 </p>
@return ApiAbortMultipartUploadRequest
*/
func (a *UploadsApiService) AbortMultipartUpload(ctx context.Context, bucket string, key string) ApiAbortMultipartUploadRequest {
return ApiAbortMultipartUploadRequest{
ApiService: a,
ctx: ctx,
bucket: bucket,
key: key,
}
}
// Execute executes the request
//
// @return map[string]interface{}
func (a *UploadsApiService) AbortMultipartUploadExecute(r ApiAbortMultipartUploadRequest) (map[string]interface{}, *APIResponse, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue map[string]interface{}
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UploadsApiService.AbortMultipartUpload")
if err != nil {
gerr := GenericOpenAPIError{}
gerr.SetError(err.Error())
return localVarReturnValue, nil, gerr
}
localVarPath := localBasePath + "/{Bucket}/{Key}?uploadId"
localVarPath = strings.Replace(localVarPath, "{"+"Bucket"+"}", parameterValueToString(r.bucket, "bucket"), -1)
localVarPath = strings.Replace(localVarPath, "{"+"Key"+"}", parameterValueToString(r.key, "key"), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if Strlen(r.bucket) < 3 {
return localVarReturnValue, nil, reportError("bucket must have at least 3 elements")
}
if Strlen(r.bucket) > 63 {
return localVarReturnValue, nil, reportError("bucket must have less than 63 elements")
}
if Strlen(r.key) < 1 {
return localVarReturnValue, nil, reportError("key must have at least 1 elements")
}
if r.uploadId == nil {
return localVarReturnValue, nil, reportError("uploadId is required and must be specified")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "uploadId", r.uploadId, "")
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/xml", "aplication/xml"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["hmac"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req)
localVarAPIResponse := &APIResponse{
Response: localVarHTTPResponse,
Method: localVarHTTPMethod,
RequestTime: httpRequestTime,
RequestURL: localVarPath,
Operation: "AbortMultipartUpload",
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarAPIResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarAPIResponse.Payload = localVarBody
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarAPIResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)))
if localVarHTTPResponse.StatusCode == 480 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.SetError(err.Error())
return localVarReturnValue, localVarAPIResponse, newErr
}
newErr.SetModel(v)
}
return localVarReturnValue, localVarAPIResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(err.Error())
return localVarReturnValue, localVarAPIResponse, newErr
}
return localVarReturnValue, localVarAPIResponse, nil
}
type ApiCompleteMultipartUploadRequest struct {
ctx context.Context
ApiService *UploadsApiService
bucket string
key string
uploadId *string
example *Example
}
// ID for the initiated multipart upload.
func (r ApiCompleteMultipartUploadRequest) UploadId(uploadId string) ApiCompleteMultipartUploadRequest {
r.uploadId = &uploadId
return r
}
func (r ApiCompleteMultipartUploadRequest) Example(example Example) ApiCompleteMultipartUploadRequest {
r.example = &example
return r
}
func (r ApiCompleteMultipartUploadRequest) Execute() (*CompleteMultipartUploadOutput, *APIResponse, error) {
return r.ApiService.CompleteMultipartUploadExecute(r)
}
/*
CompleteMultipartUpload CompleteMultipartUpload
<p>Completes a multipart upload by assembling previously uploaded parts.</p> <p>After successfully uploading all relevant parts of an upload, you call this operation to complete the upload. When IONOS Object Storage receives this request, it concatenates all the parts in ascending order by part number to create a new object. The parts list must be included in the Complete Multipart Upload request. You must ensure that the parts list is complete. This operation concatenates the parts that you provide in the list. For each part in the list, you must provide the part number and the `ETag` value, returned after that part was uploaded.</p> <p>A Complete Multipart Upload request could take several minutes to process. After IONOS Object Storage begins processing the request, it sends an HTTP response header indicating a 200 OK response. While processing is in progress, IONOS Object Storage sends white space characters on a regular basis to keep the connection from timing out. Because a request may fail after receiving the initial 200 OK response, it is advisable to check the response body to establish whether the request was successful.</p> <p> `CompleteMultipartUpload` has the following special errors:</p> <ul> <li> <p>Error code: `EntityTooSmall` </p> <ul> <li> <p>Description: Your proposed upload is smaller than the minimum allowed object size. Each part must be at least 5 MB in size, except the last part.</p> </li> <li> <p>400 Bad Request</p> </li> </ul> </li> <li> <p>Error code: `InvalidPart` </p> <ul> <li> <p>Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag.</p> </li> <li> <p>400 Bad Request</p> </li> </ul> </li> <li> <p>Error code: `InvalidPartOrder` </p> <ul> <li> <p>Description: The list of parts was not in ascending order. The parts list must be specified in order by part number.</p> </li> <li> <p>400 Bad Request</p> </li> </ul> </li> <li> <p>Error code: `NoSuchUpload` </p> <ul> <li> <p>Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.</p> </li> <li> <p>404 Not Found</p> </li> </ul> </li> </ul>
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bucket
@param key Object key for which the multipart upload was initiated.
@return ApiCompleteMultipartUploadRequest
*/
func (a *UploadsApiService) CompleteMultipartUpload(ctx context.Context, bucket string, key string) ApiCompleteMultipartUploadRequest {
return ApiCompleteMultipartUploadRequest{
ApiService: a,
ctx: ctx,
bucket: bucket,
key: key,
}
}
// Execute executes the request
//
// @return CompleteMultipartUploadOutput
func (a *UploadsApiService) CompleteMultipartUploadExecute(r ApiCompleteMultipartUploadRequest) (*CompleteMultipartUploadOutput, *APIResponse, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CompleteMultipartUploadOutput
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UploadsApiService.CompleteMultipartUpload")
if err != nil {
gerr := GenericOpenAPIError{}
gerr.SetError(err.Error())
return localVarReturnValue, nil, gerr
}
localVarPath := localBasePath + "/{Bucket}/{Key}?uploadId"
localVarPath = strings.Replace(localVarPath, "{"+"Bucket"+"}", parameterValueToString(r.bucket, "bucket"), -1)
localVarPath = strings.Replace(localVarPath, "{"+"Key"+"}", parameterValueToString(r.key, "key"), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if Strlen(r.bucket) < 3 {
return localVarReturnValue, nil, reportError("bucket must have at least 3 elements")
}
if Strlen(r.bucket) > 63 {
return localVarReturnValue, nil, reportError("bucket must have less than 63 elements")
}
if Strlen(r.key) < 1 {
return localVarReturnValue, nil, reportError("key must have at least 1 elements")
}
if r.uploadId == nil {
return localVarReturnValue, nil, reportError("uploadId is required and must be specified")
}
if r.example == nil {
return localVarReturnValue, nil, reportError("example is required and must be specified")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "uploadId", r.uploadId, "")
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/xml"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/xml"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.example
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["hmac"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req)
localVarAPIResponse := &APIResponse{
Response: localVarHTTPResponse,
Method: localVarHTTPMethod,
RequestTime: httpRequestTime,
RequestURL: localVarPath,
Operation: "CompleteMultipartUpload",
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarAPIResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarAPIResponse.Payload = localVarBody
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarAPIResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)))
return localVarReturnValue, localVarAPIResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(err.Error())
return localVarReturnValue, localVarAPIResponse, newErr
}
return localVarReturnValue, localVarAPIResponse, nil
}
type ApiCreateMultipartUploadRequest struct {
ctx context.Context
ApiService *UploadsApiService
bucket string
key string
uploads *bool
cacheControl *string
contentDisposition *string
contentEncoding *string
contentType *string
expires *time.Time
xAmzServerSideEncryption *string
xAmzStorageClass *string
xAmzWebsiteRedirectLocation *string
xAmzServerSideEncryptionCustomerAlgorithm *string
xAmzServerSideEncryptionCustomerKey *string
xAmzServerSideEncryptionCustomerKeyMD5 *string
xAmzObjectLockMode *string
xAmzObjectLockRetainUntilDate *time.Time
xAmzObjectLockLegalHold *string
xAmzMeta *map[string]string
}
func (r ApiCreateMultipartUploadRequest) Uploads(uploads bool) ApiCreateMultipartUploadRequest {
r.uploads = &uploads
return r
}
// Specifies caching behavior along the request/reply chain.
func (r ApiCreateMultipartUploadRequest) CacheControl(cacheControl string) ApiCreateMultipartUploadRequest {
r.cacheControl = &cacheControl
return r
}
// Specifies presentational information for the object.
func (r ApiCreateMultipartUploadRequest) ContentDisposition(contentDisposition string) ApiCreateMultipartUploadRequest {
r.contentDisposition = &contentDisposition
return r
}
// Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
func (r ApiCreateMultipartUploadRequest) ContentEncoding(contentEncoding string) ApiCreateMultipartUploadRequest {
r.contentEncoding = &contentEncoding
return r
}
// A standard MIME type describing the format of the object data.
func (r ApiCreateMultipartUploadRequest) ContentType(contentType string) ApiCreateMultipartUploadRequest {
r.contentType = &contentType
return r
}
// The date and time at which the object is no longer cacheable.
func (r ApiCreateMultipartUploadRequest) Expires(expires time.Time) ApiCreateMultipartUploadRequest {
r.expires = &expires
return r
}
// The server-side encryption algorithm used when storing this object in IONOS Object Storage (AES256).
func (r ApiCreateMultipartUploadRequest) XAmzServerSideEncryption(xAmzServerSideEncryption string) ApiCreateMultipartUploadRequest {
r.xAmzServerSideEncryption = &xAmzServerSideEncryption
return r
}
// IONOS Object Storage uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability.
func (r ApiCreateMultipartUploadRequest) XAmzStorageClass(xAmzStorageClass string) ApiCreateMultipartUploadRequest {
r.xAmzStorageClass = &xAmzStorageClass
return r
}
// If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. IONOS Object Storage stores the value of this header in the object metadata.
func (r ApiCreateMultipartUploadRequest) XAmzWebsiteRedirectLocation(xAmzWebsiteRedirectLocation string) ApiCreateMultipartUploadRequest {
r.xAmzWebsiteRedirectLocation = &xAmzWebsiteRedirectLocation
return r
}
// Specifies the algorithm to use to when encrypting the object (AES256).
func (r ApiCreateMultipartUploadRequest) XAmzServerSideEncryptionCustomerAlgorithm(xAmzServerSideEncryptionCustomerAlgorithm string) ApiCreateMultipartUploadRequest {
r.xAmzServerSideEncryptionCustomerAlgorithm = &xAmzServerSideEncryptionCustomerAlgorithm
return r
}
// Specifies the customer-provided encryption key for IONOS Object Storage to use in encrypting data. This value is used to store the object and then it is discarded; IONOS Object Storage does not store the encryption key. The key must be appropriate for use with the algorithm specified in the `x-amz-server-side-encryption-customer-algorithm` header.
func (r ApiCreateMultipartUploadRequest) XAmzServerSideEncryptionCustomerKey(xAmzServerSideEncryptionCustomerKey string) ApiCreateMultipartUploadRequest {
r.xAmzServerSideEncryptionCustomerKey = &xAmzServerSideEncryptionCustomerKey
return r
}
// Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. IONOS Object Storage uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
func (r ApiCreateMultipartUploadRequest) XAmzServerSideEncryptionCustomerKeyMD5(xAmzServerSideEncryptionCustomerKeyMD5 string) ApiCreateMultipartUploadRequest {
r.xAmzServerSideEncryptionCustomerKeyMD5 = &xAmzServerSideEncryptionCustomerKeyMD5
return r
}
// Specifies the Object Lock mode that you want to apply to the uploaded object.
func (r ApiCreateMultipartUploadRequest) XAmzObjectLockMode(xAmzObjectLockMode string) ApiCreateMultipartUploadRequest {
r.xAmzObjectLockMode = &xAmzObjectLockMode
return r
}
// Specifies the date and time when you want the Object Lock to expire.
func (r ApiCreateMultipartUploadRequest) XAmzObjectLockRetainUntilDate(xAmzObjectLockRetainUntilDate time.Time) ApiCreateMultipartUploadRequest {
r.xAmzObjectLockRetainUntilDate = &xAmzObjectLockRetainUntilDate
return r
}
// Specifies whether you want to apply a Legal Hold to the uploaded object.
func (r ApiCreateMultipartUploadRequest) XAmzObjectLockLegalHold(xAmzObjectLockLegalHold string) ApiCreateMultipartUploadRequest {
r.xAmzObjectLockLegalHold = &xAmzObjectLockLegalHold
return r
}
// A map of metadata to store with the object in S3.
func (r ApiCreateMultipartUploadRequest) XAmzMeta(xAmzMeta map[string]string) ApiCreateMultipartUploadRequest {
r.xAmzMeta = &xAmzMeta
return r
}
func (r ApiCreateMultipartUploadRequest) Execute() (*CreateMultipartUploadOutput, *APIResponse, error) {
return r.ApiService.CreateMultipartUploadExecute(r)
}
/*
CreateMultipartUpload CreateMultipartUpload
<p>This operation initiates a multipart upload and returns an upload ID. This upload ID is used to associate all of the parts in the specific multipart upload. You specify this upload ID in each of your subsequent upload part requests. You also include this upload ID in the final request to either complete or abort the multipart upload request.</p>
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bucket
@param key Object key for which the multipart upload is to be initiated.
@return ApiCreateMultipartUploadRequest
*/
func (a *UploadsApiService) CreateMultipartUpload(ctx context.Context, bucket string, key string) ApiCreateMultipartUploadRequest {
return ApiCreateMultipartUploadRequest{
ApiService: a,
ctx: ctx,
bucket: bucket,
key: key,
}
}
// Execute executes the request
//
// @return CreateMultipartUploadOutput
func (a *UploadsApiService) CreateMultipartUploadExecute(r ApiCreateMultipartUploadRequest) (*CreateMultipartUploadOutput, *APIResponse, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CreateMultipartUploadOutput
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UploadsApiService.CreateMultipartUpload")
if err != nil {
gerr := GenericOpenAPIError{}
gerr.SetError(err.Error())
return localVarReturnValue, nil, gerr
}
localVarPath := localBasePath + "/{Bucket}/{Key}?uploads"
localVarPath = strings.Replace(localVarPath, "{"+"Bucket"+"}", parameterValueToString(r.bucket, "bucket"), -1)
localVarPath = strings.Replace(localVarPath, "{"+"Key"+"}", parameterValueToString(r.key, "key"), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if Strlen(r.bucket) < 3 {
return localVarReturnValue, nil, reportError("bucket must have at least 3 elements")
}
if Strlen(r.bucket) > 63 {
return localVarReturnValue, nil, reportError("bucket must have less than 63 elements")
}
if Strlen(r.key) < 1 {
return localVarReturnValue, nil, reportError("key must have at least 1 elements")
}
if r.uploads == nil {
return localVarReturnValue, nil, reportError("uploads is required and must be specified")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "uploads", r.uploads, "")
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/xml"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.cacheControl != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Cache-Control", r.cacheControl, "")
}
if r.contentDisposition != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Disposition", r.contentDisposition, "")
}
if r.contentEncoding != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "")
}
if r.contentType != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "")
}
if r.expires != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "Expires", r.expires, "")
}
if r.xAmzServerSideEncryption != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-server-side-encryption", r.xAmzServerSideEncryption, "")
}
if r.xAmzStorageClass != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-storage-class", r.xAmzStorageClass, "")
}
if r.xAmzWebsiteRedirectLocation != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-website-redirect-location", r.xAmzWebsiteRedirectLocation, "")
}
if r.xAmzServerSideEncryptionCustomerAlgorithm != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-server-side-encryption-customer-algorithm", r.xAmzServerSideEncryptionCustomerAlgorithm, "")
}
if r.xAmzServerSideEncryptionCustomerKey != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-server-side-encryption-customer-key", r.xAmzServerSideEncryptionCustomerKey, "")
}
if r.xAmzServerSideEncryptionCustomerKeyMD5 != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-server-side-encryption-customer-key-MD5", r.xAmzServerSideEncryptionCustomerKeyMD5, "")
}
if r.xAmzObjectLockMode != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-object-lock-mode", r.xAmzObjectLockMode, "")
}
if r.xAmzObjectLockRetainUntilDate != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-object-lock-retain-until-date", r.xAmzObjectLockRetainUntilDate, "")
}
if r.xAmzObjectLockLegalHold != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-object-lock-legal-hold", r.xAmzObjectLockLegalHold, "")
}
if r.xAmzMeta != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "x-amz-meta", r.xAmzMeta, "")
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["hmac"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req)
localVarAPIResponse := &APIResponse{
Response: localVarHTTPResponse,
Method: localVarHTTPMethod,
RequestTime: httpRequestTime,
RequestURL: localVarPath,
Operation: "CreateMultipartUpload",
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarAPIResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarAPIResponse.Payload = localVarBody
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarAPIResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)))
return localVarReturnValue, localVarAPIResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(err.Error())
return localVarReturnValue, localVarAPIResponse, newErr
}
return localVarReturnValue, localVarAPIResponse, nil
}
type ApiListMultipartUploadsRequest struct {
ctx context.Context
ApiService *UploadsApiService
bucket string
uploads *bool
delimiter *string
encodingType *string
keyMarker *string
maxUploads *int32
prefix *string
uploadIdMarker *string
maxUploads2 *string
keyMarker2 *string
uploadIdMarker2 *string
}
func (r ApiListMultipartUploadsRequest) Uploads(uploads bool) ApiListMultipartUploadsRequest {
r.uploads = &uploads
return r
}
// <p>Character you use to group keys.</p> <p>All keys that contain the same string between the prefix, if specified, and the first occurrence of the delimiter after the prefix are grouped under a single result element, `CommonPrefixes`. If you don't specify the prefix parameter, then the substring starts at the beginning of the key. The keys that are grouped under `CommonPrefixes` result element are not returned elsewhere in the response.</p>
func (r ApiListMultipartUploadsRequest) Delimiter(delimiter string) ApiListMultipartUploadsRequest {
r.delimiter = &delimiter
return r
}
func (r ApiListMultipartUploadsRequest) EncodingType(encodingType string) ApiListMultipartUploadsRequest {
r.encodingType = &encodingType
return r
}
// <p>Together with upload-id-marker, this parameter specifies the multipart upload after which listing should begin.</p> <p>If `upload-id-marker` is not specified, only the keys lexicographically greater than the specified `key-marker` will be included in the list.</p> <p>If `upload-id-marker` is specified, any multipart uploads for a key equal to the `key-marker` might also be included, provided those multipart uploads have upload IDs lexicographically greater than the specified `upload-id-marker`.</p>
func (r ApiListMultipartUploadsRequest) KeyMarker(keyMarker string) ApiListMultipartUploadsRequest {
r.keyMarker = &keyMarker
return r
}
// Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the response body. 1,000 is the maximum number of uploads that can be returned in a response.
func (r ApiListMultipartUploadsRequest) MaxUploads(maxUploads int32) ApiListMultipartUploadsRequest {
r.maxUploads = &maxUploads
return r
}
// Lists in-progress uploads only for those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different grouping of keys. (You can think of using prefix to make groups in the same way you'd use a folder in a file system.)
func (r ApiListMultipartUploadsRequest) Prefix(prefix string) ApiListMultipartUploadsRequest {
r.prefix = &prefix
return r
}
// Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is not specified, the upload-id-marker parameter is ignored. Otherwise, any multipart uploads for a key equal to the key-marker might be included in the list only if they have an upload ID lexicographically greater than the specified `upload-id-marker`.
func (r ApiListMultipartUploadsRequest) UploadIdMarker(uploadIdMarker string) ApiListMultipartUploadsRequest {
r.uploadIdMarker = &uploadIdMarker
return r
}
// Pagination limit
func (r ApiListMultipartUploadsRequest) MaxUploads2(maxUploads2 string) ApiListMultipartUploadsRequest {
r.maxUploads2 = &maxUploads2
return r
}
// Pagination token
func (r ApiListMultipartUploadsRequest) KeyMarker2(keyMarker2 string) ApiListMultipartUploadsRequest {
r.keyMarker2 = &keyMarker2
return r
}
// Pagination token
func (r ApiListMultipartUploadsRequest) UploadIdMarker2(uploadIdMarker2 string) ApiListMultipartUploadsRequest {
r.uploadIdMarker2 = &uploadIdMarker2
return r
}
func (r ApiListMultipartUploadsRequest) Execute() (*ListMultipartUploadsOutput, *APIResponse, error) {
return r.ApiService.ListMultipartUploadsExecute(r)
}
/*
ListMultipartUploads ListMultipartUploads
<p>This operation lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that has been initiated using the Initiate Multipart Upload request, but has not yet been completed or aborted.</p> <p>This operation returns at most 1,000 multipart uploads in the response. 1,000 multipart uploads is the maximum number of uploads a response can include, which is also the default value. You can further limit the number of uploads in a response by specifying the `max-uploads` parameter in the response. If additional multipart uploads satisfy the list criteria, the response will contain an `IsTruncated` element with the value true. To list the additional multipart uploads, use the `key-marker` and `upload-id-marker` request parameters.</p> <p>In the response, the uploads are sorted by key. If your application has initiated more than one multipart upload using the same object key, then uploads in the response are first sorted by key. Additionally, uploads are sorted in ascending order within each key by the upload initiation time.</p>
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bucket
@return ApiListMultipartUploadsRequest
*/
func (a *UploadsApiService) ListMultipartUploads(ctx context.Context, bucket string) ApiListMultipartUploadsRequest {
return ApiListMultipartUploadsRequest{
ApiService: a,
ctx: ctx,
bucket: bucket,
}
}
// Execute executes the request
//
// @return ListMultipartUploadsOutput
func (a *UploadsApiService) ListMultipartUploadsExecute(r ApiListMultipartUploadsRequest) (*ListMultipartUploadsOutput, *APIResponse, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ListMultipartUploadsOutput
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UploadsApiService.ListMultipartUploads")
if err != nil {
gerr := GenericOpenAPIError{}
gerr.SetError(err.Error())
return localVarReturnValue, nil, gerr
}
localVarPath := localBasePath + "/{Bucket}?uploads"
localVarPath = strings.Replace(localVarPath, "{"+"Bucket"+"}", parameterValueToString(r.bucket, "bucket"), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if Strlen(r.bucket) < 3 {
return localVarReturnValue, nil, reportError("bucket must have at least 3 elements")
}
if Strlen(r.bucket) > 63 {
return localVarReturnValue, nil, reportError("bucket must have less than 63 elements")
}
if r.uploads == nil {
return localVarReturnValue, nil, reportError("uploads is required and must be specified")
}
if r.delimiter != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "")
}
if r.encodingType != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "encoding-type", r.encodingType, "")
}
if r.keyMarker != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "key-marker", r.keyMarker, "")
}
if r.maxUploads != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "max-uploads", r.maxUploads, "")
}
if r.prefix != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "")
}
if r.uploadIdMarker != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "upload-id-marker", r.uploadIdMarker, "")
}
if r.maxUploads2 != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "MaxUploads", r.maxUploads2, "")
}
if r.keyMarker2 != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "KeyMarker", r.keyMarker2, "")
}
if r.uploadIdMarker2 != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "UploadIdMarker", r.uploadIdMarker2, "")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "uploads", r.uploads, "")
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/xml"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["hmac"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req)
localVarAPIResponse := &APIResponse{
Response: localVarHTTPResponse,
Method: localVarHTTPMethod,
RequestTime: httpRequestTime,
RequestURL: localVarPath,
Operation: "ListMultipartUploads",
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarAPIResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarAPIResponse.Payload = localVarBody
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarAPIResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)))
return localVarReturnValue, localVarAPIResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{}
newErr.SetStatusCode(localVarHTTPResponse.StatusCode)
newErr.SetBody(localVarBody)
newErr.SetError(err.Error())
return localVarReturnValue, localVarAPIResponse, newErr
}
return localVarReturnValue, localVarAPIResponse, nil
}
type ApiListPartsRequest struct {
ctx context.Context
ApiService *UploadsApiService
bucket string
key string
uploadId *string
maxParts *int32
partNumberMarker *int32
partNumberMarker2 *string
}
// Upload ID identifying the multipart upload whose parts are being listed.
func (r ApiListPartsRequest) UploadId(uploadId string) ApiListPartsRequest {
r.uploadId = &uploadId
return r
}
// Sets the maximum number of parts to return.
func (r ApiListPartsRequest) MaxParts(maxParts int32) ApiListPartsRequest {
r.maxParts = &maxParts
return r
}
// Specifies the part after which listing should begin. Only parts with higher part numbers will be listed.
func (r ApiListPartsRequest) PartNumberMarker(partNumberMarker int32) ApiListPartsRequest {
r.partNumberMarker = &partNumberMarker
return r
}
// Pagination token
func (r ApiListPartsRequest) PartNumberMarker2(partNumberMarker2 string) ApiListPartsRequest {
r.partNumberMarker2 = &partNumberMarker2
return r
}
func (r ApiListPartsRequest) Execute() (*ListPartsOutput, *APIResponse, error) {
return r.ApiService.ListPartsExecute(r)
}
/*
ListParts ListParts
<p>Lists the parts that have been uploaded for a specific multipart upload. This operation must include the upload ID, which you obtain by sending the initiate multipart upload request. This request returns a maximum of 1,000 uploaded parts. The default number of parts returned is 1,000 parts. You can restrict the number of parts returned by specifying the `max-parts` request parameter. If your multipart upload consists of more than 1,000 parts, the response returns an `IsTruncated` field with the value of true, and a `NextPartNumberMarker` element. In subsequent `ListParts` requests you can include the part-number-marker query string parameter and set its value to the `NextPartNumberMarker` field value from the previous response.</p>
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bucket
@param key Object key for which the multipart upload was initiated.
@return ApiListPartsRequest
*/
func (a *UploadsApiService) ListParts(ctx context.Context, bucket string, key string) ApiListPartsRequest {
return ApiListPartsRequest{
ApiService: a,
ctx: ctx,
bucket: bucket,
key: key,
}
}
// Execute executes the request
//
// @return ListPartsOutput
func (a *UploadsApiService) ListPartsExecute(r ApiListPartsRequest) (*ListPartsOutput, *APIResponse, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ListPartsOutput
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UploadsApiService.ListParts")
if err != nil {
gerr := GenericOpenAPIError{}
gerr.SetError(err.Error())
return localVarReturnValue, nil, gerr
}
localVarPath := localBasePath + "/{Bucket}/{Key}?uploadId"
localVarPath = strings.Replace(localVarPath, "{"+"Bucket"+"}", parameterValueToString(r.bucket, "bucket"), -1)
localVarPath = strings.Replace(localVarPath, "{"+"Key"+"}", parameterValueToString(r.key, "key"), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if Strlen(r.bucket) < 3 {
return localVarReturnValue, nil, reportError("bucket must have at least 3 elements")
}
if Strlen(r.bucket) > 63 {
return localVarReturnValue, nil, reportError("bucket must have less than 63 elements")
}
if Strlen(r.key) < 1 {
return localVarReturnValue, nil, reportError("key must have at least 1 elements")
}
if r.uploadId == nil {
return localVarReturnValue, nil, reportError("uploadId is required and must be specified")
}
if r.maxParts != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "max-parts", r.maxParts, "")
}
if r.partNumberMarker != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "part-number-marker", r.partNumberMarker, "")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "uploadId", r.uploadId, "")
if r.partNumberMarker2 != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "PartNumberMarker", r.partNumberMarker2, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}