github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/obs/model.go (about) 1 // Copyright 2019 Huawei Technologies Co.,Ltd. 2 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 3 // this file except in compliance with the License. You may obtain a copy of the 4 // License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software distributed 9 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 10 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 // specific language governing permissions and limitations under the License. 12 13 package obs 14 15 import ( 16 "encoding/xml" 17 "io" 18 "net/http" 19 "time" 20 ) 21 22 // BaseModel defines base model response from OBS 23 type BaseModel struct { 24 StatusCode int `xml:"-"` 25 RequestId string `xml:"RequestId" json:"request_id"` 26 ResponseHeaders map[string][]string `xml:"-"` 27 } 28 29 // Bucket defines bucket properties 30 type Bucket struct { 31 XMLName xml.Name `xml:"Bucket"` 32 Name string `xml:"Name"` 33 CreationDate time.Time `xml:"CreationDate"` 34 Location string `xml:"Location"` 35 BucketType string `xml:"BucketType,omitempty"` 36 } 37 38 // Owner defines owner properties 39 type Owner struct { 40 XMLName xml.Name `xml:"Owner"` 41 ID string `xml:"ID"` 42 DisplayName string `xml:"DisplayName,omitempty"` 43 } 44 45 // Initiator defines initiator properties 46 type Initiator struct { 47 XMLName xml.Name `xml:"Initiator"` 48 ID string `xml:"ID"` 49 DisplayName string `xml:"DisplayName,omitempty"` 50 } 51 52 // ListBucketsInput is the input parameter of ListBuckets function 53 type ListBucketsInput struct { 54 QueryLocation bool 55 } 56 57 // ListBucketsOutput is the result of ListBuckets function 58 type ListBucketsOutput struct { 59 BaseModel 60 XMLName xml.Name `xml:"ListAllMyBucketsResult"` 61 Owner Owner `xml:"Owner"` 62 Buckets []Bucket `xml:"Buckets>Bucket"` 63 } 64 65 type bucketLocationObs struct { 66 XMLName xml.Name `xml:"Location"` 67 Location string `xml:",chardata"` 68 } 69 70 // BucketLocation defines bucket location configuration 71 type BucketLocation struct { 72 XMLName xml.Name `xml:"CreateBucketConfiguration"` 73 Location string `xml:"LocationConstraint,omitempty"` 74 } 75 76 // CreateBucketInput is the input parameter of CreateBucket function 77 type CreateBucketInput struct { 78 BucketLocation 79 Bucket string `xml:"-"` 80 ACL AclType `xml:"-"` 81 StorageClass StorageClassType `xml:"-"` 82 GrantReadId string `xml:"-"` 83 GrantWriteId string `xml:"-"` 84 GrantReadAcpId string `xml:"-"` 85 GrantWriteAcpId string `xml:"-"` 86 GrantFullControlId string `xml:"-"` 87 GrantReadDeliveredId string `xml:"-"` 88 GrantFullControlDeliveredId string `xml:"-"` 89 Epid string `xml:"-"` 90 AvailableZone string `xml:"-"` 91 IsFSFileInterface bool `xml:"-"` 92 } 93 94 // BucketStoragePolicy defines the bucket storage class 95 type BucketStoragePolicy struct { 96 XMLName xml.Name `xml:"StoragePolicy"` 97 StorageClass StorageClassType `xml:"DefaultStorageClass"` 98 } 99 100 // SetBucketStoragePolicyInput is the input parameter of SetBucketStoragePolicy function 101 type SetBucketStoragePolicyInput struct { 102 Bucket string `xml:"-"` 103 BucketStoragePolicy 104 } 105 106 type getBucketStoragePolicyOutputS3 struct { 107 BaseModel 108 BucketStoragePolicy 109 } 110 111 // GetBucketStoragePolicyOutput is the result of GetBucketStoragePolicy function 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 // ListObjsInput defines parameters for listing objects 127 type ListObjsInput struct { 128 Prefix string 129 MaxKeys int 130 Delimiter string 131 Origin string 132 RequestHeader string 133 EncodingType string 134 } 135 136 // ListObjectsInput is the input parameter of ListObjects function 137 type ListObjectsInput struct { 138 ListObjsInput 139 Bucket string 140 Marker string 141 } 142 143 // Content defines the object content properties 144 type Content struct { 145 XMLName xml.Name `xml:"Contents"` 146 Owner Owner `xml:"Owner"` 147 ETag string `xml:"ETag"` 148 Key string `xml:"Key"` 149 LastModified time.Time `xml:"LastModified"` 150 Size int64 `xml:"Size"` 151 StorageClass StorageClassType `xml:"StorageClass"` 152 } 153 154 // ListObjectsOutput is the result of ListObjects function 155 type ListObjectsOutput struct { 156 BaseModel 157 XMLName xml.Name `xml:"ListBucketResult"` 158 Delimiter string `xml:"Delimiter"` 159 IsTruncated bool `xml:"IsTruncated"` 160 Marker string `xml:"Marker"` 161 NextMarker string `xml:"NextMarker"` 162 MaxKeys int `xml:"MaxKeys"` 163 Name string `xml:"Name"` 164 Prefix string `xml:"Prefix"` 165 Contents []Content `xml:"Contents"` 166 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 167 Location string `xml:"-"` 168 EncodingType string `xml:"EncodingType,omitempty"` 169 } 170 171 // ListVersionsInput is the input parameter of ListVersions function 172 type ListVersionsInput struct { 173 ListObjsInput 174 Bucket string 175 KeyMarker string 176 VersionIdMarker string 177 } 178 179 // Version defines the properties of versioning objects 180 type Version struct { 181 DeleteMarker 182 XMLName xml.Name `xml:"Version"` 183 ETag string `xml:"ETag"` 184 Size int64 `xml:"Size"` 185 } 186 187 // DeleteMarker defines the properties of versioning delete markers 188 type DeleteMarker struct { 189 XMLName xml.Name `xml:"DeleteMarker"` 190 Key string `xml:"Key"` 191 VersionId string `xml:"VersionId"` 192 IsLatest bool `xml:"IsLatest"` 193 LastModified time.Time `xml:"LastModified"` 194 Owner Owner `xml:"Owner"` 195 StorageClass StorageClassType `xml:"StorageClass"` 196 } 197 198 // ListVersionsOutput is the result of ListVersions function 199 type ListVersionsOutput struct { 200 BaseModel 201 XMLName xml.Name `xml:"ListVersionsResult"` 202 Delimiter string `xml:"Delimiter"` 203 IsTruncated bool `xml:"IsTruncated"` 204 KeyMarker string `xml:"KeyMarker"` 205 NextKeyMarker string `xml:"NextKeyMarker"` 206 VersionIdMarker string `xml:"VersionIdMarker"` 207 NextVersionIdMarker string `xml:"NextVersionIdMarker"` 208 MaxKeys int `xml:"MaxKeys"` 209 Name string `xml:"Name"` 210 Prefix string `xml:"Prefix"` 211 Versions []Version `xml:"Version"` 212 DeleteMarkers []DeleteMarker `xml:"DeleteMarker"` 213 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 214 Location string `xml:"-"` 215 EncodingType string `xml:"EncodingType,omitempty"` 216 } 217 218 // ListMultipartUploadsInput is the input parameter of ListMultipartUploads function 219 type ListMultipartUploadsInput struct { 220 Bucket string 221 Prefix string 222 MaxUploads int 223 Delimiter string 224 KeyMarker string 225 UploadIdMarker string 226 EncodingType string 227 } 228 229 // Upload defines multipart upload properties 230 type Upload struct { 231 XMLName xml.Name `xml:"Upload"` 232 Key string `xml:"Key"` 233 UploadId string `xml:"UploadId"` 234 Initiated time.Time `xml:"Initiated"` 235 StorageClass StorageClassType `xml:"StorageClass"` 236 Owner Owner `xml:"Owner"` 237 Initiator Initiator `xml:"Initiator"` 238 } 239 240 // ListMultipartUploadsOutput is the result of ListMultipartUploads function 241 type ListMultipartUploadsOutput struct { 242 BaseModel 243 XMLName xml.Name `xml:"ListMultipartUploadsResult"` 244 Bucket string `xml:"Bucket"` 245 KeyMarker string `xml:"KeyMarker"` 246 NextKeyMarker string `xml:"NextKeyMarker"` 247 UploadIdMarker string `xml:"UploadIdMarker"` 248 NextUploadIdMarker string `xml:"NextUploadIdMarker"` 249 Delimiter string `xml:"Delimiter"` 250 IsTruncated bool `xml:"IsTruncated"` 251 MaxUploads int `xml:"MaxUploads"` 252 Prefix string `xml:"Prefix"` 253 Uploads []Upload `xml:"Upload"` 254 CommonPrefixes []string `xml:"CommonPrefixes>Prefix"` 255 EncodingType string `xml:"EncodingType,omitempty"` 256 } 257 258 // BucketQuota defines bucket quota configuration 259 type BucketQuota struct { 260 XMLName xml.Name `xml:"Quota"` 261 Quota int64 `xml:"StorageQuota"` 262 } 263 264 // SetBucketQuotaInput is the input parameter of SetBucketQuota function 265 type SetBucketQuotaInput struct { 266 Bucket string `xml:"-"` 267 BucketQuota 268 } 269 270 // GetBucketQuotaOutput is the result of GetBucketQuota function 271 type GetBucketQuotaOutput struct { 272 BaseModel 273 BucketQuota 274 } 275 276 // GetBucketStorageInfoOutput is the result of GetBucketStorageInfo function 277 type GetBucketStorageInfoOutput struct { 278 BaseModel 279 XMLName xml.Name `xml:"GetBucketStorageInfoResult"` 280 Size int64 `xml:"Size"` 281 ObjectNumber int `xml:"ObjectNumber"` 282 } 283 284 type getBucketLocationOutputS3 struct { 285 BaseModel 286 BucketLocation 287 } 288 type getBucketLocationOutputObs struct { 289 BaseModel 290 bucketLocationObs 291 } 292 293 // GetBucketLocationOutput is the result of GetBucketLocation function 294 type GetBucketLocationOutput struct { 295 BaseModel 296 Location string `xml:"-"` 297 } 298 299 // Grantee defines grantee properties 300 type Grantee struct { 301 XMLName xml.Name `xml:"Grantee"` 302 Type GranteeType `xml:"type,attr"` 303 ID string `xml:"ID,omitempty"` 304 DisplayName string `xml:"DisplayName,omitempty"` 305 URI GroupUriType `xml:"URI,omitempty"` 306 } 307 308 type granteeObs struct { 309 XMLName xml.Name `xml:"Grantee"` 310 Type GranteeType `xml:"type,attr"` 311 ID string `xml:"ID,omitempty"` 312 DisplayName string `xml:"DisplayName,omitempty"` 313 Canned string `xml:"Canned,omitempty"` 314 } 315 316 // Grant defines grant properties 317 type Grant struct { 318 XMLName xml.Name `xml:"Grant"` 319 Grantee Grantee `xml:"Grantee"` 320 Permission PermissionType `xml:"Permission"` 321 Delivered bool `xml:"Delivered"` 322 } 323 type grantObs struct { 324 XMLName xml.Name `xml:"Grant"` 325 Grantee granteeObs `xml:"Grantee"` 326 Permission PermissionType `xml:"Permission"` 327 Delivered bool `xml:"Delivered"` 328 } 329 330 // AccessControlPolicy defines access control policy properties 331 type AccessControlPolicy struct { 332 XMLName xml.Name `xml:"AccessControlPolicy"` 333 Owner Owner `xml:"Owner"` 334 Grants []Grant `xml:"AccessControlList>Grant"` 335 Delivered string `xml:"Delivered,omitempty"` 336 } 337 338 type accessControlPolicyObs struct { 339 XMLName xml.Name `xml:"AccessControlPolicy"` 340 Owner Owner `xml:"Owner"` 341 Grants []grantObs `xml:"AccessControlList>Grant"` 342 } 343 344 // GetBucketAclOutput is the result of GetBucketAcl function 345 type GetBucketAclOutput struct { 346 BaseModel 347 AccessControlPolicy 348 } 349 350 type getBucketACLOutputObs struct { 351 BaseModel 352 accessControlPolicyObs 353 } 354 355 // SetBucketAclInput is the input parameter of SetBucketAcl function 356 type SetBucketAclInput struct { 357 Bucket string `xml:"-"` 358 ACL AclType `xml:"-"` 359 AccessControlPolicy 360 } 361 362 // SetBucketPolicyInput is the input parameter of SetBucketPolicy function 363 type SetBucketPolicyInput struct { 364 Bucket string 365 Policy string 366 } 367 368 // GetBucketPolicyOutput is the result of GetBucketPolicy function 369 type GetBucketPolicyOutput struct { 370 BaseModel 371 Policy string `json:"body"` 372 } 373 374 // CorsRule defines the CORS rules 375 type CorsRule struct { 376 XMLName xml.Name `xml:"CORSRule"` 377 ID string `xml:"ID,omitempty"` 378 AllowedOrigin []string `xml:"AllowedOrigin"` 379 AllowedMethod []string `xml:"AllowedMethod"` 380 AllowedHeader []string `xml:"AllowedHeader,omitempty"` 381 MaxAgeSeconds int `xml:"MaxAgeSeconds"` 382 ExposeHeader []string `xml:"ExposeHeader,omitempty"` 383 } 384 385 // BucketCors defines the bucket CORS configuration 386 type BucketCors struct { 387 XMLName xml.Name `xml:"CORSConfiguration"` 388 CorsRules []CorsRule `xml:"CORSRule"` 389 } 390 391 // SetBucketCorsInput is the input parameter of SetBucketCors function 392 type SetBucketCorsInput struct { 393 Bucket string `xml:"-"` 394 BucketCors 395 } 396 397 // GetBucketCorsOutput is the result of GetBucketCors function 398 type GetBucketCorsOutput struct { 399 BaseModel 400 BucketCors 401 } 402 403 // BucketVersioningConfiguration defines the versioning configuration 404 type BucketVersioningConfiguration struct { 405 XMLName xml.Name `xml:"VersioningConfiguration"` 406 Status VersioningStatusType `xml:"Status"` 407 } 408 409 // SetBucketVersioningInput is the input parameter of SetBucketVersioning function 410 type SetBucketVersioningInput struct { 411 Bucket string `xml:"-"` 412 BucketVersioningConfiguration 413 } 414 415 // GetBucketVersioningOutput is the result of GetBucketVersioning function 416 type GetBucketVersioningOutput struct { 417 BaseModel 418 BucketVersioningConfiguration 419 } 420 421 // IndexDocument defines the default page configuration 422 type IndexDocument struct { 423 Suffix string `xml:"Suffix"` 424 } 425 426 // ErrorDocument defines the error page configuration 427 type ErrorDocument struct { 428 Key string `xml:"Key,omitempty"` 429 } 430 431 // Condition defines condition in RoutingRule 432 type Condition struct { 433 XMLName xml.Name `xml:"Condition"` 434 KeyPrefixEquals string `xml:"KeyPrefixEquals,omitempty"` 435 HttpErrorCodeReturnedEquals string `xml:"HttpErrorCodeReturnedEquals,omitempty"` 436 } 437 438 // Redirect defines redirect in RoutingRule 439 type Redirect struct { 440 XMLName xml.Name `xml:"Redirect"` 441 Protocol ProtocolType `xml:"Protocol,omitempty"` 442 HostName string `xml:"HostName,omitempty"` 443 ReplaceKeyPrefixWith string `xml:"ReplaceKeyPrefixWith,omitempty"` 444 ReplaceKeyWith string `xml:"ReplaceKeyWith,omitempty"` 445 HttpRedirectCode string `xml:"HttpRedirectCode,omitempty"` 446 } 447 448 // RoutingRule defines routing rules 449 type RoutingRule struct { 450 XMLName xml.Name `xml:"RoutingRule"` 451 Condition Condition `xml:"Condition,omitempty"` 452 Redirect Redirect `xml:"Redirect"` 453 } 454 455 // RedirectAllRequestsTo defines redirect in BucketWebsiteConfiguration 456 type RedirectAllRequestsTo struct { 457 XMLName xml.Name `xml:"RedirectAllRequestsTo"` 458 Protocol ProtocolType `xml:"Protocol,omitempty"` 459 HostName string `xml:"HostName"` 460 } 461 462 // BucketWebsiteConfiguration defines the bucket website configuration 463 type BucketWebsiteConfiguration struct { 464 XMLName xml.Name `xml:"WebsiteConfiguration"` 465 RedirectAllRequestsTo RedirectAllRequestsTo `xml:"RedirectAllRequestsTo,omitempty"` 466 IndexDocument IndexDocument `xml:"IndexDocument,omitempty"` 467 ErrorDocument ErrorDocument `xml:"ErrorDocument,omitempty"` 468 RoutingRules []RoutingRule `xml:"RoutingRules>RoutingRule,omitempty"` 469 } 470 471 // SetBucketWebsiteConfigurationInput is the input parameter of SetBucketWebsiteConfiguration function 472 type SetBucketWebsiteConfigurationInput struct { 473 Bucket string `xml:"-"` 474 BucketWebsiteConfiguration 475 } 476 477 // GetBucketWebsiteConfigurationOutput is the result of GetBucketWebsiteConfiguration function 478 type GetBucketWebsiteConfigurationOutput struct { 479 BaseModel 480 BucketWebsiteConfiguration 481 } 482 483 // GetBucketMetadataInput is the input parameter of GetBucketMetadata function 484 type GetBucketMetadataInput struct { 485 Bucket string 486 Origin string 487 RequestHeader string 488 } 489 490 // SetObjectMetadataInput is the input parameter of SetObjectMetadata function 491 type SetObjectMetadataInput struct { 492 Bucket string 493 Key string 494 VersionId string 495 MetadataDirective MetadataDirectiveType 496 CacheControl string 497 ContentDisposition string 498 ContentEncoding string 499 ContentLanguage string 500 ContentType string 501 Expires string 502 WebsiteRedirectLocation string 503 StorageClass StorageClassType 504 Metadata map[string]string 505 } 506 507 //SetObjectMetadataOutput is the result of SetObjectMetadata function 508 type SetObjectMetadataOutput struct { 509 BaseModel 510 MetadataDirective MetadataDirectiveType 511 CacheControl string 512 ContentDisposition string 513 ContentEncoding string 514 ContentLanguage string 515 ContentType string 516 Expires string 517 WebsiteRedirectLocation string 518 StorageClass StorageClassType 519 Metadata map[string]string 520 } 521 522 // GetBucketMetadataOutput is the result of GetBucketMetadata function 523 type GetBucketMetadataOutput struct { 524 BaseModel 525 StorageClass StorageClassType 526 Location string 527 Version string 528 AllowOrigin string 529 AllowMethod string 530 AllowHeader string 531 MaxAgeSeconds int 532 ExposeHeader string 533 Epid string 534 AvailableZone string 535 FSStatus FSStatusType 536 } 537 538 // BucketLoggingStatus defines the bucket logging configuration 539 type BucketLoggingStatus struct { 540 XMLName xml.Name `xml:"BucketLoggingStatus"` 541 Agency string `xml:"Agency,omitempty"` 542 TargetBucket string `xml:"LoggingEnabled>TargetBucket,omitempty"` 543 TargetPrefix string `xml:"LoggingEnabled>TargetPrefix,omitempty"` 544 TargetGrants []Grant `xml:"LoggingEnabled>TargetGrants>Grant,omitempty"` 545 } 546 547 // SetBucketLoggingConfigurationInput is the input parameter of SetBucketLoggingConfiguration function 548 type SetBucketLoggingConfigurationInput struct { 549 Bucket string `xml:"-"` 550 BucketLoggingStatus 551 } 552 553 // GetBucketLoggingConfigurationOutput is the result of GetBucketLoggingConfiguration function 554 type GetBucketLoggingConfigurationOutput struct { 555 BaseModel 556 BucketLoggingStatus 557 } 558 559 // Transition defines transition property in LifecycleRule 560 type Transition struct { 561 XMLName xml.Name `xml:"Transition"` 562 Date time.Time `xml:"Date,omitempty"` 563 Days int `xml:"Days,omitempty"` 564 StorageClass StorageClassType `xml:"StorageClass"` 565 } 566 567 // Expiration defines expiration property in LifecycleRule 568 type Expiration struct { 569 XMLName xml.Name `xml:"Expiration"` 570 Date time.Time `xml:"Date,omitempty"` 571 Days int `xml:"Days,omitempty"` 572 } 573 574 // NoncurrentVersionTransition defines noncurrentVersion transition property in LifecycleRule 575 type NoncurrentVersionTransition struct { 576 XMLName xml.Name `xml:"NoncurrentVersionTransition"` 577 NoncurrentDays int `xml:"NoncurrentDays"` 578 StorageClass StorageClassType `xml:"StorageClass"` 579 } 580 581 // NoncurrentVersionExpiration defines noncurrentVersion expiration property in LifecycleRule 582 type NoncurrentVersionExpiration struct { 583 XMLName xml.Name `xml:"NoncurrentVersionExpiration"` 584 NoncurrentDays int `xml:"NoncurrentDays"` 585 } 586 587 // LifecycleRule defines lifecycle rule 588 type LifecycleRule struct { 589 ID string `xml:"ID,omitempty"` 590 Prefix string `xml:"Prefix"` 591 Status RuleStatusType `xml:"Status"` 592 Transitions []Transition `xml:"Transition,omitempty"` 593 Expiration Expiration `xml:"Expiration,omitempty"` 594 NoncurrentVersionTransitions []NoncurrentVersionTransition `xml:"NoncurrentVersionTransition,omitempty"` 595 NoncurrentVersionExpiration NoncurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty"` 596 } 597 598 // BucketLifecyleConfiguration defines the bucket lifecycle configuration 599 type BucketLifecyleConfiguration struct { 600 XMLName xml.Name `xml:"LifecycleConfiguration"` 601 LifecycleRules []LifecycleRule `xml:"Rule"` 602 } 603 604 // SetBucketLifecycleConfigurationInput is the input parameter of SetBucketLifecycleConfiguration function 605 type SetBucketLifecycleConfigurationInput struct { 606 Bucket string `xml:"-"` 607 BucketLifecyleConfiguration 608 } 609 610 // GetBucketLifecycleConfigurationOutput is the result of GetBucketLifecycleConfiguration function 611 type GetBucketLifecycleConfigurationOutput struct { 612 BaseModel 613 BucketLifecyleConfiguration 614 } 615 616 // BucketEncryptionConfiguration defines the bucket encryption configuration 617 type BucketEncryptionConfiguration struct { 618 XMLName xml.Name `xml:"ServerSideEncryptionConfiguration"` 619 SSEAlgorithm string `xml:"Rule>ApplyServerSideEncryptionByDefault>SSEAlgorithm"` 620 KMSMasterKeyID string `xml:"Rule>ApplyServerSideEncryptionByDefault>KMSMasterKeyID,omitempty"` 621 ProjectID string `xml:"Rule>ApplyServerSideEncryptionByDefault>ProjectID,omitempty"` 622 } 623 624 // SetBucketEncryptionInput is the input parameter of SetBucketEncryption function 625 type SetBucketEncryptionInput struct { 626 Bucket string `xml:"-"` 627 BucketEncryptionConfiguration 628 } 629 630 // GetBucketEncryptionOutput is the result of GetBucketEncryption function 631 type GetBucketEncryptionOutput struct { 632 BaseModel 633 BucketEncryptionConfiguration 634 } 635 636 // Tag defines tag property in BucketTagging 637 type Tag struct { 638 XMLName xml.Name `xml:"Tag"` 639 Key string `xml:"Key"` 640 Value string `xml:"Value"` 641 } 642 643 // BucketTagging defines the bucket tag configuration 644 type BucketTagging struct { 645 XMLName xml.Name `xml:"Tagging"` 646 Tags []Tag `xml:"TagSet>Tag"` 647 } 648 649 // SetBucketTaggingInput is the input parameter of SetBucketTagging function 650 type SetBucketTaggingInput struct { 651 Bucket string `xml:"-"` 652 BucketTagging 653 } 654 655 // GetBucketTaggingOutput is the result of GetBucketTagging function 656 type GetBucketTaggingOutput struct { 657 BaseModel 658 BucketTagging 659 } 660 661 // FilterRule defines filter rule in TopicConfiguration 662 type FilterRule struct { 663 XMLName xml.Name `xml:"FilterRule"` 664 Name string `xml:"Name,omitempty"` 665 Value string `xml:"Value,omitempty"` 666 } 667 668 // TopicConfiguration defines the topic configuration 669 type TopicConfiguration struct { 670 XMLName xml.Name `xml:"TopicConfiguration"` 671 ID string `xml:"Id,omitempty"` 672 Topic string `xml:"Topic"` 673 Events []EventType `xml:"Event"` 674 FilterRules []FilterRule `xml:"Filter>Object>FilterRule"` 675 } 676 677 // BucketNotification defines the bucket notification configuration 678 type BucketNotification struct { 679 XMLName xml.Name `xml:"NotificationConfiguration"` 680 TopicConfigurations []TopicConfiguration `xml:"TopicConfiguration"` 681 } 682 683 // SetBucketNotificationInput is the input parameter of SetBucketNotification function 684 type SetBucketNotificationInput struct { 685 Bucket string `xml:"-"` 686 BucketNotification 687 } 688 689 type topicConfigurationS3 struct { 690 XMLName xml.Name `xml:"TopicConfiguration"` 691 ID string `xml:"Id,omitempty"` 692 Topic string `xml:"Topic"` 693 Events []string `xml:"Event"` 694 FilterRules []FilterRule `xml:"Filter>S3Key>FilterRule"` 695 } 696 697 type bucketNotificationS3 struct { 698 XMLName xml.Name `xml:"NotificationConfiguration"` 699 TopicConfigurations []topicConfigurationS3 `xml:"TopicConfiguration"` 700 } 701 702 type getBucketNotificationOutputS3 struct { 703 BaseModel 704 bucketNotificationS3 705 } 706 707 // GetBucketNotificationOutput is the result of GetBucketNotification function 708 type GetBucketNotificationOutput struct { 709 BaseModel 710 BucketNotification 711 } 712 713 // DeleteObjectInput is the input parameter of DeleteObject function 714 type DeleteObjectInput struct { 715 Bucket string 716 Key string 717 VersionId string 718 } 719 720 // DeleteObjectOutput is the result of DeleteObject function 721 type DeleteObjectOutput struct { 722 BaseModel 723 VersionId string 724 DeleteMarker bool 725 } 726 727 // ObjectToDelete defines the object property in DeleteObjectsInput 728 type ObjectToDelete struct { 729 XMLName xml.Name `xml:"Object"` 730 Key string `xml:"Key"` 731 VersionId string `xml:"VersionId,omitempty"` 732 } 733 734 // DeleteObjectsInput is the input parameter of DeleteObjects function 735 type DeleteObjectsInput struct { 736 Bucket string `xml:"-"` 737 XMLName xml.Name `xml:"Delete"` 738 Quiet bool `xml:"Quiet,omitempty"` 739 Objects []ObjectToDelete `xml:"Object"` 740 EncodingType string `xml:"EncodingType"` 741 } 742 743 // Deleted defines the deleted property in DeleteObjectsOutput 744 type Deleted struct { 745 XMLName xml.Name `xml:"Deleted"` 746 Key string `xml:"Key"` 747 VersionId string `xml:"VersionId"` 748 DeleteMarker bool `xml:"DeleteMarker"` 749 DeleteMarkerVersionId string `xml:"DeleteMarkerVersionId"` 750 } 751 752 // Error defines the error property in DeleteObjectsOutput 753 type Error struct { 754 XMLName xml.Name `xml:"Error"` 755 Key string `xml:"Key"` 756 VersionId string `xml:"VersionId"` 757 Code string `xml:"Code"` 758 Message string `xml:"Message"` 759 } 760 761 // DeleteObjectsOutput is the result of DeleteObjects function 762 type DeleteObjectsOutput struct { 763 BaseModel 764 XMLName xml.Name `xml:"DeleteResult"` 765 Deleteds []Deleted `xml:"Deleted"` 766 Errors []Error `xml:"Error"` 767 EncodingType string `xml:"EncodingType,omitempty"` 768 } 769 770 // SetObjectAclInput is the input parameter of SetObjectAcl function 771 type SetObjectAclInput struct { 772 Bucket string `xml:"-"` 773 Key string `xml:"-"` 774 VersionId string `xml:"-"` 775 ACL AclType `xml:"-"` 776 AccessControlPolicy 777 } 778 779 // GetObjectAclInput is the input parameter of GetObjectAcl function 780 type GetObjectAclInput struct { 781 Bucket string 782 Key string 783 VersionId string 784 } 785 786 // GetObjectAclOutput is the result of GetObjectAcl function 787 type GetObjectAclOutput struct { 788 BaseModel 789 VersionId string 790 AccessControlPolicy 791 } 792 793 // RestoreObjectInput is the input parameter of RestoreObject function 794 type RestoreObjectInput struct { 795 Bucket string `xml:"-"` 796 Key string `xml:"-"` 797 VersionId string `xml:"-"` 798 XMLName xml.Name `xml:"RestoreRequest"` 799 Days int `xml:"Days"` 800 Tier RestoreTierType `xml:"GlacierJobParameters>Tier,omitempty"` 801 } 802 803 // ISseHeader defines the sse encryption header 804 type ISseHeader interface { 805 GetEncryption() string 806 GetKey() string 807 } 808 809 // SseKmsHeader defines the SseKms header 810 type SseKmsHeader struct { 811 Encryption string 812 Key string 813 isObs bool 814 } 815 816 // SseCHeader defines the SseC header 817 type SseCHeader struct { 818 Encryption string 819 Key string 820 KeyMD5 string 821 } 822 823 // GetObjectMetadataInput is the input parameter of GetObjectMetadata function 824 type GetObjectMetadataInput struct { 825 Bucket string 826 Key string 827 VersionId string 828 Origin string 829 RequestHeader string 830 SseHeader ISseHeader 831 } 832 833 // GetObjectMetadataOutput is the result of GetObjectMetadata function 834 type GetObjectMetadataOutput struct { 835 BaseModel 836 VersionId string 837 WebsiteRedirectLocation string 838 Expiration string 839 Restore string 840 ObjectType string 841 NextAppendPosition string 842 StorageClass StorageClassType 843 ContentLength int64 844 ContentType string 845 ETag string 846 AllowOrigin string 847 AllowHeader string 848 AllowMethod string 849 ExposeHeader string 850 MaxAgeSeconds int 851 LastModified time.Time 852 SseHeader ISseHeader 853 Metadata map[string]string 854 } 855 856 // GetObjectInput is the input parameter of GetObject function 857 type GetObjectInput struct { 858 GetObjectMetadataInput 859 IfMatch string 860 IfNoneMatch string 861 IfUnmodifiedSince time.Time 862 IfModifiedSince time.Time 863 RangeStart int64 864 RangeEnd int64 865 ImageProcess string 866 ResponseCacheControl string 867 ResponseContentDisposition string 868 ResponseContentEncoding string 869 ResponseContentLanguage string 870 ResponseContentType string 871 ResponseExpires string 872 } 873 874 // GetObjectOutput is the result of GetObject function 875 type GetObjectOutput struct { 876 GetObjectMetadataOutput 877 DeleteMarker bool 878 CacheControl string 879 ContentDisposition string 880 ContentEncoding string 881 ContentLanguage string 882 Expires string 883 Body io.ReadCloser 884 } 885 886 // ObjectOperationInput defines the object operation properties 887 type ObjectOperationInput struct { 888 Bucket string 889 Key string 890 ACL AclType 891 GrantReadId string 892 GrantReadAcpId string 893 GrantWriteAcpId string 894 GrantFullControlId string 895 StorageClass StorageClassType 896 WebsiteRedirectLocation string 897 Expires int64 898 SseHeader ISseHeader 899 Metadata map[string]string 900 } 901 902 // PutObjectBasicInput defines the basic object operation properties 903 type PutObjectBasicInput struct { 904 ObjectOperationInput 905 ContentType string 906 ContentMD5 string 907 ContentLength int64 908 } 909 910 // PutObjectInput is the input parameter of PutObject function 911 type PutObjectInput struct { 912 PutObjectBasicInput 913 Body io.Reader 914 } 915 916 // PutFileInput is the input parameter of PutFile function 917 type PutFileInput struct { 918 PutObjectBasicInput 919 SourceFile string 920 } 921 922 // PutObjectOutput is the result of PutObject function 923 type PutObjectOutput struct { 924 BaseModel 925 VersionId string 926 SseHeader ISseHeader 927 StorageClass StorageClassType 928 ETag string 929 } 930 931 // CopyObjectInput is the input parameter of CopyObject function 932 type CopyObjectInput struct { 933 ObjectOperationInput 934 CopySourceBucket string 935 CopySourceKey string 936 CopySourceVersionId string 937 CopySourceIfMatch string 938 CopySourceIfNoneMatch string 939 CopySourceIfUnmodifiedSince time.Time 940 CopySourceIfModifiedSince time.Time 941 SourceSseHeader ISseHeader 942 CacheControl string 943 ContentDisposition string 944 ContentEncoding string 945 ContentLanguage string 946 ContentType string 947 Expires string 948 MetadataDirective MetadataDirectiveType 949 SuccessActionRedirect string 950 } 951 952 // CopyObjectOutput is the result of CopyObject function 953 type CopyObjectOutput struct { 954 BaseModel 955 CopySourceVersionId string `xml:"-"` 956 VersionId string `xml:"-"` 957 SseHeader ISseHeader `xml:"-"` 958 XMLName xml.Name `xml:"CopyObjectResult"` 959 LastModified time.Time `xml:"LastModified"` 960 ETag string `xml:"ETag"` 961 } 962 963 // AbortMultipartUploadInput is the input parameter of AbortMultipartUpload function 964 type AbortMultipartUploadInput struct { 965 Bucket string 966 Key string 967 UploadId string 968 } 969 970 // InitiateMultipartUploadInput is the input parameter of InitiateMultipartUpload function 971 type InitiateMultipartUploadInput struct { 972 ObjectOperationInput 973 ContentType string 974 EncodingType string 975 } 976 977 // InitiateMultipartUploadOutput is the result of InitiateMultipartUpload function 978 type InitiateMultipartUploadOutput struct { 979 BaseModel 980 XMLName xml.Name `xml:"InitiateMultipartUploadResult"` 981 Bucket string `xml:"Bucket"` 982 Key string `xml:"Key"` 983 UploadId string `xml:"UploadId"` 984 SseHeader ISseHeader 985 EncodingType string `xml:"EncodingType,omitempty"` 986 } 987 988 // UploadPartInput is the input parameter of UploadPart function 989 type UploadPartInput struct { 990 Bucket string 991 Key string 992 PartNumber int 993 UploadId string 994 ContentMD5 string 995 SseHeader ISseHeader 996 Body io.Reader 997 SourceFile string 998 Offset int64 999 PartSize int64 1000 } 1001 1002 // UploadPartOutput is the result of UploadPart function 1003 type UploadPartOutput struct { 1004 BaseModel 1005 PartNumber int 1006 ETag string 1007 SseHeader ISseHeader 1008 } 1009 1010 // Part defines the part properties 1011 type Part struct { 1012 XMLName xml.Name `xml:"Part"` 1013 PartNumber int `xml:"PartNumber"` 1014 ETag string `xml:"ETag"` 1015 LastModified time.Time `xml:"LastModified,omitempty"` 1016 Size int64 `xml:"Size,omitempty"` 1017 } 1018 1019 // CompleteMultipartUploadInput is the input parameter of CompleteMultipartUpload function 1020 type CompleteMultipartUploadInput struct { 1021 Bucket string `xml:"-"` 1022 Key string `xml:"-"` 1023 UploadId string `xml:"-"` 1024 XMLName xml.Name `xml:"CompleteMultipartUpload"` 1025 Parts []Part `xml:"Part"` 1026 EncodingType string `xml:"-"` 1027 } 1028 1029 // CompleteMultipartUploadOutput is the result of CompleteMultipartUpload function 1030 type CompleteMultipartUploadOutput struct { 1031 BaseModel 1032 VersionId string `xml:"-"` 1033 SseHeader ISseHeader `xml:"-"` 1034 XMLName xml.Name `xml:"CompleteMultipartUploadResult"` 1035 Location string `xml:"Location"` 1036 Bucket string `xml:"Bucket"` 1037 Key string `xml:"Key"` 1038 ETag string `xml:"ETag"` 1039 EncodingType string `xml:"EncodingType,omitempty"` 1040 } 1041 1042 // ListPartsInput is the input parameter of ListParts function 1043 type ListPartsInput struct { 1044 Bucket string 1045 Key string 1046 UploadId string 1047 MaxParts int 1048 PartNumberMarker int 1049 EncodingType string 1050 } 1051 1052 // ListPartsOutput is the result of ListParts function 1053 type ListPartsOutput struct { 1054 BaseModel 1055 XMLName xml.Name `xml:"ListPartsResult"` 1056 Bucket string `xml:"Bucket"` 1057 Key string `xml:"Key"` 1058 UploadId string `xml:"UploadId"` 1059 PartNumberMarker int `xml:"PartNumberMarker"` 1060 NextPartNumberMarker int `xml:"NextPartNumberMarker"` 1061 MaxParts int `xml:"MaxParts"` 1062 IsTruncated bool `xml:"IsTruncated"` 1063 StorageClass StorageClassType `xml:"StorageClass"` 1064 Initiator Initiator `xml:"Initiator"` 1065 Owner Owner `xml:"Owner"` 1066 Parts []Part `xml:"Part"` 1067 EncodingType string `xml:"EncodingType,omitempty"` 1068 } 1069 1070 // CopyPartInput is the input parameter of CopyPart function 1071 type CopyPartInput struct { 1072 Bucket string 1073 Key string 1074 UploadId string 1075 PartNumber int 1076 CopySourceBucket string 1077 CopySourceKey string 1078 CopySourceVersionId string 1079 CopySourceRangeStart int64 1080 CopySourceRangeEnd int64 1081 SseHeader ISseHeader 1082 SourceSseHeader ISseHeader 1083 } 1084 1085 // CopyPartOutput is the result of CopyPart function 1086 type CopyPartOutput struct { 1087 BaseModel 1088 XMLName xml.Name `xml:"CopyPartResult"` 1089 PartNumber int `xml:"-"` 1090 ETag string `xml:"ETag"` 1091 LastModified time.Time `xml:"LastModified"` 1092 SseHeader ISseHeader `xml:"-"` 1093 } 1094 1095 // CreateSignedUrlInput is the input parameter of CreateSignedUrl function 1096 type CreateSignedUrlInput struct { 1097 Method HttpMethodType 1098 Bucket string 1099 Key string 1100 SubResource SubResourceType 1101 Expires int 1102 Headers map[string]string 1103 QueryParams map[string]string 1104 } 1105 1106 // CreateSignedUrlOutput is the result of CreateSignedUrl function 1107 type CreateSignedUrlOutput struct { 1108 SignedUrl string 1109 ActualSignedRequestHeaders http.Header 1110 } 1111 1112 // CreateBrowserBasedSignatureInput is the input parameter of CreateBrowserBasedSignature function. 1113 type CreateBrowserBasedSignatureInput struct { 1114 Bucket string 1115 Key string 1116 Expires int 1117 FormParams map[string]string 1118 } 1119 1120 // CreateBrowserBasedSignatureOutput is the result of CreateBrowserBasedSignature function. 1121 type CreateBrowserBasedSignatureOutput struct { 1122 OriginPolicy string 1123 Policy string 1124 Algorithm string 1125 Credential string 1126 Date string 1127 Signature string 1128 } 1129 1130 // HeadObjectInput is the input parameter of HeadObject function 1131 type HeadObjectInput struct { 1132 Bucket string 1133 Key string 1134 VersionId string 1135 } 1136 1137 // BucketPayer defines the request payment configuration 1138 type BucketPayer struct { 1139 XMLName xml.Name `xml:"RequestPaymentConfiguration"` 1140 Payer PayerType `xml:"Payer"` 1141 } 1142 1143 // SetBucketRequestPaymentInput is the input parameter of SetBucketRequestPayment function 1144 type SetBucketRequestPaymentInput struct { 1145 Bucket string `xml:"-"` 1146 BucketPayer 1147 } 1148 1149 // GetBucketRequestPaymentOutput is the result of GetBucketRequestPayment function 1150 type GetBucketRequestPaymentOutput struct { 1151 BaseModel 1152 BucketPayer 1153 } 1154 1155 // UploadFileInput is the input parameter of UploadFile function 1156 type UploadFileInput struct { 1157 ObjectOperationInput 1158 ContentType string 1159 UploadFile string 1160 PartSize int64 1161 TaskNum int 1162 EnableCheckpoint bool 1163 CheckpointFile string 1164 EncodingType string 1165 } 1166 1167 // DownloadFileInput is the input parameter of DownloadFile function 1168 type DownloadFileInput struct { 1169 GetObjectMetadataInput 1170 IfMatch string 1171 IfNoneMatch string 1172 IfModifiedSince time.Time 1173 IfUnmodifiedSince time.Time 1174 DownloadFile string 1175 PartSize int64 1176 TaskNum int 1177 EnableCheckpoint bool 1178 CheckpointFile string 1179 } 1180 1181 // SetBucketFetchPolicyInput is the input parameter of SetBucketFetchPolicy function 1182 type SetBucketFetchPolicyInput struct { 1183 Bucket string 1184 Status FetchPolicyStatusType `json:"status"` 1185 Agency string `json:"agency"` 1186 } 1187 1188 // GetBucketFetchPolicyInput is the input parameter of GetBucketFetchPolicy function 1189 type GetBucketFetchPolicyInput struct { 1190 Bucket string 1191 } 1192 1193 // GetBucketFetchPolicyOutput is the result of GetBucketFetchPolicy function 1194 type GetBucketFetchPolicyOutput struct { 1195 BaseModel 1196 FetchResponse `json:"fetch"` 1197 } 1198 1199 // FetchResponse defines the response fetch policy configuration 1200 type FetchResponse struct { 1201 Status FetchPolicyStatusType `json:"status"` 1202 Agency string `json:"agency"` 1203 } 1204 1205 // DeleteBucketFetchPolicyInput is the input parameter of DeleteBucketFetchPolicy function 1206 type DeleteBucketFetchPolicyInput struct { 1207 Bucket string 1208 } 1209 1210 // SetBucketFetchJobInput is the input parameter of SetBucketFetchJob function 1211 type SetBucketFetchJobInput struct { 1212 Bucket string `json:"bucket"` 1213 URL string `json:"url"` 1214 Host string `json:"host,omitempty"` 1215 Key string `json:"key,omitempty"` 1216 Md5 string `json:"md5,omitempty"` 1217 CallBackURL string `json:"callbackurl,omitempty"` 1218 CallBackBody string `json:"callbackbody,omitempty"` 1219 CallBackBodyType string `json:"callbackbodytype,omitempty"` 1220 CallBackHost string `json:"callbackhost,omitempty"` 1221 FileType string `json:"file_type,omitempty"` 1222 IgnoreSameKey bool `json:"ignore_same_key,omitempty"` 1223 ObjectHeaders map[string]string `json:"objectheaders,omitempty"` 1224 Etag string `json:"etag,omitempty"` 1225 TrustName string `json:"trustname,omitempty"` 1226 } 1227 1228 // SetBucketFetchJobOutput is the result of SetBucketFetchJob function 1229 type SetBucketFetchJobOutput struct { 1230 BaseModel 1231 SetBucketFetchJobResponse 1232 } 1233 1234 // SetBucketFetchJobResponse defines the response SetBucketFetchJob configuration 1235 type SetBucketFetchJobResponse struct { 1236 ID string `json:"id"` 1237 Wait int `json:"Wait"` 1238 } 1239 1240 // GetBucketFetchJobInput is the input parameter of GetBucketFetchJob function 1241 type GetBucketFetchJobInput struct { 1242 Bucket string 1243 JobID string 1244 } 1245 1246 // GetBucketFetchJobOutput is the result of GetBucketFetchJob function 1247 type GetBucketFetchJobOutput struct { 1248 BaseModel 1249 GetBucketFetchJobResponse 1250 } 1251 1252 // GetBucketFetchJobResponse defines the response fetch job configuration 1253 type GetBucketFetchJobResponse struct { 1254 Err string `json:"err"` 1255 Code string `json:"code"` 1256 Status string `json:"status"` 1257 Job JobResponse `json:"job"` 1258 } 1259 1260 // JobResponse defines the response job configuration 1261 type JobResponse struct { 1262 Bucket string `json:"bucket"` 1263 URL string `json:"url"` 1264 Host string `json:"host"` 1265 Key string `json:"key"` 1266 Md5 string `json:"md5"` 1267 CallBackURL string `json:"callbackurl"` 1268 CallBackBody string `json:"callbackbody"` 1269 CallBackBodyType string `json:"callbackbodytype"` 1270 CallBackHost string `json:"callbackhost"` 1271 FileType string `json:"file_type"` 1272 IgnoreSameKey bool `json:"ignore_same_key"` 1273 }