public static interface PutMethodResponse.Builder extends ApiGatewayResponse.Builder, SdkPojo, CopyableBuilder<PutMethodResponse.Builder,PutMethodResponse>
Modifier and Type | Method and Description |
---|---|
PutMethodResponse.Builder |
apiKeyRequired(Boolean apiKeyRequired)
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
|
PutMethodResponse.Builder |
authorizationScopes(Collection<String> authorizationScopes)
A list of authorization scopes configured on the method.
|
PutMethodResponse.Builder |
authorizationScopes(String... authorizationScopes)
A list of authorization scopes configured on the method.
|
PutMethodResponse.Builder |
authorizationType(String authorizationType)
The method's authorization type.
|
PutMethodResponse.Builder |
authorizerId(String authorizerId)
The identifier of an Authorizer to use on this method.
|
PutMethodResponse.Builder |
httpMethod(String httpMethod)
The method's HTTP verb.
|
default PutMethodResponse.Builder |
methodIntegration(Consumer<Integration.Builder> methodIntegration)
Gets the method's integration responsible for passing the client-submitted request to the back end and
performing necessary transformations to make the request compliant with the back end.
|
PutMethodResponse.Builder |
methodIntegration(Integration methodIntegration)
Gets the method's integration responsible for passing the client-submitted request to the back end and
performing necessary transformations to make the request compliant with the back end.
|
PutMethodResponse.Builder |
methodResponses(Map<String,MethodResponse> methodResponses)
Gets a method response associated with a given HTTP status code.
|
PutMethodResponse.Builder |
operationName(String operationName)
A human-friendly operation identifier for the method.
|
PutMethodResponse.Builder |
requestModels(Map<String,String> requestModels)
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the
request payloads of given content types (as the mapping key).
|
PutMethodResponse.Builder |
requestParameters(Map<String,Boolean> requestParameters)
A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
|
PutMethodResponse.Builder |
requestValidatorId(String requestValidatorId)
The identifier of a RequestValidator for request validation.
|
build, responseMetadata, responseMetadata
sdkHttpResponse, sdkHttpResponse
copy
applyMutation, build
PutMethodResponse.Builder httpMethod(String httpMethod)
The method's HTTP verb.
httpMethod
- The method's HTTP verb.PutMethodResponse.Builder authorizationType(String authorizationType)
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for
using AWS IAM permissions, CUSTOM
for using a custom authorizer, or
COGNITO_USER_POOLS
for using a Cognito user pool.
authorizationType
- The method's authorization type. Valid values are NONE
for open access,
AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer,
or COGNITO_USER_POOLS
for using a Cognito user pool.PutMethodResponse.Builder authorizerId(String authorizerId)
The identifier of an Authorizer to use on this method. The authorizationType
must be
CUSTOM
.
authorizerId
- The identifier of an Authorizer to use on this method. The authorizationType
must
be CUSTOM
.PutMethodResponse.Builder apiKeyRequired(Boolean apiKeyRequired)
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
apiKeyRequired
- A boolean flag specifying whether a valid ApiKey is required to invoke this method.PutMethodResponse.Builder requestValidatorId(String requestValidatorId)
The identifier of a RequestValidator for request validation.
requestValidatorId
- The identifier of a RequestValidator for request validation.PutMethodResponse.Builder operationName(String operationName)
A human-friendly operation identifier for the method. For example, you can assign the
operationName
of ListPets
for the GET /pets
method in PetStore example.
operationName
- A human-friendly operation identifier for the method. For example, you can assign the
operationName
of ListPets
for the GET /pets
method in PetStore example.PutMethodResponse.Builder requestParameters(Map<String,Boolean> requestParameters)
A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, where location
is querystring
,
path
, or header
and name
is a valid and unique parameter name. The
value associated with the key is a Boolean flag indicating whether the parameter is required (
true
) or optional (false
). The method request parameter names defined here are
available in Integration to be mapped to integration request parameters or templates.
requestParameters
- A key-value map defining required or optional method request parameters that can be accepted by API
Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter
name. The value associated with the key is a Boolean flag indicating whether the parameter is required
(true
) or optional (false
). The method request parameter names defined here
are available in Integration to be mapped to integration request parameters or templates.PutMethodResponse.Builder requestModels(Map<String,String> requestModels)
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
requestModels
- A key-value map specifying data schemas, represented by Model resources, (as the mapped value)
of the request payloads of given content types (as the mapping key).PutMethodResponse.Builder methodResponses(Map<String,MethodResponse> methodResponses)
Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
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}
The successful response returns a 200 OK
status code and a payload similar to the following:
{ "_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" }
methodResponses
- Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
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}
The successful response returns a 200 OK
status code and a payload similar to the
following:
{ "_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" }
PutMethodResponse.Builder methodIntegration(Integration methodIntegration)
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
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}
The successful response returns a 200 OK
status code and a payload similar to the following:
{ "_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" } } }
methodIntegration
- Gets the method's integration responsible for passing the client-submitted request to the back end and
performing necessary transformations to make the request compliant with the back end.
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}
The successful response returns a 200 OK
status code and a payload similar to the
following:
{ "_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" } } }
default PutMethodResponse.Builder methodIntegration(Consumer<Integration.Builder> methodIntegration)
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
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}
The successful response returns a 200 OK
status code and a payload similar to the following:
{ "_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" } } }
Integration.Builder
avoiding the need to create
one manually via Integration.builder()
.
When the Consumer
completes, SdkBuilder.build()
is called immediately and its result
is passed to methodIntegration(Integration)
.methodIntegration
- a consumer that will call methods on Integration.Builder
methodIntegration(Integration)
PutMethodResponse.Builder authorizationScopes(Collection<String> authorizationScopes)
A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by
matching the method scopes against the scopes parsed from the access token in the incoming request. The
method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise,
the invocation is not authorized. When the method scope is configured, the client must provide an access
token instead of an identity token for authorization purposes.
authorizationScopes
- A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works
by matching the method scopes against the scopes parsed from the access token in the incoming request.
The method invocation is authorized if any method scopes matches a claimed scope in the access token.
Otherwise, the invocation is not authorized. When the method scope is configured, the client must
provide an access token instead of an identity token for authorization purposes.PutMethodResponse.Builder authorizationScopes(String... authorizationScopes)
A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by
matching the method scopes against the scopes parsed from the access token in the incoming request. The
method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise,
the invocation is not authorized. When the method scope is configured, the client must provide an access
token instead of an identity token for authorization purposes.
authorizationScopes
- A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works
by matching the method scopes against the scopes parsed from the access token in the incoming request.
The method invocation is authorized if any method scopes matches a claimed scope in the access token.
Otherwise, the invocation is not authorized. When the method scope is configured, the client must
provide an access token instead of an identity token for authorization purposes.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.