« blib/lib/Paws/ApiGateway/MapOfStringToString.pm
↑ Summary
blib/lib/Paws/ApiGateway/MethodResponse.pm »
| 1 | |||
| 2 | package Paws::ApiGateway::Method; | ||
| 3 | use Moose; | ||
| 4 | has ApiKeyRequired => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'apiKeyRequired'); | ||
| 5 | has AuthorizationScopes => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'authorizationScopes'); | ||
| 6 | has AuthorizationType => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'authorizationType'); | ||
| 7 | has AuthorizerId => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'authorizerId'); | ||
| 8 | has HttpMethod => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'httpMethod'); | ||
| 9 | has MethodIntegration => (is => 'ro', isa => 'Paws::ApiGateway::Integration', traits => ['NameInRequest'], request_name => 'methodIntegration'); | ||
| 10 | has MethodResponses => (is => 'ro', isa => 'Paws::ApiGateway::MapOfMethodResponse', traits => ['NameInRequest'], request_name => 'methodResponses'); | ||
| 11 | has OperationName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'operationName'); | ||
| 12 | has RequestModels => (is => 'ro', isa => 'Paws::ApiGateway::MapOfStringToString', traits => ['NameInRequest'], request_name => 'requestModels'); | ||
| 13 | has RequestParameters => (is => 'ro', isa => 'Paws::ApiGateway::MapOfStringToBoolean', traits => ['NameInRequest'], request_name => 'requestParameters'); | ||
| 14 | has RequestValidatorId => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'requestValidatorId'); | ||
| 15 | |||
| 16 | has _request_id => (is => 'ro', isa => 'Str'); | ||
| 17 | 1; | ||
| 18 | |||
| 19 | ### main pod documentation begin ### | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Paws::ApiGateway::Method | ||
| 24 | |||
| 25 | =head1 ATTRIBUTES | ||
| 26 | |||
| 27 | |||
| 28 | =head2 ApiKeyRequired => Bool | ||
| 29 | |||
| 30 | A boolean flag specifying whether a valid ApiKey is required to invoke | ||
| 31 | this method. | ||
| 32 | |||
| 33 | |||
| 34 | =head2 AuthorizationScopes => ArrayRef[Str|Undef] | ||
| 35 | |||
| 36 | A list of authorization scopes configured on the method. The scopes are | ||
| 37 | used with a C<COGNITO_USER_POOLS> authorizer to authorize the method | ||
| 38 | invocation. The authorization works by matching the method scopes | ||
| 39 | against the scopes parsed from the access token in the incoming | ||
| 40 | request. The method invocation is authorized if any method scopes | ||
| 41 | matches a claimed scope in the access token. Otherwise, the invocation | ||
| 42 | is not authorized. When the method scope is configured, the client must | ||
| 43 | provide an access token instead of an identity token for authorization | ||
| 44 | purposes. | ||
| 45 | |||
| 46 | |||
| 47 | =head2 AuthorizationType => Str | ||
| 48 | |||
| 49 | The method's authorization type. Valid values are C<NONE> for open | ||
| 50 | access, C<AWS_IAM> for using AWS IAM permissions, C<CUSTOM> for using a | ||
| 51 | custom authorizer, or C<COGNITO_USER_POOLS> for using a Cognito user | ||
| 52 | pool. | ||
| 53 | |||
| 54 | |||
| 55 | =head2 AuthorizerId => Str | ||
| 56 | |||
| 57 | The identifier of an Authorizer to use on this method. The | ||
| 58 | C<authorizationType> must be C<CUSTOM>. | ||
| 59 | |||
| 60 | |||
| 61 | =head2 HttpMethod => Str | ||
| 62 | |||
| 63 | The method's HTTP verb. | ||
| 64 | |||
| 65 | |||
| 66 | =head2 MethodIntegration => L<Paws::ApiGateway::Integration> | ||
| 67 | |||
| 68 | Gets the method's integration responsible for passing the | ||
| 69 | client-submitted request to the back end and performing necessary | ||
| 70 | transformations to make the request compliant with the back end. | ||
| 71 | |||
| 72 | =head1 Example: | ||
| 73 | |||
| 74 | =head2 Request | ||
| 75 | |||
| 76 | GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} | ||
| 77 | |||
| 78 | =head2 Response | ||
| 79 | |||
| 80 | The successful response returns a C<200 OK> status code and a payload | ||
| 81 | similar to the following: | ||
| 82 | |||
| 83 | { "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } } | ||
| 84 | |||
| 85 | AWS CLI | ||
| 86 | (https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-integration.html) | ||
| 87 | |||
| 88 | |||
| 89 | =head2 MethodResponses => L<Paws::ApiGateway::MapOfMethodResponse> | ||
| 90 | |||
| 91 | Gets a method response associated with a given HTTP status code. | ||
| 92 | |||
| 93 | The collection of method responses are encapsulated in a key-value map, | ||
| 94 | where the key is a response's HTTP status code and the value is a | ||
| 95 | MethodResponse resource that specifies the response returned to the | ||
| 96 | caller from the back end through the integration response. | ||
| 97 | |||
| 98 | =head1 Example: Get a 200 OK response of a GET method | ||
| 99 | |||
| 100 | =head2 Request | ||
| 101 | |||
| 102 | GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} | ||
| 103 | |||
| 104 | =head2 Response | ||
| 105 | |||
| 106 | The successful response returns a C<200 OK> status code and a payload | ||
| 107 | similar to the following: | ||
| 108 | |||
| 109 | { "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" } | ||
| 110 | |||
| 111 | AWS CLI | ||
| 112 | (https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-method-response.html) | ||
| 113 | |||
| 114 | |||
| 115 | =head2 OperationName => Str | ||
| 116 | |||
| 117 | A human-friendly operation identifier for the method. For example, you | ||
| 118 | can assign the C<operationName> of C<ListPets> for the C<GET /pets> | ||
| 119 | method in the C<PetStore> example. | ||
| 120 | |||
| 121 | |||
| 122 | =head2 RequestModels => L<Paws::ApiGateway::MapOfStringToString> | ||
| 123 | |||
| 124 | A key-value map specifying data schemas, represented by Model | ||
| 125 | resources, (as the mapped value) of the request payloads of given | ||
| 126 | content types (as the mapping key). | ||
| 127 | |||
| 128 | |||
| 129 | =head2 RequestParameters => L<Paws::ApiGateway::MapOfStringToBoolean> | ||
| 130 | |||
| 131 | A key-value map defining required or optional method request parameters | ||
| 132 | that can be accepted by API Gateway. A key is a method request | ||
| 133 | parameter name matching the pattern of | ||
| 134 | C<method.request.{location}.{name}>, where C<location> is | ||
| 135 | C<querystring>, C<path>, or C<header> and C<name> is a valid and unique | ||
| 136 | parameter name. The value associated with the key is a Boolean flag | ||
| 137 | indicating whether the parameter is required (C<true>) or optional | ||
| 138 | (C<false>). The method request parameter names defined here are | ||
| 139 | available in Integration to be mapped to integration request parameters | ||
| 140 | or templates. | ||
| 141 | |||
| 142 | |||
| 143 | =head2 RequestValidatorId => Str | ||
| 144 | |||
| 145 | The identifier of a RequestValidator for request validation. | ||
| 146 | |||
| 147 | |||
| 148 | =head2 _request_id => Str | ||
| 149 | |||
| 150 | |||
| 151 | =cut | ||
| 152 |