blib/lib/Paws/S3/PutBucketPolicy.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 19 / 19 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Paws/S3/PutBucketNotification.pm ↑ Summary blib/lib/Paws/S3/PutBucketReplication.pm »
1  
2 package Paws::S3::PutBucketPolicy;
3 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 has Bucket => (is => 'ro', isa => 'Str', uri_name => 'Bucket', traits => ['ParamInURI'], required => 1);
5 1 has ConfirmRemoveSelfBucketAccess => (is => 'ro', isa => 'Bool', header_name => 'x-amz-confirm-remove-self-bucket-access', traits => ['ParamInHeader']);
6 1 has ContentMD5 => (is => 'ro', isa => 'Str', header_name => 'Content-MD5', auto => 'MD5', traits => ['AutoInHeader']);
7 1 has ExpectedBucketOwner => (is => 'ro', isa => 'Str', header_name => 'x-amz-expected-bucket-owner', traits => ['ParamInHeader']);
8 1 has Policy => (is => 'ro', isa => 'Str', traits => ['ParamInBody'], required => 1);
9  
10  
11 1 ▶ use MooseX::ClassAttribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutBucketPolicy');
14 1 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/{Bucket}?policy');
15 1 class_has _api_method => (isa => 'Str', is => 'ro', default => 'PUT');
16 1 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::API::Response');
17 1 class_has _result_key => (isa => 'Str', is => 'ro');
18
19
20 1 1;
21  
22 ### main pod documentation begin ###
23  
24 =head1 NAME
25  
26 Paws::S3::PutBucketPolicy - Arguments for method PutBucketPolicy on L<Paws::S3>
27  
28 =head1 DESCRIPTION
29  
30 This class represents the parameters used for calling the method PutBucketPolicy on the
31 L<Amazon Simple Storage Service|Paws::S3> service. Use the attributes of this class
32 as arguments to method PutBucketPolicy.
33  
34 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutBucketPolicy.
35  
36 =head1 SYNOPSIS
37  
38 my $s3 = Paws->service('S3');
39 # Set bucket policy
40 # The following example sets a permission policy on a bucket.
41 $s3->PutBucketPolicy(
42 'Bucket' => 'examplebucket',
43 'Policy' =>
44 '{"Version": "2012-10-17", "Statement": [{ "Sid": "id-1","Effect": "Allow","Principal": {"AWS": "arn:aws:iam::123456789012:root"}, "Action": [ "s3:PutObject","s3:PutObjectAcl"], "Resource": ["arn:aws:s3:::acl3/*" ] } ]}'
45 );
46  
47  
48 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.
49 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/s3/PutBucketPolicy>
50  
51 =head1 ATTRIBUTES
52  
53  
54 =head2 B<REQUIRED> Bucket => Str
55  
56 The name of the bucket.
57  
58  
59  
60 =head2 ConfirmRemoveSelfBucketAccess => Bool
61  
62 Set this parameter to true to confirm that you want to remove your
63 permissions to change this bucket policy in the future.
64  
65  
66  
67 =head2 ContentMD5 => Str
68  
69 The MD5 hash of the request body.
70  
71 For requests made using the AWS Command Line Interface (CLI) or AWS
72 SDKs, this field is calculated automatically.
73  
74  
75  
76 =head2 ExpectedBucketOwner => Str
77  
78 The account ID of the expected bucket owner. If the bucket is owned by
79 a different account, the request will fail with an HTTP C<403 (Access
80 Denied)> error.
81  
82  
83  
84 =head2 B<REQUIRED> Policy => Str
85  
86 The bucket policy as a JSON document.
87  
88  
89  
90  
91 =head1 SEE ALSO
92  
93 This class forms part of L<Paws>, documenting arguments for method PutBucketPolicy in L<Paws::S3>
94  
95 =head1 BUGS and CONTRIBUTIONS
96  
97 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
98  
99 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
100  
101 =cut
102  
« blib/lib/Paws/S3/PutBucketNotification.pm ↑ Summary blib/lib/Paws/S3/PutBucketReplication.pm »