Class: Aws::APIGateway::Types::GatewayResponse
- Inherits:
-
Struct
- Object
- Struct
- Aws::APIGateway::Types::GatewayResponse
- Includes:
- Structure
- Defined in:
- lib/aws-sdk-apigateway/types.rb
Overview
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
<div class=“remarks” markdown=“1”> For more information about valid gateway response types, see [Gateway Response Types Supported by API Gateway] <div class=“example” markdown=“1”> #### 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" \}
</div> </div>
<div class=“seeAlso” markdown=“1”>
- Customize Gateway Responses][2
-
</div>
[1]: docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html [2]: docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html
Constant Summary collapse
- SENSITIVE =
[]
Instance Attribute Summary collapse
-
#default_response ⇒ Boolean
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (‘true`) or not (`false`).
-
#response_parameters ⇒ Hash<String,String>
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
-
#response_templates ⇒ Hash<String,String>
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
-
#response_type ⇒ String
The response type of the associated GatewayResponse.
-
#status_code ⇒ String
The HTTP status code for this GatewayResponse.
Instance Attribute Details
#default_response ⇒ Boolean
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.
2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/aws-sdk-apigateway/types.rb', line 2904 class GatewayResponse < Struct.new( :response_type, :status_code, :response_parameters, :response_templates, :default_response) SENSITIVE = [] include Aws::Structure end |
#response_parameters ⇒ Hash<String,String>
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/aws-sdk-apigateway/types.rb', line 2904 class GatewayResponse < Struct.new( :response_type, :status_code, :response_parameters, :response_templates, :default_response) SENSITIVE = [] include Aws::Structure end |
#response_templates ⇒ Hash<String,String>
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/aws-sdk-apigateway/types.rb', line 2904 class GatewayResponse < Struct.new( :response_type, :status_code, :response_parameters, :response_templates, :default_response) SENSITIVE = [] include Aws::Structure end |
#response_type ⇒ String
The response type of the associated GatewayResponse.
2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/aws-sdk-apigateway/types.rb', line 2904 class GatewayResponse < Struct.new( :response_type, :status_code, :response_parameters, :response_templates, :default_response) SENSITIVE = [] include Aws::Structure end |
#status_code ⇒ String
The HTTP status code for this GatewayResponse.
2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/aws-sdk-apigateway/types.rb', line 2904 class GatewayResponse < Struct.new( :response_type, :status_code, :response_parameters, :response_templates, :default_response) SENSITIVE = [] include Aws::Structure end |