{-# 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 #-}
module Amazonka.APIGateway.GetGatewayResponse
(
GetGatewayResponse (..),
newGetGatewayResponse,
getGatewayResponse_restApiId,
getGatewayResponse_responseType,
GatewayResponse (..),
newGatewayResponse,
gatewayResponse_defaultResponse,
gatewayResponse_responseParameters,
gatewayResponse_responseTemplates,
gatewayResponse_responseType,
gatewayResponse_statusCode,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetGatewayResponse = GetGatewayResponse'
{
GetGatewayResponse -> Text
restApiId :: Prelude.Text,
GetGatewayResponse -> GatewayResponseType
responseType :: GatewayResponseType
}
deriving (GetGatewayResponse -> GetGatewayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGatewayResponse -> GetGatewayResponse -> Bool
$c/= :: GetGatewayResponse -> GetGatewayResponse -> Bool
== :: GetGatewayResponse -> GetGatewayResponse -> Bool
$c== :: GetGatewayResponse -> GetGatewayResponse -> Bool
Prelude.Eq, ReadPrec [GetGatewayResponse]
ReadPrec GetGatewayResponse
Int -> ReadS GetGatewayResponse
ReadS [GetGatewayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGatewayResponse]
$creadListPrec :: ReadPrec [GetGatewayResponse]
readPrec :: ReadPrec GetGatewayResponse
$creadPrec :: ReadPrec GetGatewayResponse
readList :: ReadS [GetGatewayResponse]
$creadList :: ReadS [GetGatewayResponse]
readsPrec :: Int -> ReadS GetGatewayResponse
$creadsPrec :: Int -> ReadS GetGatewayResponse
Prelude.Read, Int -> GetGatewayResponse -> ShowS
[GetGatewayResponse] -> ShowS
GetGatewayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGatewayResponse] -> ShowS
$cshowList :: [GetGatewayResponse] -> ShowS
show :: GetGatewayResponse -> String
$cshow :: GetGatewayResponse -> String
showsPrec :: Int -> GetGatewayResponse -> ShowS
$cshowsPrec :: Int -> GetGatewayResponse -> ShowS
Prelude.Show, forall x. Rep GetGatewayResponse x -> GetGatewayResponse
forall x. GetGatewayResponse -> Rep GetGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGatewayResponse x -> GetGatewayResponse
$cfrom :: forall x. GetGatewayResponse -> Rep GetGatewayResponse x
Prelude.Generic)
newGetGatewayResponse ::
Prelude.Text ->
GatewayResponseType ->
GetGatewayResponse
newGetGatewayResponse :: Text -> GatewayResponseType -> GetGatewayResponse
newGetGatewayResponse Text
pRestApiId_ GatewayResponseType
pResponseType_ =
GetGatewayResponse'
{ $sel:restApiId:GetGatewayResponse' :: Text
restApiId = Text
pRestApiId_,
$sel:responseType:GetGatewayResponse' :: GatewayResponseType
responseType = GatewayResponseType
pResponseType_
}
getGatewayResponse_restApiId :: Lens.Lens' GetGatewayResponse Prelude.Text
getGatewayResponse_restApiId :: Lens' GetGatewayResponse Text
getGatewayResponse_restApiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponse' {Text
restApiId :: Text
$sel:restApiId:GetGatewayResponse' :: GetGatewayResponse -> Text
restApiId} -> Text
restApiId) (\s :: GetGatewayResponse
s@GetGatewayResponse' {} Text
a -> GetGatewayResponse
s {$sel:restApiId:GetGatewayResponse' :: Text
restApiId = Text
a} :: GetGatewayResponse)
getGatewayResponse_responseType :: Lens.Lens' GetGatewayResponse GatewayResponseType
getGatewayResponse_responseType :: Lens' GetGatewayResponse GatewayResponseType
getGatewayResponse_responseType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGatewayResponse' {GatewayResponseType
responseType :: GatewayResponseType
$sel:responseType:GetGatewayResponse' :: GetGatewayResponse -> GatewayResponseType
responseType} -> GatewayResponseType
responseType) (\s :: GetGatewayResponse
s@GetGatewayResponse' {} GatewayResponseType
a -> GetGatewayResponse
s {$sel:responseType:GetGatewayResponse' :: GatewayResponseType
responseType = GatewayResponseType
a} :: GetGatewayResponse)
instance Core.AWSRequest GetGatewayResponse where
type AWSResponse GetGatewayResponse = GatewayResponse
request :: (Service -> Service)
-> GetGatewayResponse -> Request GetGatewayResponse
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetGatewayResponse
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetGatewayResponse)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable GetGatewayResponse where
hashWithSalt :: Int -> GetGatewayResponse -> Int
hashWithSalt Int
_salt GetGatewayResponse' {Text
GatewayResponseType
responseType :: GatewayResponseType
restApiId :: Text
$sel:responseType:GetGatewayResponse' :: GetGatewayResponse -> GatewayResponseType
$sel:restApiId:GetGatewayResponse' :: GetGatewayResponse -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GatewayResponseType
responseType
instance Prelude.NFData GetGatewayResponse where
rnf :: GetGatewayResponse -> ()
rnf GetGatewayResponse' {Text
GatewayResponseType
responseType :: GatewayResponseType
restApiId :: Text
$sel:responseType:GetGatewayResponse' :: GetGatewayResponse -> GatewayResponseType
$sel:restApiId:GetGatewayResponse' :: GetGatewayResponse -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
restApiId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GatewayResponseType
responseType
instance Data.ToHeaders GetGatewayResponse where
toHeaders :: GetGatewayResponse -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Data.ToPath GetGatewayResponse where
toPath :: GetGatewayResponse -> ByteString
toPath GetGatewayResponse' {Text
GatewayResponseType
responseType :: GatewayResponseType
restApiId :: Text
$sel:responseType:GetGatewayResponse' :: GetGatewayResponse -> GatewayResponseType
$sel:restApiId:GetGatewayResponse' :: GetGatewayResponse -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
ByteString
"/gatewayresponses/",
forall a. ToByteString a => a -> ByteString
Data.toBS GatewayResponseType
responseType
]
instance Data.ToQuery GetGatewayResponse where
toQuery :: GetGatewayResponse -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty