{-# 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_id,
deployment_description,
)
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
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
(GetDeployment -> GetDeployment -> Bool)
-> (GetDeployment -> GetDeployment -> Bool) -> Eq GetDeployment
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]
(Int -> ReadS GetDeployment)
-> ReadS [GetDeployment]
-> ReadPrec GetDeployment
-> ReadPrec [GetDeployment]
-> Read 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
(Int -> GetDeployment -> ShowS)
-> (GetDeployment -> String)
-> ([GetDeployment] -> ShowS)
-> Show GetDeployment
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. GetDeployment -> Rep GetDeployment x)
-> (forall x. Rep GetDeployment x -> GetDeployment)
-> Generic GetDeployment
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' :: Maybe [Text] -> Text -> Text -> GetDeployment
GetDeployment'
{ $sel:embed:GetDeployment' :: Maybe [Text]
embed = Maybe [Text]
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> GetDeployment -> f GetDeployment
getDeployment_embed = (GetDeployment -> Maybe [Text])
-> (GetDeployment -> Maybe [Text] -> GetDeployment)
-> Lens GetDeployment GetDeployment (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
-> GetDeployment -> f GetDeployment)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetDeployment
-> f GetDeployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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 :: (Text -> f Text) -> GetDeployment -> f GetDeployment
getDeployment_restApiId = (GetDeployment -> Text)
-> (GetDeployment -> Text -> GetDeployment)
-> Lens GetDeployment GetDeployment Text Text
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 :: (Text -> f Text) -> GetDeployment -> f GetDeployment
getDeployment_deploymentId = (GetDeployment -> Text)
-> (GetDeployment -> Text -> GetDeployment)
-> Lens GetDeployment GetDeployment Text Text
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 :: GetDeployment -> Request GetDeployment
request = Service -> GetDeployment -> Request GetDeployment
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeployment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDeployment))
-> Logger
-> Service
-> Proxy GetDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeployment)))
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 -> Object -> Either String Deployment
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetDeployment
instance Prelude.NFData GetDeployment
instance Core.ToHeaders GetDeployment where
toHeaders :: GetDeployment -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetDeployment -> 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 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]
..} =
[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
"/deployments/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deploymentId
]
instance Core.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]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"embed"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
embed)
]