blib/lib/Paws/ApiGateway/CreateAuthorizer.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 32 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::ApiGateway::CreateAuthorizer;
3 use Moose;
4 has AuthorizerCredentials => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'authorizerCredentials');
5 has AuthorizerResultTtlInSeconds => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'authorizerResultTtlInSeconds');
6 has AuthorizerUri => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'authorizerUri');
7 has AuthType => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'authType');
8 has IdentitySource => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'identitySource');
9 has IdentityValidationExpression => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'identityValidationExpression');
10 has Name => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'name', required => 1);
11 has ProviderARNs => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'providerARNs');
12 has RestApiId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'restapi_id', required => 1);
13 has Type => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'type', required => 1);
14  
15 use MooseX::ClassAttribute;
16  
17 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateAuthorizer');
18 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/restapis/{restapi_id}/authorizers');
19 class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
20 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ApiGateway::Authorizer');
21 1;
22  
23 ### main pod documentation begin ###
24  
25 =head1 NAME
26  
27 Paws::ApiGateway::CreateAuthorizer - Arguments for method CreateAuthorizer on L<Paws::ApiGateway>
28  
29 =head1 DESCRIPTION
30  
31 This class represents the parameters used for calling the method CreateAuthorizer on the
32 L<Amazon API Gateway|Paws::ApiGateway> service. Use the attributes of this class
33 as arguments to method CreateAuthorizer.
34  
35 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateAuthorizer.
36  
37 =head1 SYNOPSIS
38  
39 my $apigateway = Paws->service('ApiGateway');
40 my $Authorizer = $apigateway->CreateAuthorizer(
41 Name => 'MyString',
42 RestApiId => 'MyString',
43 Type => 'TOKEN',
44 AuthType => 'MyString', # OPTIONAL
45 AuthorizerCredentials => 'MyString', # OPTIONAL
46 AuthorizerResultTtlInSeconds => 1, # OPTIONAL
47 AuthorizerUri => 'MyString', # OPTIONAL
48 IdentitySource => 'MyString', # OPTIONAL
49 IdentityValidationExpression => 'MyString', # OPTIONAL
50 ProviderARNs => [ 'MyProviderARN', ... ], # OPTIONAL
51 );
52  
53 # Results:
54 my $AuthType = $Authorizer->AuthType;
55 my $AuthorizerCredentials = $Authorizer->AuthorizerCredentials;
56 my $AuthorizerResultTtlInSeconds =
57 $Authorizer->AuthorizerResultTtlInSeconds;
58 my $AuthorizerUri = $Authorizer->AuthorizerUri;
59 my $Id = $Authorizer->Id;
60 my $IdentitySource = $Authorizer->IdentitySource;
61 my $IdentityValidationExpression =
62 $Authorizer->IdentityValidationExpression;
63 my $Name = $Authorizer->Name;
64 my $ProviderARNs = $Authorizer->ProviderARNs;
65 my $Type = $Authorizer->Type;
66  
67 # Returns a L<Paws::ApiGateway::Authorizer> object.
68  
69 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.
70 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/apigateway/CreateAuthorizer>
71  
72 =head1 ATTRIBUTES
73  
74  
75 =head2 AuthorizerCredentials => Str
76  
77 Specifies the required credentials as an IAM role for API Gateway to
78 invoke the authorizer. To specify an IAM role for API Gateway to
79 assume, use the role's Amazon Resource Name (ARN). To use
80 resource-based permissions on the Lambda function, specify null.
81  
82  
83  
84 =head2 AuthorizerResultTtlInSeconds => Int
85  
86 The TTL in seconds of cached authorizer results. If it equals 0,
87 authorization caching is disabled. If it is greater than 0, API Gateway
88 will cache authorizer responses. If this field is not set, the default
89 value is 300. The maximum value is 3600, or 1 hour.
90  
91  
92  
93 =head2 AuthorizerUri => Str
94  
95 Specifies the authorizer's Uniform Resource Identifier (URI). For
96 C<TOKEN> or C<REQUEST> authorizers, this must be a well-formed Lambda
97 function URI, for example,
98 C<arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations>.
99 In general, the URI has this form
100 C<arn:aws:apigateway:{region}:lambda:path/{service_api}>, where
101 C<{region}> is the same as the region hosting the Lambda function,
102 C<path> indicates that the remaining substring in the URI should be
103 treated as the path to the resource, including the initial C</>. For
104 Lambda functions, this is usually of the form
105 C</2015-03-31/functions/[FunctionARN]/invocations>.
106  
107  
108  
109 =head2 AuthType => Str
110  
111 Optional customer-defined field, used in OpenAPI imports and exports
112 without functional impact.
113  
114  
115  
116 =head2 IdentitySource => Str
117  
118 The identity source for which authorization is requested.
119  
120 =over
121  
122 =item * For a C<TOKEN> or C<COGNITO_USER_POOLS> authorizer, this is
123 required and specifies the request header mapping expression for the
124 custom header holding the authorization token submitted by the client.
125 For example, if the token header name is C<Auth>, the header mapping
126 expression is C<method.request.header.Auth>.
127  
128 =item * For the C<REQUEST> authorizer, this is required when
129 authorization caching is enabled. The value is a comma-separated string
130 of one or more mapping expressions of the specified request parameters.
131 For example, if an C<Auth> header, a C<Name> query string parameter are
132 defined as identity sources, this value is
133 C<method.request.header.Auth, method.request.querystring.Name>. These
134 parameters will be used to derive the authorization caching key and to
135 perform runtime validation of the C<REQUEST> authorizer by verifying
136 all of the identity-related request parameters are present, not null
137 and non-empty. Only when this is true does the authorizer invoke the
138 authorizer Lambda function, otherwise, it returns a 401 Unauthorized
139 response without calling the Lambda function. The valid value is a
140 string of comma-separated mapping expressions of the specified request
141 parameters. When the authorization caching is not enabled, this
142 property is optional.
143  
144 =back
145  
146  
147  
148  
149 =head2 IdentityValidationExpression => Str
150  
151 A validation expression for the incoming identity token. For C<TOKEN>
152 authorizers, this value is a regular expression. For
153 C<COGNITO_USER_POOLS> authorizers, API Gateway will match the C<aud>
154 field of the incoming token from the client against the specified
155 regular expression. It will invoke the authorizer's Lambda function
156 when there is a match. Otherwise, it will return a 401 Unauthorized
157 response without calling the Lambda function. The validation expression
158 does not apply to the C<REQUEST> authorizer.
159  
160  
161  
162 =head2 B<REQUIRED> Name => Str
163  
164 [Required] The name of the authorizer.
165  
166  
167  
168 =head2 ProviderARNs => ArrayRef[Str|Undef]
169  
170 A list of the Amazon Cognito user pool ARNs for the
171 C<COGNITO_USER_POOLS> authorizer. Each element is of this format:
172 C<arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}>.
173 For a C<TOKEN> or C<REQUEST> authorizer, this is not defined.
174  
175  
176  
177 =head2 B<REQUIRED> RestApiId => Str
178  
179 [Required] The string identifier of the associated RestApi.
180  
181  
182  
183 =head2 B<REQUIRED> Type => Str
184  
185 [Required] The authorizer type. Valid values are C<TOKEN> for a Lambda
186 function using a single authorization token submitted in a custom
187 header, C<REQUEST> for a Lambda function using incoming request
188 parameters, and C<COGNITO_USER_POOLS> for using an Amazon Cognito user
189 pool.
190  
191 Valid values are: C<"TOKEN">, C<"REQUEST">, C<"COGNITO_USER_POOLS">
192  
193  
194 =head1 SEE ALSO
195  
196 This class forms part of L<Paws>, documenting arguments for method CreateAuthorizer in L<Paws::ApiGateway>
197  
198 =head1 BUGS and CONTRIBUTIONS
199  
200 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
201  
202 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
203  
204 =cut
205