blib/lib/Paws/S3/PutObject.pm

filter: Statementstmt 100% 45 / 45 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 47 / 47 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Paws/S3/PutBucketWebsite.pm ↑ Summary blib/lib/Paws/S3/PutObjectOutput.pm »
1  
2 package Paws::S3::PutObject;
3 6 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 has ACL => (is => 'ro', isa => 'Str', header_name => 'x-amz-acl', traits => ['ParamInHeader']);
5 6 has Body => (is => 'ro', isa => 'Str', traits => ['ParamInBody']);
6 6 has Bucket => (is => 'ro', isa => 'Str', uri_name => 'Bucket', traits => ['ParamInURI'], required => 1);
7 6 has BucketKeyEnabled => (is => 'ro', isa => 'Bool', header_name => 'x-amz-server-side-encryption-bucket-key-enabled', traits => ['ParamInHeader']);
8 6 has CacheControl => (is => 'ro', isa => 'Str', header_name => 'Cache-Control', traits => ['ParamInHeader']);
9 6 has ContentDisposition => (is => 'ro', isa => 'Str', header_name => 'Content-Disposition', traits => ['ParamInHeader']);
10 6 has ContentEncoding => (is => 'ro', isa => 'Str', header_name => 'Content-Encoding', traits => ['ParamInHeader']);
11 6 has ContentLanguage => (is => 'ro', isa => 'Str', header_name => 'Content-Language', traits => ['ParamInHeader']);
12 6 has ContentLength => (is => 'ro', isa => 'Int', header_name => 'Content-Length', traits => ['ParamInHeader']);
13 6 has ContentMD5 => (is => 'ro', isa => 'Str', header_name => 'Content-MD5', auto => 'MD5', traits => ['AutoInHeader']);
14 6 has ContentType => (is => 'ro', isa => 'Str', header_name => 'Content-Type', traits => ['ParamInHeader']);
15 6 has ExpectedBucketOwner => (is => 'ro', isa => 'Str', header_name => 'x-amz-expected-bucket-owner', traits => ['ParamInHeader']);
16 6 has Expires => (is => 'ro', isa => 'Str', header_name => 'Expires', traits => ['ParamInHeader']);
17 6 has GrantFullControl => (is => 'ro', isa => 'Str', header_name => 'x-amz-grant-full-control', traits => ['ParamInHeader']);
18 6 has GrantRead => (is => 'ro', isa => 'Str', header_name => 'x-amz-grant-read', traits => ['ParamInHeader']);
19 6 has GrantReadACP => (is => 'ro', isa => 'Str', header_name => 'x-amz-grant-read-acp', traits => ['ParamInHeader']);
20 6 has GrantWriteACP => (is => 'ro', isa => 'Str', header_name => 'x-amz-grant-write-acp', traits => ['ParamInHeader']);
21 6 has Key => (is => 'ro', isa => 'Str', uri_name => 'Key', traits => ['ParamInURI'], required => 1);
22 6 has Metadata => (is => 'ro', isa => 'Paws::S3::Metadata', header_prefix => 'x-amz-meta-', traits => ['ParamInHeaders']);
23 6 has ObjectLockLegalHoldStatus => (is => 'ro', isa => 'Str', header_name => 'x-amz-object-lock-legal-hold', traits => ['ParamInHeader']);
24 6 has ObjectLockMode => (is => 'ro', isa => 'Str', header_name => 'x-amz-object-lock-mode', traits => ['ParamInHeader']);
25 6 has ObjectLockRetainUntilDate => (is => 'ro', isa => 'Str', header_name => 'x-amz-object-lock-retain-until-date', traits => ['ParamInHeader']);
26 6 has RequestPayer => (is => 'ro', isa => 'Str', header_name => 'x-amz-request-payer', traits => ['ParamInHeader']);
27 6 has ServerSideEncryption => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption', traits => ['ParamInHeader']);
28 6 has SSECustomerAlgorithm => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-algorithm', traits => ['ParamInHeader']);
29 6 has SSECustomerKey => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-key', traits => ['ParamInHeader']);
30 6 has SSECustomerKeyMD5 => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-key-MD5', traits => ['ParamInHeader']);
31 6 has SSEKMSEncryptionContext => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-context', traits => ['ParamInHeader']);
32 6 has SSEKMSKeyId => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-aws-kms-key-id', traits => ['ParamInHeader']);
33 6 has StorageClass => (is => 'ro', isa => 'Str', header_name => 'x-amz-storage-class', traits => ['ParamInHeader']);
34 6 has Tagging => (is => 'ro', isa => 'Str', header_name => 'x-amz-tagging', traits => ['ParamInHeader']);
35 6 has WebsiteRedirectLocation => (is => 'ro', isa => 'Str', header_name => 'x-amz-website-redirect-location', traits => ['ParamInHeader']);
36  
37  
38 6 ▶ use MooseX::ClassAttribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 6 class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutObject');
41 6 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/{Bucket}/{Key+}');
42 6 class_has _api_method => (isa => 'Str', is => 'ro', default => 'PUT');
43 6 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::S3::PutObjectOutput');
44 6 class_has _result_key => (isa => 'Str', is => 'ro');
45 6 class_has _stream_param => (is => 'ro', default => 'Body');
46
47 6 1;
48  
49 ### main pod documentation begin ###
50  
51 =head1 NAME
52  
53 Paws::S3::PutObject - Arguments for method PutObject on L<Paws::S3>
54  
55 =head1 DESCRIPTION
56  
57 This class represents the parameters used for calling the method PutObject on the
58 L<Amazon Simple Storage Service|Paws::S3> service. Use the attributes of this class
59 as arguments to method PutObject.
60  
61 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutObject.
62  
63 =head1 SYNOPSIS
64  
65 my $s3 = Paws->service('S3');
66 # To create an object.
67 # The following example creates an object. If the bucket is versioning enabled,
68 # S3 returns version ID in response.
69 my $PutObjectOutput = $s3->PutObject(
70 'Body' => 'filetoupload',
71 'Bucket' => 'examplebucket',
72 'Key' => 'objectkey'
73 );
74  
75 # Results:
76 my $ETag = $PutObjectOutput->ETag;
77 my $VersionId = $PutObjectOutput->VersionId;
78  
79 # Returns a L<Paws::S3::PutObjectOutput> object.
80 # To upload an object (specify optional headers)
81 # The following example uploads an object. The request specifies optional
82 # request headers to directs S3 to use specific storage class and use
83 # server-side encryption.
84 my $PutObjectOutput = $s3->PutObject(
85 'Body' => 'HappyFace.jpg',
86 'Bucket' => 'examplebucket',
87 'Key' => 'HappyFace.jpg',
88 'ServerSideEncryption' => 'AES256',
89 'StorageClass' => 'STANDARD_IA'
90 );
91  
92 # Results:
93 my $ETag = $PutObjectOutput->ETag;
94 my $ServerSideEncryption = $PutObjectOutput->ServerSideEncryption;
95 my $VersionId = $PutObjectOutput->VersionId;
96  
97 # Returns a L<Paws::S3::PutObjectOutput> object.
98 # To upload an object and specify canned ACL.
99 # The following example uploads and object. The request specifies optional
100 # canned ACL (access control list) to all READ access to authenticated users. If
101 # the bucket is versioning enabled, S3 returns version ID in response.
102 my $PutObjectOutput = $s3->PutObject(
103 'ACL' => 'authenticated-read',
104 'Body' => 'filetoupload',
105 'Bucket' => 'examplebucket',
106 'Key' => 'exampleobject'
107 );
108  
109 # Results:
110 my $ETag = $PutObjectOutput->ETag;
111 my $VersionId = $PutObjectOutput->VersionId;
112  
113 # Returns a L<Paws::S3::PutObjectOutput> object.
114 # To upload an object
115 # The following example uploads an object to a versioning-enabled bucket. The
116 # source file is specified using Windows file syntax. S3 returns VersionId of
117 # the newly created object.
118 my $PutObjectOutput = $s3->PutObject(
119 'Body' => 'HappyFace.jpg',
120 'Bucket' => 'examplebucket',
121 'Key' => 'HappyFace.jpg'
122 );
123  
124 # Results:
125 my $ETag = $PutObjectOutput->ETag;
126 my $VersionId = $PutObjectOutput->VersionId;
127  
128 # Returns a L<Paws::S3::PutObjectOutput> object.
129 # To upload object and specify user-defined metadata
130 # The following example creates an object. The request also specifies optional
131 # metadata. If the bucket is versioning enabled, S3 returns version ID in
132 # response.
133 my $PutObjectOutput = $s3->PutObject(
134 'Body' => 'filetoupload',
135 'Bucket' => 'examplebucket',
136 'Key' => 'exampleobject',
137 'Metadata' => {
138 'Metadata1' => 'value1',
139 'Metadata2' => 'value2'
140 }
141 );
142  
143 # Results:
144 my $ETag = $PutObjectOutput->ETag;
145 my $VersionId = $PutObjectOutput->VersionId;
146  
147 # Returns a L<Paws::S3::PutObjectOutput> object.
148 # To upload an object and specify optional tags
149 # The following example uploads an object. The request specifies optional object
150 # tags. The bucket is versioned, therefore S3 returns version ID of the newly
151 # created object.
152 my $PutObjectOutput = $s3->PutObject(
153 'Body' => 'c:\HappyFace.jpg',
154 'Bucket' => 'examplebucket',
155 'Key' => 'HappyFace.jpg',
156 'Tagging' => 'key1=value1&key2=value2'
157 );
158  
159 # Results:
160 my $ETag = $PutObjectOutput->ETag;
161 my $VersionId = $PutObjectOutput->VersionId;
162  
163 # Returns a L<Paws::S3::PutObjectOutput> object.
164 # To upload an object and specify server-side encryption and object tags
165 # The following example uploads and object. The request specifies the optional
166 # server-side encryption option. The request also specifies optional object
167 # tags. If the bucket is versioning enabled, S3 returns version ID in response.
168 my $PutObjectOutput = $s3->PutObject(
169 'Body' => 'filetoupload',
170 'Bucket' => 'examplebucket',
171 'Key' => 'exampleobject',
172 'ServerSideEncryption' => 'AES256',
173 'Tagging' => 'key1=value1&key2=value2'
174 );
175  
176 # Results:
177 my $ETag = $PutObjectOutput->ETag;
178 my $ServerSideEncryption = $PutObjectOutput->ServerSideEncryption;
179 my $VersionId = $PutObjectOutput->VersionId;
180  
181 # Returns a L<Paws::S3::PutObjectOutput> object.
182  
183 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
184 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/s3/PutObject>
185  
186 =head1 ATTRIBUTES
187  
188  
189 =head2 ACL => Str
190  
191 The canned ACL to apply to the object. For more information, see Canned
192 ACL
193 (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).
194  
195 This action is not supported by Amazon S3 on Outposts.
196  
197 Valid values are: C<"private">, C<"public-read">, C<"public-read-write">, C<"authenticated-read">, C<"aws-exec-read">, C<"bucket-owner-read">, C<"bucket-owner-full-control">
198  
199 =head2 Body => Str
200  
201 Object data.
202  
203  
204  
205 =head2 B<REQUIRED> Bucket => Str
206  
207 The bucket name to which the PUT action was initiated.
208  
209 When using this action with an access point, you must direct requests
210 to the access point hostname. The access point hostname takes the form
211 I<AccessPointName>-I<AccountId>.s3-accesspoint.I<Region>.amazonaws.com.
212 When using this action with an access point through the AWS SDKs, you
213 provide the access point ARN in place of the bucket name. For more
214 information about access point ARNs, see Using access points
215 (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html)
216 in the I<Amazon S3 User Guide>.
217  
218 When using this action with Amazon S3 on Outposts, you must direct
219 requests to the S3 on Outposts hostname. The S3 on Outposts hostname
220 takes the form
221 I<AccessPointName>-I<AccountId>.I<outpostID>.s3-outposts.I<Region>.amazonaws.com.
222 When using this action using S3 on Outposts through the AWS SDKs, you
223 provide the Outposts bucket ARN in place of the bucket name. For more
224 information about S3 on Outposts ARNs, see Using S3 on Outposts
225 (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html)
226 in the I<Amazon S3 User Guide>.
227  
228  
229  
230 =head2 BucketKeyEnabled => Bool
231  
232 Specifies whether Amazon S3 should use an S3 Bucket Key for object
233 encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
234 this header to C<true> causes Amazon S3 to use an S3 Bucket Key for
235 object encryption with SSE-KMS.
236  
237 Specifying this header with a PUT action doesnE<rsquo>t affect
238 bucket-level settings for S3 Bucket Key.
239  
240  
241  
242 =head2 CacheControl => Str
243  
244 Can be used to specify caching behavior along the request/reply chain.
245 For more information, see
246 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
247 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9).
248  
249  
250  
251 =head2 ContentDisposition => Str
252  
253 Specifies presentational information for the object. For more
254 information, see
255 http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
256 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1).
257  
258  
259  
260 =head2 ContentEncoding => Str
261  
262 Specifies what content encodings have been applied to the object and
263 thus what decoding mechanisms must be applied to obtain the media-type
264 referenced by the Content-Type header field. For more information, see
265 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
266 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11).
267  
268  
269  
270 =head2 ContentLanguage => Str
271  
272 The language the content is in.
273  
274  
275  
276 =head2 ContentLength => Int
277  
278 Size of the body in bytes. This parameter is useful when the size of
279 the body cannot be determined automatically. For more information, see
280 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
281 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13).
282  
283  
284  
285 =head2 ContentMD5 => Str
286  
287 The base64-encoded 128-bit MD5 digest of the message (without the
288 headers) according to RFC 1864. This header can be used as a message
289 integrity check to verify that the data is the same data that was
290 originally sent. Although it is optional, we recommend using the
291 Content-MD5 mechanism as an end-to-end integrity check. For more
292 information about REST request authentication, see REST Authentication
293 (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).
294  
295  
296  
297 =head2 ContentType => Str
298  
299 A standard MIME type describing the format of the contents. For more
300 information, see
301 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
302 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17).
303  
304  
305  
306 =head2 ExpectedBucketOwner => Str
307  
308 The account ID of the expected bucket owner. If the bucket is owned by
309 a different account, the request will fail with an HTTP C<403 (Access
310 Denied)> error.
311  
312  
313  
314 =head2 Expires => Str
315  
316 The date and time at which the object is no longer cacheable. For more
317 information, see
318 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
319 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21).
320  
321  
322  
323 =head2 GrantFullControl => Str
324  
325 Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
326 object.
327  
328 This action is not supported by Amazon S3 on Outposts.
329  
330  
331  
332 =head2 GrantRead => Str
333  
334 Allows grantee to read the object data and its metadata.
335  
336 This action is not supported by Amazon S3 on Outposts.
337  
338  
339  
340 =head2 GrantReadACP => Str
341  
342 Allows grantee to read the object ACL.
343  
344 This action is not supported by Amazon S3 on Outposts.
345  
346  
347  
348 =head2 GrantWriteACP => Str
349  
350 Allows grantee to write the ACL for the applicable object.
351  
352 This action is not supported by Amazon S3 on Outposts.
353  
354  
355  
356 =head2 B<REQUIRED> Key => Str
357  
358 Object key for which the PUT action was initiated.
359  
360  
361  
362 =head2 Metadata => L<Paws::S3::Metadata>
363  
364 A map of metadata to store with the object in S3.
365  
366  
367  
368 =head2 ObjectLockLegalHoldStatus => Str
369  
370 Specifies whether a legal hold will be applied to this object. For more
371 information about S3 Object Lock, see Object Lock
372 (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html).
373  
374 Valid values are: C<"ON">, C<"OFF">
375  
376 =head2 ObjectLockMode => Str
377  
378 The Object Lock mode that you want to apply to this object.
379  
380 Valid values are: C<"GOVERNANCE">, C<"COMPLIANCE">
381  
382 =head2 ObjectLockRetainUntilDate => Str
383  
384 The date and time when you want this object's Object Lock to expire.
385 Must be formatted as a timestamp parameter.
386  
387  
388  
389 =head2 RequestPayer => Str
390  
391  
392  
393 Valid values are: C<"requester">
394  
395 =head2 ServerSideEncryption => Str
396  
397 The server-side encryption algorithm used when storing this object in
398 Amazon S3 (for example, AES256, aws:kms).
399  
400 Valid values are: C<"AES256">, C<"aws:kms">
401  
402 =head2 SSECustomerAlgorithm => Str
403  
404 Specifies the algorithm to use to when encrypting the object (for
405 example, AES256).
406  
407  
408  
409 =head2 SSECustomerKey => Str
410  
411 Specifies the customer-provided encryption key for Amazon S3 to use in
412 encrypting data. This value is used to store the object and then it is
413 discarded; Amazon S3 does not store the encryption key. The key must be
414 appropriate for use with the algorithm specified in the
415 C<x-amz-server-side-encryption-customer-algorithm> header.
416  
417  
418  
419 =head2 SSECustomerKeyMD5 => Str
420  
421 Specifies the 128-bit MD5 digest of the encryption key according to RFC
422 1321. Amazon S3 uses this header for a message integrity check to
423 ensure that the encryption key was transmitted without error.
424  
425  
426  
427 =head2 SSEKMSEncryptionContext => Str
428  
429 Specifies the AWS KMS Encryption Context to use for object encryption.
430 The value of this header is a base64-encoded UTF-8 string holding JSON
431 with the encryption context key-value pairs.
432  
433  
434  
435 =head2 SSEKMSKeyId => Str
436  
437 If C<x-amz-server-side-encryption> is present and has the value of
438 C<aws:kms>, this header specifies the ID of the AWS Key Management
439 Service (AWS KMS) symmetrical customer managed customer master key
440 (CMK) that was used for the object. If you specify
441 C<x-amz-server-side-encryption:aws:kms>, but do not provideC<
442 x-amz-server-side-encryption-aws-kms-key-id>, Amazon S3 uses the AWS
443 managed CMK in AWS to protect the data. If the KMS key does not exist
444 in the same account issuing the command, you must use the full ARN and
445 not just the ID.
446  
447  
448  
449 =head2 StorageClass => Str
450  
451 By default, Amazon S3 uses the STANDARD Storage Class to store newly
452 created objects. The STANDARD storage class provides high durability
453 and high availability. Depending on performance needs, you can specify
454 a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
455 Storage Class. For more information, see Storage Classes
456 (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html)
457 in the I<Amazon S3 User Guide>.
458  
459 Valid values are: C<"STANDARD">, C<"REDUCED_REDUNDANCY">, C<"STANDARD_IA">, C<"ONEZONE_IA">, C<"INTELLIGENT_TIERING">, C<"GLACIER">, C<"DEEP_ARCHIVE">, C<"OUTPOSTS">
460  
461 =head2 Tagging => Str
462  
463 The tag-set for the object. The tag-set must be encoded as URL Query
464 parameters. (For example, "Key1=Value1")
465  
466  
467  
468 =head2 WebsiteRedirectLocation => Str
469  
470 If the bucket is configured as a website, redirects requests for this
471 object to another object in the same bucket or to an external URL.
472 Amazon S3 stores the value of this header in the object metadata. For
473 information about object metadata, see Object Key and Metadata
474 (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html).
475  
476 In the following example, the request header sets the redirect to an
477 object (anotherPage.html) in the same bucket:
478  
479 C<x-amz-website-redirect-location: /anotherPage.html>
480  
481 In the following example, the request header sets the object redirect
482 to another website:
483  
484 C<x-amz-website-redirect-location: http://www.example.com/>
485  
486 For more information about website hosting in Amazon S3, see Hosting
487 Websites on Amazon S3
488 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html)
489 and How to Configure Website Page Redirects
490 (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
491  
492  
493  
494  
495 =head1 SEE ALSO
496  
497 This class forms part of L<Paws>, documenting arguments for method PutObject in L<Paws::S3>
498  
499 =head1 BUGS and CONTRIBUTIONS
500  
501 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
502  
503 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
504  
505 =cut
506  
« blib/lib/Paws/S3/PutBucketWebsite.pm ↑ Summary blib/lib/Paws/S3/PutObjectOutput.pm »