{-# 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.ApiGatewayV2.GetDeployment
(
GetDeployment (..),
newGetDeployment,
getDeployment_apiId,
getDeployment_deploymentId,
GetDeploymentResponse (..),
newGetDeploymentResponse,
getDeploymentResponse_autoDeployed,
getDeploymentResponse_createdDate,
getDeploymentResponse_deploymentId,
getDeploymentResponse_deploymentStatus,
getDeploymentResponse_deploymentStatusMessage,
getDeploymentResponse_description,
getDeploymentResponse_httpStatus,
)
where
import Amazonka.ApiGatewayV2.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 -> Text
apiId :: 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
pApiId_ Text
pDeploymentId_ =
GetDeployment'
{ $sel:apiId:GetDeployment' :: Text
apiId = Text
pApiId_,
$sel:deploymentId:GetDeployment' :: Text
deploymentId = Text
pDeploymentId_
}
getDeployment_apiId :: Lens.Lens' GetDeployment Prelude.Text
getDeployment_apiId :: Lens' GetDeployment Text
getDeployment_apiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployment' {Text
apiId :: Text
$sel:apiId:GetDeployment' :: GetDeployment -> Text
apiId} -> Text
apiId) (\s :: GetDeployment
s@GetDeployment' {} Text
a -> GetDeployment
s {$sel:apiId:GetDeployment' :: Text
apiId = 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 =
GetDeploymentResponse
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 ->
Maybe Bool
-> Maybe ISO8601
-> Maybe Text
-> Maybe DeploymentStatus
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeploymentResponse
GetDeploymentResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"autoDeployed")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"createdDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentStatusMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetDeployment where
hashWithSalt :: Int -> GetDeployment -> Int
hashWithSalt Int
_salt GetDeployment' {Text
deploymentId :: Text
apiId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:apiId:GetDeployment' :: GetDeployment -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
apiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deploymentId
instance Prelude.NFData GetDeployment where
rnf :: GetDeployment -> ()
rnf GetDeployment' {Text
deploymentId :: Text
apiId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:apiId:GetDeployment' :: GetDeployment -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
apiId
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
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetDeployment where
toPath :: GetDeployment -> ByteString
toPath GetDeployment' {Text
deploymentId :: Text
apiId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
$sel:apiId:GetDeployment' :: GetDeployment -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/apis/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
apiId,
ByteString
"/deployments/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
deploymentId
]
instance Data.ToQuery GetDeployment where
toQuery :: GetDeployment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetDeploymentResponse = GetDeploymentResponse'
{
GetDeploymentResponse -> Maybe Bool
autoDeployed :: Prelude.Maybe Prelude.Bool,
GetDeploymentResponse -> Maybe ISO8601
createdDate :: Prelude.Maybe Data.ISO8601,
GetDeploymentResponse -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
GetDeploymentResponse -> Maybe DeploymentStatus
deploymentStatus :: Prelude.Maybe DeploymentStatus,
GetDeploymentResponse -> Maybe Text
deploymentStatusMessage :: Prelude.Maybe Prelude.Text,
GetDeploymentResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
GetDeploymentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDeploymentResponse -> GetDeploymentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
$c/= :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
== :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
$c== :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
Prelude.Eq, ReadPrec [GetDeploymentResponse]
ReadPrec GetDeploymentResponse
Int -> ReadS GetDeploymentResponse
ReadS [GetDeploymentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeploymentResponse]
$creadListPrec :: ReadPrec [GetDeploymentResponse]
readPrec :: ReadPrec GetDeploymentResponse
$creadPrec :: ReadPrec GetDeploymentResponse
readList :: ReadS [GetDeploymentResponse]
$creadList :: ReadS [GetDeploymentResponse]
readsPrec :: Int -> ReadS GetDeploymentResponse
$creadsPrec :: Int -> ReadS GetDeploymentResponse
Prelude.Read, Int -> GetDeploymentResponse -> ShowS
[GetDeploymentResponse] -> ShowS
GetDeploymentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeploymentResponse] -> ShowS
$cshowList :: [GetDeploymentResponse] -> ShowS
show :: GetDeploymentResponse -> String
$cshow :: GetDeploymentResponse -> String
showsPrec :: Int -> GetDeploymentResponse -> ShowS
$cshowsPrec :: Int -> GetDeploymentResponse -> ShowS
Prelude.Show, forall x. Rep GetDeploymentResponse x -> GetDeploymentResponse
forall x. GetDeploymentResponse -> Rep GetDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeploymentResponse x -> GetDeploymentResponse
$cfrom :: forall x. GetDeploymentResponse -> Rep GetDeploymentResponse x
Prelude.Generic)
newGetDeploymentResponse ::
Prelude.Int ->
GetDeploymentResponse
newGetDeploymentResponse :: Int -> GetDeploymentResponse
newGetDeploymentResponse Int
pHttpStatus_ =
GetDeploymentResponse'
{ $sel:autoDeployed:GetDeploymentResponse' :: Maybe Bool
autoDeployed =
forall a. Maybe a
Prelude.Nothing,
$sel:createdDate:GetDeploymentResponse' :: Maybe ISO8601
createdDate = forall a. Maybe a
Prelude.Nothing,
$sel:deploymentId:GetDeploymentResponse' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
$sel:deploymentStatus:GetDeploymentResponse' :: Maybe DeploymentStatus
deploymentStatus = forall a. Maybe a
Prelude.Nothing,
$sel:deploymentStatusMessage:GetDeploymentResponse' :: Maybe Text
deploymentStatusMessage = forall a. Maybe a
Prelude.Nothing,
$sel:description:GetDeploymentResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDeploymentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDeploymentResponse_autoDeployed :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Bool)
getDeploymentResponse_autoDeployed :: Lens' GetDeploymentResponse (Maybe Bool)
getDeploymentResponse_autoDeployed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Bool
autoDeployed :: Maybe Bool
$sel:autoDeployed:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Bool
autoDeployed} -> Maybe Bool
autoDeployed) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Bool
a -> GetDeploymentResponse
s {$sel:autoDeployed:GetDeploymentResponse' :: Maybe Bool
autoDeployed = Maybe Bool
a} :: GetDeploymentResponse)
getDeploymentResponse_createdDate :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.UTCTime)
getDeploymentResponse_createdDate :: Lens' GetDeploymentResponse (Maybe UTCTime)
getDeploymentResponse_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe ISO8601
createdDate :: Maybe ISO8601
$sel:createdDate:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe ISO8601
createdDate} -> Maybe ISO8601
createdDate) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe ISO8601
a -> GetDeploymentResponse
s {$sel:createdDate:GetDeploymentResponse' :: Maybe ISO8601
createdDate = Maybe ISO8601
a} :: GetDeploymentResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
getDeploymentResponse_deploymentId :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_deploymentId :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:deploymentId:GetDeploymentResponse' :: Maybe Text
deploymentId = Maybe Text
a} :: GetDeploymentResponse)
getDeploymentResponse_deploymentStatus :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe DeploymentStatus)
getDeploymentResponse_deploymentStatus :: Lens' GetDeploymentResponse (Maybe DeploymentStatus)
getDeploymentResponse_deploymentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe DeploymentStatus
deploymentStatus :: Maybe DeploymentStatus
$sel:deploymentStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentStatus
deploymentStatus} -> Maybe DeploymentStatus
deploymentStatus) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe DeploymentStatus
a -> GetDeploymentResponse
s {$sel:deploymentStatus:GetDeploymentResponse' :: Maybe DeploymentStatus
deploymentStatus = Maybe DeploymentStatus
a} :: GetDeploymentResponse)
getDeploymentResponse_deploymentStatusMessage :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_deploymentStatusMessage :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_deploymentStatusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
deploymentStatusMessage :: Maybe Text
$sel:deploymentStatusMessage:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
deploymentStatusMessage} -> Maybe Text
deploymentStatusMessage) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:deploymentStatusMessage:GetDeploymentResponse' :: Maybe Text
deploymentStatusMessage = Maybe Text
a} :: GetDeploymentResponse)
getDeploymentResponse_description :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_description :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
description :: Maybe Text
$sel:description:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:description:GetDeploymentResponse' :: Maybe Text
description = Maybe Text
a} :: GetDeploymentResponse)
getDeploymentResponse_httpStatus :: Lens.Lens' GetDeploymentResponse Prelude.Int
getDeploymentResponse_httpStatus :: Lens' GetDeploymentResponse Int
getDeploymentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Int
a -> GetDeploymentResponse
s {$sel:httpStatus:GetDeploymentResponse' :: Int
httpStatus = Int
a} :: GetDeploymentResponse)
instance Prelude.NFData GetDeploymentResponse where
rnf :: GetDeploymentResponse -> ()
rnf GetDeploymentResponse' {Int
Maybe Bool
Maybe Text
Maybe ISO8601
Maybe DeploymentStatus
httpStatus :: Int
description :: Maybe Text
deploymentStatusMessage :: Maybe Text
deploymentStatus :: Maybe DeploymentStatus
deploymentId :: Maybe Text
createdDate :: Maybe ISO8601
autoDeployed :: Maybe Bool
$sel:httpStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Int
$sel:description:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:deploymentStatusMessage:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:deploymentStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentStatus
$sel:deploymentId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:createdDate:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe ISO8601
$sel:autoDeployed:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoDeployed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentStatus
deploymentStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentStatusMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus