All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.apigateway.model.Integration Maven / Gradle / Ivy

/*
 * Copyright 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.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 final class Integration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type") .getter(getter(Integration::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build(); private static final SdkField HTTP_METHOD_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("httpMethod").getter(getter(Integration::httpMethod)).setter(setter(Builder::httpMethod)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("httpMethod").build()).build(); private static final SdkField URI_FIELD = SdkField. builder(MarshallingType.STRING).memberName("uri") .getter(getter(Integration::uri)).setter(setter(Builder::uri)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uri").build()).build(); private static final SdkField CONNECTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectionType").getter(getter(Integration::connectionTypeAsString)) .setter(setter(Builder::connectionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionType").build()).build(); private static final SdkField CONNECTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectionId").getter(getter(Integration::connectionId)).setter(setter(Builder::connectionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionId").build()).build(); private static final SdkField CREDENTIALS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("credentials").getter(getter(Integration::credentials)).setter(setter(Builder::credentials)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("credentials").build()).build(); private static final SdkField> REQUEST_PARAMETERS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("requestParameters") .getter(getter(Integration::requestParameters)) .setter(setter(Builder::requestParameters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestParameters").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField> REQUEST_TEMPLATES_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("requestTemplates") .getter(getter(Integration::requestTemplates)) .setter(setter(Builder::requestTemplates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestTemplates").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField PASSTHROUGH_BEHAVIOR_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("passthroughBehavior").getter(getter(Integration::passthroughBehavior)) .setter(setter(Builder::passthroughBehavior)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("passthroughBehavior").build()) .build(); private static final SdkField CONTENT_HANDLING_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("contentHandling").getter(getter(Integration::contentHandlingAsString)) .setter(setter(Builder::contentHandling)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("contentHandling").build()).build(); private static final SdkField TIMEOUT_IN_MILLIS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("timeoutInMillis").getter(getter(Integration::timeoutInMillis)).setter(setter(Builder::timeoutInMillis)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeoutInMillis").build()).build(); private static final SdkField CACHE_NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("cacheNamespace").getter(getter(Integration::cacheNamespace)).setter(setter(Builder::cacheNamespace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cacheNamespace").build()).build(); private static final SdkField> CACHE_KEY_PARAMETERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("cacheKeyParameters") .getter(getter(Integration::cacheKeyParameters)) .setter(setter(Builder::cacheKeyParameters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cacheKeyParameters").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> INTEGRATION_RESPONSES_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("integrationResponses") .getter(getter(Integration::integrationResponses)) .setter(setter(Builder::integrationResponses)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("integrationResponses").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(IntegrationResponse::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField TLS_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("tlsConfig").getter(getter(Integration::tlsConfig)).setter(setter(Builder::tlsConfig)) .constructor(TlsConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tlsConfig").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD, HTTP_METHOD_FIELD, URI_FIELD, CONNECTION_TYPE_FIELD, CONNECTION_ID_FIELD, CREDENTIALS_FIELD, REQUEST_PARAMETERS_FIELD, REQUEST_TEMPLATES_FIELD, PASSTHROUGH_BEHAVIOR_FIELD, CONTENT_HANDLING_FIELD, TIMEOUT_IN_MILLIS_FIELD, CACHE_NAMESPACE_FIELD, CACHE_KEY_PARAMETERS_FIELD, INTEGRATION_RESPONSES_FIELD, TLS_CONFIG_FIELD)); private static final long serialVersionUID = 1L; private final String type; private final String httpMethod; private final String uri; private final String connectionType; private final String connectionId; private final String credentials; private final Map requestParameters; private final Map requestTemplates; private final String passthroughBehavior; private final String contentHandling; private final Integer timeoutInMillis; private final String cacheNamespace; private final List cacheKeyParameters; private final Map integrationResponses; private final TlsConfig tlsConfig; private Integration(BuilderImpl builder) { this.type = builder.type; this.httpMethod = builder.httpMethod; this.uri = builder.uri; this.connectionType = builder.connectionType; this.connectionId = builder.connectionId; this.credentials = builder.credentials; this.requestParameters = builder.requestParameters; this.requestTemplates = builder.requestTemplates; this.passthroughBehavior = builder.passthroughBehavior; this.contentHandling = builder.contentHandling; this.timeoutInMillis = builder.timeoutInMillis; this.cacheNamespace = builder.cacheNamespace; this.cacheKeyParameters = builder.cacheKeyParameters; this.integrationResponses = builder.integrationResponses; this.tlsConfig = builder.tlsConfig; } /** *

* Specifies an API method integration type. The valid value is one of the following: *

*
    *
  • AWS: for integrating the API method request with an AWS service action, including the Lambda * function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom * integration. With any other AWS service action, this is known as AWS integration.
  • *
  • AWS_PROXY: for integrating the API method request with the Lambda function-invoking action with * the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.
  • *
  • HTTP: for integrating the API method request with an HTTP endpoint, including a private HTTP * endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
  • *
  • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a private * HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP * proxy integration.
  • *
  • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint without * invoking any backend.
  • *
*

* For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https), port * and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy * integration with a connectionType of VPC_LINK is referred to as a private integration * and uses a VpcLink to connect API Gateway to a network load balancer of a VPC. *

*

* 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 #typeAsString}. *

* * @return Specifies an API method integration type. The valid value is one of the following:

*
    *
  • AWS: for integrating the API method request with an AWS service action, including the * Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the * Lambda custom integration. With any other AWS service action, this is known as AWS integration.
  • *
  • AWS_PROXY: for integrating the API method request with the Lambda function-invoking * action with the client request passed through as-is. This integration is also referred to as the Lambda * proxy integration.
  • *
  • HTTP: for integrating the API method request with an HTTP endpoint, including a private * HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
  • *
  • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred * to as the HTTP proxy integration.
  • *
  • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint * without invoking any backend.
  • *
*

* For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( * http/https), port and path. Standard 80 and 443 ports are supported as well as custom ports * above 1024. An HTTP or HTTP proxy integration with a connectionType of VPC_LINK * is referred to as a private integration and uses a VpcLink to connect API Gateway to a network * load balancer of a VPC. * @see IntegrationType */ public final IntegrationType type() { return IntegrationType.fromValue(type); } /** *

* Specifies an API method integration type. The valid value is one of the following: *

*
    *
  • AWS: for integrating the API method request with an AWS service action, including the Lambda * function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom * integration. With any other AWS service action, this is known as AWS integration.
  • *
  • AWS_PROXY: for integrating the API method request with the Lambda function-invoking action with * the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.
  • *
  • HTTP: for integrating the API method request with an HTTP endpoint, including a private HTTP * endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
  • *
  • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a private * HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP * proxy integration.
  • *
  • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint without * invoking any backend.
  • *
*

* For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https), port * and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy * integration with a connectionType of VPC_LINK is referred to as a private integration * and uses a VpcLink to connect API Gateway to a network load balancer of a VPC. *

*

* 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 #typeAsString}. *

* * @return Specifies an API method integration type. The valid value is one of the following:

*
    *
  • AWS: for integrating the API method request with an AWS service action, including the * Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the * Lambda custom integration. With any other AWS service action, this is known as AWS integration.
  • *
  • AWS_PROXY: for integrating the API method request with the Lambda function-invoking * action with the client request passed through as-is. This integration is also referred to as the Lambda * proxy integration.
  • *
  • HTTP: for integrating the API method request with an HTTP endpoint, including a private * HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
  • *
  • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred * to as the HTTP proxy integration.
  • *
  • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint * without invoking any backend.
  • *
*

* For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( * http/https), port and path. Standard 80 and 443 ports are supported as well as custom ports * above 1024. An HTTP or HTTP proxy integration with a connectionType of VPC_LINK * is referred to as a private integration and uses a VpcLink to connect API Gateway to a network * load balancer of a VPC. * @see IntegrationType */ public final String typeAsString() { return type; } /** *

* Specifies the integration's HTTP method type. *

* * @return Specifies the integration's HTTP method type. */ public final String httpMethod() { return httpMethod; } /** *

* Specifies Uniform Resource Identifier (URI) of the integration endpoint. *

*
    *
  • *

    * For HTTP or HTTP_PROXY integrations, the URI must be a fully formed, encoded HTTP(S) * URL according to the RFC-3986 * specification, for either standard integration, where connectionType is not * VPC_LINK, or private integration, where connectionType is VPC_LINK. For a * private HTTP integration, the URI is not used for routing. *

    *
  • *
  • *

    * For AWS or AWS_PROXY integrations, the URI is of the form * arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}. Here, * {Region} is the API Gateway region (e.g., us-east-1); {service} is the * name of the integrated AWS service (e.g., s3); and {subdomain} is a designated * subdomain supported by certain AWS service for fast host-name lookup. action can be used for an AWS * service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The * ensuing {service_api} refers to a supported action {name} plus any required input * parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing * service_api refers to the path to an AWS service resource, including the region of the integrated * AWS service, if applicable. For example, for integration with the S3 API of * GetObject, the * uri can be either * arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or * arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} *

    *
  • *
* * @return Specifies Uniform Resource Identifier (URI) of the integration endpoint.

*
    *
  • *

    * For HTTP or HTTP_PROXY integrations, the URI must be a fully formed, encoded * HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where * connectionType is not VPC_LINK, or private integration, where * connectionType is VPC_LINK. For a private HTTP integration, the URI is not used * for routing. *

    *
  • *
  • *

    * For AWS or AWS_PROXY integrations, the URI is of the form * arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}. Here, * {Region} is the API Gateway region (e.g., us-east-1); {service} is * the name of the integrated AWS service (e.g., s3); and {subdomain} is a * designated subdomain supported by certain AWS service for fast host-name lookup. action can * be used for an AWS service action-based API, using an * Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing * {service_api} refers to a supported action {name} plus any required input * parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing * service_api refers to the path to an AWS service resource, including the region of the * integrated AWS service, if applicable. For example, for integration with the S3 API of * GetObject, * the uri can be either * arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or * arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} *

    *
  • */ public final String uri() { return uri; } /** *

    * The type of the network connection to the integration endpoint. The valid value is INTERNET for * connections through the public routable internet or VPC_LINK for private connections between API * Gateway and a network load balancer in a VPC. The default value is INTERNET. *

    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #connectionType} * will return {@link ConnectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectionTypeAsString}. *

    * * @return The type of the network connection to the integration endpoint. The valid value is INTERNET * for connections through the public routable internet or VPC_LINK for private connections * between API Gateway and a network load balancer in a VPC. The default value is INTERNET. * @see ConnectionType */ public final ConnectionType connectionType() { return ConnectionType.fromValue(connectionType); } /** *

    * The type of the network connection to the integration endpoint. The valid value is INTERNET for * connections through the public routable internet or VPC_LINK for private connections between API * Gateway and a network load balancer in a VPC. The default value is INTERNET. *

    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #connectionType} * will return {@link ConnectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectionTypeAsString}. *

    * * @return The type of the network connection to the integration endpoint. The valid value is INTERNET * for connections through the public routable internet or VPC_LINK for private connections * between API Gateway and a network load balancer in a VPC. The default value is INTERNET. * @see ConnectionType */ public final String connectionTypeAsString() { return connectionType; } /** *

    * The (id) of * the VpcLink used for the integration when connectionType=VPC_LINK and undefined, otherwise. *

    * * @return The (id * ) of the VpcLink used for the integration when connectionType=VPC_LINK and * undefined, otherwise. */ public final String connectionId() { return connectionId; } /** *

    * Specifies the credentials required for the integration, if any. For AWS integrations, three options are * available. To specify an IAM Role for 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 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 final String credentials() { return credentials; } /** * Returns true if the RequestParameters property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasRequestParameters() { return requestParameters != null && !(requestParameters instanceof SdkAutoConstructMap); } /** *

    * 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. *

    *

    * You can use {@link #hasRequestParameters()} to see if a value was sent in this field. *

    * * @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 final Map requestParameters() { return requestParameters; } /** * Returns true if the RequestTemplates property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasRequestTemplates() { return requestTemplates != null && !(requestTemplates instanceof SdkAutoConstructMap); } /** *

    * 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. *

    *

    * You can use {@link #hasRequestTemplates()} to see if a value was sent in this field. *

    * * @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 final 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. The valid value is one of the following: *

    *
      *
    • 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. The valid value is one of the following: *

    *
      *
    • 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 final 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 passthroughBehavior 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 #contentHandlingAsString}. *

    * * @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 passthroughBehavior is * configured to support payload pass-through. * @see ContentHandlingStrategy */ public final 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 passthroughBehavior 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 #contentHandlingAsString}. *

    * * @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 passthroughBehavior is * configured to support payload pass-through. * @see ContentHandlingStrategy */ public final String contentHandlingAsString() { return contentHandling; } /** *

    * Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. *

    * * @return Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 * seconds. */ public final Integer timeoutInMillis() { return timeoutInMillis; } /** *

    * Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the * cacheNamespace. You can specify the same cacheNamespace across resources to return the * same cached data for requests to different resources. *

    * * @return Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the * cacheNamespace. You can specify the same cacheNamespace across resources to * return the same cached data for requests to different resources. */ public final String cacheNamespace() { return cacheNamespace; } /** * Returns true if the CacheKeyParameters property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasCacheKeyParameters() { return cacheKeyParameters != null && !(cacheKeyParameters instanceof SdkAutoConstructList); } /** *

    * A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. *

    *

    * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

    *

    * You can use {@link #hasCacheKeyParameters()} to see if a value was sent in this field. *

    * * @return A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. */ public final List cacheKeyParameters() { return cacheKeyParameters; } /** * Returns true if the IntegrationResponses property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasIntegrationResponses() { return integrationResponses != null && !(integrationResponses instanceof SdkAutoConstructMap); } /** *

    * 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": "https://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. *

    *

    * You can use {@link #hasIntegrationResponses()} to see if a value was sent in this field. *

    * * @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": "https://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 final Map integrationResponses() { return integrationResponses; } /** *

    * Specifies the TLS configuration for an integration. *

    * * @return Specifies the TLS configuration for an integration. */ public final TlsConfig tlsConfig() { return tlsConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(httpMethod()); hashCode = 31 * hashCode + Objects.hashCode(uri()); hashCode = 31 * hashCode + Objects.hashCode(connectionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(connectionId()); hashCode = 31 * hashCode + Objects.hashCode(credentials()); hashCode = 31 * hashCode + Objects.hashCode(hasRequestParameters() ? requestParameters() : null); hashCode = 31 * hashCode + Objects.hashCode(hasRequestTemplates() ? requestTemplates() : null); hashCode = 31 * hashCode + Objects.hashCode(passthroughBehavior()); hashCode = 31 * hashCode + Objects.hashCode(contentHandlingAsString()); hashCode = 31 * hashCode + Objects.hashCode(timeoutInMillis()); hashCode = 31 * hashCode + Objects.hashCode(cacheNamespace()); hashCode = 31 * hashCode + Objects.hashCode(hasCacheKeyParameters() ? cacheKeyParameters() : null); hashCode = 31 * hashCode + Objects.hashCode(hasIntegrationResponses() ? integrationResponses() : null); hashCode = 31 * hashCode + Objects.hashCode(tlsConfig()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Integration)) { return false; } Integration other = (Integration) obj; return Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(httpMethod(), other.httpMethod()) && Objects.equals(uri(), other.uri()) && Objects.equals(connectionTypeAsString(), other.connectionTypeAsString()) && Objects.equals(connectionId(), other.connectionId()) && Objects.equals(credentials(), other.credentials()) && hasRequestParameters() == other.hasRequestParameters() && Objects.equals(requestParameters(), other.requestParameters()) && hasRequestTemplates() == other.hasRequestTemplates() && Objects.equals(requestTemplates(), other.requestTemplates()) && Objects.equals(passthroughBehavior(), other.passthroughBehavior()) && Objects.equals(contentHandlingAsString(), other.contentHandlingAsString()) && Objects.equals(timeoutInMillis(), other.timeoutInMillis()) && Objects.equals(cacheNamespace(), other.cacheNamespace()) && hasCacheKeyParameters() == other.hasCacheKeyParameters() && Objects.equals(cacheKeyParameters(), other.cacheKeyParameters()) && hasIntegrationResponses() == other.hasIntegrationResponses() && Objects.equals(integrationResponses(), other.integrationResponses()) && Objects.equals(tlsConfig(), other.tlsConfig()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("Integration").add("Type", typeAsString()).add("HttpMethod", httpMethod()).add("Uri", uri()) .add("ConnectionType", connectionTypeAsString()).add("ConnectionId", connectionId()) .add("Credentials", credentials()).add("RequestParameters", hasRequestParameters() ? requestParameters() : null) .add("RequestTemplates", hasRequestTemplates() ? requestTemplates() : null) .add("PassthroughBehavior", passthroughBehavior()).add("ContentHandling", contentHandlingAsString()) .add("TimeoutInMillis", timeoutInMillis()).add("CacheNamespace", cacheNamespace()) .add("CacheKeyParameters", hasCacheKeyParameters() ? cacheKeyParameters() : null) .add("IntegrationResponses", hasIntegrationResponses() ? integrationResponses() : null) .add("TlsConfig", tlsConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "httpMethod": return Optional.ofNullable(clazz.cast(httpMethod())); case "uri": return Optional.ofNullable(clazz.cast(uri())); case "connectionType": return Optional.ofNullable(clazz.cast(connectionTypeAsString())); case "connectionId": return Optional.ofNullable(clazz.cast(connectionId())); case "credentials": return Optional.ofNullable(clazz.cast(credentials())); case "requestParameters": return Optional.ofNullable(clazz.cast(requestParameters())); case "requestTemplates": return Optional.ofNullable(clazz.cast(requestTemplates())); case "passthroughBehavior": return Optional.ofNullable(clazz.cast(passthroughBehavior())); case "contentHandling": return Optional.ofNullable(clazz.cast(contentHandlingAsString())); case "timeoutInMillis": return Optional.ofNullable(clazz.cast(timeoutInMillis())); case "cacheNamespace": return Optional.ofNullable(clazz.cast(cacheNamespace())); case "cacheKeyParameters": return Optional.ofNullable(clazz.cast(cacheKeyParameters())); case "integrationResponses": return Optional.ofNullable(clazz.cast(integrationResponses())); case "tlsConfig": return Optional.ofNullable(clazz.cast(tlsConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Integration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * Specifies an API method integration type. The valid value is one of the following: *

    *
      *
    • AWS: for integrating the API method request with an AWS service action, including the Lambda * function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom * integration. With any other AWS service action, this is known as AWS integration.
    • *
    • AWS_PROXY: for integrating the API method request with the Lambda function-invoking action * with the client request passed through as-is. This integration is also referred to as the Lambda proxy * integration.
    • *
    • HTTP: for integrating the API method request with an HTTP endpoint, including a private HTTP * endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
    • *
    • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as * the HTTP proxy integration.
    • *
    • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint * without invoking any backend.
    • *
    *

    * For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https), * port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP * proxy integration with a connectionType of VPC_LINK is referred to as a private * integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC. *

    * * @param type * Specifies an API method integration type. The valid value is one of the following:

    *
      *
    • AWS: for integrating the API method request with an AWS service action, including the * Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the * Lambda custom integration. With any other AWS service action, this is known as AWS integration.
    • *
    • AWS_PROXY: for integrating the API method request with the Lambda function-invoking * action with the client request passed through as-is. This integration is also referred to as the * Lambda proxy integration.
    • *
    • HTTP: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom * integration.
    • *
    • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also * referred to as the HTTP proxy integration.
    • *
    • MOCK: for integrating the API method request with API Gateway as a "loop-back" * endpoint without invoking any backend.
    • *
    *

    * For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( * http/https), port and path. Standard 80 and 443 ports are supported as well as custom * ports above 1024. An HTTP or HTTP proxy integration with a connectionType of * VPC_LINK is referred to as a private integration and uses a VpcLink to connect API * Gateway to a network load balancer of a VPC. * @see IntegrationType * @return Returns a reference to this object so that method calls can be chained together. * @see IntegrationType */ Builder type(String type); /** *

    * Specifies an API method integration type. The valid value is one of the following: *

    *
      *
    • AWS: for integrating the API method request with an AWS service action, including the Lambda * function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom * integration. With any other AWS service action, this is known as AWS integration.
    • *
    • AWS_PROXY: for integrating the API method request with the Lambda function-invoking action * with the client request passed through as-is. This integration is also referred to as the Lambda proxy * integration.
    • *
    • HTTP: for integrating the API method request with an HTTP endpoint, including a private HTTP * endpoint within a VPC. This integration is also referred to as the HTTP custom integration.
    • *
    • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as * the HTTP proxy integration.
    • *
    • MOCK: for integrating the API method request with API Gateway as a "loop-back" endpoint * without invoking any backend.
    • *
    *

    * For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https), * port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP * proxy integration with a connectionType of VPC_LINK is referred to as a private * integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC. *

    * * @param type * Specifies an API method integration type. The valid value is one of the following:

    *
      *
    • AWS: for integrating the API method request with an AWS service action, including the * Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the * Lambda custom integration. With any other AWS service action, this is known as AWS integration.
    • *
    • AWS_PROXY: for integrating the API method request with the Lambda function-invoking * action with the client request passed through as-is. This integration is also referred to as the * Lambda proxy integration.
    • *
    • HTTP: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom * integration.
    • *
    • HTTP_PROXY: for integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed through as-is. This is also * referred to as the HTTP proxy integration.
    • *
    • MOCK: for integrating the API method request with API Gateway as a "loop-back" * endpoint without invoking any backend.
    • *
    *

    * For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( * http/https), port and path. Standard 80 and 443 ports are supported as well as custom * ports above 1024. An HTTP or HTTP proxy integration with a connectionType of * VPC_LINK is referred to as a private integration and uses a VpcLink to connect API * Gateway to a network load balancer of a VPC. * @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 Uniform Resource Identifier (URI) of the integration endpoint. *

    *
      *
    • *

      * For HTTP or HTTP_PROXY integrations, the URI must be a fully formed, encoded * HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where * connectionType is not VPC_LINK, or private integration, where * connectionType is VPC_LINK. For a private HTTP integration, the URI is not used for * routing. *

      *
    • *
    • *

      * For AWS or AWS_PROXY integrations, the URI is of the form * arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}. Here, * {Region} is the API Gateway region (e.g., us-east-1); {service} is the * name of the integrated AWS service (e.g., s3); and {subdomain} is a designated * subdomain supported by certain AWS service for fast host-name lookup. action can be used for an * AWS service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. * The ensuing {service_api} refers to a supported action {name} plus any required * input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing * service_api refers to the path to an AWS service resource, including the region of the * integrated AWS service, if applicable. For example, for integration with the S3 API of * GetObject, the * uri can be either * arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or * arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} *

      *
    • *
    * * @param uri * Specifies Uniform Resource Identifier (URI) of the integration endpoint.

    *
      *
    • *

      * For HTTP or HTTP_PROXY integrations, the URI must be a fully formed, encoded * HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where * connectionType is not VPC_LINK, or private integration, where * connectionType is VPC_LINK. For a private HTTP integration, the URI is not * used for routing. *

      *
    • *
    • *

      * For AWS or AWS_PROXY integrations, the URI is of the form * arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}. Here, * {Region} is the API Gateway region (e.g., us-east-1); {service} * is the name of the integrated AWS service (e.g., s3); and {subdomain} is a * designated subdomain supported by certain AWS service for fast host-name lookup. action * can be used for an AWS service action-based API, using an * Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing * {service_api} refers to a supported action {name} plus any required input * parameters. Alternatively, path can be used for an AWS service path-based API. The * ensuing service_api refers to the path to an AWS service resource, including the region * of the integrated AWS service, if applicable. For example, for integration with the S3 API of * GetObject * , the uri can be either * arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or * arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder uri(String uri); /** *

      * The type of the network connection to the integration endpoint. The valid value is INTERNET for * connections through the public routable internet or VPC_LINK for private connections between API * Gateway and a network load balancer in a VPC. The default value is INTERNET. *

      * * @param connectionType * The type of the network connection to the integration endpoint. The valid value is * INTERNET for connections through the public routable internet or VPC_LINK * for private connections between API Gateway and a network load balancer in a VPC. The default value is * INTERNET. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(String connectionType); /** *

      * The type of the network connection to the integration endpoint. The valid value is INTERNET for * connections through the public routable internet or VPC_LINK for private connections between API * Gateway and a network load balancer in a VPC. The default value is INTERNET. *

      * * @param connectionType * The type of the network connection to the integration endpoint. The valid value is * INTERNET for connections through the public routable internet or VPC_LINK * for private connections between API Gateway and a network load balancer in a VPC. The default value is * INTERNET. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(ConnectionType connectionType); /** *

      * The (id * ) of the VpcLink used for the integration when connectionType=VPC_LINK and undefined, * otherwise. *

      * * @param connectionId * The ( * id) of the VpcLink used for the integration when * connectionType=VPC_LINK and undefined, otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectionId(String connectionId); /** *

      * Specifies the credentials required for the integration, if any. For AWS integrations, three options are * available. To specify an IAM Role for 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 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. The valid value is one of the following: *

      *
        *
      • 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. The valid value is one of the following: *

      *
        *
      • 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 passthroughBehavior 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 passthroughBehavior 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 passthroughBehavior 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 passthroughBehavior 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); /** *

      * Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. *

      * * @param timeoutInMillis * Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 * seconds. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeoutInMillis(Integer timeoutInMillis); /** *

      * Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the * cacheNamespace. You can specify the same cacheNamespace across resources to return * the same cached data for requests to different resources. *

      * * @param cacheNamespace * Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the * cacheNamespace. You can specify the same cacheNamespace across resources to * return the same cached data for requests to different resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheNamespace(String cacheNamespace); /** *

      * A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. *

      * * @param cacheKeyParameters * A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheKeyParameters(Collection cacheKeyParameters); /** *

      * A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. *

      * * @param cacheKeyParameters * A list of request parameters whose values API Gateway caches. To be valid values for * cacheKeyParameters, these parameters must also be specified for Method * requestParameters. * @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": "https://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": "https://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); /** *

      * Specifies the TLS configuration for an integration. *

      * * @param tlsConfig * Specifies the TLS configuration for an integration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tlsConfig(TlsConfig tlsConfig); /** *

      * Specifies the TLS configuration for an integration. *

      * This is a convenience that creates an instance of the {@link TlsConfig.Builder} avoiding the need to create * one manually via {@link TlsConfig#builder()}. * * When the {@link Consumer} completes, {@link TlsConfig.Builder#build()} is called immediately and its result * is passed to {@link #tlsConfig(TlsConfig)}. * * @param tlsConfig * a consumer that will call methods on {@link TlsConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tlsConfig(TlsConfig) */ default Builder tlsConfig(Consumer tlsConfig) { return tlsConfig(TlsConfig.builder().applyMutation(tlsConfig).build()); } } static final class BuilderImpl implements Builder { private String type; private String httpMethod; private String uri; private String connectionType; private String connectionId; private String credentials; private Map requestParameters = DefaultSdkAutoConstructMap.getInstance(); private Map requestTemplates = DefaultSdkAutoConstructMap.getInstance(); private String passthroughBehavior; private String contentHandling; private Integer timeoutInMillis; private String cacheNamespace; private List cacheKeyParameters = DefaultSdkAutoConstructList.getInstance(); private Map integrationResponses = DefaultSdkAutoConstructMap.getInstance(); private TlsConfig tlsConfig; private BuilderImpl() { } private BuilderImpl(Integration model) { type(model.type); httpMethod(model.httpMethod); uri(model.uri); connectionType(model.connectionType); connectionId(model.connectionId); credentials(model.credentials); requestParameters(model.requestParameters); requestTemplates(model.requestTemplates); passthroughBehavior(model.passthroughBehavior); contentHandling(model.contentHandling); timeoutInMillis(model.timeoutInMillis); cacheNamespace(model.cacheNamespace); cacheKeyParameters(model.cacheKeyParameters); integrationResponses(model.integrationResponses); tlsConfig(model.tlsConfig); } 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 == null ? null : 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 getConnectionType() { return connectionType; } @Override public final Builder connectionType(String connectionType) { this.connectionType = connectionType; return this; } @Override public final Builder connectionType(ConnectionType connectionType) { this.connectionType(connectionType == null ? null : connectionType.toString()); return this; } public final void setConnectionType(String connectionType) { this.connectionType = connectionType; } public final String getConnectionId() { return connectionId; } @Override public final Builder connectionId(String connectionId) { this.connectionId = connectionId; return this; } public final void setConnectionId(String connectionId) { this.connectionId = connectionId; } 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() { if (requestParameters instanceof SdkAutoConstructMap) { return null; } 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() { if (requestTemplates instanceof SdkAutoConstructMap) { return null; } 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 == null ? null : contentHandling.toString()); return this; } public final void setContentHandling(String contentHandling) { this.contentHandling = contentHandling; } public final Integer getTimeoutInMillis() { return timeoutInMillis; } @Override public final Builder timeoutInMillis(Integer timeoutInMillis) { this.timeoutInMillis = timeoutInMillis; return this; } public final void setTimeoutInMillis(Integer timeoutInMillis) { this.timeoutInMillis = timeoutInMillis; } 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() { if (cacheKeyParameters instanceof SdkAutoConstructList) { return null; } 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() { Map result = MapOfIntegrationResponseCopier .copyToBuilder(this.integrationResponses); if (result instanceof SdkAutoConstructMap) { return null; } return result; } @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); } public final TlsConfig.Builder getTlsConfig() { return tlsConfig != null ? tlsConfig.toBuilder() : null; } @Override public final Builder tlsConfig(TlsConfig tlsConfig) { this.tlsConfig = tlsConfig; return this; } public final void setTlsConfig(TlsConfig.BuilderImpl tlsConfig) { this.tlsConfig = tlsConfig != null ? tlsConfig.build() : null; } @Override public Integration build() { return new Integration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy