yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/huawei/obs/model.go (about) 1 // Copyright 2019 Yunion 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Copyright 2019 Huawei Technologies Co.,Ltd. 16 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 17 // this file except in compliance with the License. You may obtain a copy of the 18 // License at 19 // 20 // http://www.apache.org/licenses/LICENSE-2.0 21 // 22 // Unless required by applicable law or agreed to in writing, software distributed 23 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 24 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 25 // specific language governing permissions and limitations under the License. 26 27 package obs 28 29 import ( 30 "encoding/xml" 31 "io" 32 "net/http" 33 "time" 34 ) 35 36 type BaseModel struct { 37 StatusCode int `xml:"-"` 38 RequestId string `xml:"RequestId"` 39 ResponseHeaders map[string][]string `xml:"-"` 40 } 41 42 type Bucket struct { 43 XMLName xml.Name `xml:"Bucket"` 44 Name string `xml:"Name"` 45 CreationDate time.Time `xml:"CreationDate"` 46 Location string `xml:"Location"` 47 } 48 49 type Owner struct { 50 XMLName xml.Name `xml:"Owner"` 51 ID string `xml:"ID"` 52 DisplayName string `xml:"DisplayName,omitempty"` 53 } 54 55 type Initiator struct { 56 XMLName xml.Name `xml:"Initiator"` 57 ID string `xml:"ID"` 58 DisplayName string `xml:"DisplayName,omitempty"` 59 } 60 61 type ListBucketsInput struct { 62 QueryLocation bool 63 } 64 65 type ListBucketsOutput struct { 66 BaseModel 67 XMLName xml.Name `xml:"ListAllMyBucketsResult"` 68 Owner Owner `xml:"Owner"` 69 Buckets []Bucket `xml:"Buckets>Bucket"` 70 } 71 72 type bucketLocationObs struct { 73 XMLName xml.Name `xml:"Location"` 74 Location string `xml:",chardata"` 75 } 76 77 type BucketLocation struct { 78 XMLName xml.Name `xml:"CreateBucketConfiguration"` 79 Location string `xml:"LocationConstraint,omitempty"` 80 } 81 82 type CreateBucketInput struct { 83 BucketLocation 84 Bucket string `xml:"-"` 85 ACL AclType `xml:"-"` 86 StorageClass StorageClassType `xml:"-"` 87 GrantReadId string `xml:"-"` 88 GrantWriteId string `xml:"-"` 89 GrantReadAcpId string `xml:"-"` 90 GrantWriteAcpId string `xml:"-"` 91 GrantFullControlId string `xml:"-"` 92 GrantReadDeliveredId string `xml:"-"` 93 GrantFullControlDeliveredId string `xml:"-"` 94 Epid string `xml:"-"` 95 } 96 97 type BucketStoragePolicy struct { 98 XMLName xml.Name `xml:"StoragePolicy"` 99 StorageClass StorageClassType `xml:"DefaultStorageClass"` 100 } 101 102 type SetBucketStoragePolicyInput struct { 103 Bucket string `xml:"-"` 104 BucketStoragePolicy 105 } 106 107 type getBucketStoragePolicyOutputS3 struct { 108 BaseModel 109 BucketStoragePolicy 110 } 111 112 type GetBucketStoragePolicyOutput struct { 113 BaseModel 114 StorageClass string 115 } 116 117 type bucketStoragePolicyObs struct { 118 XMLName xml.Name `xml:"StorageClass"` 119 StorageClass string `xml:",chardata"` 120 } 121 type getBucketStoragePolicyOutputObs struct { 122 BaseModel 123 bucketStoragePolicyObs 124 } 125 126 type ListObjsInput struct { 127 Prefix string 128 MaxKeys int 129 Delimiter string 130 Origin string 131 RequestHeader string 132 } 133 134 type ListObjectsInput struct { 135 ListObjsInput 136 Bucket string 137 Marker string 138 } 139 140 type Content struct { 141 XMLName xml.Name `xml:"Contents"` 142 Owner Owner `xml:"Owner"` 143 ETag string `xml:"ETag"` 144 Key string `xml:"Key"` 145 LastModified time.Time `xml:"LastModified"` 146 Size int64 `xml:"Size"` 147 StorageClass StorageClassType `xml:"StorageClass"` 148 } 149 150 type ListObjectsOutput struct { 151 BaseModel 152 XMLName xml.Name `xml:"ListBucketResult"` 153 Delimiter string `xml:"Delimiter"` 154 IsTruncated bool `xml:"IsTruncated"` 155 Marker string `xml:"Marker"` 156 NextMarker string `xml:"NextMarker"` 157 MaxKeys int `xml:"MaxKeys"` 158 Name string `xml:"Name"` 159 Prefix string `xml:"Prefix"` 160 Contents []Content `xml:"Contents"` 161 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 162 Location string `xml:"-"` 163 } 164 165 type ListVersionsInput struct { 166 ListObjsInput 167 Bucket string 168 KeyMarker string 169 VersionIdMarker string 170 } 171 172 type Version struct { 173 DeleteMarker 174 XMLName xml.Name `xml:"Version"` 175 ETag string `xml:"ETag"` 176 Size int64 `xml:"Size"` 177 } 178 179 type DeleteMarker struct { 180 XMLName xml.Name `xml:"DeleteMarker"` 181 Key string `xml:"Key"` 182 VersionId string `xml:"VersionId"` 183 IsLatest bool `xml:"IsLatest"` 184 LastModified time.Time `xml:"LastModified"` 185 Owner Owner `xml:"Owner"` 186 StorageClass StorageClassType `xml:"StorageClass"` 187 } 188 189 type ListVersionsOutput struct { 190 BaseModel 191 XMLName xml.Name `xml:"ListVersionsResult"` 192 Delimiter string `xml:"Delimiter"` 193 IsTruncated bool `xml:"IsTruncated"` 194 KeyMarker string `xml:"KeyMarker"` 195 NextKeyMarker string `xml:"NextKeyMarker"` 196 VersionIdMarker string `xml:"VersionIdMarker"` 197 NextVersionIdMarker string `xml:"NextVersionIdMarker"` 198 MaxKeys int `xml:"MaxKeys"` 199 Name string `xml:"Name"` 200 Prefix string `xml:"Prefix"` 201 Versions []Version `xml:"Version"` 202 DeleteMarkers []DeleteMarker `xml:"DeleteMarker"` 203 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 204 Location string `xml:"-"` 205 } 206 207 type ListMultipartUploadsInput struct { 208 Bucket string 209 Prefix string 210 MaxUploads int 211 Delimiter string 212 KeyMarker string 213 UploadIdMarker string 214 } 215 216 type Upload struct { 217 XMLName xml.Name `xml:"Upload"` 218 Key string `xml:"Key"` 219 UploadId string `xml:"UploadId"` 220 Initiated time.Time `xml:"Initiated"` 221 StorageClass StorageClassType `xml:"StorageClass"` 222 Owner Owner `xml:"Owner"` 223 Initiator Initiator `xml:"Initiator"` 224 } 225 226 type ListMultipartUploadsOutput struct { 227 BaseModel 228 XMLName xml.Name `xml:"ListMultipartUploadsResult"` 229 Bucket string `xml:"Bucket"` 230 KeyMarker string `xml:"KeyMarker"` 231 NextKeyMarker string `xml:"NextKeyMarker"` 232 UploadIdMarker string `xml:"UploadIdMarker"` 233 NextUploadIdMarker string `xml:"NextUploadIdMarker"` 234 Delimiter string `xml:"Delimiter"` 235 IsTruncated bool `xml:"IsTruncated"` 236 MaxUploads int `xml:"MaxUploads"` 237 Prefix string `xml:"Prefix"` 238 Uploads []Upload `xml:"Upload"` 239 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 240 } 241 242 type BucketQuota struct { 243 XMLName xml.Name `xml:"Quota"` 244 Quota int64 `xml:"StorageQuota"` 245 } 246 247 type SetBucketQuotaInput struct { 248 Bucket string `xml:"-"` 249 BucketQuota 250 } 251 252 type GetBucketQuotaOutput struct { 253 BaseModel 254 BucketQuota 255 } 256 257 type GetBucketStorageInfoOutput struct { 258 BaseModel 259 XMLName xml.Name `xml:"GetBucketStorageInfoResult"` 260 Size int64 `xml:"Size"` 261 ObjectNumber int `xml:"ObjectNumber"` 262 } 263 264 type getBucketLocationOutputS3 struct { 265 BaseModel 266 BucketLocation 267 } 268 type getBucketLocationOutputObs struct { 269 BaseModel 270 bucketLocationObs 271 } 272 type GetBucketLocationOutput struct { 273 BaseModel 274 Location string `xml:"-"` 275 } 276 277 type Grantee struct { 278 XMLName xml.Name `xml:"Grantee"` 279 Type GranteeType `xml:"type,attr"` 280 ID string `xml:"ID,omitempty"` 281 DisplayName string `xml:"DisplayName,omitempty"` 282 URI GroupUriType `xml:"URI,omitempty"` 283 } 284 285 type granteeObs struct { 286 XMLName xml.Name `xml:"Grantee"` 287 Type GranteeType `xml:"type,attr"` 288 ID string `xml:"ID,omitempty"` 289 DisplayName string `xml:"DisplayName,omitempty"` 290 Canned string `xml:"Canned,omitempty"` 291 } 292 293 type Grant struct { 294 XMLName xml.Name `xml:"Grant"` 295 Grantee Grantee `xml:"Grantee"` 296 Permission PermissionType `xml:"Permission"` 297 Delivered bool `xml:"Delivered"` 298 } 299 type grantObs struct { 300 XMLName xml.Name `xml:"Grant"` 301 Grantee granteeObs `xml:"Grantee"` 302 Permission PermissionType `xml:"Permission"` 303 Delivered bool `xml:"Delivered"` 304 } 305 306 type AccessControlPolicy struct { 307 XMLName xml.Name `xml:"AccessControlPolicy"` 308 Owner Owner `xml:"Owner"` 309 Grants []Grant `xml:"AccessControlList>Grant"` 310 Delivered string `xml:"Delivered,omitempty"` 311 } 312 313 type accessControlPolicyObs struct { 314 XMLName xml.Name `xml:"AccessControlPolicy"` 315 Owner Owner `xml:"Owner"` 316 Grants []grantObs `xml:"AccessControlList>Grant"` 317 } 318 319 type GetBucketAclOutput struct { 320 BaseModel 321 AccessControlPolicy 322 } 323 324 type getBucketAclOutputObs struct { 325 BaseModel 326 accessControlPolicyObs 327 } 328 329 type SetBucketAclInput struct { 330 Bucket string `xml:"-"` 331 ACL AclType `xml:"-"` 332 AccessControlPolicy 333 } 334 335 type SetBucketPolicyInput struct { 336 Bucket string 337 Policy string 338 } 339 340 type GetBucketPolicyOutput struct { 341 BaseModel 342 Policy string `json:"body"` 343 } 344 345 type CorsRule struct { 346 XMLName xml.Name `xml:"CORSRule"` 347 ID string `xml:"ID,omitempty"` 348 AllowedOrigin []string `xml:"AllowedOrigin"` 349 AllowedMethod []string `xml:"AllowedMethod"` 350 AllowedHeader []string `xml:"AllowedHeader,omitempty"` 351 MaxAgeSeconds int `xml:"MaxAgeSeconds"` 352 ExposeHeader []string `xml:"ExposeHeader,omitempty"` 353 } 354 355 type BucketCors struct { 356 XMLName xml.Name `xml:"CORSConfiguration"` 357 CorsRules []CorsRule `xml:"CORSRule"` 358 } 359 360 type SetBucketCorsInput struct { 361 Bucket string `xml:"-"` 362 BucketCors 363 } 364 365 type GetBucketCorsOutput struct { 366 BaseModel 367 BucketCors 368 } 369 370 type BucketVersioningConfiguration struct { 371 XMLName xml.Name `xml:"VersioningConfiguration"` 372 Status VersioningStatusType `xml:"Status"` 373 } 374 375 type SetBucketVersioningInput struct { 376 Bucket string `xml:"-"` 377 BucketVersioningConfiguration 378 } 379 380 type GetBucketVersioningOutput struct { 381 BaseModel 382 BucketVersioningConfiguration 383 } 384 385 type IndexDocument struct { 386 Suffix string `xml:"Suffix"` 387 } 388 389 type ErrorDocument struct { 390 Key string `xml:"Key,omitempty"` 391 } 392 393 type Condition struct { 394 XMLName xml.Name `xml:"Condition"` 395 KeyPrefixEquals string `xml:"KeyPrefixEquals,omitempty"` 396 HttpErrorCodeReturnedEquals string `xml:"HttpErrorCodeReturnedEquals,omitempty"` 397 } 398 399 type Redirect struct { 400 XMLName xml.Name `xml:"Redirect"` 401 Protocol ProtocolType `xml:"Protocol,omitempty"` 402 HostName string `xml:"HostName,omitempty"` 403 ReplaceKeyPrefixWith string `xml:"ReplaceKeyPrefixWith,omitempty"` 404 ReplaceKeyWith string `xml:"ReplaceKeyWith,omitempty"` 405 HttpRedirectCode string `xml:"HttpRedirectCode,omitempty"` 406 } 407 408 type RoutingRule struct { 409 XMLName xml.Name `xml:"RoutingRule"` 410 Condition Condition `xml:"Condition,omitempty"` 411 Redirect Redirect `xml:"Redirect"` 412 } 413 414 type RedirectAllRequestsTo struct { 415 XMLName xml.Name `xml:"RedirectAllRequestsTo"` 416 Protocol ProtocolType `xml:"Protocol,omitempty"` 417 HostName string `xml:"HostName"` 418 } 419 420 type BucketWebsiteConfiguration struct { 421 XMLName xml.Name `xml:"WebsiteConfiguration"` 422 RedirectAllRequestsTo RedirectAllRequestsTo `xml:"RedirectAllRequestsTo,omitempty"` 423 IndexDocument IndexDocument `xml:"IndexDocument,omitempty"` 424 ErrorDocument ErrorDocument `xml:"ErrorDocument,omitempty"` 425 RoutingRules []RoutingRule `xml:"RoutingRules>RoutingRule,omitempty"` 426 } 427 428 type SetBucketWebsiteConfigurationInput struct { 429 Bucket string `xml:"-"` 430 BucketWebsiteConfiguration 431 } 432 433 type GetBucketWebsiteConfigurationOutput struct { 434 BaseModel 435 BucketWebsiteConfiguration 436 } 437 438 type GetBucketMetadataInput struct { 439 Bucket string 440 Origin string 441 RequestHeader string 442 } 443 444 type SetObjectMetadataInput struct { 445 Bucket string 446 Key string 447 VersionId string 448 MetadataDirective MetadataDirectiveType 449 CacheControl string 450 ContentDisposition string 451 ContentEncoding string 452 ContentLanguage string 453 ContentType string 454 Expires string 455 WebsiteRedirectLocation string 456 StorageClass StorageClassType 457 Metadata map[string]string 458 } 459 460 type SetObjectMetadataOutput struct { 461 BaseModel 462 MetadataDirective MetadataDirectiveType 463 CacheControl string 464 ContentDisposition string 465 ContentEncoding string 466 ContentLanguage string 467 ContentType string 468 Expires string 469 WebsiteRedirectLocation string 470 StorageClass StorageClassType 471 Metadata map[string]string 472 } 473 474 type GetBucketMetadataOutput struct { 475 BaseModel 476 StorageClass StorageClassType 477 Location string 478 Version string 479 AllowOrigin string 480 AllowMethod string 481 AllowHeader string 482 MaxAgeSeconds int 483 ExposeHeader string 484 Epid string 485 } 486 487 type BucketLoggingStatus struct { 488 XMLName xml.Name `xml:"BucketLoggingStatus"` 489 Agency string `xml:"Agency,omitempty"` 490 TargetBucket string `xml:"LoggingEnabled>TargetBucket,omitempty"` 491 TargetPrefix string `xml:"LoggingEnabled>TargetPrefix,omitempty"` 492 TargetGrants []Grant `xml:"LoggingEnabled>TargetGrants>Grant,omitempty"` 493 } 494 495 type SetBucketLoggingConfigurationInput struct { 496 Bucket string `xml:"-"` 497 BucketLoggingStatus 498 } 499 500 type GetBucketLoggingConfigurationOutput struct { 501 BaseModel 502 BucketLoggingStatus 503 } 504 505 type Transition struct { 506 XMLName xml.Name `xml:"Transition"` 507 Date time.Time `xml:"Date,omitempty"` 508 Days int `xml:"Days,omitempty"` 509 StorageClass StorageClassType `xml:"StorageClass"` 510 } 511 512 type Expiration struct { 513 XMLName xml.Name `xml:"Expiration"` 514 Date time.Time `xml:"Date,omitempty"` 515 Days int `xml:"Days,omitempty"` 516 } 517 518 type NoncurrentVersionTransition struct { 519 XMLName xml.Name `xml:"NoncurrentVersionTransition"` 520 NoncurrentDays int `xml:"NoncurrentDays"` 521 StorageClass StorageClassType `xml:"StorageClass"` 522 } 523 524 type NoncurrentVersionExpiration struct { 525 XMLName xml.Name `xml:"NoncurrentVersionExpiration"` 526 NoncurrentDays int `xml:"NoncurrentDays"` 527 } 528 529 type LifecycleRule struct { 530 ID string `xml:"ID,omitempty"` 531 Prefix string `xml:"Prefix"` 532 Status RuleStatusType `xml:"Status"` 533 Transitions []Transition `xml:"Transition,omitempty"` 534 Expiration Expiration `xml:"Expiration,omitempty"` 535 NoncurrentVersionTransitions []NoncurrentVersionTransition `xml:"NoncurrentVersionTransition,omitempty"` 536 NoncurrentVersionExpiration NoncurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty"` 537 } 538 539 type BucketLifecyleConfiguration struct { 540 XMLName xml.Name `xml:"LifecycleConfiguration"` 541 LifecycleRules []LifecycleRule `xml:"Rule"` 542 } 543 544 type SetBucketLifecycleConfigurationInput struct { 545 Bucket string `xml:"-"` 546 BucketLifecyleConfiguration 547 } 548 549 type GetBucketLifecycleConfigurationOutput struct { 550 BaseModel 551 BucketLifecyleConfiguration 552 } 553 554 type Tag struct { 555 XMLName xml.Name `xml:"Tag"` 556 Key string `xml:"Key"` 557 Value string `xml:"Value"` 558 } 559 560 type BucketTagging struct { 561 XMLName xml.Name `xml:"Tagging"` 562 Tags []Tag `xml:"TagSet>Tag"` 563 } 564 565 type SetBucketTaggingInput struct { 566 Bucket string `xml:"-"` 567 BucketTagging 568 } 569 570 type GetBucketTaggingOutput struct { 571 BaseModel 572 BucketTagging 573 } 574 575 type FilterRule struct { 576 XMLName xml.Name `xml:"FilterRule"` 577 Name string `xml:"Name,omitempty"` 578 Value string `xml:"Value,omitempty"` 579 } 580 581 type TopicConfiguration struct { 582 XMLName xml.Name `xml:"TopicConfiguration"` 583 ID string `xml:"Id,omitempty"` 584 Topic string `xml:"Topic"` 585 Events []EventType `xml:"Event"` 586 FilterRules []FilterRule `xml:"Filter>Object>FilterRule"` 587 } 588 589 type BucketNotification struct { 590 XMLName xml.Name `xml:"NotificationConfiguration"` 591 TopicConfigurations []TopicConfiguration `xml:"TopicConfiguration"` 592 } 593 594 type SetBucketNotificationInput struct { 595 Bucket string `xml:"-"` 596 BucketNotification 597 } 598 599 type topicConfigurationS3 struct { 600 XMLName xml.Name `xml:"TopicConfiguration"` 601 ID string `xml:"Id,omitempty"` 602 Topic string `xml:"Topic"` 603 Events []string `xml:"Event"` 604 FilterRules []FilterRule `xml:"Filter>S3Key>FilterRule"` 605 } 606 607 type bucketNotificationS3 struct { 608 XMLName xml.Name `xml:"NotificationConfiguration"` 609 TopicConfigurations []topicConfigurationS3 `xml:"TopicConfiguration"` 610 } 611 612 type getBucketNotificationOutputS3 struct { 613 BaseModel 614 bucketNotificationS3 615 } 616 617 type GetBucketNotificationOutput struct { 618 BaseModel 619 BucketNotification 620 } 621 622 type DeleteObjectInput struct { 623 Bucket string 624 Key string 625 VersionId string 626 } 627 628 type DeleteObjectOutput struct { 629 BaseModel 630 VersionId string 631 DeleteMarker bool 632 } 633 634 type ObjectToDelete struct { 635 XMLName xml.Name `xml:"Object"` 636 Key string `xml:"Key"` 637 VersionId string `xml:"VersionId,omitempty"` 638 } 639 640 type DeleteObjectsInput struct { 641 Bucket string `xml:"-"` 642 XMLName xml.Name `xml:"Delete"` 643 Quiet bool `xml:"Quiet,omitempty"` 644 Objects []ObjectToDelete `xml:"Object"` 645 } 646 647 type Deleted struct { 648 XMLName xml.Name `xml:"Deleted"` 649 Key string `xml:"Key"` 650 VersionId string `xml:"VersionId"` 651 DeleteMarker bool `xml:"DeleteMarker"` 652 DeleteMarkerVersionId string `xml:"DeleteMarkerVersionId"` 653 } 654 655 type Error struct { 656 XMLName xml.Name `xml:"Error"` 657 Key string `xml:"Key"` 658 VersionId string `xml:"VersionId"` 659 Code string `xml:"Code"` 660 Message string `xml:"Message"` 661 } 662 663 type DeleteObjectsOutput struct { 664 BaseModel 665 XMLName xml.Name `xml:"DeleteResult"` 666 Deleteds []Deleted `xml:"Deleted"` 667 Errors []Error `xml:"Error"` 668 } 669 670 type SetObjectAclInput struct { 671 Bucket string `xml:"-"` 672 Key string `xml:"-"` 673 VersionId string `xml:"-"` 674 ACL AclType `xml:"-"` 675 AccessControlPolicy 676 } 677 678 type GetObjectAclInput struct { 679 Bucket string 680 Key string 681 VersionId string 682 } 683 684 type GetObjectAclOutput struct { 685 BaseModel 686 VersionId string 687 AccessControlPolicy 688 } 689 690 type RestoreObjectInput struct { 691 Bucket string `xml:"-"` 692 Key string `xml:"-"` 693 VersionId string `xml:"-"` 694 XMLName xml.Name `xml:"RestoreRequest"` 695 Days int `xml:"Days"` 696 Tier RestoreTierType `xml:"GlacierJobParameters>Tier,omitempty"` 697 } 698 699 type ISseHeader interface { 700 GetEncryption() string 701 GetKey() string 702 } 703 704 type SseKmsHeader struct { 705 Encryption string 706 Key string 707 isObs bool 708 } 709 710 type SseCHeader struct { 711 Encryption string 712 Key string 713 KeyMD5 string 714 } 715 716 type GetObjectMetadataInput struct { 717 Bucket string 718 Key string 719 VersionId string 720 Origin string 721 RequestHeader string 722 SseHeader ISseHeader 723 } 724 725 type GetObjectMetadataOutput struct { 726 BaseModel 727 VersionId string 728 WebsiteRedirectLocation string 729 Expiration string 730 Restore string 731 ObjectType string 732 NextAppendPosition string 733 StorageClass StorageClassType 734 ContentLength int64 735 ContentType string 736 ETag string 737 AllowOrigin string 738 AllowHeader string 739 AllowMethod string 740 ExposeHeader string 741 MaxAgeSeconds int 742 LastModified time.Time 743 SseHeader ISseHeader 744 Metadata map[string]string 745 } 746 747 type GetObjectInput struct { 748 GetObjectMetadataInput 749 IfMatch string 750 IfNoneMatch string 751 IfUnmodifiedSince time.Time 752 IfModifiedSince time.Time 753 RangeStart int64 754 RangeEnd int64 755 ImageProcess string 756 ResponseCacheControl string 757 ResponseContentDisposition string 758 ResponseContentEncoding string 759 ResponseContentLanguage string 760 ResponseContentType string 761 ResponseExpires string 762 } 763 764 type GetObjectOutput struct { 765 GetObjectMetadataOutput 766 DeleteMarker bool 767 CacheControl string 768 ContentDisposition string 769 ContentEncoding string 770 ContentLanguage string 771 Expires string 772 Body io.ReadCloser 773 } 774 775 type ObjectOperationInput struct { 776 Bucket string 777 Key string 778 ACL AclType 779 GrantReadId string 780 GrantReadAcpId string 781 GrantWriteAcpId string 782 GrantFullControlId string 783 StorageClass StorageClassType 784 WebsiteRedirectLocation string 785 Expires int64 786 SseHeader ISseHeader 787 Metadata map[string]string 788 } 789 790 type PutObjectBasicInput struct { 791 ObjectOperationInput 792 ContentType string 793 ContentMD5 string 794 ContentLength int64 795 } 796 797 type PutObjectInput struct { 798 PutObjectBasicInput 799 Body io.Reader 800 } 801 802 type PutFileInput struct { 803 PutObjectBasicInput 804 SourceFile string 805 } 806 807 type PutObjectOutput struct { 808 BaseModel 809 VersionId string 810 SseHeader ISseHeader 811 StorageClass StorageClassType 812 ETag string 813 } 814 815 type CopyObjectInput struct { 816 ObjectOperationInput 817 CopySourceBucket string 818 CopySourceKey string 819 CopySourceVersionId string 820 CopySourceIfMatch string 821 CopySourceIfNoneMatch string 822 CopySourceIfUnmodifiedSince time.Time 823 CopySourceIfModifiedSince time.Time 824 SourceSseHeader ISseHeader 825 CacheControl string 826 ContentDisposition string 827 ContentEncoding string 828 ContentLanguage string 829 ContentType string 830 Expires string 831 MetadataDirective MetadataDirectiveType 832 SuccessActionRedirect string 833 } 834 835 type CopyObjectOutput struct { 836 BaseModel 837 CopySourceVersionId string `xml:"-"` 838 VersionId string `xml:"-"` 839 SseHeader ISseHeader `xml:"-"` 840 XMLName xml.Name `xml:"CopyObjectResult"` 841 LastModified time.Time `xml:"LastModified"` 842 ETag string `xml:"ETag"` 843 } 844 845 type AbortMultipartUploadInput struct { 846 Bucket string 847 Key string 848 UploadId string 849 } 850 851 type InitiateMultipartUploadInput struct { 852 ObjectOperationInput 853 ContentType string 854 } 855 856 type InitiateMultipartUploadOutput struct { 857 BaseModel 858 XMLName xml.Name `xml:"InitiateMultipartUploadResult"` 859 Bucket string `xml:"Bucket"` 860 Key string `xml:"Key"` 861 UploadId string `xml:"UploadId"` 862 SseHeader ISseHeader 863 } 864 865 type UploadPartInput struct { 866 Bucket string 867 Key string 868 PartNumber int 869 UploadId string 870 ContentMD5 string 871 SseHeader ISseHeader 872 Body io.Reader 873 SourceFile string 874 Offset int64 875 PartSize int64 876 } 877 878 type UploadPartOutput struct { 879 BaseModel 880 PartNumber int 881 ETag string 882 SseHeader ISseHeader 883 } 884 885 type Part struct { 886 XMLName xml.Name `xml:"Part"` 887 PartNumber int `xml:"PartNumber"` 888 ETag string `xml:"ETag"` 889 LastModified time.Time `xml:"LastModified,omitempty"` 890 Size int64 `xml:"Size,omitempty"` 891 } 892 893 type CompleteMultipartUploadInput struct { 894 Bucket string `xml:"-"` 895 Key string `xml:"-"` 896 UploadId string `xml:"-"` 897 XMLName xml.Name `xml:"CompleteMultipartUpload"` 898 Parts []Part `xml:"Part"` 899 } 900 901 type CompleteMultipartUploadOutput struct { 902 BaseModel 903 VersionId string `xml:"-"` 904 SseHeader ISseHeader `xml:"-"` 905 XMLName xml.Name `xml:"CompleteMultipartUploadResult"` 906 Location string `xml:"Location"` 907 Bucket string `xml:"Bucket"` 908 Key string `xml:"Key"` 909 ETag string `xml:"ETag"` 910 } 911 912 type ListPartsInput struct { 913 Bucket string 914 Key string 915 UploadId string 916 MaxParts int 917 PartNumberMarker int 918 } 919 920 type ListPartsOutput struct { 921 BaseModel 922 XMLName xml.Name `xml:"ListPartsResult"` 923 Bucket string `xml:"Bucket"` 924 Key string `xml:"Key"` 925 UploadId string `xml:"UploadId"` 926 PartNumberMarker int `xml:"PartNumberMarker"` 927 NextPartNumberMarker int `xml:"NextPartNumberMarker"` 928 MaxParts int `xml:"MaxParts"` 929 IsTruncated bool `xml:"IsTruncated"` 930 StorageClass StorageClassType `xml:"StorageClass"` 931 Initiator Initiator `xml:"Initiator"` 932 Owner Owner `xml:"Owner"` 933 Parts []Part `xml:"Part"` 934 } 935 936 type CopyPartInput struct { 937 Bucket string 938 Key string 939 UploadId string 940 PartNumber int 941 CopySourceBucket string 942 CopySourceKey string 943 CopySourceVersionId string 944 CopySourceRangeStart int64 945 CopySourceRangeEnd int64 946 SseHeader ISseHeader 947 SourceSseHeader ISseHeader 948 } 949 950 type CopyPartOutput struct { 951 BaseModel 952 XMLName xml.Name `xml:"CopyPartResult"` 953 PartNumber int `xml:"-"` 954 ETag string `xml:"ETag"` 955 LastModified time.Time `xml:"LastModified"` 956 SseHeader ISseHeader `xml:"-"` 957 } 958 959 type CreateSignedUrlInput struct { 960 Method HttpMethodType 961 Bucket string 962 Key string 963 SubResource SubResourceType 964 Expires int 965 Headers map[string]string 966 QueryParams map[string]string 967 } 968 969 type CreateSignedUrlOutput struct { 970 SignedUrl string 971 ActualSignedRequestHeaders http.Header 972 } 973 974 type CreateBrowserBasedSignatureInput struct { 975 Bucket string 976 Key string 977 Expires int 978 FormParams map[string]string 979 } 980 981 type CreateBrowserBasedSignatureOutput struct { 982 OriginPolicy string 983 Policy string 984 Algorithm string 985 Credential string 986 Date string 987 Signature string 988 }