software.amazon.awssdk.services.apigateway.model.UpdateIntegrationResponse Maven / Gradle / Ivy
Show all versions of api-gateway Show documentation
/*
* Copyright 2013-2018 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 software.amazon.awssdk.services.apigateway.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration.
*
* In the API Gateway console, the built-in Lambda integration is an AWS integration.
*/
@Generated("software.amazon.awssdk:codegen")
public class UpdateIntegrationResponse extends APIGatewayResponse implements
ToCopyableBuilder {
private final String type;
private final String httpMethod;
private final String uri;
private final String credentials;
private final Map requestParameters;
private final Map requestTemplates;
private final String passthroughBehavior;
private final String contentHandling;
private final String cacheNamespace;
private final List cacheKeyParameters;
private final Map integrationResponses;
private UpdateIntegrationResponse(BuilderImpl builder) {
super(builder);
this.type = builder.type;
this.httpMethod = builder.httpMethod;
this.uri = builder.uri;
this.credentials = builder.credentials;
this.requestParameters = builder.requestParameters;
this.requestTemplates = builder.requestTemplates;
this.passthroughBehavior = builder.passthroughBehavior;
this.contentHandling = builder.contentHandling;
this.cacheNamespace = builder.cacheNamespace;
this.cacheKeyParameters = builder.cacheKeyParameters;
this.integrationResponses = builder.integrationResponses;
}
/**
*
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back end,
* AWS
for any AWS service endpoints, MOCK
for testing without actually invoking the back
* end, HTTP_PROXY
for integrating with the HTTP proxy integration, or AWS_PROXY
for
* integrating with the Lambda proxy integration type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link IntegrationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeString}.
*
*
* @return Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back
* end, AWS
for any AWS service endpoints, MOCK
for testing without actually
* invoking the back end, HTTP_PROXY
for integrating with the HTTP proxy integration, or
* AWS_PROXY
for integrating with the Lambda proxy integration type.
* @see IntegrationType
*/
public IntegrationType type() {
return IntegrationType.fromValue(type);
}
/**
*
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back end,
* AWS
for any AWS service endpoints, MOCK
for testing without actually invoking the back
* end, HTTP_PROXY
for integrating with the HTTP proxy integration, or AWS_PROXY
for
* integrating with the Lambda proxy integration type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link IntegrationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeString}.
*
*
* @return Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back
* end, AWS
for any AWS service endpoints, MOCK
for testing without actually
* invoking the back end, HTTP_PROXY
for integrating with the HTTP proxy integration, or
* AWS_PROXY
for integrating with the Lambda proxy integration type.
* @see IntegrationType
*/
public String typeString() {
return type;
}
/**
*
* Specifies the integration's HTTP method type.
*
*
* @return Specifies the integration's HTTP method type.
*/
public String httpMethod() {
return httpMethod;
}
/**
*
* Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully
* formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form
* arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
.
* Region
, subdomain
and service
are used to determine the right endpoint.
* For AWS services that use the Action=
query string parameter, service_api
should be a
* valid action for the desired service. For RESTful AWS service APIs, path
is used to indicate that
* the remaining substring in the URI should be treated as the path to the resource, including the initial
* /
.
*
*
* @return Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a
* fully formed, encoded HTTP(S) URL according to the RFC-3986
* specification. For AWS integrations, the URI should be of the form
* arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
.
* Region
, subdomain
and service
are used to determine the right
* endpoint. For AWS services that use the Action=
query string parameter,
* service_api
should be a valid action for the desired service. For RESTful AWS service APIs,
* path
is used to indicate that the remaining substring in the URI should be treated as the
* path to the resource, including the initial /
.
*/
public String uri() {
return uri;
}
/**
*
* Specifies the credentials required for the integration, if any. For AWS integrations, three options are
* available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To
* require that the caller's identity be passed through from the request, specify the string
* arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
*
*
* @return Specifies the credentials required for the integration, if any. For AWS integrations, three options are
* available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name
* (ARN). To require that the caller's identity be passed through from the request, specify the string
* arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services,
* specify null.
*/
public String credentials() {
return credentials;
}
/**
*
* A key-value map specifying request parameters that are passed from the method request to the back end. The key is
* an integration request parameter name and the associated value is a method request parameter value or static
* value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request
* parameter value must match the pattern of method.request.{location}.{name}
, where
* location
is querystring
, path
, or header
and
* name
must be a valid and unique method request parameter name.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A key-value map specifying request parameters that are passed from the method request to the back end.
* The key is an integration request parameter name and the associated value is a method request parameter
* value or static value that must be enclosed within single quotes and pre-encoded as required by the back
* end. The method request parameter value must match the pattern of
* method.request.{location}.{name}
, where location
is querystring
,
* path
, or header
and name
must be a valid and unique method request
* parameter name.
*/
public Map requestParameters() {
return requestParameters;
}
/**
*
* Represents a map of Velocity templates that are applied on the request payload based on the value of the
* Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
* String) is the value.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Represents a map of Velocity templates that are applied on the request payload based on the value of the
* Content-Type header sent by the client. The content type value is the key in this map, and the template
* (as a String) is the value.
*/
public Map requestTemplates() {
return requestTemplates;
}
/**
*
*
* Specifies how the method request body of an unmapped content type will be passed through the integration request
* to the back end without transformation. A content type is unmapped if no mapping template is defined in the
* integration or the content type does not match any of the mapped content types, as specified in
* requestTemplates
. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
*
* -
WHEN_NO_MATCH
passes the method request body through the integration request to the back end
* without transformation when the method request content type does not match any content type associated with the
* mapping templates defined in the integration request.
* -
WHEN_NO_TEMPLATES
passes the method request body through the integration request to the back end
* without transformation when no mapping template is defined in the integration request. If a template is defined
* when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP
* 415 Unsupported Media Type
response.
* -
NEVER
rejects the method request with an HTTP 415 Unsupported Media Type
response
* when either the method request content type does not match any content type associated with the mapping templates
* defined in the integration request or no mapping template is defined in the integration request.
*
*
*
* @return
* Specifies how the method request body of an unmapped content type will be passed through the integration
* request to the back end without transformation. A content type is unmapped if no mapping template is
* defined in the integration or the content type does not match any of the mapped content types, as
* specified in requestTemplates
. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
*
* -
WHEN_NO_MATCH
passes the method request body through the integration request to the back
* end without transformation when the method request content type does not match any content type
* associated with the mapping templates defined in the integration request.
* -
WHEN_NO_TEMPLATES
passes the method request body through the integration request to the
* back end without transformation when no mapping template is defined in the integration request. If a
* template is defined when this option is selected, the method request of an unmapped content-type will be
* rejected with an HTTP 415 Unsupported Media Type
response.
* -
NEVER
rejects the method request with an HTTP 415 Unsupported Media Type
* response when either the method request content type does not match any content type associated with the
* mapping templates defined in the integration request or no mapping template is defined in the integration
* request.
*
*/
public String passthroughBehavior() {
return passthroughBehavior;
}
/**
*
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding
* binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is configured to
* support payload pass-through.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #contentHandling}
* will return {@link ContentHandlingStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #contentHandlingString}.
*
*
* @return Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the
* corresponding binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is
* configured to support payload pass-through.
* @see ContentHandlingStrategy
*/
public ContentHandlingStrategy contentHandling() {
return ContentHandlingStrategy.fromValue(contentHandling);
}
/**
*
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding
* binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is configured to
* support payload pass-through.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #contentHandling}
* will return {@link ContentHandlingStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #contentHandlingString}.
*
*
* @return Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the
* corresponding binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is
* configured to support payload pass-through.
* @see ContentHandlingStrategy
*/
public String contentHandlingString() {
return contentHandling;
}
/**
*
* Specifies the integration's cache namespace.
*
*
* @return Specifies the integration's cache namespace.
*/
public String cacheNamespace() {
return cacheNamespace;
}
/**
*
* Specifies the integration's cache key parameters.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Specifies the integration's cache key parameters.
*/
public List cacheKeyParameters() {
return cacheKeyParameters;
}
/**
*
* Specifies the integration's responses.
*
*
*
* Example: Get integration responses of a method
* Request
*
*
*
* GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
*
*
* Response
*
* The successful response returns 200 OK
status and a payload as follows:
*
*
*
* { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/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#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Specifies the integration's responses.
*
* Example: Get integration responses of a method
* Request
*
*
*
* GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
*
*
* Response
*
* The successful response returns 200 OK
status and a payload as follows:
*
*
*
* { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/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#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
*
*
* Creating an
* API
*/
public Map integrationResponses() {
return integrationResponses;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(typeString());
hashCode = 31 * hashCode + Objects.hashCode(httpMethod());
hashCode = 31 * hashCode + Objects.hashCode(uri());
hashCode = 31 * hashCode + Objects.hashCode(credentials());
hashCode = 31 * hashCode + Objects.hashCode(requestParameters());
hashCode = 31 * hashCode + Objects.hashCode(requestTemplates());
hashCode = 31 * hashCode + Objects.hashCode(passthroughBehavior());
hashCode = 31 * hashCode + Objects.hashCode(contentHandlingString());
hashCode = 31 * hashCode + Objects.hashCode(cacheNamespace());
hashCode = 31 * hashCode + Objects.hashCode(cacheKeyParameters());
hashCode = 31 * hashCode + Objects.hashCode(integrationResponses());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateIntegrationResponse)) {
return false;
}
UpdateIntegrationResponse other = (UpdateIntegrationResponse) obj;
return Objects.equals(typeString(), other.typeString()) && Objects.equals(httpMethod(), other.httpMethod())
&& Objects.equals(uri(), other.uri()) && Objects.equals(credentials(), other.credentials())
&& Objects.equals(requestParameters(), other.requestParameters())
&& Objects.equals(requestTemplates(), other.requestTemplates())
&& Objects.equals(passthroughBehavior(), other.passthroughBehavior())
&& Objects.equals(contentHandlingString(), other.contentHandlingString())
&& Objects.equals(cacheNamespace(), other.cacheNamespace())
&& Objects.equals(cacheKeyParameters(), other.cacheKeyParameters())
&& Objects.equals(integrationResponses(), other.integrationResponses());
}
@Override
public String toString() {
return ToString.builder("UpdateIntegrationResponse").add("Type", typeString()).add("HttpMethod", httpMethod())
.add("Uri", uri()).add("Credentials", credentials()).add("RequestParameters", requestParameters())
.add("RequestTemplates", requestTemplates()).add("PassthroughBehavior", passthroughBehavior())
.add("ContentHandling", contentHandlingString()).add("CacheNamespace", cacheNamespace())
.add("CacheKeyParameters", cacheKeyParameters()).add("IntegrationResponses", integrationResponses()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "type":
return Optional.of(clazz.cast(typeString()));
case "httpMethod":
return Optional.of(clazz.cast(httpMethod()));
case "uri":
return Optional.of(clazz.cast(uri()));
case "credentials":
return Optional.of(clazz.cast(credentials()));
case "requestParameters":
return Optional.of(clazz.cast(requestParameters()));
case "requestTemplates":
return Optional.of(clazz.cast(requestTemplates()));
case "passthroughBehavior":
return Optional.of(clazz.cast(passthroughBehavior()));
case "contentHandling":
return Optional.of(clazz.cast(contentHandlingString()));
case "cacheNamespace":
return Optional.of(clazz.cast(cacheNamespace()));
case "cacheKeyParameters":
return Optional.of(clazz.cast(cacheKeyParameters()));
case "integrationResponses":
return Optional.of(clazz.cast(integrationResponses()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayResponse.Builder, CopyableBuilder {
/**
*
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back end,
* AWS
for any AWS service endpoints, MOCK
for testing without actually invoking the
* back end, HTTP_PROXY
for integrating with the HTTP proxy integration, or AWS_PROXY
* for integrating with the Lambda proxy integration type.
*
*
* @param type
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP
* back end, AWS
for any AWS service endpoints, MOCK
for testing without
* actually invoking the back end, HTTP_PROXY
for integrating with the HTTP proxy
* integration, or AWS_PROXY
for integrating with the Lambda proxy integration type.
* @see IntegrationType
* @return Returns a reference to this object so that method calls can be chained together.
* @see IntegrationType
*/
Builder type(String type);
/**
*
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP back end,
* AWS
for any AWS service endpoints, MOCK
for testing without actually invoking the
* back end, HTTP_PROXY
for integrating with the HTTP proxy integration, or AWS_PROXY
* for integrating with the Lambda proxy integration type.
*
*
* @param type
* Specifies the integration's type. The valid value is HTTP
for integrating with an HTTP
* back end, AWS
for any AWS service endpoints, MOCK
for testing without
* actually invoking the back end, HTTP_PROXY
for integrating with the HTTP proxy
* integration, or AWS_PROXY
for integrating with the Lambda proxy integration type.
* @see IntegrationType
* @return Returns a reference to this object so that method calls can be chained together.
* @see IntegrationType
*/
Builder type(IntegrationType type);
/**
*
* Specifies the integration's HTTP method type.
*
*
* @param httpMethod
* Specifies the integration's HTTP method type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder httpMethod(String httpMethod);
/**
*
* Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully
* formed, encoded HTTP(S) URL according to the RFC-3986 specification.
* For AWS integrations, the URI should be of the form
* arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
.
* Region
, subdomain
and service
are used to determine the right
* endpoint. For AWS services that use the Action=
query string parameter, service_api
* should be a valid action for the desired service. For RESTful AWS service APIs, path
is used to
* indicate that the remaining substring in the URI should be treated as the path to the resource, including the
* initial /
.
*
*
* @param uri
* Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be
* a fully formed, encoded HTTP(S) URL according to the RFC-3986
* specification. For AWS integrations, the URI should be of the form
* arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
.
* Region
, subdomain
and service
are used to determine the right
* endpoint. For AWS services that use the Action=
query string parameter,
* service_api
should be a valid action for the desired service. For RESTful AWS service
* APIs, path
is used to indicate that the remaining substring in the URI should be treated
* as the path to the resource, including the initial /
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder uri(String uri);
/**
*
* Specifies the credentials required for the integration, if any. For AWS integrations, three options are
* available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name
* (ARN). To require that the caller's identity be passed through from the request, specify the string
* arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify
* null.
*
*
* @param credentials
* Specifies the credentials required for the integration, if any. For AWS integrations, three options
* are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource
* Name (ARN). To require that the caller's identity be passed through from the request, specify the
* string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS
* services, specify null.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder credentials(String credentials);
/**
*
* A key-value map specifying request parameters that are passed from the method request to the back end. The
* key is an integration request parameter name and the associated value is a method request parameter value or
* static value that must be enclosed within single quotes and pre-encoded as required by the back end. The
* method request parameter value must match the pattern of method.request.{location}.{name}
, where
* location
is querystring
, path
, or header
and
* name
must be a valid and unique method request parameter name.
*
*
* @param requestParameters
* A key-value map specifying request parameters that are passed from the method request to the back end.
* The key is an integration request parameter name and the associated value is a method request
* parameter value or static value that must be enclosed within single quotes and pre-encoded as required
* by the back end. The method request parameter value must match the pattern of
* method.request.{location}.{name}
, where location
is querystring
* , path
, or header
and name
must be a valid and unique method
* request parameter name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requestParameters(Map requestParameters);
/**
*
* Represents a map of Velocity templates that are applied on the request payload based on the value of the
* Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
* String) is the value.
*
*
* @param requestTemplates
* Represents a map of Velocity templates that are applied on the request payload based on the value of
* the Content-Type header sent by the client. The content type value is the key in this map, and the
* template (as a String) is the value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requestTemplates(Map requestTemplates);
/**
*
*
* Specifies how the method request body of an unmapped content type will be passed through the integration
* request to the back end without transformation. A content type is unmapped if no mapping template is defined
* in the integration or the content type does not match any of the mapped content types, as specified in
* requestTemplates
. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
*
* -
WHEN_NO_MATCH
passes the method request body through the integration request to the back end
* without transformation when the method request content type does not match any content type associated with
* the mapping templates defined in the integration request.
* -
WHEN_NO_TEMPLATES
passes the method request body through the integration request to the back
* end without transformation when no mapping template is defined in the integration request. If a template is
* defined when this option is selected, the method request of an unmapped content-type will be rejected with an
* HTTP 415 Unsupported Media Type
response.
* -
NEVER
rejects the method request with an HTTP 415 Unsupported Media Type
* response when either the method request content type does not match any content type associated with the
* mapping templates defined in the integration request or no mapping template is defined in the integration
* request.
*
*
*
* @param passthroughBehavior
*
* Specifies how the method request body of an unmapped content type will be passed through the
* integration request to the back end without transformation. A content type is unmapped if no mapping
* template is defined in the integration or the content type does not match any of the mapped content
* types, as specified in requestTemplates
. There are three valid values:
* WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and NEVER
.
*
*
* -
WHEN_NO_MATCH
passes the method request body through the integration request to the
* back end without transformation when the method request content type does not match any content type
* associated with the mapping templates defined in the integration request.
* -
WHEN_NO_TEMPLATES
passes the method request body through the integration request to
* the back end without transformation when no mapping template is defined in the integration request. If
* a template is defined when this option is selected, the method request of an unmapped content-type
* will be rejected with an HTTP 415 Unsupported Media Type
response.
* -
NEVER
rejects the method request with an HTTP 415 Unsupported Media Type
* response when either the method request content type does not match any content type associated with
* the mapping templates defined in the integration request or no mapping template is defined in the
* integration request.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder passthroughBehavior(String passthroughBehavior);
/**
*
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding
* binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is configured
* to support payload pass-through.
*
*
* @param contentHandling
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the
* corresponding binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded
* string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is
* configured to support payload pass-through.
* @see ContentHandlingStrategy
* @return Returns a reference to this object so that method calls can be chained together.
* @see ContentHandlingStrategy
*/
Builder contentHandling(String contentHandling);
/**
*
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding
* binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is configured
* to support payload pass-through.
*
*
* @param contentHandling
* Specifies how to handle request payload content type conversions. Supported values are
* CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
*
* -
*
* CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the
* corresponding binary blob.
*
*
* -
*
* CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded
* string.
*
*
*
*
* If this property is not defined, the request payload will be passed through from the method request to
* integration request without modification, provided that the passthroughBehaviors
is
* configured to support payload pass-through.
* @see ContentHandlingStrategy
* @return Returns a reference to this object so that method calls can be chained together.
* @see ContentHandlingStrategy
*/
Builder contentHandling(ContentHandlingStrategy contentHandling);
/**
*
* Specifies the integration's cache namespace.
*
*
* @param cacheNamespace
* Specifies the integration's cache namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheNamespace(String cacheNamespace);
/**
*
* Specifies the integration's cache key parameters.
*
*
* @param cacheKeyParameters
* Specifies the integration's cache key parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheKeyParameters(Collection cacheKeyParameters);
/**
*
* Specifies the integration's cache key parameters.
*
*
* @param cacheKeyParameters
* Specifies the integration's cache key parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheKeyParameters(String... cacheKeyParameters);
/**
*
* Specifies the integration's responses.
*
*
*
* Example: Get integration responses of a method
* Request
*
*
*
* GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
*
*
* Response
*
* The successful response returns 200 OK
status and a payload as follows:
*
*
*
* { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/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#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
*
*
*
*
* @param integrationResponses
* Specifies the integration's responses.
*
*
*
* Example: Get integration responses of a method
* Request
*
*
*
* GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
*
*
* Response
*
* The successful response returns 200 OK
status and a payload as follows:
*
*
*
* { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/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#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
*
*
* Creating an
* API
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integrationResponses(Map integrationResponses);
}
static final class BuilderImpl extends APIGatewayResponse.BuilderImpl implements Builder {
private String type;
private String httpMethod;
private String uri;
private String credentials;
private Map requestParameters;
private Map requestTemplates;
private String passthroughBehavior;
private String contentHandling;
private String cacheNamespace;
private List cacheKeyParameters;
private Map integrationResponses;
private BuilderImpl() {
}
private BuilderImpl(UpdateIntegrationResponse model) {
type(model.type);
httpMethod(model.httpMethod);
uri(model.uri);
credentials(model.credentials);
requestParameters(model.requestParameters);
requestTemplates(model.requestTemplates);
passthroughBehavior(model.passthroughBehavior);
contentHandling(model.contentHandling);
cacheNamespace(model.cacheNamespace);
cacheKeyParameters(model.cacheKeyParameters);
integrationResponses(model.integrationResponses);
}
public final String getType() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(IntegrationType type) {
this.type(type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final String getHttpMethod() {
return httpMethod;
}
@Override
public final Builder httpMethod(String httpMethod) {
this.httpMethod = httpMethod;
return this;
}
public final void setHttpMethod(String httpMethod) {
this.httpMethod = httpMethod;
}
public final String getUri() {
return uri;
}
@Override
public final Builder uri(String uri) {
this.uri = uri;
return this;
}
public final void setUri(String uri) {
this.uri = uri;
}
public final String getCredentials() {
return credentials;
}
@Override
public final Builder credentials(String credentials) {
this.credentials = credentials;
return this;
}
public final void setCredentials(String credentials) {
this.credentials = credentials;
}
public final Map getRequestParameters() {
return requestParameters;
}
@Override
public final Builder requestParameters(Map requestParameters) {
this.requestParameters = MapOfStringToStringCopier.copy(requestParameters);
return this;
}
public final void setRequestParameters(Map requestParameters) {
this.requestParameters = MapOfStringToStringCopier.copy(requestParameters);
}
public final Map getRequestTemplates() {
return requestTemplates;
}
@Override
public final Builder requestTemplates(Map requestTemplates) {
this.requestTemplates = MapOfStringToStringCopier.copy(requestTemplates);
return this;
}
public final void setRequestTemplates(Map requestTemplates) {
this.requestTemplates = MapOfStringToStringCopier.copy(requestTemplates);
}
public final String getPassthroughBehavior() {
return passthroughBehavior;
}
@Override
public final Builder passthroughBehavior(String passthroughBehavior) {
this.passthroughBehavior = passthroughBehavior;
return this;
}
public final void setPassthroughBehavior(String passthroughBehavior) {
this.passthroughBehavior = passthroughBehavior;
}
public final String getContentHandling() {
return contentHandling;
}
@Override
public final Builder contentHandling(String contentHandling) {
this.contentHandling = contentHandling;
return this;
}
@Override
public final Builder contentHandling(ContentHandlingStrategy contentHandling) {
this.contentHandling(contentHandling.toString());
return this;
}
public final void setContentHandling(String contentHandling) {
this.contentHandling = contentHandling;
}
public final String getCacheNamespace() {
return cacheNamespace;
}
@Override
public final Builder cacheNamespace(String cacheNamespace) {
this.cacheNamespace = cacheNamespace;
return this;
}
public final void setCacheNamespace(String cacheNamespace) {
this.cacheNamespace = cacheNamespace;
}
public final Collection getCacheKeyParameters() {
return cacheKeyParameters;
}
@Override
public final Builder cacheKeyParameters(Collection cacheKeyParameters) {
this.cacheKeyParameters = ListOfStringCopier.copy(cacheKeyParameters);
return this;
}
@Override
@SafeVarargs
public final Builder cacheKeyParameters(String... cacheKeyParameters) {
cacheKeyParameters(Arrays.asList(cacheKeyParameters));
return this;
}
public final void setCacheKeyParameters(Collection cacheKeyParameters) {
this.cacheKeyParameters = ListOfStringCopier.copy(cacheKeyParameters);
}
public final Map getIntegrationResponses() {
return integrationResponses != null ? CollectionUtils.mapValues(integrationResponses, IntegrationResponse::toBuilder)
: null;
}
@Override
public final Builder integrationResponses(Map integrationResponses) {
this.integrationResponses = MapOfIntegrationResponseCopier.copy(integrationResponses);
return this;
}
public final void setIntegrationResponses(Map integrationResponses) {
this.integrationResponses = MapOfIntegrationResponseCopier.copyFromBuilder(integrationResponses);
}
@Override
public UpdateIntegrationResponse build() {
return new UpdateIntegrationResponse(this);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy