/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { template class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace APIGateway { namespace Model { /** *

A gateway response of a given response type and status code, with optional * response parameters and mapping templates.

For more * information about valid gateway response types, see Gateway * Response Types Supported by API Gateway

Example: * Get a Gateway Response of a given response type

Request

This * example shows how to get a gateway response of the * MISSING_AUTHENTICATION_TOKEN type.

GET
   * /restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN HTTP/1.1
   * Host: beta-apigateway.us-east-1.amazonaws.com Content-Type: application/json
   * X-Amz-Date: 20170503T202516Z Authorization: AWS4-HMAC-SHA256
   * Credential={access-key-id}/20170503/us-east-1/apigateway/aws4_request,
   * SignedHeaders=content-type;host;x-amz-date,
   * Signature=1b52460e3159c1a26cff29093855d50ea141c1c5b937528fecaf60f51129697a
   * Cache-Control: no-cache Postman-Token: 3b2a1ce9-c848-2e26-2e2f-9c2caefbed45
   * 

The response type is specified as a URL path.

*
Response

The successful operation returns the 200 OK * status code and a payload similar to the following:

{ "_links": {
   * "curies": { "href":
   * "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-gatewayresponse-{rel}.html",
   * "name": "gatewayresponse", "templated": true }, "self": { "href":
   * "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" },
   * "gatewayresponse:delete": { "href":
   * "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" },
   * "gatewayresponse:put": { "href":
   * "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true },
   * "gatewayresponse:update": { "href":
   * "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" } },
   * "defaultResponse": false, "responseParameters": {
   * "gatewayresponse.header.x-request-path": "method.request.path.petId",
   * "gatewayresponse.header.Access-Control-Allow-Origin": "'a.b.c'",
   * "gatewayresponse.header.x-request-query": "method.request.querystring.q",
   * "gatewayresponse.header.x-request-header": "method.request.header.Accept" },
   * "responseTemplates": { "application/json": "{\n \"message\":
   * $context.error.messageString,\n \"type\": \"$context.error.responseType\",\n
   * \"stage\": \"$context.stage\",\n \"resourcePath\": \"$context.resourcePath\",\n
   * \"stageVariables.a\": \"$stageVariables.a\",\n \"statusCode\":
   * \"'404'\"\n}" }, "responseType": "MISSING_AUTHENTICATION_TOKEN",
   * "statusCode": "404" }

See Also:

AWS * API Reference

*/ class AWS_APIGATEWAY_API UpdateGatewayResponseResult { public: UpdateGatewayResponseResult(); UpdateGatewayResponseResult(const Aws::AmazonWebServiceResult& result); UpdateGatewayResponseResult& operator=(const Aws::AmazonWebServiceResult& result); /** *

The response type of the associated GatewayResponse. Valid values are *

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • * AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • * QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE
*

*/ inline const GatewayResponseType& GetResponseType() const{ return m_responseType; } /** *

The response type of the associated GatewayResponse. Valid values are *

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • * AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • * QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE
*

*/ inline void SetResponseType(const GatewayResponseType& value) { m_responseType = value; } /** *

The response type of the associated GatewayResponse. Valid values are *

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • * AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • * QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE
*

*/ inline void SetResponseType(GatewayResponseType&& value) { m_responseType = std::move(value); } /** *

The response type of the associated GatewayResponse. Valid values are *

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • * AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • * QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE
*

*/ inline UpdateGatewayResponseResult& WithResponseType(const GatewayResponseType& value) { SetResponseType(value); return *this;} /** *

The response type of the associated GatewayResponse. Valid values are *

  • ACCESS_DENIED
  • API_CONFIGURATION_ERROR
  • AUTHORIZER_FAILURE
  • * AUTHORIZER_CONFIGURATION_ERROR
  • BAD_REQUEST_PARAMETERS
  • BAD_REQUEST_BODY
  • DEFAULT_4XX
  • DEFAULT_5XX
  • EXPIRED_TOKEN
  • INVALID_SIGNATURE
  • INTEGRATION_FAILURE
  • INTEGRATION_TIMEOUT
  • INVALID_API_KEY
  • MISSING_AUTHENTICATION_TOKEN
  • * QUOTA_EXCEEDED
  • REQUEST_TOO_LARGE
  • RESOURCE_NOT_FOUND
  • THROTTLED
  • UNAUTHORIZED
  • UNSUPPORTED_MEDIA_TYPE
*

*/ inline UpdateGatewayResponseResult& WithResponseType(GatewayResponseType&& value) { SetResponseType(std::move(value)); return *this;} /** *

The HTTP status code for this GatewayResponse.

*/ inline const Aws::String& GetStatusCode() const{ return m_statusCode; } /** *

The HTTP status code for this GatewayResponse.

*/ inline void SetStatusCode(const Aws::String& value) { m_statusCode = value; } /** *

The HTTP status code for this GatewayResponse.

*/ inline void SetStatusCode(Aws::String&& value) { m_statusCode = std::move(value); } /** *

The HTTP status code for this GatewayResponse.

*/ inline void SetStatusCode(const char* value) { m_statusCode.assign(value); } /** *

The HTTP status code for this GatewayResponse.

*/ inline UpdateGatewayResponseResult& WithStatusCode(const Aws::String& value) { SetStatusCode(value); return *this;} /** *

The HTTP status code for this GatewayResponse.

*/ inline UpdateGatewayResponseResult& WithStatusCode(Aws::String&& value) { SetStatusCode(std::move(value)); return *this;} /** *

The HTTP status code for this GatewayResponse.

*/ inline UpdateGatewayResponseResult& WithStatusCode(const char* value) { SetStatusCode(value); return *this;} /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline const Aws::Map& GetResponseParameters() const{ return m_responseParameters; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline void SetResponseParameters(const Aws::Map& value) { m_responseParameters = value; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline void SetResponseParameters(Aws::Map&& value) { m_responseParameters = std::move(value); } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& WithResponseParameters(const Aws::Map& value) { SetResponseParameters(value); return *this;} /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& WithResponseParameters(Aws::Map&& value) { SetResponseParameters(std::move(value)); return *this;} /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(const Aws::String& key, const Aws::String& value) { m_responseParameters.emplace(key, value); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(Aws::String&& key, const Aws::String& value) { m_responseParameters.emplace(std::move(key), value); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(const Aws::String& key, Aws::String&& value) { m_responseParameters.emplace(key, std::move(value)); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(Aws::String&& key, Aws::String&& value) { m_responseParameters.emplace(std::move(key), std::move(value)); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(const char* key, Aws::String&& value) { m_responseParameters.emplace(key, std::move(value)); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(Aws::String&& key, const char* value) { m_responseParameters.emplace(std::move(key), value); return *this; } /** *

Response parameters (paths, query strings and headers) of the * GatewayResponse as a string-to-string map of key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseParameters(const char* key, const char* value) { m_responseParameters.emplace(key, value); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline const Aws::Map& GetResponseTemplates() const{ return m_responseTemplates; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline void SetResponseTemplates(const Aws::Map& value) { m_responseTemplates = value; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline void SetResponseTemplates(Aws::Map&& value) { m_responseTemplates = std::move(value); } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& WithResponseTemplates(const Aws::Map& value) { SetResponseTemplates(value); return *this;} /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& WithResponseTemplates(Aws::Map&& value) { SetResponseTemplates(std::move(value)); return *this;} /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(const Aws::String& key, const Aws::String& value) { m_responseTemplates.emplace(key, value); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(Aws::String&& key, const Aws::String& value) { m_responseTemplates.emplace(std::move(key), value); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(const Aws::String& key, Aws::String&& value) { m_responseTemplates.emplace(key, std::move(value)); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(Aws::String&& key, Aws::String&& value) { m_responseTemplates.emplace(std::move(key), std::move(value)); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(const char* key, Aws::String&& value) { m_responseTemplates.emplace(key, std::move(value)); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(Aws::String&& key, const char* value) { m_responseTemplates.emplace(std::move(key), value); return *this; } /** *

Response templates of the GatewayResponse as a string-to-string map of * key-value pairs.

*/ inline UpdateGatewayResponseResult& AddResponseTemplates(const char* key, const char* value) { m_responseTemplates.emplace(key, value); return *this; } /** *

A Boolean flag to indicate whether this GatewayResponse is the default * gateway response (true) or not (false). A default * gateway response is one generated by API Gateway without any customization by an * API developer.

*/ inline bool GetDefaultResponse() const{ return m_defaultResponse; } /** *

A Boolean flag to indicate whether this GatewayResponse is the default * gateway response (true) or not (false). A default * gateway response is one generated by API Gateway without any customization by an * API developer.

*/ inline void SetDefaultResponse(bool value) { m_defaultResponse = value; } /** *

A Boolean flag to indicate whether this GatewayResponse is the default * gateway response (true) or not (false). A default * gateway response is one generated by API Gateway without any customization by an * API developer.

*/ inline UpdateGatewayResponseResult& WithDefaultResponse(bool value) { SetDefaultResponse(value); return *this;} private: GatewayResponseType m_responseType; Aws::String m_statusCode; Aws::Map m_responseParameters; Aws::Map m_responseTemplates; bool m_defaultResponse; }; } // namespace Model } // namespace APIGateway } // namespace Aws