Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Updates a GatewayResponse
of a specified response type on the given RestApi
.
- updateGatewayResponse :: Text -> GatewayResponseType -> UpdateGatewayResponse
- data UpdateGatewayResponse
- ugPatchOperations :: Lens' UpdateGatewayResponse [PatchOperation]
- ugRestAPIId :: Lens' UpdateGatewayResponse Text
- ugResponseType :: Lens' UpdateGatewayResponse GatewayResponseType
- gatewayResponse :: GatewayResponse
- data GatewayResponse
- gDefaultResponse :: Lens' GatewayResponse (Maybe Bool)
- gResponseTemplates :: Lens' GatewayResponse (HashMap Text Text)
- gResponseType :: Lens' GatewayResponse (Maybe GatewayResponseType)
- gStatusCode :: Lens' GatewayResponse (Maybe Text)
- gResponseParameters :: Lens' GatewayResponse (HashMap Text Text)
Creating a Request
updateGatewayResponse Source #
Creates a value of UpdateGatewayResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ugPatchOperations
- A list of update operations to be applied to the specified resource and in the order specified in this list.ugRestAPIId
- The string identifier of the associatedRestApi
.ugResponseType
- The response type of the associatedGatewayResponse
. 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_TYPES
data UpdateGatewayResponse Source #
Updates a GatewayResponse
of a specified response type on the given RestApi
.
See: updateGatewayResponse
smart constructor.
Request Lenses
ugPatchOperations :: Lens' UpdateGatewayResponse [PatchOperation] Source #
A list of update operations to be applied to the specified resource and in the order specified in this list.
ugRestAPIId :: Lens' UpdateGatewayResponse Text Source #
The string identifier of the associated RestApi
.
ugResponseType :: Lens' UpdateGatewayResponse GatewayResponseType Source #
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_TYPES
Destructuring the Response
gatewayResponse :: GatewayResponse Source #
Creates a value of GatewayResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gDefaultResponse
- A Boolean flag to indicate whether thisGatewayResponse
is the default gateway response (true
) or not (false
). A default gateway response is one generated by Amazon API Gateway without any customization by an API developer.gResponseTemplates
- Response templates of theGatewayResponse
as a string-to-string map of key-value pairs.gResponseType
- The response type of the associatedGatewayResponse
. 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_TYPESgStatusCode
- The HTTP status code for thisGatewayResponse
.gResponseParameters
- Response parameters (paths, query strings and headers) of theGatewayResponse
as a string-to-string map of key-value pairs.
data GatewayResponse Source #
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 Amazon 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_AUTHNETICATION_TOKEN
type.
@GET restapiso81lxiseflgatewayresponsesMISSING_AUTHENTICATION_TOKEN HTTP1.1 Host: beta-apigateway.us-east-1.amazonaws.com Content-Type: applicationjson X-Amz-Date: 20170503T202516Z Authorization: AWS4-HMAC-SHA256 Credential={access-key-id}20170503us-east-1apigatewayaws4_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": "restapiso81lxiseflgatewayresponsesMISSING_AUTHENTICATION_TOKEN" }, "gatewayresponse:delete": { "href": "restapiso81lxiseflgatewayresponsesMISSING_AUTHENTICATION_TOKEN" }, "gatewayresponse:put": { "href": "restapiso81lxiseflgatewayresponses{response_type}", "templated": true }, "gatewayresponse:update": { "href": "restapiso81lxiseflgatewayresponsesMISSING_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: gatewayResponse
smart constructor.
Response Lenses
gDefaultResponse :: Lens' GatewayResponse (Maybe Bool) Source #
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 Amazon API Gateway without any customization by an API developer.
gResponseTemplates :: Lens' GatewayResponse (HashMap Text Text) Source #
Response templates of the GatewayResponse
as a string-to-string map of key-value pairs.
gResponseType :: Lens' GatewayResponse (Maybe GatewayResponseType) Source #
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_TYPES
gStatusCode :: Lens' GatewayResponse (Maybe Text) Source #
The HTTP status code for this GatewayResponse
.
gResponseParameters :: Lens' GatewayResponse (HashMap Text Text) Source #
Response parameters (paths, query strings and headers) of the GatewayResponse
as a string-to-string map of key-value pairs.