AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

UpdateGatewayResponseOutput

import "github.com/aws/aws-sdk-go/service/apigateway"

type UpdateGatewayResponseOutput struct { DefaultResponse *bool `locationName:"defaultResponse" type:"boolean"` ResponseParameters map[string]*string `locationName:"responseParameters" type:"map"` ResponseTemplates map[string]*string `locationName:"responseTemplates" type:"map"` ResponseType *string `locationName:"responseType" type:"string" enum:"GatewayResponseType"` StatusCode *string `locationName:"statusCode" type:"string"` }

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 (https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html)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": "https://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" }

Customize Gateway Responses (https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html)

DefaultResponse

Type: *bool

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.

ResponseParameters

Type: map[string]*string

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

ResponseTemplates

Type: map[string]*string

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

ResponseType

Type: *string

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

StatusCode

Type: *string

The HTTP status code for this GatewayResponse.

Method

GoString

func (s UpdateGatewayResponseOutput) GoString() string

GoString returns the string representation

SetDefaultResponse

func (s *UpdateGatewayResponseOutput) SetDefaultResponse(v bool) *UpdateGatewayResponseOutput

SetDefaultResponse sets the DefaultResponse field's value.

SetResponseParameters

func (s *UpdateGatewayResponseOutput) SetResponseParameters(v map[string]*string) *UpdateGatewayResponseOutput

SetResponseParameters sets the ResponseParameters field's value.

SetResponseTemplates

func (s *UpdateGatewayResponseOutput) SetResponseTemplates(v map[string]*string) *UpdateGatewayResponseOutput

SetResponseTemplates sets the ResponseTemplates field's value.

SetResponseType

func (s *UpdateGatewayResponseOutput) SetResponseType(v string) *UpdateGatewayResponseOutput

SetResponseType sets the ResponseType field's value.

SetStatusCode

func (s *UpdateGatewayResponseOutput) SetStatusCode(v string) *UpdateGatewayResponseOutput

SetStatusCode sets the StatusCode field's value.

String

func (s UpdateGatewayResponseOutput) String() string

String returns the string representation

On this page: