{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.APIGateway.GetGatewayResponses
-- Copyright   : (c) 2013-2021 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)
--
-- Gets the GatewayResponses collection on the given RestApi. If an API
-- developer has not added any definitions for gateway responses, the
-- result will be the API Gateway-generated default GatewayResponses
-- collection for the supported response types.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetGatewayResponses
  ( -- * Creating a Request
    GetGatewayResponses (..),
    newGetGatewayResponses,

    -- * Request Lenses
    getGatewayResponses_limit,
    getGatewayResponses_position,
    getGatewayResponses_restApiId,

    -- * Destructuring the Response
    GetGatewayResponsesResponse (..),
    newGetGatewayResponsesResponse,

    -- * Response Lenses
    getGatewayResponsesResponse_items,
    getGatewayResponsesResponse_position,
    getGatewayResponsesResponse_httpStatus,
  )
where

import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Gets the GatewayResponses collection on the given RestApi. If an API
-- developer has not added any definitions for gateway responses, the
-- result will be the API Gateway-generated default GatewayResponses
-- collection for the supported response types.
--
-- /See:/ 'newGetGatewayResponses' smart constructor.
data GetGatewayResponses = GetGatewayResponses'
  { -- | The maximum number of returned results per page. The default value is 25
    -- and the maximum value is 500. The GatewayResponses collection does not
    -- support pagination and the limit does not apply here.
    GetGatewayResponses -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set. The
    -- GatewayResponse collection does not support pagination and the position
    -- does not apply here.
    GetGatewayResponses -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | [Required] The string identifier of the associated RestApi.
    GetGatewayResponses -> Text
restApiId :: Prelude.Text
  }
  deriving (GetGatewayResponses -> GetGatewayResponses -> Bool
(GetGatewayResponses -> GetGatewayResponses -> Bool)
-> (GetGatewayResponses -> GetGatewayResponses -> Bool)
-> Eq GetGatewayResponses
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGatewayResponses -> GetGatewayResponses -> Bool
$c/= :: GetGatewayResponses -> GetGatewayResponses -> Bool
== :: GetGatewayResponses -> GetGatewayResponses -> Bool
$c== :: GetGatewayResponses -> GetGatewayResponses -> Bool
Prelude.Eq, ReadPrec [GetGatewayResponses]
ReadPrec GetGatewayResponses
Int -> ReadS GetGatewayResponses
ReadS [GetGatewayResponses]
(Int -> ReadS GetGatewayResponses)
-> ReadS [GetGatewayResponses]
-> ReadPrec GetGatewayResponses
-> ReadPrec [GetGatewayResponses]
-> Read GetGatewayResponses
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGatewayResponses]
$creadListPrec :: ReadPrec [GetGatewayResponses]
readPrec :: ReadPrec GetGatewayResponses
$creadPrec :: ReadPrec GetGatewayResponses
readList :: ReadS [GetGatewayResponses]
$creadList :: ReadS [GetGatewayResponses]
readsPrec :: Int -> ReadS GetGatewayResponses
$creadsPrec :: Int -> ReadS GetGatewayResponses
Prelude.Read, Int -> GetGatewayResponses -> ShowS
[GetGatewayResponses] -> ShowS
GetGatewayResponses -> String
(Int -> GetGatewayResponses -> ShowS)
-> (GetGatewayResponses -> String)
-> ([GetGatewayResponses] -> ShowS)
-> Show GetGatewayResponses
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGatewayResponses] -> ShowS
$cshowList :: [GetGatewayResponses] -> ShowS
show :: GetGatewayResponses -> String
$cshow :: GetGatewayResponses -> String
showsPrec :: Int -> GetGatewayResponses -> ShowS
$cshowsPrec :: Int -> GetGatewayResponses -> ShowS
Prelude.Show, (forall x. GetGatewayResponses -> Rep GetGatewayResponses x)
-> (forall x. Rep GetGatewayResponses x -> GetGatewayResponses)
-> Generic GetGatewayResponses
forall x. Rep GetGatewayResponses x -> GetGatewayResponses
forall x. GetGatewayResponses -> Rep GetGatewayResponses x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGatewayResponses x -> GetGatewayResponses
$cfrom :: forall x. GetGatewayResponses -> Rep GetGatewayResponses x
Prelude.Generic)

