{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ApiGatewayV2.Types.Deployment where
import Amazonka.ApiGatewayV2.Types.DeploymentStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Deployment = Deployment'
{
Deployment -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
Deployment -> Maybe Bool
autoDeployed :: Prelude.Maybe Prelude.Bool,
Deployment -> Maybe Text
deploymentStatusMessage :: Prelude.Maybe Prelude.Text,
Deployment -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
Deployment -> Maybe DeploymentStatus
deploymentStatus :: Prelude.Maybe DeploymentStatus,
Deployment -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (Deployment -> Deployment -> Bool
(Deployment -> Deployment -> Bool)
-> (Deployment -> Deployment -> Bool) -> Eq Deployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Deployment -> Deployment -> Bool
$c/= :: Deployment -> Deployment -> Bool
== :: Deployment -> Deployment -> Bool
$c== :: Deployment -> Deployment -> Bool
Prelude.Eq, ReadPrec [Deployment]
ReadPrec Deployment
Int -> ReadS Deployment
ReadS [Deployment]
(Int -> ReadS Deployment)
-> ReadS [Deployment]
-> ReadPrec Deployment
-> ReadPrec [Deployment]
-> Read Deployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Deployment]
$creadListPrec :: ReadPrec [Deployment]
readPrec :: ReadPrec Deployment
$creadPrec :: ReadPrec Deployment
readList :: ReadS [Deployment]
$creadList :: ReadS [Deployment]
readsPrec :: Int -> ReadS Deployment
$creadsPrec :: Int -> ReadS Deployment
Prelude.Read, Int -> Deployment -> ShowS
[Deployment] -> ShowS
Deployment -> String
(Int -> Deployment -> ShowS)
-> (Deployment -> String)
-> ([Deployment] -> ShowS)
-> Show Deployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Deployment] -> ShowS
$cshowList :: [Deployment] -> ShowS
show :: Deployment -> String
$cshow :: Deployment -> String
showsPrec :: Int -> Deployment -> ShowS
$cshowsPrec :: Int -> Deployment -> ShowS
Prelude.Show, (forall x. Deployment -> Rep Deployment x)
-> (forall x. Rep Deployment x -> Deployment) -> Generic Deployment
forall x. Rep Deployment x -> Deployment
forall x. Deployment -> Rep Deployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Deployment x -> Deployment
$cfrom :: forall x. Deployment -> Rep Deployment x
Prelude.Generic)
newDeployment ::
Deployment
newDeployment :: Deployment
newDeployment =
Deployment' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment
Deployment'
{ $sel:deploymentId:Deployment' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoDeployed:Deployment' :: Maybe Bool
autoDeployed = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentStatusMessage:Deployment' :: Maybe Text
deploymentStatusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdDate:Deployment' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentStatus:Deployment' :: Maybe DeploymentStatus
deploymentStatus = Maybe DeploymentStatus
forall a. Maybe a
Prelude.Nothing,
$sel:description:Deployment' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deployment_deploymentId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_deploymentId :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_deploymentId = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:Deployment' :: Deployment -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:deploymentId:Deployment' :: Maybe Text
deploymentId = Maybe Text
a} :: Deployment)
deployment_autoDeployed :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Bool)
deployment_autoDeployed :: (Maybe Bool -> f (Maybe Bool)) -> Deployment -> f Deployment
deployment_autoDeployed = (Deployment -> Maybe Bool)
-> (Deployment -> Maybe Bool -> Deployment)
-> Lens Deployment Deployment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Bool
autoDeployed :: Maybe Bool
$sel:autoDeployed:Deployment' :: Deployment -> Maybe Bool
autoDeployed} -> Maybe Bool
autoDeployed) (\s :: Deployment
s@Deployment' {} Maybe Bool
a -> Deployment
s {$sel:autoDeployed:Deployment' :: Maybe Bool
autoDeployed = Maybe Bool
a} :: Deployment)
deployment_deploymentStatusMessage :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_deploymentStatusMessage :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_deploymentStatusMessage = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
deploymentStatusMessage :: Maybe Text
$sel:deploymentStatusMessage:Deployment' :: Deployment -> Maybe Text
deploymentStatusMessage} -> Maybe Text
deploymentStatusMessage) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:deploymentStatusMessage:Deployment' :: Maybe Text
deploymentStatusMessage = Maybe Text
a} :: Deployment)
deployment_createdDate :: Lens.Lens' Deployment (Prelude.Maybe Prelude.UTCTime)
deployment_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Deployment -> f Deployment
deployment_createdDate = (Deployment -> Maybe POSIX)
-> (Deployment -> Maybe POSIX -> Deployment)
-> Lens Deployment Deployment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:Deployment' :: Deployment -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: Deployment
s@Deployment' {} Maybe POSIX
a -> Deployment
s {$sel:createdDate:Deployment' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: Deployment) ((Maybe POSIX -> f (Maybe POSIX)) -> Deployment -> f Deployment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Deployment
-> f Deployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
deployment_deploymentStatus :: Lens.Lens' Deployment (Prelude.Maybe DeploymentStatus)
deployment_deploymentStatus :: (Maybe DeploymentStatus -> f (Maybe DeploymentStatus))
-> Deployment -> f Deployment
deployment_deploymentStatus = (Deployment -> Maybe DeploymentStatus)
-> (Deployment -> Maybe DeploymentStatus -> Deployment)
-> Lens
Deployment
Deployment
(Maybe DeploymentStatus)
(Maybe DeploymentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe DeploymentStatus
deploymentStatus :: Maybe DeploymentStatus
$sel:deploymentStatus:Deployment' :: Deployment -> Maybe DeploymentStatus
deploymentStatus} -> Maybe DeploymentStatus
deploymentStatus) (\s :: Deployment
s@Deployment' {} Maybe DeploymentStatus
a -> Deployment
s {$sel:deploymentStatus:Deployment' :: Maybe DeploymentStatus
deploymentStatus = Maybe DeploymentStatus
a} :: Deployment)
deployment_description :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_description :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_description = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
description :: Maybe Text
$sel:description:Deployment' :: Deployment -> Maybe Text
description} -> Maybe Text
description) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:description:Deployment' :: Maybe Text
description = Maybe Text
a} :: Deployment)
instance Core.FromJSON Deployment where
parseJSON :: Value -> Parser Deployment
parseJSON =
String
-> (Object -> Parser Deployment) -> Value -> Parser Deployment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Deployment"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment
Deployment'
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deploymentId")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"autoDeployed")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe DeploymentStatus
-> Maybe Text
-> Deployment)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX -> Maybe DeploymentStatus -> Maybe Text -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deploymentStatusMessage")
Parser
(Maybe POSIX -> Maybe DeploymentStatus -> Maybe Text -> Deployment)
-> Parser (Maybe POSIX)
-> Parser (Maybe DeploymentStatus -> Maybe Text -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
Parser (Maybe DeploymentStatus -> Maybe Text -> Deployment)
-> Parser (Maybe DeploymentStatus)
-> Parser (Maybe Text -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeploymentStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deploymentStatus")
Parser (Maybe Text -> Deployment)
-> Parser (Maybe Text) -> Parser Deployment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
)
instance Prelude.Hashable Deployment
instance Prelude.NFData Deployment