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”.



19930
19931
19932
// File 'service/s3/api.go', line 19930

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

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

SetACL sets the ACL field's value.



19957
19958
19959
19960
// File 'service/s3/api.go', line 19957

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.



19963
19964
19965
19966
// File 'service/s3/api.go', line 19963

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.



19969
19970
19971
19972
// File 'service/s3/api.go', line 19969

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.



19982
19983
19984
19985
// File 'service/s3/api.go', line 19982

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.



19988
19989
19990
19991
// File 'service/s3/api.go', line 19988

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.



19994
19995
19996
19997
// File 'service/s3/api.go', line 19994

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.



20000
20001
20002
20003
// File 'service/s3/api.go', line 20000

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.



20006
20007
20008
20009
// File 'service/s3/api.go', line 20006

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.



20012
20013
20014
20015
// File 'service/s3/api.go', line 20012

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.



20018
20019
20020
20021
// File 'service/s3/api.go', line 20018

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.



20024
20025
20026
20027
// File 'service/s3/api.go', line 20024

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.



20030
20031
20032
20033
// File 'service/s3/api.go', line 20030

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.



20036
20037
20038
20039
// File 'service/s3/api.go', line 20036

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.



20042
20043
20044
20045
// File 'service/s3/api.go', line 20042

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.



20048
20049
20050
20051
// File 'service/s3/api.go', line 20048

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.



20054
20055
20056
20057
// File 'service/s3/api.go', line 20054

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.



20060
20061
20062
20063
// File 'service/s3/api.go', line 20060

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.



20066
20067
20068
20069
// File 'service/s3/api.go', line 20066

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.



20072
20073
20074
20075
// File 'service/s3/api.go', line 20072

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.



20078
20079
20080
20081
// File 'service/s3/api.go', line 20078

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.



20084
20085
20086
20087
// File 'service/s3/api.go', line 20084

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.



20090
20091
20092
20093
// File 'service/s3/api.go', line 20090

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.



20096
20097
20098
20099
// File 'service/s3/api.go', line 20096

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.



20102
20103
20104
20105
// File 'service/s3/api.go', line 20102

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.



20139
20140
20141
20142
// File 'service/s3/api.go', line 20139

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.



20108
20109
20110
20111
// File 'service/s3/api.go', line 20108

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.



20114
20115
20116
20117
// File 'service/s3/api.go', line 20114

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.



20127
20128
20129
20130
// File 'service/s3/api.go', line 20127

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.



20133
20134
20135
20136
// File 'service/s3/api.go', line 20133

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.



20145
20146
20147
20148
// File 'service/s3/api.go', line 20145

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.



20151
20152
20153
20154
// File 'service/s3/api.go', line 20151

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.



20157
20158
20159
20160
// File 'service/s3/api.go', line 20157

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”.



19921
19922
19923
// File 'service/s3/api.go', line 19921

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.



19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
// File 'service/s3/api.go', line 19935

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 }