-- |
-- Create a value of 'GetGatewayResponses' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'limit', 'getGatewayResponses_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500. The GatewayResponses collection does not
-- support pagination and the limit does not apply here.
--
-- 'position', 'getGatewayResponses_position' - The current pagination position in the paged result set. The
-- GatewayResponse collection does not support pagination and the position
-- does not apply here.
--
-- 'restApiId', 'getGatewayResponses_restApiId' - [Required] The string identifier of the associated RestApi.
newGetGatewayResponses ::
  -- | 'restApiId'
  Prelude.Text ->
  GetGatewayResponses
newGetGatewayResponses :: Text -> GetGatewayResponses
newGetGatewayResponses Text
pRestApiId_ =
  GetGatewayResponses' :: Maybe Int -> Maybe Text -> Text -> GetGatewayResponses
GetGatewayResponses'
    { $sel:limit:GetGatewayResponses' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetGatewayResponses' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:restApiId:GetGatewayResponses' :: Text
restApiId = Text
pRestApiId_
    }

-- | The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500. The GatewayResponses collection does not
-- support pagination and the limit does not apply here.
getGatewayResponses_limit :: Lens.Lens' GetGatewayResponses (Prelude.Maybe Prelude.Int)
getGatewayResponses_limit :: (Maybe Int -> f (Maybe Int))
-> GetGatewayResponses -> f GetGatewayResponses
getGatewayResponses_limit = (GetGatewayResponses -> Maybe Int)
-> (GetGatewayResponses -> Maybe Int -> GetGatewayResponses)
-> Lens
     GetGatewayResponses GetGatewayResponses (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponses' {Maybe Int
limit :: Maybe Int
$sel:limit:GetGatewayResponses' :: GetGatewayResponses -> Maybe Int
limit} -> Maybe Int
limit) (\s :: GetGatewayResponses
s@GetGatewayResponses' {} Maybe Int
a -> GetGatewayResponses
s {$sel:limit:GetGatewayResponses' :: Maybe Int
limit = Maybe Int
a} :: GetGatewayResponses)

-- | The current pagination position in the paged result set. The
-- GatewayResponse collection does not support pagination and the position
-- does not apply here.
getGatewayResponses_position :: Lens.Lens' GetGatewayResponses (Prelude.Maybe Prelude.Text)
getGatewayResponses_position :: (Maybe Text -> f (Maybe Text))
-> GetGatewayResponses -> f GetGatewayResponses
getGatewayResponses_position = (GetGatewayResponses -> Maybe Text)
-> (GetGatewayResponses -> Maybe Text -> GetGatewayResponses)
-> Lens
     GetGatewayResponses GetGatewayResponses (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponses' {Maybe Text
position :: Maybe Text
$sel:position:GetGatewayResponses' :: GetGatewayResponses -> Maybe Text
position} -> Maybe Text
position) (\s :: GetGatewayResponses
s@GetGatewayResponses' {} Maybe Text
a -> GetGatewayResponses
s {$sel:position:GetGatewayResponses' :: Maybe Text
position = Maybe Text
a} :: GetGatewayResponses)

-- | [Required] The string identifier of the associated RestApi.
getGatewayResponses_restApiId :: Lens.Lens' GetGatewayResponses Prelude.Text
getGatewayResponses_restApiId :: (Text -> f Text) -> GetGatewayResponses -> f GetGatewayResponses
getGatewayResponses_restApiId = (GetGatewayResponses -> Text)
-> (GetGatewayResponses -> Text -> GetGatewayResponses)
-> Lens GetGatewayResponses GetGatewayResponses Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponses' {Text
restApiId :: Text
$sel:restApiId:GetGatewayResponses' :: GetGatewayResponses -> Text
restApiId} -> Text
restApiId) (\s :: GetGatewayResponses
s@GetGatewayResponses' {} Text
a -> GetGatewayResponses
s {$sel:restApiId:GetGatewayResponses' :: Text
restApiId = Text
a} :: GetGatewayResponses)

instance Core.AWSPager GetGatewayResponses where
  page :: GetGatewayResponses
-> AWSResponse GetGatewayResponses -> Maybe GetGatewayResponses
page GetGatewayResponses
rq AWSResponse GetGatewayResponses
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetGatewayResponses
GetGatewayResponsesResponse
rs
            GetGatewayResponsesResponse
-> Getting (First Text) GetGatewayResponsesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetGatewayResponsesResponse
-> Const (First Text) GetGatewayResponsesResponse
Lens' GetGatewayResponsesResponse (Maybe Text)
getGatewayResponsesResponse_position
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetGatewayResponsesResponse
 -> Const (First Text) GetGatewayResponsesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetGatewayResponsesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetGatewayResponses
forall a. Maybe a
Prelude.Nothing
    | Maybe [GatewayResponse] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetGatewayResponses
GetGatewayResponsesResponse
rs
            GetGatewayResponsesResponse
-> Getting
     (First [GatewayResponse])
     GetGatewayResponsesResponse
     [GatewayResponse]
-> Maybe [GatewayResponse]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GatewayResponse]
 -> Const (First [GatewayResponse]) (Maybe [GatewayResponse]))
-> GetGatewayResponsesResponse
-> Const (First [GatewayResponse]) GetGatewayResponsesResponse
Lens' GetGatewayResponsesResponse (Maybe [GatewayResponse])
getGatewayResponsesResponse_items
              ((Maybe [GatewayResponse]
  -> Const (First [GatewayResponse]) (Maybe [GatewayResponse]))
 -> GetGatewayResponsesResponse
 -> Const (First [GatewayResponse]) GetGatewayResponsesResponse)
-> (([GatewayResponse]
     -> Const (First [GatewayResponse]) [GatewayResponse])
    -> Maybe [GatewayResponse]
    -> Const (First [GatewayResponse]) (Maybe [GatewayResponse]))
-> Getting
     (First [GatewayResponse])
     GetGatewayResponsesResponse
     [GatewayResponse]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GatewayResponse]
 -> Const (First [GatewayResponse]) [GatewayResponse])
-> Maybe [GatewayResponse]
-> Const (First [GatewayResponse]) (Maybe [GatewayResponse])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetGatewayResponses
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetGatewayResponses -> Maybe GetGatewayResponses
forall a. a -> Maybe a
Prelude.Just (GetGatewayResponses -> Maybe GetGatewayResponses)
-> GetGatewayResponses -> Maybe GetGatewayResponses
forall a b. (a -> b) -> a -> b
Prelude.$
        GetGatewayResponses
rq
          GetGatewayResponses
-> (GetGatewayResponses -> GetGatewayResponses)
-> GetGatewayResponses
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetGatewayResponses -> Identity GetGatewayResponses
Lens
  GetGatewayResponses GetGatewayResponses (Maybe Text) (Maybe Text)
getGatewayResponses_position
          ((Maybe Text -> Identity (Maybe Text))
 -> GetGatewayResponses -> Identity GetGatewayResponses)
-> Maybe Text -> GetGatewayResponses -> GetGatewayResponses
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetGatewayResponses
GetGatewayResponsesResponse
rs
          GetGatewayResponsesResponse
-> Getting (First Text) GetGatewayResponsesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetGatewayResponsesResponse
-> Const (First Text) GetGatewayResponsesResponse
Lens' GetGatewayResponsesResponse (Maybe Text)
getGatewayResponsesResponse_position
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetGatewayResponsesResponse
 -> Const (First Text) GetGatewayResponsesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetGatewayResponsesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetGatewayResponses where
  type
    AWSResponse GetGatewayResponses =
      GetGatewayResponsesResponse
  request :: GetGatewayResponses -> Request GetGatewayResponses
request = Service -> GetGatewayResponses -> Request GetGatewayResponses
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetGatewayResponses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetGatewayResponses)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetGatewayResponses))
-> Logger
-> Service
-> Proxy GetGatewayResponses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetGatewayResponses)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [GatewayResponse]
-> Maybe Text -> Int -> GetGatewayResponsesResponse
GetGatewayResponsesResponse'
            (Maybe [GatewayResponse]
 -> Maybe Text -> Int -> GetGatewayResponsesResponse)
-> Either String (Maybe [GatewayResponse])
-> Either String (Maybe Text -> Int -> GetGatewayResponsesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [GatewayResponse]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"item" Either String (Maybe (Maybe [GatewayResponse]))
-> Maybe [GatewayResponse]
-> Either String (Maybe [GatewayResponse])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GatewayResponse]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetGatewayResponsesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetGatewayResponsesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"position")
            Either String (Int -> GetGatewayResponsesResponse)
-> Either String Int -> Either String GetGatewayResponsesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetGatewayResponses

instance Prelude.NFData GetGatewayResponses

instance Core.ToHeaders GetGatewayResponses where
  toHeaders :: GetGatewayResponses -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetGatewayResponses -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath GetGatewayResponses where
  toPath :: GetGatewayResponses -> ByteString
toPath GetGatewayResponses' {Maybe Int
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
$sel:restApiId:GetGatewayResponses' :: GetGatewayResponses -> Text
$sel:position:GetGatewayResponses' :: GetGatewayResponses -> Maybe Text
$sel:limit:GetGatewayResponses' :: GetGatewayResponses -> Maybe Int
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/gatewayresponses"
      ]

instance Core.ToQuery GetGatewayResponses where
  toQuery :: GetGatewayResponses -> QueryString
toQuery GetGatewayResponses' {Maybe Int
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
$sel:restApiId:GetGatewayResponses' :: GetGatewayResponses -> Text
$sel:position:GetGatewayResponses' :: GetGatewayResponses -> Maybe Text
$sel:limit:GetGatewayResponses' :: GetGatewayResponses -> Maybe Int
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit, ByteString
"position" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
position]

-- | The collection of the GatewayResponse instances of a RestApi as a
-- @responseType@-to-GatewayResponse object map of key-value pairs. As
-- such, pagination is not supported for querying this collection.
--
-- For more information about valid gateway response types, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html Gateway Response Types Supported by API Gateway>
--
-- ==== Example: Get the collection of gateway responses of an API
--
-- ===== Request
--
-- This example request shows how to retrieve the GatewayResponses
-- collection from an API.
--
-- > GET /restapis/o81lxisefl/gatewayresponses HTTP/1.1 Host: beta-apigateway.us-east-1.amazonaws.com Content-Type: application/json X-Amz-Date: 20170503T220604Z Authorization: AWS4-HMAC-SHA256 Credential={access-key-id}/20170503/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=59b42fe54a76a5de8adf2c67baa6d39206f8e9ad49a1d77ccc6a5da3103a398a Cache-Control: no-cache Postman-Token: 5637af27-dc29-fc5c-9dfe-0645d52cb515
--
-- ===== 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" }, "first": { "href": "/restapis/o81lxisefl/gatewayresponses" }, "gatewayresponse:by-type": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "item": [ { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_FAILURE" }, { "href": "/restapis/o81lxisefl/gatewayresponses/RESOURCE_NOT_FOUND" }, { "href": "/restapis/o81lxisefl/gatewayresponses/REQUEST_TOO_LARGE" }, { "href": "/restapis/o81lxisefl/gatewayresponses/THROTTLED" }, { "href": "/restapis/o81lxisefl/gatewayresponses/UNSUPPORTED_MEDIA_TYPE" }, { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_CONFIGURATION_ERROR" }, { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_5XX" }, { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_4XX" }, { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_PARAMETERS" }, { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_BODY" }, { "href": "/restapis/o81lxisefl/gatewayresponses/EXPIRED_TOKEN" }, { "href": "/restapis/o81lxisefl/gatewayresponses/ACCESS_DENIED" }, { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_API_KEY" }, { "href": "/restapis/o81lxisefl/gatewayresponses/UNAUTHORIZED" }, { "href": "/restapis/o81lxisefl/gatewayresponses/API_CONFIGURATION_ERROR" }, { "href": "/restapis/o81lxisefl/gatewayresponses/QUOTA_EXCEEDED" }, { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_TIMEOUT" }, { "href": "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" }, { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_SIGNATURE" }, { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_FAILURE" } ] }, "_embedded": { "item": [ { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_FAILURE" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_FAILURE" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "INTEGRATION_FAILURE", "statusCode": "504" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/RESOURCE_NOT_FOUND" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/RESOURCE_NOT_FOUND" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "RESOURCE_NOT_FOUND", "statusCode": "404" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/REQUEST_TOO_LARGE" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/REQUEST_TOO_LARGE" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "REQUEST_TOO_LARGE", "statusCode": "413" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/THROTTLED" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/THROTTLED" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "THROTTLED", "statusCode": "429" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/UNSUPPORTED_MEDIA_TYPE" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/UNSUPPORTED_MEDIA_TYPE" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "UNSUPPORTED_MEDIA_TYPE", "statusCode": "415" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_CONFIGURATION_ERROR" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_CONFIGURATION_ERROR" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "AUTHORIZER_CONFIGURATION_ERROR", "statusCode": "500" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_5XX" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_5XX" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "DEFAULT_5XX" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_4XX" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/DEFAULT_4XX" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "DEFAULT_4XX" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_PARAMETERS" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_PARAMETERS" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "BAD_REQUEST_PARAMETERS", "statusCode": "400" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_BODY" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/BAD_REQUEST_BODY" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "BAD_REQUEST_BODY", "statusCode": "400" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/EXPIRED_TOKEN" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/EXPIRED_TOKEN" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "EXPIRED_TOKEN", "statusCode": "403" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/ACCESS_DENIED" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/ACCESS_DENIED" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "ACCESS_DENIED", "statusCode": "403" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_API_KEY" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_API_KEY" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "INVALID_API_KEY", "statusCode": "403" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/UNAUTHORIZED" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/UNAUTHORIZED" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "UNAUTHORIZED", "statusCode": "401" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/API_CONFIGURATION_ERROR" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/API_CONFIGURATION_ERROR" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "API_CONFIGURATION_ERROR", "statusCode": "500" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/QUOTA_EXCEEDED" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/QUOTA_EXCEEDED" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "QUOTA_EXCEEDED", "statusCode": "429" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_TIMEOUT" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/INTEGRATION_TIMEOUT" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "INTEGRATION_TIMEOUT", "statusCode": "504" }, { "_links": { "self": { "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": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "MISSING_AUTHENTICATION_TOKEN", "statusCode": "403" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_SIGNATURE" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/INVALID_SIGNATURE" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "INVALID_SIGNATURE", "statusCode": "403" }, { "_links": { "self": { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_FAILURE" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/AUTHORIZER_FAILURE" } }, "defaultResponse": true, "responseParameters": {}, "responseTemplates": { "application/json": "{\"message\":$context.error.messageString}" }, "responseType": "AUTHORIZER_FAILURE", "statusCode": "500" } ] } }
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html Customize Gateway Responses>
--
-- /See:/ 'newGetGatewayResponsesResponse' smart constructor.
data GetGatewayResponsesResponse = GetGatewayResponsesResponse'
  { -- | Returns the entire collection, because of no pagination support.
    GetGatewayResponsesResponse -> Maybe [GatewayResponse]
items :: Prelude.Maybe [GatewayResponse],
    GetGatewayResponsesResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetGatewayResponsesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetGatewayResponsesResponse -> GetGatewayResponsesResponse -> Bool
(GetGatewayResponsesResponse
 -> GetGatewayResponsesResponse -> Bool)
-> (GetGatewayResponsesResponse
    -> GetGatewayResponsesResponse -> Bool)
-> Eq GetGatewayResponsesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGatewayResponsesResponse -> GetGatewayResponsesResponse -> Bool
$c/= :: GetGatewayResponsesResponse -> GetGatewayResponsesResponse -> Bool
== :: GetGatewayResponsesResponse -> GetGatewayResponsesResponse -> Bool
$c== :: GetGatewayResponsesResponse -> GetGatewayResponsesResponse -> Bool
Prelude.Eq, ReadPrec [GetGatewayResponsesResponse]
ReadPrec GetGatewayResponsesResponse
Int -> ReadS GetGatewayResponsesResponse
ReadS [GetGatewayResponsesResponse]
(Int -> ReadS GetGatewayResponsesResponse)
-> ReadS [GetGatewayResponsesResponse]
-> ReadPrec GetGatewayResponsesResponse
-> ReadPrec [GetGatewayResponsesResponse]
-> Read GetGatewayResponsesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGatewayResponsesResponse]
$creadListPrec :: ReadPrec [GetGatewayResponsesResponse]
readPrec :: ReadPrec GetGatewayResponsesResponse
$creadPrec :: ReadPrec GetGatewayResponsesResponse
readList :: ReadS [GetGatewayResponsesResponse]
$creadList :: ReadS [GetGatewayResponsesResponse]
readsPrec :: Int -> ReadS GetGatewayResponsesResponse
$creadsPrec :: Int -> ReadS GetGatewayResponsesResponse
Prelude.Read, Int -> GetGatewayResponsesResponse -> ShowS
[GetGatewayResponsesResponse] -> ShowS
GetGatewayResponsesResponse -> String
(Int -> GetGatewayResponsesResponse -> ShowS)
-> (GetGatewayResponsesResponse -> String)
-> ([GetGatewayResponsesResponse] -> ShowS)
-> Show GetGatewayResponsesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGatewayResponsesResponse] -> ShowS
$cshowList :: [GetGatewayResponsesResponse] -> ShowS
show :: GetGatewayResponsesResponse -> String
$cshow :: GetGatewayResponsesResponse -> String
showsPrec :: Int -> GetGatewayResponsesResponse -> ShowS
$cshowsPrec :: Int -> GetGatewayResponsesResponse -> ShowS
Prelude.Show, (forall x.
 GetGatewayResponsesResponse -> Rep GetGatewayResponsesResponse x)
-> (forall x.
    Rep GetGatewayResponsesResponse x -> GetGatewayResponsesResponse)
-> Generic GetGatewayResponsesResponse
forall x.
Rep GetGatewayResponsesResponse x -> GetGatewayResponsesResponse
forall x.
GetGatewayResponsesResponse -> Rep GetGatewayResponsesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetGatewayResponsesResponse x -> GetGatewayResponsesResponse
$cfrom :: forall x.
GetGatewayResponsesResponse -> Rep GetGatewayResponsesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetGatewayResponsesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'items', 'getGatewayResponsesResponse_items' - Returns the entire collection, because of no pagination support.
--
-- 'position', 'getGatewayResponsesResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getGatewayResponsesResponse_httpStatus' - The response's http status code.
newGetGatewayResponsesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetGatewayResponsesResponse
newGetGatewayResponsesResponse :: Int -> GetGatewayResponsesResponse
newGetGatewayResponsesResponse Int
pHttpStatus_ =
  GetGatewayResponsesResponse' :: Maybe [GatewayResponse]
-> Maybe Text -> Int -> GetGatewayResponsesResponse
GetGatewayResponsesResponse'
    { $sel:items:GetGatewayResponsesResponse' :: Maybe [GatewayResponse]
items =
        Maybe [GatewayResponse]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetGatewayResponsesResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetGatewayResponsesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returns the entire collection, because of no pagination support.
getGatewayResponsesResponse_items :: Lens.Lens' GetGatewayResponsesResponse (Prelude.Maybe [GatewayResponse])
getGatewayResponsesResponse_items :: (Maybe [GatewayResponse] -> f (Maybe [GatewayResponse]))
-> GetGatewayResponsesResponse -> f GetGatewayResponsesResponse
getGatewayResponsesResponse_items = (GetGatewayResponsesResponse -> Maybe [GatewayResponse])
-> (GetGatewayResponsesResponse
    -> Maybe [GatewayResponse] -> GetGatewayResponsesResponse)
-> Lens' GetGatewayResponsesResponse (Maybe [GatewayResponse])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponsesResponse' {Maybe [GatewayResponse]
items :: Maybe [GatewayResponse]
$sel:items:GetGatewayResponsesResponse' :: GetGatewayResponsesResponse -> Maybe [GatewayResponse]
items} -> Maybe [GatewayResponse]
items) (\s :: GetGatewayResponsesResponse
s@GetGatewayResponsesResponse' {} Maybe [GatewayResponse]
a -> GetGatewayResponsesResponse
s {$sel:items:GetGatewayResponsesResponse' :: Maybe [GatewayResponse]
items = Maybe [GatewayResponse]
a} :: GetGatewayResponsesResponse) ((Maybe [GatewayResponse] -> f (Maybe [GatewayResponse]))
 -> GetGatewayResponsesResponse -> f GetGatewayResponsesResponse)
-> ((Maybe [GatewayResponse] -> f (Maybe [GatewayResponse]))
    -> Maybe [GatewayResponse] -> f (Maybe [GatewayResponse]))
-> (Maybe [GatewayResponse] -> f (Maybe [GatewayResponse]))
-> GetGatewayResponsesResponse
-> f GetGatewayResponsesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GatewayResponse]
  [GatewayResponse]
  [GatewayResponse]
  [GatewayResponse]
-> Iso
     (Maybe [GatewayResponse])
     (Maybe [GatewayResponse])
     (Maybe [GatewayResponse])
     (Maybe [GatewayResponse])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [GatewayResponse]
  [GatewayResponse]
  [GatewayResponse]
  [GatewayResponse]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
getGatewayResponsesResponse_position :: Lens.Lens' GetGatewayResponsesResponse (Prelude.Maybe Prelude.Text)
getGatewayResponsesResponse_position :: (Maybe Text -> f (Maybe Text))
-> GetGatewayResponsesResponse -> f GetGatewayResponsesResponse
getGatewayResponsesResponse_position = (GetGatewayResponsesResponse -> Maybe Text)
-> (GetGatewayResponsesResponse
    -> Maybe Text -> GetGatewayResponsesResponse)
-> Lens' GetGatewayResponsesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponsesResponse' {Maybe Text
position :: Maybe Text
$sel:position:GetGatewayResponsesResponse' :: GetGatewayResponsesResponse -> Maybe Text
position} -> Maybe Text
position) (\s :: GetGatewayResponsesResponse
s@GetGatewayResponsesResponse' {} Maybe Text
a -> GetGatewayResponsesResponse
s {$sel:position:GetGatewayResponsesResponse' :: Maybe Text
position = Maybe Text
a} :: GetGatewayResponsesResponse)

-- | The response's http status code.
getGatewayResponsesResponse_httpStatus :: Lens.Lens' GetGatewayResponsesResponse Prelude.Int
getGatewayResponsesResponse_httpStatus :: (Int -> f Int)
-> GetGatewayResponsesResponse -> f GetGatewayResponsesResponse
getGatewayResponsesResponse_httpStatus = (GetGatewayResponsesResponse -> Int)
-> (GetGatewayResponsesResponse
    -> Int -> GetGatewayResponsesResponse)
-> Lens
     GetGatewayResponsesResponse GetGatewayResponsesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponsesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetGatewayResponsesResponse' :: GetGatewayResponsesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetGatewayResponsesResponse
s@GetGatewayResponsesResponse' {} Int
a -> GetGatewayResponsesResponse
s {$sel:httpStatus:GetGatewayResponsesResponse' :: Int
httpStatus = Int
a} :: GetGatewayResponsesResponse)

instance Prelude.NFData GetGatewayResponsesResponse