
com.amazonaws.services.apigateway.model.Method Maven / Gradle / Ivy
Show all versions of aws-java-sdk-api-gateway Show documentation
/*
* Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.apigateway.model;
import java.io.Serializable;
/**
*
* Represents a client-facing interface by which the client calls the API to access back-end resources. A Method
* resource is integrated with an Integration resource. Both consist of a request and one or more responses. The
* method request takes the client input that is passed to the back end through the integration request. A method
* response returns the output from the back end to the client through an integration response. A method request is
* embodied in a Method resource, whereas an integration request is embodied in an Integration resource.
* On the other hand, a method response is represented by a MethodResponse resource, whereas an integration
* response is represented by an IntegrationResponse resource.
*
*
*
* Example: Retrive the GET method on a specified resource
* Request
*
* The following example request retrieves the information about the GET method on an API resource (
* 3kzxbg5sa2
) of an API (fugvjdxtri
).
*
*
*
* GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160603T210259Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160603/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", "name": "method", "templated": true }, { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", "templated": true } }, "apiKeyRequired": true, "authorizationType": "NONE", "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E%23foreach(%24stream%20in%20%24input.path(%27%24.StreamNames%27))%3Cstream%3E%3Cname%3E%24stream%3C%2Fname%3E%3C%2Fstream%3E%23end%3C%2FkinesisStreams%3E\")" }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.Content-Type": false }, "statusCode": "200" } } }
*
*
* In the example above, the response template for the 200 OK
response maps the JSON output from the
* ListStreams
action in the back end to an XML output. The mapping template is URL-encoded as
* %3CkinesisStreams%3E%23foreach(%24stream%20in%20%24input.path(%27%24.StreamNames%27))%3Cstream%3E%3Cname%3E%24stream%3C%2Fname%3E%3C%2Fstream%3E%23end%3C%2FkinesisStreams%3E
* and the output is decoded using the $util.urlDecode() helper function.
*
*
*/
public class Method implements Serializable, Cloneable {
/**
*
* The method's HTTP verb.
*
*/
private String httpMethod;
/**
*
* The method's authorization type.
*
*/
private String authorizationType;
/**
*
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*
*/
private String authorizerId;
/**
*
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*
*/
private Boolean apiKeyRequired;
/**
*
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
*
*/
private java.util.Map requestParameters;
/**
*
* 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).
*
*/
private java.util.Map requestModels;
/**
*
* 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
*
*/
private java.util.Map methodResponses;
/**
*
* 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
*
*/
private Integration methodIntegration;
/**
*
* The method's HTTP verb.
*
*
* @param httpMethod
* The method's HTTP verb.
*/
public void setHttpMethod(String httpMethod) {
this.httpMethod = httpMethod;
}
/**
*
* The method's HTTP verb.
*
*
* @return The method's HTTP verb.
*/
public String getHttpMethod() {
return this.httpMethod;
}
/**
*
* The method's HTTP verb.
*
*
* @param httpMethod
* The method's HTTP verb.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withHttpMethod(String httpMethod) {
setHttpMethod(httpMethod);
return this;
}
/**
*
* The method's authorization type.
*
*
* @param authorizationType
* The method's authorization type.
*/
public void setAuthorizationType(String authorizationType) {
this.authorizationType = authorizationType;
}
/**
*
* The method's authorization type.
*
*
* @return The method's authorization type.
*/
public String getAuthorizationType() {
return this.authorizationType;
}
/**
*
* The method's authorization type.
*
*
* @param authorizationType
* The method's authorization type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withAuthorizationType(String authorizationType) {
setAuthorizationType(authorizationType);
return this;
}
/**
*
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*
*
* @param authorizerId
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*/
public void setAuthorizerId(String authorizerId) {
this.authorizerId = authorizerId;
}
/**
*
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*
*
* @return The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*/
public String getAuthorizerId() {
return this.authorizerId;
}
/**
*
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
*
*
* @param authorizerId
* The identifier of an Authorizer to use on this method. The authorizationType
must be
* CUSTOM
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withAuthorizerId(String authorizerId) {
setAuthorizerId(authorizerId);
return this;
}
/**
*
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*
*
* @param apiKeyRequired
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*/
public void setApiKeyRequired(Boolean apiKeyRequired) {
this.apiKeyRequired = apiKeyRequired;
}
/**
*
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*
*
* @return A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*/
public Boolean getApiKeyRequired() {
return this.apiKeyRequired;
}
/**
*
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*
*
* @param apiKeyRequired
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withApiKeyRequired(Boolean apiKeyRequired) {
setApiKeyRequired(apiKeyRequired);
return this;
}
/**
*
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*
*
* @return A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*/
public Boolean isApiKeyRequired() {
return this.apiKeyRequired;
}
/**
*
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
*
*
* @return A key-value map defining required or optional method request parameters that can be accepted by Amazon
* 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.
*/
public java.util.Map getRequestParameters() {
return requestParameters;
}
/**
*
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
*
*
* @param requestParameters
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
*/
public void setRequestParameters(java.util.Map requestParameters) {
this.requestParameters = requestParameters;
}
/**
*
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
*
*
* @param requestParameters
* A key-value map defining required or optional method request parameters that can be accepted by Amazon 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withRequestParameters(java.util.Map requestParameters) {
setRequestParameters(requestParameters);
return this;
}
public Method addRequestParametersEntry(String key, Boolean value) {
if (null == this.requestParameters) {
this.requestParameters = new java.util.HashMap();
}
if (this.requestParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.requestParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into RequestParameters. <p> Returns a reference to this object so that method
* calls can be chained together.
*/
public Method clearRequestParametersEntries() {
this.requestParameters = null;
return this;
}
/**
*
* 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).
*
*
* @return 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).
*/
public java.util.Map getRequestModels() {
return 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).
*
*
* @param 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).
*/
public void setRequestModels(java.util.Map requestModels) {
this.requestModels = 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).
*
*
* @param 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).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withRequestModels(java.util.Map requestModels) {
setRequestModels(requestModels);
return this;
}
public Method addRequestModelsEntry(String key, String value) {
if (null == this.requestModels) {
this.requestModels = new java.util.HashMap();
}
if (this.requestModels.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.requestModels.put(key, value);
return this;
}
/**
* Removes all the entries added into RequestModels. <p> Returns a reference to this object so that method calls
* can be chained together.
*/
public Method clearRequestModelsEntries() {
this.requestModels = null;
return this;
}
/**
*
* 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
*
*
* @return 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
* AWS CLI
*/
public java.util.Map getMethodResponses() {
return 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
*
*
* @param 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
* AWS CLI
*/
public void setMethodResponses(java.util.Map methodResponses) {
this.methodResponses = 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
*
*
* @param 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.
*
* Example: Get a 200 OK response of a GET method
Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": { "href": "http://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" }
*
*
* AWS CLI
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withMethodResponses(java.util.Map methodResponses) {
setMethodResponses(methodResponses);
return this;
}
public Method addMethodResponsesEntry(String key, MethodResponse value) {
if (null == this.methodResponses) {
this.methodResponses = new java.util.HashMap();
}
if (this.methodResponses.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.methodResponses.put(key, value);
return this;
}
/**
* Removes all the entries added into MethodResponses. <p> Returns a reference to this object so that method
* calls can be chained together.
*/
public Method clearMethodResponsesEntries() {
this.methodResponses = null;
return this;
}
/**
*
* 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
*
*
* @param 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
* AWS CLI
*/
public void setMethodIntegration(Integration methodIntegration) {
this.methodIntegration = 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
*
*
* @return 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
* AWS CLI
*/
public Integration getMethodIntegration() {
return this.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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
*
*
* @param 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.
*
*
*
* Example:
* Request
*
*
*
* 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}
*
*
* Response
*
* The successful response returns a 200 OK
status code and a payload similar to the following:
*
*
*
* { "_links": { "curies": [ { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "http://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" } } }
*
*
* AWS CLI
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Method withMethodIntegration(Integration methodIntegration) {
setMethodIntegration(methodIntegration);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getHttpMethod() != null)
sb.append("HttpMethod: " + getHttpMethod() + ",");
if (getAuthorizationType() != null)
sb.append("AuthorizationType: " + getAuthorizationType() + ",");
if (getAuthorizerId() != null)
sb.append("AuthorizerId: " + getAuthorizerId() + ",");
if (getApiKeyRequired() != null)
sb.append("ApiKeyRequired: " + getApiKeyRequired() + ",");
if (getRequestParameters() != null)
sb.append("RequestParameters: " + getRequestParameters() + ",");
if (getRequestModels() != null)
sb.append("RequestModels: " + getRequestModels() + ",");
if (getMethodResponses() != null)
sb.append("MethodResponses: " + getMethodResponses() + ",");
if (getMethodIntegration() != null)
sb.append("MethodIntegration: " + getMethodIntegration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Method == false)
return false;
Method other = (Method) obj;
if (other.getHttpMethod() == null ^ this.getHttpMethod() == null)
return false;
if (other.getHttpMethod() != null && other.getHttpMethod().equals(this.getHttpMethod()) == false)
return false;
if (other.getAuthorizationType() == null ^ this.getAuthorizationType() == null)
return false;
if (other.getAuthorizationType() != null && other.getAuthorizationType().equals(this.getAuthorizationType()) == false)
return false;
if (other.getAuthorizerId() == null ^ this.getAuthorizerId() == null)
return false;
if (other.getAuthorizerId() != null && other.getAuthorizerId().equals(this.getAuthorizerId()) == false)
return false;
if (other.getApiKeyRequired() == null ^ this.getApiKeyRequired() == null)
return false;
if (other.getApiKeyRequired() != null && other.getApiKeyRequired().equals(this.getApiKeyRequired()) == false)
return false;
if (other.getRequestParameters() == null ^ this.getRequestParameters() == null)
return false;
if (other.getRequestParameters() != null && other.getRequestParameters().equals(this.getRequestParameters()) == false)
return false;
if (other.getRequestModels() == null ^ this.getRequestModels() == null)
return false;
if (other.getRequestModels() != null && other.getRequestModels().equals(this.getRequestModels()) == false)
return false;
if (other.getMethodResponses() == null ^ this.getMethodResponses() == null)
return false;
if (other.getMethodResponses() != null && other.getMethodResponses().equals(this.getMethodResponses()) == false)
return false;
if (other.getMethodIntegration() == null ^ this.getMethodIntegration() == null)
return false;
if (other.getMethodIntegration() != null && other.getMethodIntegration().equals(this.getMethodIntegration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHttpMethod() == null) ? 0 : getHttpMethod().hashCode());
hashCode = prime * hashCode + ((getAuthorizationType() == null) ? 0 : getAuthorizationType().hashCode());
hashCode = prime * hashCode + ((getAuthorizerId() == null) ? 0 : getAuthorizerId().hashCode());
hashCode = prime * hashCode + ((getApiKeyRequired() == null) ? 0 : getApiKeyRequired().hashCode());
hashCode = prime * hashCode + ((getRequestParameters() == null) ? 0 : getRequestParameters().hashCode());
hashCode = prime * hashCode + ((getRequestModels() == null) ? 0 : getRequestModels().hashCode());
hashCode = prime * hashCode + ((getMethodResponses() == null) ? 0 : getMethodResponses().hashCode());
hashCode = prime * hashCode + ((getMethodIntegration() == null) ? 0 : getMethodIntegration().hashCode());
return hashCode;
}
@Override
public Method clone() {
try {
return (Method) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy