amazonka-apigateway-1.6.1: Amazon API Gateway SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.APIGateway.GetGatewayResponse

Contents

Description

Gets a GatewayResponse of a specified response type on the given RestApi .

Synopsis

Creating a Request

getGatewayResponse Source #

Creates a value of GetGatewayResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • gggRestAPIId - [Required] The string identifier of the associated RestApi .
  • gggResponseType - [Required] 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

data GetGatewayResponse Source #

Gets a GatewayResponse of a specified response type on the given RestApi .

See: getGatewayResponse smart constructor.

Instances
Eq GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Data GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetGatewayResponse -> c GetGatewayResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetGatewayResponse #

toConstr :: GetGatewayResponse -> Constr #

dataTypeOf :: GetGatewayResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GetGatewayResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetGatewayResponse) #

gmapT :: (forall b. Data b => b -> b) -> GetGatewayResponse -> GetGatewayResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetGatewayResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetGatewayResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetGatewayResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetGatewayResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetGatewayResponse -> m GetGatewayResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetGatewayResponse -> m GetGatewayResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetGatewayResponse -> m GetGatewayResponse #

Read GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Show GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Generic GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Associated Types

type Rep GetGatewayResponse :: Type -> Type #

Hashable GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

AWSRequest GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Associated Types

type Rs GetGatewayResponse :: Type #

ToHeaders GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

ToPath GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

ToQuery GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

NFData GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Methods

rnf :: GetGatewayResponse -> () #

type Rep GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

type Rep GetGatewayResponse = D1 (MetaData "GetGatewayResponse" "Network.AWS.APIGateway.GetGatewayResponse" "amazonka-apigateway-1.6.1-BCCM2RP3l9Q2ENgHvKrj59" False) (C1 (MetaCons "GetGatewayResponse'" PrefixI True) (S1 (MetaSel (Just "_gggRestAPIId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_gggResponseType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 GatewayResponseType)))
type Rs GetGatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.GetGatewayResponse

Request Lenses

gggRestAPIId :: Lens' GetGatewayResponse Text Source #

Required
The string identifier of the associated RestApi .

gggResponseType :: Lens' GetGatewayResponse GatewayResponseType Source #

Required
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

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 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.
  • gResponseTemplates - Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
  • gResponseType - 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
  • gStatusCode - The HTTP status code for this GatewayResponse .
  • gResponseParameters - Response parameters (paths, query strings and headers) of the GatewayResponse 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 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 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" } @

Customize Gateway Responses

See: gatewayResponse smart constructor.

Instances
Eq GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Data GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GatewayResponse -> c GatewayResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GatewayResponse #

toConstr :: GatewayResponse -> Constr #

dataTypeOf :: GatewayResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GatewayResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GatewayResponse) #

gmapT :: (forall b. Data b => b -> b) -> GatewayResponse -> GatewayResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GatewayResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GatewayResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> GatewayResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GatewayResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GatewayResponse -> m GatewayResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GatewayResponse -> m GatewayResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GatewayResponse -> m GatewayResponse #

Read GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Show GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Generic GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Associated Types

type Rep GatewayResponse :: Type -> Type #

Hashable GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

FromJSON GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

NFData GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

Methods

rnf :: GatewayResponse -> () #

type Rep GatewayResponse Source # 
Instance details

Defined in Network.AWS.APIGateway.Types.Product

type Rep GatewayResponse = D1 (MetaData "GatewayResponse" "Network.AWS.APIGateway.Types.Product" "amazonka-apigateway-1.6.1-BCCM2RP3l9Q2ENgHvKrj59" False) (C1 (MetaCons "GatewayResponse'" PrefixI True) ((S1 (MetaSel (Just "_gDefaultResponse") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_gResponseTemplates") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text)))) :*: (S1 (MetaSel (Just "_gResponseType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe GatewayResponseType)) :*: (S1 (MetaSel (Just "_gStatusCode") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_gResponseParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text)))))))

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 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_TYPE

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.