/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.apigatewayv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *
* Creates a new IntegrationResponse resource to represent an integration response. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateIntegrationResponseRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** ** The API identifier. *
*/ private String apiId; /** ** Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and * CONVERT_TO_TEXT, with the following behaviors: *
** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response to the * route response or method response without modification. *
*/ private String contentHandlingStrategy; /** ** The integration ID. *
*/ private String integrationId; /** ** The integration response key. *
*/ private String integrationResponseKey; /** ** A key-value map specifying response parameters that are passed to the method response from the backend. The key * is a method response header parameter name and the mapped value is an integration response header value, a static * value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The * mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header * name. The mapped non-static value must match the pattern of integration.response.header.{name} or * integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and * {JSON-expression} is a valid JSON expression without the $ prefix. *
*/ private java.util.Map* The collection of response templates for the integration response as a string-to-string map of key-value pairs. * Response templates are represented as a key/value map, with a content-type as the key and a template as the * value. *
*/ private java.util.Map* The template selection expression for the integration response. Supported only for WebSocket APIs. *
*/ private String templateSelectionExpression; /** ** The API identifier. *
* * @param apiId * The API identifier. */ public void setApiId(String apiId) { this.apiId = apiId; } /** ** The API identifier. *
* * @return The API identifier. */ public String getApiId() { return this.apiId; } /** ** The API identifier. *
* * @param apiId * The API identifier. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withApiId(String apiId) { setApiId(apiId); return this; } /** ** Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and * CONVERT_TO_TEXT, with the following behaviors: *
** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response to the * route response or method response without modification. *
* * @param contentHandlingStrategy * Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY * and CONVERT_TO_TEXT, with the following behaviors: ** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary * blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response * to the route response or method response without modification. * @see ContentHandlingStrategy */ public void setContentHandlingStrategy(String contentHandlingStrategy) { this.contentHandlingStrategy = contentHandlingStrategy; } /** *
* Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and * CONVERT_TO_TEXT, with the following behaviors: *
** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response to the * route response or method response without modification. *
* * @return Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY * and CONVERT_TO_TEXT, with the following behaviors: ** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary * blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration * response to the route response or method response without modification. * @see ContentHandlingStrategy */ public String getContentHandlingStrategy() { return this.contentHandlingStrategy; } /** *
* Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and * CONVERT_TO_TEXT, with the following behaviors: *
** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response to the * route response or method response without modification. *
* * @param contentHandlingStrategy * Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY * and CONVERT_TO_TEXT, with the following behaviors: ** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary * blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response * to the route response or method response without modification. * @return Returns a reference to this object so that method calls can be chained together. * @see ContentHandlingStrategy */ public CreateIntegrationResponseRequest withContentHandlingStrategy(String contentHandlingStrategy) { setContentHandlingStrategy(contentHandlingStrategy); return this; } /** *
* Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and * CONVERT_TO_TEXT, with the following behaviors: *
** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response to the * route response or method response without modification. *
* * @param contentHandlingStrategy * Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY * and CONVERT_TO_TEXT, with the following behaviors: ** CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary * blob. *
** CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string. *
** If this property is not defined, the response payload will be passed through from the integration response * to the route response or method response without modification. * @return Returns a reference to this object so that method calls can be chained together. * @see ContentHandlingStrategy */ public CreateIntegrationResponseRequest withContentHandlingStrategy(ContentHandlingStrategy contentHandlingStrategy) { this.contentHandlingStrategy = contentHandlingStrategy.toString(); return this; } /** *
* The integration ID. *
* * @param integrationId * The integration ID. */ public void setIntegrationId(String integrationId) { this.integrationId = integrationId; } /** ** The integration ID. *
* * @return The integration ID. */ public String getIntegrationId() { return this.integrationId; } /** ** The integration ID. *
* * @param integrationId * The integration ID. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withIntegrationId(String integrationId) { setIntegrationId(integrationId); return this; } /** ** The integration response key. *
* * @param integrationResponseKey * The integration response key. */ public void setIntegrationResponseKey(String integrationResponseKey) { this.integrationResponseKey = integrationResponseKey; } /** ** The integration response key. *
* * @return The integration response key. */ public String getIntegrationResponseKey() { return this.integrationResponseKey; } /** ** The integration response key. *
* * @param integrationResponseKey * The integration response key. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withIntegrationResponseKey(String integrationResponseKey) { setIntegrationResponseKey(integrationResponseKey); return this; } /** ** A key-value map specifying response parameters that are passed to the method response from the backend. The key * is a method response header parameter name and the mapped value is an integration response header value, a static * value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The * mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header * name. The mapped non-static value must match the pattern of integration.response.header.{name} or * integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and * {JSON-expression} is a valid JSON expression without the $ prefix. *
* * @return A key-value map specifying response parameters that are passed to the method response from the backend. * The key is a method response header parameter name and the mapped value is an integration response header * value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration * response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a * valid and unique header name. The mapped non-static value must match the pattern of * integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a * valid and unique response header name and {JSON-expression} is a valid JSON expression without the $ * prefix. */ public java.util.Map* A key-value map specifying response parameters that are passed to the method response from the backend. The key * is a method response header parameter name and the mapped value is an integration response header value, a static * value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The * mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header * name. The mapped non-static value must match the pattern of integration.response.header.{name} or * integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and * {JSON-expression} is a valid JSON expression without the $ prefix. *
* * @param responseParameters * A key-value map specifying response parameters that are passed to the method response from the backend. * The key is a method response header parameter name and the mapped value is an integration response header * value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration * response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a * valid and unique header name. The mapped non-static value must match the pattern of * integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid * and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix. */ public void setResponseParameters(java.util.Map* A key-value map specifying response parameters that are passed to the method response from the backend. The key * is a method response header parameter name and the mapped value is an integration response header value, a static * value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The * mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header * name. The mapped non-static value must match the pattern of integration.response.header.{name} or * integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and * {JSON-expression} is a valid JSON expression without the $ prefix. *
* * @param responseParameters * A key-value map specifying response parameters that are passed to the method response from the backend. * The key is a method response header parameter name and the mapped value is an integration response header * value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration * response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a * valid and unique header name. The mapped non-static value must match the pattern of * integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid * and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withResponseParameters(java.util.Map* The collection of response templates for the integration response as a string-to-string map of key-value pairs. * Response templates are represented as a key/value map, with a content-type as the key and a template as the * value. *
* * @return The collection of response templates for the integration response as a string-to-string map of key-value * pairs. Response templates are represented as a key/value map, with a content-type as the key and a * template as the value. */ public java.util.Map* The collection of response templates for the integration response as a string-to-string map of key-value pairs. * Response templates are represented as a key/value map, with a content-type as the key and a template as the * value. *
* * @param responseTemplates * The collection of response templates for the integration response as a string-to-string map of key-value * pairs. Response templates are represented as a key/value map, with a content-type as the key and a * template as the value. */ public void setResponseTemplates(java.util.Map* The collection of response templates for the integration response as a string-to-string map of key-value pairs. * Response templates are represented as a key/value map, with a content-type as the key and a template as the * value. *
* * @param responseTemplates * The collection of response templates for the integration response as a string-to-string map of key-value * pairs. Response templates are represented as a key/value map, with a content-type as the key and a * template as the value. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withResponseTemplates(java.util.Map* The template selection expression for the integration response. Supported only for WebSocket APIs. *
* * @param templateSelectionExpression * The template selection expression for the integration response. Supported only for WebSocket APIs. */ public void setTemplateSelectionExpression(String templateSelectionExpression) { this.templateSelectionExpression = templateSelectionExpression; } /** ** The template selection expression for the integration response. Supported only for WebSocket APIs. *
* * @return The template selection expression for the integration response. Supported only for WebSocket APIs. */ public String getTemplateSelectionExpression() { return this.templateSelectionExpression; } /** ** The template selection expression for the integration response. Supported only for WebSocket APIs. *
* * @param templateSelectionExpression * The template selection expression for the integration response. Supported only for WebSocket APIs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateIntegrationResponseRequest withTemplateSelectionExpression(String templateSelectionExpression) { setTemplateSelectionExpression(templateSelectionExpression); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getApiId() != null) sb.append("ApiId: ").append(getApiId()).append(","); if (getContentHandlingStrategy() != null) sb.append("ContentHandlingStrategy: ").append(getContentHandlingStrategy()).append(","); if (getIntegrationId() != null) sb.append("IntegrationId: ").append(getIntegrationId()).append(","); if (getIntegrationResponseKey() != null) sb.append("IntegrationResponseKey: ").append(getIntegrationResponseKey()).append(","); if (getResponseParameters() != null) sb.append("ResponseParameters: ").append(getResponseParameters()).append(","); if (getResponseTemplates() != null) sb.append("ResponseTemplates: ").append(getResponseTemplates()).append(","); if (getTemplateSelectionExpression() != null) sb.append("TemplateSelectionExpression: ").append(getTemplateSelectionExpression()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateIntegrationResponseRequest == false) return false; CreateIntegrationResponseRequest other = (CreateIntegrationResponseRequest) obj; if (other.getApiId() == null ^ this.getApiId() == null) return false; if (other.getApiId() != null && other.getApiId().equals(this.getApiId()) == false) return false; if (other.getContentHandlingStrategy() == null ^ this.getContentHandlingStrategy() == null) return false; if (other.getContentHandlingStrategy() != null && other.getContentHandlingStrategy().equals(this.getContentHandlingStrategy()) == false) return false; if (other.getIntegrationId() == null ^ this.getIntegrationId() == null) return false; if (other.getIntegrationId() != null && other.getIntegrationId().equals(this.getIntegrationId()) == false) return false; if (other.getIntegrationResponseKey() == null ^ this.getIntegrationResponseKey() == null) return false; if (other.getIntegrationResponseKey() != null && other.getIntegrationResponseKey().equals(this.getIntegrationResponseKey()) == false) return false; if (other.getResponseParameters() == null ^ this.getResponseParameters() == null) return false; if (other.getResponseParameters() != null && other.getResponseParameters().equals(this.getResponseParameters()) == false) return false; if (other.getResponseTemplates() == null ^ this.getResponseTemplates() == null) return false; if (other.getResponseTemplates() != null && other.getResponseTemplates().equals(this.getResponseTemplates()) == false) return false; if (other.getTemplateSelectionExpression() == null ^ this.getTemplateSelectionExpression() == null) return false; if (other.getTemplateSelectionExpression() != null && other.getTemplateSelectionExpression().equals(this.getTemplateSelectionExpression()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApiId() == null) ? 0 : getApiId().hashCode()); hashCode = prime * hashCode + ((getContentHandlingStrategy() == null) ? 0 : getContentHandlingStrategy().hashCode()); hashCode = prime * hashCode + ((getIntegrationId() == null) ? 0 : getIntegrationId().hashCode()); hashCode = prime * hashCode + ((getIntegrationResponseKey() == null) ? 0 : getIntegrationResponseKey().hashCode()); hashCode = prime * hashCode + ((getResponseParameters() == null) ? 0 : getResponseParameters().hashCode()); hashCode = prime * hashCode + ((getResponseTemplates() == null) ? 0 : getResponseTemplates().hashCode()); hashCode = prime * hashCode + ((getTemplateSelectionExpression() == null) ? 0 : getTemplateSelectionExpression().hashCode()); return hashCode; } @Override public CreateIntegrationResponseRequest clone() { return (CreateIntegrationResponseRequest) super.clone(); } }