blib/lib/Paws/Lambda/AddPermission.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::Lambda::AddPermission;
3 use Moose;
4 has Action => (is => 'ro', isa => 'Str', required => 1);
5 has EventSourceToken => (is => 'ro', isa => 'Str');
6 has FunctionName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'FunctionName', required => 1);
7 has Principal => (is => 'ro', isa => 'Str', required => 1);
8 has Qualifier => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'Qualifier');
9 has RevisionId => (is => 'ro', isa => 'Str');
10 has SourceAccount => (is => 'ro', isa => 'Str');
11 has SourceArn => (is => 'ro', isa => 'Str');
12 has StatementId => (is => 'ro', isa => 'Str', required => 1);
13  
14 use MooseX::ClassAttribute;
15  
16 class_has _api_call => (isa => 'Str', is => 'ro', default => 'AddPermission');
17 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/2015-03-31/functions/{FunctionName}/policy');
18 class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
19 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Lambda::AddPermissionResponse');
20 1;
21  
22 ### main pod documentation begin ###
23  
24 =head1 NAME
25  
26 Paws::Lambda::AddPermission - Arguments for method AddPermission on L<Paws::Lambda>
27  
28 =head1 DESCRIPTION
29  
30 This class represents the parameters used for calling the method AddPermission on the
31 L<AWS Lambda|Paws::Lambda> service. Use the attributes of this class
32 as arguments to method AddPermission.
33  
34 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to AddPermission.
35  
36 =head1 SYNOPSIS
37  
38 my $lambda = Paws->service('Lambda');
39 # To grant Amazon S3 permission to invoke a function
40 # The following example adds permission for Amazon S3 to invoke a Lambda
41 # function named my-function for notifications from a bucket named
42 # my-bucket-1xpuxmplzrlbh in account 123456789012.
43 my $AddPermissionResponse = $lambda->AddPermission(
44 'Action' => 'lambda:InvokeFunction',
45 'FunctionName' => 'my-function',
46 'Principal' => 's3.amazonaws.com',
47 'SourceAccount' => 123456789012,
48 'SourceArn' => 'arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*',
49 'StatementId' => 's3'
50 );
51  
52 # Results:
53 my $Statement = $AddPermissionResponse->Statement;
54  
55 # Returns a L<Paws::Lambda::AddPermissionResponse> object.
56 # To grant another account permission to invoke a function
57 # The following example adds permission for account 223456789012 invoke a Lambda
58 # function named my-function.
59 my $AddPermissionResponse = $lambda->AddPermission(
60 'Action' => 'lambda:InvokeFunction',
61 'FunctionName' => 'my-function',
62 'Principal' => 223456789012,
63 'StatementId' => 'xaccount'
64 );
65  
66 # Results:
67 my $Statement = $AddPermissionResponse->Statement;
68  
69 # Returns a L<Paws::Lambda::AddPermissionResponse> object.
70  
71 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.
72 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/lambda/AddPermission>
73  
74 =head1 ATTRIBUTES
75  
76  
77 =head2 B<REQUIRED> Action => Str
78  
79 The action that the principal can use on the function. For example,
80 C<lambda:InvokeFunction> or C<lambda:GetFunction>.
81  
82  
83  
84 =head2 EventSourceToken => Str
85  
86 For Alexa Smart Home functions, a token that must be supplied by the
87 invoker.
88  
89  
90  
91 =head2 B<REQUIRED> FunctionName => Str
92  
93 The name of the Lambda function, version, or alias.
94  
95 B<Name formats>
96  
97 =over
98  
99 =item *
100  
101 B<Function name> - C<my-function> (name-only), C<my-function:v1> (with
102 alias).
103  
104 =item *
105  
106 B<Function ARN> -
107 C<arn:aws:lambda:us-west-2:123456789012:function:my-function>.
108  
109 =item *
110  
111 B<Partial ARN> - C<123456789012:function:my-function>.
112  
113 =back
114  
115 You can append a version number or alias to any of the formats. The
116 length constraint applies only to the full ARN. If you specify only the
117 function name, it is limited to 64 characters in length.
118  
119  
120  
121 =head2 B<REQUIRED> Principal => Str
122  
123 The Amazon Web Services service or account that invokes the function.
124 If you specify a service, use C<SourceArn> or C<SourceAccount> to limit
125 who can invoke the function through that service.
126  
127  
128  
129 =head2 Qualifier => Str
130  
131 Specify a version or alias to add permissions to a published version of
132 the function.
133  
134  
135  
136 =head2 RevisionId => Str
137  
138 Only update the policy if the revision ID matches the ID that's
139 specified. Use this option to avoid modifying a policy that has changed
140 since you last read it.
141  
142  
143  
144 =head2 SourceAccount => Str
145  
146 For Amazon S3, the ID of the account that owns the resource. Use this
147 together with C<SourceArn> to ensure that the resource is owned by the
148 specified account. It is possible for an Amazon S3 bucket to be deleted
149 by its owner and recreated by another account.
150  
151  
152  
153 =head2 SourceArn => Str
154  
155 For Amazon Web Services services, the ARN of the Amazon Web Services
156 resource that invokes the function. For example, an Amazon S3 bucket or
157 Amazon SNS topic.
158  
159  
160  
161 =head2 B<REQUIRED> StatementId => Str
162  
163 A statement identifier that differentiates the statement from others in
164 the same policy.
165  
166  
167  
168  
169 =head1 SEE ALSO
170  
171 This class forms part of L<Paws>, documenting arguments for method AddPermission in L<Paws::Lambda>
172  
173 =head1 BUGS and CONTRIBUTIONS
174  
175 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
176  
177 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
178  
179 =cut
180