File Coverage

blib/lib/Paws/ApiGateway/CreateAuthorizer.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


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