software.amazon.awssdk.services.apigateway.model.PutIntegrationRequest 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 java.util.function.Consumer;
import javax.annotation.Generated;
import software.amazon.awssdk.core.AwsRequestOverrideConfig;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Sets up a method's integration.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class PutIntegrationRequest extends APIGatewayRequest implements
ToCopyableBuilder {
private final String restApiId;
private final String resourceId;
private final String httpMethod;
private final String type;
private final String integrationHttpMethod;
private final String uri;
private final String credentials;
private final Map requestParameters;
private final Map requestTemplates;
private final String passthroughBehavior;
private final String cacheNamespace;
private final List cacheKeyParameters;
private final String contentHandling;
private PutIntegrationRequest(BuilderImpl builder) {
super(builder);
this.restApiId = builder.restApiId;
this.resourceId = builder.resourceId;
this.httpMethod = builder.httpMethod;
this.type = builder.type;
this.integrationHttpMethod = builder.integrationHttpMethod;
this.uri = builder.uri;
this.credentials = builder.credentials;
this.requestParameters = builder.requestParameters;
this.requestTemplates = builder.requestTemplates;
this.passthroughBehavior = builder.passthroughBehavior;
this.cacheNamespace = builder.cacheNamespace;
this.cacheKeyParameters = builder.cacheKeyParameters;
this.contentHandling = builder.contentHandling;
}
/**
*
* The string identifier of the associated RestApi.
*
*
* @return The string identifier of the associated RestApi.
*/
public String restApiId() {
return restApiId;
}
/**
*
* Specifies a put integration request's resource ID.
*
*
* @return Specifies a put integration request's resource ID.
*/
public String resourceId() {
return resourceId;
}
/**
*
* Specifies a put integration request's HTTP method.
*
*
* @return Specifies a put integration request's HTTP method.
*/
public String httpMethod() {
return httpMethod;
}
/**
*
* Specifies a put integration input's 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 a put integration input's type.
* @see IntegrationType
*/
public IntegrationType type() {
return IntegrationType.fromValue(type);
}
/**
*
* Specifies a put integration input's 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 a put integration input's type.
* @see IntegrationType
*/
public String typeString() {
return type;
}
/**
*
* Specifies a put integration HTTP method. When the integration type is HTTP or AWS, this field is required.
*
*
* @return Specifies a put integration HTTP method. When the integration type is HTTP or AWS, this field is
* required.
*/
public String integrationHttpMethod() {
return integrationHttpMethod;
}
/**
*
* 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 whether credentials are required for a put integration.
*
*
* @return Specifies whether credentials are required for a put integration.
*/
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 the pass-through behavior for incoming requests based on the Content-Type header in the request, and
* the available mapping templates specified as the requestTemplates
property on the Integration
* resource. There are three valid values: WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and
* NEVER
.
*
*
* -
*
* WHEN_NO_MATCH
passes the request body for unmapped content types through to the integration back end
* without transformation.
*
*
* -
*
* NEVER
rejects unmapped content types with an HTTP 415 'Unsupported Media Type' response.
*
*
* -
*
* WHEN_NO_TEMPLATES
allows pass-through when the integration has NO content types mapped to templates.
* However if there is at least one content type defined, unmapped content types will be rejected with the same 415
* response.
*
*
*
*
* @return Specifies the pass-through behavior for incoming requests based on the Content-Type header in the
* request, and the available mapping templates specified as the requestTemplates
property on
* the Integration resource. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
* -
*
* WHEN_NO_MATCH
passes the request body for unmapped content types through to the integration
* back end without transformation.
*
*
* -
*
* NEVER
rejects unmapped content types with an HTTP 415 'Unsupported Media Type' response.
*
*
* -
*
* WHEN_NO_TEMPLATES
allows pass-through when the integration has NO content types mapped to
* templates. However if there is at least one content type defined, unmapped content types will be rejected
* with the same 415 response.
*
*
*/
public String passthroughBehavior() {
return passthroughBehavior;
}
/**
*
* Specifies a put integration input's cache namespace.
*
*
* @return Specifies a put integration input's cache namespace.
*/
public String cacheNamespace() {
return cacheNamespace;
}
/**
*
* Specifies a put integration input's cache key parameters.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Specifies a put integration input's cache key parameters.
*/
public List cacheKeyParameters() {
return cacheKeyParameters;
}
/**
*
* 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;
}
@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(restApiId());
hashCode = 31 * hashCode + Objects.hashCode(resourceId());
hashCode = 31 * hashCode + Objects.hashCode(httpMethod());
hashCode = 31 * hashCode + Objects.hashCode(typeString());
hashCode = 31 * hashCode + Objects.hashCode(integrationHttpMethod());
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(cacheNamespace());
hashCode = 31 * hashCode + Objects.hashCode(cacheKeyParameters());
hashCode = 31 * hashCode + Objects.hashCode(contentHandlingString());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof PutIntegrationRequest)) {
return false;
}
PutIntegrationRequest other = (PutIntegrationRequest) obj;
return Objects.equals(restApiId(), other.restApiId()) && Objects.equals(resourceId(), other.resourceId())
&& Objects.equals(httpMethod(), other.httpMethod()) && Objects.equals(typeString(), other.typeString())
&& Objects.equals(integrationHttpMethod(), other.integrationHttpMethod()) && 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(cacheNamespace(), other.cacheNamespace())
&& Objects.equals(cacheKeyParameters(), other.cacheKeyParameters())
&& Objects.equals(contentHandlingString(), other.contentHandlingString());
}
@Override
public String toString() {
return ToString.builder("PutIntegrationRequest").add("RestApiId", restApiId()).add("ResourceId", resourceId())
.add("HttpMethod", httpMethod()).add("Type", typeString()).add("IntegrationHttpMethod", integrationHttpMethod())
.add("Uri", uri()).add("Credentials", credentials()).add("RequestParameters", requestParameters())
.add("RequestTemplates", requestTemplates()).add("PassthroughBehavior", passthroughBehavior())
.add("CacheNamespace", cacheNamespace()).add("CacheKeyParameters", cacheKeyParameters())
.add("ContentHandling", contentHandlingString()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "restApiId":
return Optional.of(clazz.cast(restApiId()));
case "resourceId":
return Optional.of(clazz.cast(resourceId()));
case "httpMethod":
return Optional.of(clazz.cast(httpMethod()));
case "type":
return Optional.of(clazz.cast(typeString()));
case "integrationHttpMethod":
return Optional.of(clazz.cast(integrationHttpMethod()));
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 "cacheNamespace":
return Optional.of(clazz.cast(cacheNamespace()));
case "cacheKeyParameters":
return Optional.of(clazz.cast(cacheKeyParameters()));
case "contentHandling":
return Optional.of(clazz.cast(contentHandlingString()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayRequest.Builder, CopyableBuilder {
/**
*
* The string identifier of the associated RestApi.
*
*
* @param restApiId
* The string identifier of the associated RestApi.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder restApiId(String restApiId);
/**
*
* Specifies a put integration request's resource ID.
*
*
* @param resourceId
* Specifies a put integration request's resource ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceId(String resourceId);
/**
*
* Specifies a put integration request's HTTP method.
*
*
* @param httpMethod
* Specifies a put integration request's HTTP method.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder httpMethod(String httpMethod);
/**
*
* Specifies a put integration input's type.
*
*
* @param type
* Specifies a put integration input's 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 a put integration input's type.
*
*
* @param type
* Specifies a put integration input's 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 a put integration HTTP method. When the integration type is HTTP or AWS, this field is required.
*
*
* @param integrationHttpMethod
* Specifies a put integration HTTP method. When the integration type is HTTP or AWS, this field is
* required.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integrationHttpMethod(String integrationHttpMethod);
/**
*
* 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 whether credentials are required for a put integration.
*
*
* @param credentials
* Specifies whether credentials are required for a put integration.
* @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 the pass-through behavior for incoming requests based on the Content-Type header in the request,
* and the available mapping templates specified as the requestTemplates
property on the
* Integration resource. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
*
* -
*
* WHEN_NO_MATCH
passes the request body for unmapped content types through to the integration back
* end without transformation.
*
*
* -
*
* NEVER
rejects unmapped content types with an HTTP 415 'Unsupported Media Type' response.
*
*
* -
*
* WHEN_NO_TEMPLATES
allows pass-through when the integration has NO content types mapped to
* templates. However if there is at least one content type defined, unmapped content types will be rejected
* with the same 415 response.
*
*
*
*
* @param passthroughBehavior
* Specifies the pass-through behavior for incoming requests based on the Content-Type header in the
* request, and the available mapping templates specified as the requestTemplates
property
* on the Integration resource. There are three valid values: WHEN_NO_MATCH
,
* WHEN_NO_TEMPLATES
, and NEVER
.
*
* -
*
* WHEN_NO_MATCH
passes the request body for unmapped content types through to the
* integration back end without transformation.
*
*
* -
*
* NEVER
rejects unmapped content types with an HTTP 415 'Unsupported Media Type' response.
*
*
* -
*
* WHEN_NO_TEMPLATES
allows pass-through when the integration has NO content types mapped to
* templates. However if there is at least one content type defined, unmapped content types will be
* rejected with the same 415 response.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder passthroughBehavior(String passthroughBehavior);
/**
*
* Specifies a put integration input's cache namespace.
*
*
* @param cacheNamespace
* Specifies a put integration input's cache namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheNamespace(String cacheNamespace);
/**
*
* Specifies a put integration input's cache key parameters.
*
*
* @param cacheKeyParameters
* Specifies a put integration input's cache key parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheKeyParameters(Collection cacheKeyParameters);
/**
*
* Specifies a put integration input's cache key parameters.
*
*
* @param cacheKeyParameters
* Specifies a put integration input's cache key parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheKeyParameters(String... cacheKeyParameters);
/**
*
* 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);
@Override
Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig);
}
static final class BuilderImpl extends APIGatewayRequest.BuilderImpl implements Builder {
private String restApiId;
private String resourceId;
private String httpMethod;
private String type;
private String integrationHttpMethod;
private String uri;
private String credentials;
private Map requestParameters;
private Map requestTemplates;
private String passthroughBehavior;
private String cacheNamespace;
private List cacheKeyParameters;
private String contentHandling;
private BuilderImpl() {
}
private BuilderImpl(PutIntegrationRequest model) {
restApiId(model.restApiId);
resourceId(model.resourceId);
httpMethod(model.httpMethod);
type(model.type);
integrationHttpMethod(model.integrationHttpMethod);
uri(model.uri);
credentials(model.credentials);
requestParameters(model.requestParameters);
requestTemplates(model.requestTemplates);
passthroughBehavior(model.passthroughBehavior);
cacheNamespace(model.cacheNamespace);
cacheKeyParameters(model.cacheKeyParameters);
contentHandling(model.contentHandling);
}
public final String getRestApiId() {
return restApiId;
}
@Override
public final Builder restApiId(String restApiId) {
this.restApiId = restApiId;
return this;
}
public final void setRestApiId(String restApiId) {
this.restApiId = restApiId;
}
public final String getResourceId() {
return resourceId;
}
@Override
public final Builder resourceId(String resourceId) {
this.resourceId = resourceId;
return this;
}
public final void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
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 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 getIntegrationHttpMethod() {
return integrationHttpMethod;
}
@Override
public final Builder integrationHttpMethod(String integrationHttpMethod) {
this.integrationHttpMethod = integrationHttpMethod;
return this;
}
public final void setIntegrationHttpMethod(String integrationHttpMethod) {
this.integrationHttpMethod = integrationHttpMethod;
}
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 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 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;
}
@Override
public Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig) {
super.requestOverrideConfig(awsRequestOverrideConfig);
return this;
}
@Override
public Builder requestOverrideConfig(Consumer builderConsumer) {
super.requestOverrideConfig(builderConsumer);
return this;
}
@Override
public PutIntegrationRequest build() {
return new PutIntegrationRequest(this);
}
}
}