Struct: s3.PutObjectInput

import "../ibm-cos-sdk-go/service/s3"

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, request.Validator, s3manager.WriterReadFrom

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"`

The canned ACL to apply to the object. For more information, see Canned ACL (docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).

This action is not supported by Amazon S3 on Outposts.

Body io.ReadSeeker `type:"blob"`

Object data.

Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`

The bucket name to which the PUT action was initiated.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points (docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) in the Amazon S3 User Guide.

When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When you use this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts? (docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the Amazon S3 User Guide.

Bucket is a required field

CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"`

Can be used to specify caching behavior along the request/reply chain. For more information, see www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 (www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9).

ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"`

Specifies presentational information for the object. For more information, see www.rfc-editor.org/rfc/rfc6266#section-4 (www.rfc-editor.org/rfc/rfc6266#section-4).

ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"`

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. For more information, see www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding (www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding).

ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"`

The language the content is in.

ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"`

Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. For more information, see www.rfc-editor.org/rfc/rfc9110.html#name-content-length (www.rfc-editor.org/rfc/rfc9110.html#name-content-length).

ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"`

The base64-encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication (docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).

ContentType *string `location:"header" locationName:"Content-Type" type:"string"`

A standard MIME type describing the format of the contents. For more information, see www.rfc-editor.org/rfc/rfc9110.html#name-content-type (www.rfc-editor.org/rfc/rfc9110.html#name-content-type).

Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"`

The date and time at which the object is no longer cacheable. For more information, see www.rfc-editor.org/rfc/rfc7234#section-5.3 (www.rfc-editor.org/rfc/rfc7234#section-5.3).

GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"`

Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

This action is not supported by Amazon S3 on Outposts.

GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"`

Allows grantee to read the object data and its metadata.

This action is not supported by Amazon S3 on Outposts.

GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"`

Allows grantee to read the object ACL.

This action is not supported by Amazon S3 on Outposts.

GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"`

Allows grantee to write the ACL for the applicable object.

This action is not supported by Amazon S3 on Outposts.

Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"`

Object key for which the PUT action was initiated.

Key is a required field

Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"`

A map of metadata to store with the object in S3.

ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"`

Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock (docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html).

ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"`

The Object Lock mode that you want to apply to this object.

ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"`

The date and time when you want this object’s Object Lock to expire.

RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"`

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination Amazon S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets (docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) in the Amazon S3 User Guide.

RetentionExpirationDate *time.Time `location:"header" locationName:"Retention-Expiration-Date" type:"timestamp"`

Date on which it will be legal to delete or modify the object. This field can only be specified if Retention-Directive is REPLACE. You can only specify this or the Retention-Period header. If both are specified a 400 error will be returned. If neither is specified the bucket’s DefaultRetention period will be used.

RetentionLegalHoldId *string `location:"header" locationName:"Retention-Legal-Hold-ID" type:"string"`

A single legal hold to apply to the object. This field can only be specified if Retention-Directive is REPLACE. A legal hold is a character long string of max length 64. The object cannot be overwritten or deleted until all legal holds associated with the object are removed.

RetentionPeriod *int64 `location:"header" locationName:"Retention-Period" type:"integer"`

Retention period to store on the object in seconds. If this field and Retention-Expiration-Date are specified a 400 error is returned. If neither is specified the bucket’s DefaultRetention period will be used. 0 is a legal value assuming the bucket’s minimum retention period is also 0.

SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"`

Specifies the algorithm to use to when encrypting the object (for example, AES256).

SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"`

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 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.

SSECustomerKey is a sensitive parameter and its value will be replaced with “sensitive” in string returned by PutObjectInput’s String and GoString methods.

SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"`

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"`

If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not providex-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that’s issuing the command, you must use the full ARN and not just the ID.

SSEKMSKeyId is a sensitive parameter and its value will be replaced with “sensitive” in string returned by PutObjectInput’s String and GoString methods.

ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"`

The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"`

By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, see Storage Classes (docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) in the Amazon S3 User Guide.

Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"`

The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, “Key1=Value1”)

WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"`

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. Amazon S3 stores the value of this header in the object metadata. For information about object metadata, see Object Key and Metadata (docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html).

In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket:

x-amz-website-redirect-location: /anotherPage.html

In the following example, the request header sets the object redirect to another website:

x-amz-website-redirect-location: www.example.com/

For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 (docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) and How to Configure Website Page Redirects (docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).

_ struct{} `locationName:"PutObjectRequest" type:"structure" payload:"Body"`

Method Details

func (s PutObjectInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



20695
20696
20697
// File 'service/s3/api.go', line 20695

func (s PutObjectInput) GoString() string { return s.String() }

func (s *PutObjectInput) SetACL(v string) *PutObjectInput

SetACL sets the ACL field’s value.



20722
20723
20724
20725
// File 'service/s3/api.go', line 20722

func (s *PutObjectInput) SetACL(v string) *PutObjectInput { s.ACL = &v return s }

func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput

SetBody sets the Body field’s value.



20728
20729
20730
20731
// File 'service/s3/api.go', line 20728

func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput { s.Body = v return s }

func (s *PutObjectInput) SetBucket(v string) *PutObjectInput

SetBucket sets the Bucket field’s value.



20734
20735
20736
20737
// File 'service/s3/api.go', line 20734

func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { s.Bucket = &v return s }

func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput

SetCacheControl sets the CacheControl field’s value.



20747
20748
20749
20750
// File 'service/s3/api.go', line 20747

func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { s.CacheControl = &v return s }

func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput

SetContentDisposition sets the ContentDisposition field’s value.



20753
20754
20755
20756
// File 'service/s3/api.go', line 20753

func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput { s.ContentDisposition = &v return s }

func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput

SetContentEncoding sets the ContentEncoding field’s value.



20759
20760
20761
20762
// File 'service/s3/api.go', line 20759

func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput { s.ContentEncoding = &v return s }

func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput

SetContentLanguage sets the ContentLanguage field’s value.



20765
20766
20767
20768
// File 'service/s3/api.go', line 20765

func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput { s.ContentLanguage = &v return s }

func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput

SetContentLength sets the ContentLength field’s value.



20771
20772
20773
20774
// File 'service/s3/api.go', line 20771

func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput { s.ContentLength = &v return s }

func (s *PutObjectInput) SetContentMD5(v string) *PutObjectInput

SetContentMD5 sets the ContentMD5 field’s value.



20777
20778
20779
20780
// File 'service/s3/api.go', line 20777

func (s *PutObjectInput) SetContentMD5(v string) *PutObjectInput { s.ContentMD5 = &v return s }

func (s *PutObjectInput) SetContentType(v string) *PutObjectInput

SetContentType sets the ContentType field’s value.



20783
20784
20785
20786
// File 'service/s3/api.go', line 20783

func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { s.ContentType = &v return s }

func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput

SetExpires sets the Expires field’s value.



20789
20790
20791
20792
// File 'service/s3/api.go', line 20789

func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { s.Expires = &v return s }

func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput

SetGrantFullControl sets the GrantFullControl field’s value.



20795
20796
20797
20798
// File 'service/s3/api.go', line 20795

func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput { s.GrantFullControl = &v return s }

func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput

SetGrantRead sets the GrantRead field’s value.



20801
20802
20803
20804
// File 'service/s3/api.go', line 20801

func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput { s.GrantRead = &v return s }

func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput

SetGrantReadACP sets the GrantReadACP field’s value.



20807
20808
20809
20810
// File 'service/s3/api.go', line 20807

func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput { s.GrantReadACP = &v return s }

func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput

SetGrantWriteACP sets the GrantWriteACP field’s value.



20813
20814
20815
20816
// File 'service/s3/api.go', line 20813

func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput { s.GrantWriteACP = &v return s }

func (s *PutObjectInput) SetKey(v string) *PutObjectInput

SetKey sets the Key field’s value.



20819
20820
20821
20822
// File 'service/s3/api.go', line 20819

func (s *PutObjectInput) SetKey(v string) *PutObjectInput { s.Key = &v return s }

func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput

SetMetadata sets the Metadata field’s value.



20825
20826
20827
20828
// File 'service/s3/api.go', line 20825

func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput { s.Metadata = v return s }

func (s *PutObjectInput) SetObjectLockLegalHoldStatus(v string) *PutObjectInput

SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field’s value.



20831
20832
20833
20834
// File 'service/s3/api.go', line 20831

func (s *PutObjectInput) SetObjectLockLegalHoldStatus(v string) *PutObjectInput { s.ObjectLockLegalHoldStatus = &v return s }

func (s *PutObjectInput) SetObjectLockMode(v string) *PutObjectInput

SetObjectLockMode sets the ObjectLockMode field’s value.



20837
20838
20839
20840
// File 'service/s3/api.go', line 20837

func (s *PutObjectInput) SetObjectLockMode(v string) *PutObjectInput { s.ObjectLockMode = &v return s }

func (s *PutObjectInput) SetObjectLockRetainUntilDate(v time.Time) *PutObjectInput

SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field’s value.



20843
20844
20845
20846
// File 'service/s3/api.go', line 20843

func (s *PutObjectInput) SetObjectLockRetainUntilDate(v time.Time) *PutObjectInput { s.ObjectLockRetainUntilDate = &v return s }

func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput

SetRequestPayer sets the RequestPayer field’s value.



20849
20850
20851
20852
// File 'service/s3/api.go', line 20849

func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput { s.RequestPayer = &v return s }

func (s *PutObjectInput) SetRetentionExpirationDate(v time.Time) *PutObjectInput

SetRetentionExpirationDate sets the RetentionExpirationDate field’s value.



20855
20856
20857
20858
// File 'service/s3/api.go', line 20855

func (s *PutObjectInput) SetRetentionExpirationDate(v time.Time) *PutObjectInput { s.RetentionExpirationDate = &v return s }

func (s *PutObjectInput) SetRetentionLegalHoldId(v string) *PutObjectInput

SetRetentionLegalHoldId sets the RetentionLegalHoldId field’s value.



20861
20862
20863
20864
// File 'service/s3/api.go', line 20861

func (s *PutObjectInput) SetRetentionLegalHoldId(v string) *PutObjectInput { s.RetentionLegalHoldId = &v return s }

func (s *PutObjectInput) SetRetentionPeriod(v int64) *PutObjectInput

SetRetentionPeriod sets the RetentionPeriod field’s value.



20867
20868
20869
20870
// File 'service/s3/api.go', line 20867

func (s *PutObjectInput) SetRetentionPeriod(v int64) *PutObjectInput { s.RetentionPeriod = &v return s }

func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput

SetServerSideEncryption sets the ServerSideEncryption field’s value.



20904
20905
20906
20907
// File 'service/s3/api.go', line 20904

func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput { s.ServerSideEncryption = &v return s }

func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput

SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field’s value.



20873
20874
20875
20876
// File 'service/s3/api.go', line 20873

func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput { s.SSECustomerAlgorithm = &v return s }

func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput

SetSSECustomerKey sets the SSECustomerKey field’s value.



20879
20880
20881
20882
// File 'service/s3/api.go', line 20879

func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { s.SSECustomerKey = &v return s }

func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput

SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field’s value.



20892
20893
20894
20895
// File 'service/s3/api.go', line 20892

func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { s.SSECustomerKeyMD5 = &v return s }

func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput

SetSSEKMSKeyId sets the SSEKMSKeyId field’s value.



20898
20899
20900
20901
// File 'service/s3/api.go', line 20898

func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { s.SSEKMSKeyId = &v return s }

func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput

SetStorageClass sets the StorageClass field’s value.



20910
20911
20912
20913
// File 'service/s3/api.go', line 20910

func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput { s.StorageClass = &v return s }

func (s *PutObjectInput) SetTagging(v string) *PutObjectInput

SetTagging sets the Tagging field’s value.



20916
20917
20918
20919
// File 'service/s3/api.go', line 20916

func (s *PutObjectInput) SetTagging(v string) *PutObjectInput { s.Tagging = &v return s }

func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput

SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field’s value.



20922
20923
20924
20925
// File 'service/s3/api.go', line 20922

func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { s.WebsiteRedirectLocation = &v return s }

func (s PutObjectInput) String() string

String returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



20686
20687
20688
// File 'service/s3/api.go', line 20686

func (s PutObjectInput) String() string { return awsutil.Prettify(s) }

func (s *PutObjectInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.



20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
// File 'service/s3/api.go', line 20700

func (s *PutObjectInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} if s.Bucket == nil { invalidParams.Add(request.NewErrParamRequired("Bucket")) } if s.Bucket != nil && len(*s.Bucket) < 1 { invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) } if s.Key == nil { invalidParams.Add(request.NewErrParamRequired("Key")) } if s.Key != nil && len(*s.Key) < 1 { invalidParams.Add(request.NewErrParamMinLen("Key", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil }