{-# 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.GetDeployment
(
GetDeployment (..),
newGetDeployment,
getDeployment_embed,
getDeployment_restApiId,
getDeployment_deploymentId,
Deployment (..),
newDeployment,
deployment_apiSummary,
deployment_createdDate,
deployment_description,
deployment_id,
)
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 GetDeployment = GetDeployment'
{
GetDeployment -> Maybe [Text]
embed :: Prelude.Maybe [Prelude.Text],
GetDeployment -> Text
restApiId :: Prelude.Text,
GetDeployment -> Text
deploymentId :: Prelude.Text
}
deriving (GetDeployment -> GetDeployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeployment -> GetDeployment -> Bool
$c/= :: GetDeployment -> GetDeployment -> Bool
== :: GetDeployment -> GetDeployment -> Bool
$c== :: GetDeployment -> GetDeployment -> Bool
Prelude.Eq, ReadPrec [GetDeployment]
ReadPrec GetDeployment
Int -> ReadS GetDeployment
ReadS [GetDeployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeployment]
$creadListPrec :: ReadPrec [GetDeployment]
readPrec :: ReadPrec GetDeployment
$creadPrec :: ReadPrec GetDeployment
readList :: ReadS [GetDeployment]
$creadList :: ReadS [GetDeployment]
readsPrec :: Int -> ReadS GetDeployment
$creadsPrec :: Int -> ReadS GetDeployment
Prelude.Read, Int -> GetDeployment -> ShowS
[GetDeployment] -> ShowS
GetDeployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeployment] -> ShowS
$cshowList :: [GetDeployment] -> ShowS
show :: GetDeployment -> String
$cshow :: GetDeployment -> String
showsPrec :: Int -> GetDeployment -> ShowS
$cshowsPrec :: Int -> GetDeployment -> ShowS
Prelude.Show, forall x. Rep GetDeployment x -> GetDeployment
forall x. GetDeployment -> Rep GetDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeployment x -> GetDeployment
$cfrom :: forall x. GetDeployment -> Rep GetDeployment x
Prelude.Generic)
newGetDeployment ::
Prelude.Text ->
Prelude.Text ->
GetDeployment
newGetDeployment :: Text -> Text -> GetDeployment
newGetDeployment Text
pRestApiId_ Text
pDeploymentId_ =
GetDeployment'
{ $sel:embed:GetDeployment' :: Maybe [Text]
embed = forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:GetDeployment' :: Text
restApiId = Text
pRestApiId_,
$sel:deploymentId:GetDeployment' :: Text
deploymentId = Text
pDeploymentId_
}
getDeployment_embed :: Lens.Lens' GetDeployment (Prelude.Maybe [Prelude.Text])
getDeployment_embed :: Lens' GetDeployment (Maybe [Text])
getDeployment_embed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployment' {Maybe [Text]
embed :: Maybe [Text]
$sel:embed:GetDeployment' :: GetDeployment -> Maybe [Text]
embed} -> Maybe [Text]
embed) (\s :: GetDeployment
s@GetDeployment' {} Maybe [Text]
a -> GetDeployment
s {$sel:embed:GetDeployment' :: Maybe [Text]
embed = Maybe [Text]
a} :: GetDeployment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getDeployment_restApiId :: Lens.Lens' GetDeployment Prelude.Text
getDeployment_restApiId :: Lens' GetDeployment Text
getDeployment_restApiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployment' {Text
restApiId :: Text
$sel:restApiId:GetDeployment' :: GetDeployment -> Text
restApiId} -> Text
restApiId) (\s :: GetDeployment
s@GetDeployment' {} Text
a -> GetDeployment
s {$sel:restApiId:GetDeployment' :: Text
restApiId = Text
a} :: GetDeployment)
getDeployment_deploymentId :: Lens.Lens' GetDeployment Prelude.Text
getDeployment_deploymentId :: Lens' GetDeployment Text
getDeployment_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployment' {Text
deploymentId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
deploymentId} -> Text
deploymentId) (\s :: GetDeployment
s@GetDeployment' {} Text
a -> GetDeployment
s {$sel:deploymentId:GetDeployment' :: Text
deploymentId = Text
a} :: GetDeployment)
instance Core.AWSRequest GetDeployment where
type AWSResponse GetDeployment = Deployment
request :: (Service -> Service) -> GetDeployment -> Request GetDeployment
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 GetDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeployment)))
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 GetDeployment where
hashWithSalt :: Int -> GetDeployment -> Int
hashWithSalt Int
_salt GetDeployment' {Maybe [Text]
Text
deploymentId :: Text
restApiId :: Text
embed :: Maybe [Text]
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:restApiId:GetDeployment' :: GetDeployment -> Text
$sel:embed:GetDeployment' :: GetDeployment -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
embed
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deploymentId
instance Prelude.NFData GetDeployment where
rnf :: GetDeployment -> ()
rnf GetDeployment' {Maybe [Text]
Text
deploymentId :: Text
restApiId :: Text
embed :: Maybe [Text]
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:restApiId:GetDeployment' :: GetDeployment -> Text
$sel:embed:GetDeployment' :: GetDeployment -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
embed
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
deploymentId
instance Data.ToHeaders GetDeployment where
toHeaders :: GetDeployment -> 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 GetDeployment where
toPath :: GetDeployment -> ByteString
toPath GetDeployment' {Maybe [Text]
Text
deploymentId :: Text
restApiId :: Text
embed :: Maybe [Text]
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:restApiId:GetDeployment' :: GetDeployment -> Text
$sel:embed:GetDeployment' :: GetDeployment -> Maybe [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
ByteString
"/deployments/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
deploymentId
]
instance Data.ToQuery GetDeployment where
toQuery :: GetDeployment -> QueryString
toQuery GetDeployment' {Maybe [Text]
Text
deploymentId :: Text
restApiId :: Text
embed :: Maybe [Text]
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:restApiId:GetDeployment' :: GetDeployment -> Text
$sel:embed:GetDeployment' :: GetDeployment -> Maybe [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"embed"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
embed)
]