{-# 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.CodeDeploy.Types.CloudFormationTarget where
import Amazonka.CodeDeploy.Types.LifecycleEvent
import Amazonka.CodeDeploy.Types.TargetStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CloudFormationTarget = CloudFormationTarget'
{
CloudFormationTarget -> Maybe Text
targetId :: Prelude.Maybe Prelude.Text,
CloudFormationTarget -> Maybe TargetStatus
status :: Prelude.Maybe TargetStatus,
CloudFormationTarget -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
CloudFormationTarget -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
CloudFormationTarget -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
CloudFormationTarget -> Maybe [LifecycleEvent]
lifecycleEvents :: Prelude.Maybe [LifecycleEvent],
CloudFormationTarget -> Maybe Double
targetVersionWeight :: Prelude.Maybe Prelude.Double
}
deriving (CloudFormationTarget -> CloudFormationTarget -> Bool
(CloudFormationTarget -> CloudFormationTarget -> Bool)
-> (CloudFormationTarget -> CloudFormationTarget -> Bool)
-> Eq CloudFormationTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudFormationTarget -> CloudFormationTarget -> Bool
$c/= :: CloudFormationTarget -> CloudFormationTarget -> Bool
== :: CloudFormationTarget -> CloudFormationTarget -> Bool
$c== :: CloudFormationTarget -> CloudFormationTarget -> Bool
Prelude.Eq, ReadPrec [CloudFormationTarget]
ReadPrec CloudFormationTarget
Int -> ReadS CloudFormationTarget
ReadS [CloudFormationTarget]
(Int -> ReadS CloudFormationTarget)
-> ReadS [CloudFormationTarget]
-> ReadPrec CloudFormationTarget
-> ReadPrec [CloudFormationTarget]
-> Read CloudFormationTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudFormationTarget]
$creadListPrec :: ReadPrec [CloudFormationTarget]
readPrec :: ReadPrec CloudFormationTarget
$creadPrec :: ReadPrec CloudFormationTarget
readList :: ReadS [CloudFormationTarget]
$creadList :: ReadS [CloudFormationTarget]
readsPrec :: Int -> ReadS CloudFormationTarget
$creadsPrec :: Int -> ReadS CloudFormationTarget
Prelude.Read, Int -> CloudFormationTarget -> ShowS
[CloudFormationTarget] -> ShowS
CloudFormationTarget -> String
(Int -> CloudFormationTarget -> ShowS)
-> (CloudFormationTarget -> String)
-> ([CloudFormationTarget] -> ShowS)
-> Show CloudFormationTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudFormationTarget] -> ShowS
$cshowList :: [CloudFormationTarget] -> ShowS
show :: CloudFormationTarget -> String
$cshow :: CloudFormationTarget -> String
showsPrec :: Int -> CloudFormationTarget -> ShowS
$cshowsPrec :: Int -> CloudFormationTarget -> ShowS
Prelude.Show, (forall x. CloudFormationTarget -> Rep CloudFormationTarget x)
-> (forall x. Rep CloudFormationTarget x -> CloudFormationTarget)
-> Generic CloudFormationTarget
forall x. Rep CloudFormationTarget x -> CloudFormationTarget
forall x. CloudFormationTarget -> Rep CloudFormationTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudFormationTarget x -> CloudFormationTarget
$cfrom :: forall x. CloudFormationTarget -> Rep CloudFormationTarget x
Prelude.Generic)
newCloudFormationTarget ::
CloudFormationTarget
newCloudFormationTarget :: CloudFormationTarget
newCloudFormationTarget =
CloudFormationTarget' :: Maybe Text
-> Maybe TargetStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget
CloudFormationTarget'
{ $sel:targetId:CloudFormationTarget' :: Maybe Text
targetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:CloudFormationTarget' :: Maybe TargetStatus
status = Maybe TargetStatus
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentId:CloudFormationTarget' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:CloudFormationTarget' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedAt:CloudFormationTarget' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lifecycleEvents:CloudFormationTarget' :: Maybe [LifecycleEvent]
lifecycleEvents = Maybe [LifecycleEvent]
forall a. Maybe a
Prelude.Nothing,
$sel:targetVersionWeight:CloudFormationTarget' :: Maybe Double
targetVersionWeight = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
cloudFormationTarget_targetId :: Lens.Lens' CloudFormationTarget (Prelude.Maybe Prelude.Text)
cloudFormationTarget_targetId :: (Maybe Text -> f (Maybe Text))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_targetId = (CloudFormationTarget -> Maybe Text)
-> (CloudFormationTarget -> Maybe Text -> CloudFormationTarget)
-> Lens
CloudFormationTarget CloudFormationTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe Text
targetId :: Maybe Text
$sel:targetId:CloudFormationTarget' :: CloudFormationTarget -> Maybe Text
targetId} -> Maybe Text
targetId) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe Text
a -> CloudFormationTarget
s {$sel:targetId:CloudFormationTarget' :: Maybe Text
targetId = Maybe Text
a} :: CloudFormationTarget)
cloudFormationTarget_status :: Lens.Lens' CloudFormationTarget (Prelude.Maybe TargetStatus)
cloudFormationTarget_status :: (Maybe TargetStatus -> f (Maybe TargetStatus))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_status = (CloudFormationTarget -> Maybe TargetStatus)
-> (CloudFormationTarget
-> Maybe TargetStatus -> CloudFormationTarget)
-> Lens
CloudFormationTarget
CloudFormationTarget
(Maybe TargetStatus)
(Maybe TargetStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe TargetStatus
status :: Maybe TargetStatus
$sel:status:CloudFormationTarget' :: CloudFormationTarget -> Maybe TargetStatus
status} -> Maybe TargetStatus
status) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe TargetStatus
a -> CloudFormationTarget
s {$sel:status:CloudFormationTarget' :: Maybe TargetStatus
status = Maybe TargetStatus
a} :: CloudFormationTarget)
cloudFormationTarget_deploymentId :: Lens.Lens' CloudFormationTarget (Prelude.Maybe Prelude.Text)
cloudFormationTarget_deploymentId :: (Maybe Text -> f (Maybe Text))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_deploymentId = (CloudFormationTarget -> Maybe Text)
-> (CloudFormationTarget -> Maybe Text -> CloudFormationTarget)
-> Lens
CloudFormationTarget CloudFormationTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CloudFormationTarget' :: CloudFormationTarget -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe Text
a -> CloudFormationTarget
s {$sel:deploymentId:CloudFormationTarget' :: Maybe Text
deploymentId = Maybe Text
a} :: CloudFormationTarget)
cloudFormationTarget_resourceType :: Lens.Lens' CloudFormationTarget (Prelude.Maybe Prelude.Text)
cloudFormationTarget_resourceType :: (Maybe Text -> f (Maybe Text))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_resourceType = (CloudFormationTarget -> Maybe Text)
-> (CloudFormationTarget -> Maybe Text -> CloudFormationTarget)
-> Lens
CloudFormationTarget CloudFormationTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:CloudFormationTarget' :: CloudFormationTarget -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe Text
a -> CloudFormationTarget
s {$sel:resourceType:CloudFormationTarget' :: Maybe Text
resourceType = Maybe Text
a} :: CloudFormationTarget)
cloudFormationTarget_lastUpdatedAt :: Lens.Lens' CloudFormationTarget (Prelude.Maybe Prelude.UTCTime)
cloudFormationTarget_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_lastUpdatedAt = (CloudFormationTarget -> Maybe POSIX)
-> (CloudFormationTarget -> Maybe POSIX -> CloudFormationTarget)
-> Lens
CloudFormationTarget
CloudFormationTarget
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:CloudFormationTarget' :: CloudFormationTarget -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe POSIX
a -> CloudFormationTarget
s {$sel:lastUpdatedAt:CloudFormationTarget' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: CloudFormationTarget) ((Maybe POSIX -> f (Maybe POSIX))
-> CloudFormationTarget -> f CloudFormationTarget)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CloudFormationTarget
-> f CloudFormationTarget
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
cloudFormationTarget_lifecycleEvents :: Lens.Lens' CloudFormationTarget (Prelude.Maybe [LifecycleEvent])
cloudFormationTarget_lifecycleEvents :: (Maybe [LifecycleEvent] -> f (Maybe [LifecycleEvent]))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_lifecycleEvents = (CloudFormationTarget -> Maybe [LifecycleEvent])
-> (CloudFormationTarget
-> Maybe [LifecycleEvent] -> CloudFormationTarget)
-> Lens
CloudFormationTarget
CloudFormationTarget
(Maybe [LifecycleEvent])
(Maybe [LifecycleEvent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe [LifecycleEvent]
lifecycleEvents :: Maybe [LifecycleEvent]
$sel:lifecycleEvents:CloudFormationTarget' :: CloudFormationTarget -> Maybe [LifecycleEvent]
lifecycleEvents} -> Maybe [LifecycleEvent]
lifecycleEvents) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe [LifecycleEvent]
a -> CloudFormationTarget
s {$sel:lifecycleEvents:CloudFormationTarget' :: Maybe [LifecycleEvent]
lifecycleEvents = Maybe [LifecycleEvent]
a} :: CloudFormationTarget) ((Maybe [LifecycleEvent] -> f (Maybe [LifecycleEvent]))
-> CloudFormationTarget -> f CloudFormationTarget)
-> ((Maybe [LifecycleEvent] -> f (Maybe [LifecycleEvent]))
-> Maybe [LifecycleEvent] -> f (Maybe [LifecycleEvent]))
-> (Maybe [LifecycleEvent] -> f (Maybe [LifecycleEvent]))
-> CloudFormationTarget
-> f CloudFormationTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LifecycleEvent] [LifecycleEvent] [LifecycleEvent] [LifecycleEvent]
-> Iso
(Maybe [LifecycleEvent])
(Maybe [LifecycleEvent])
(Maybe [LifecycleEvent])
(Maybe [LifecycleEvent])
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
[LifecycleEvent] [LifecycleEvent] [LifecycleEvent] [LifecycleEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
cloudFormationTarget_targetVersionWeight :: Lens.Lens' CloudFormationTarget (Prelude.Maybe Prelude.Double)
cloudFormationTarget_targetVersionWeight :: (Maybe Double -> f (Maybe Double))
-> CloudFormationTarget -> f CloudFormationTarget
cloudFormationTarget_targetVersionWeight = (CloudFormationTarget -> Maybe Double)
-> (CloudFormationTarget -> Maybe Double -> CloudFormationTarget)
-> Lens
CloudFormationTarget
CloudFormationTarget
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationTarget' {Maybe Double
targetVersionWeight :: Maybe Double
$sel:targetVersionWeight:CloudFormationTarget' :: CloudFormationTarget -> Maybe Double
targetVersionWeight} -> Maybe Double
targetVersionWeight) (\s :: CloudFormationTarget
s@CloudFormationTarget' {} Maybe Double
a -> CloudFormationTarget
s {$sel:targetVersionWeight:CloudFormationTarget' :: Maybe Double
targetVersionWeight = Maybe Double
a} :: CloudFormationTarget)
instance Core.FromJSON CloudFormationTarget where
parseJSON :: Value -> Parser CloudFormationTarget
parseJSON =
String
-> (Object -> Parser CloudFormationTarget)
-> Value
-> Parser CloudFormationTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CloudFormationTarget"
( \Object
x ->
Maybe Text
-> Maybe TargetStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget
CloudFormationTarget'
(Maybe Text
-> Maybe TargetStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe TargetStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
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
"targetId")
Parser
(Maybe TargetStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
-> Parser (Maybe TargetStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TargetStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
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
"deploymentId")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe [LifecycleEvent]
-> Maybe Double
-> CloudFormationTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe [LifecycleEvent] -> Maybe Double -> CloudFormationTarget)
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
"resourceType")
Parser
(Maybe POSIX
-> Maybe [LifecycleEvent] -> Maybe Double -> CloudFormationTarget)
-> Parser (Maybe POSIX)
-> Parser
(Maybe [LifecycleEvent] -> Maybe Double -> CloudFormationTarget)
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
"lastUpdatedAt")
Parser
(Maybe [LifecycleEvent] -> Maybe Double -> CloudFormationTarget)
-> Parser (Maybe [LifecycleEvent])
-> Parser (Maybe Double -> CloudFormationTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [LifecycleEvent]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lifecycleEvents"
Parser (Maybe (Maybe [LifecycleEvent]))
-> Maybe [LifecycleEvent] -> Parser (Maybe [LifecycleEvent])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LifecycleEvent]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Double -> CloudFormationTarget)
-> Parser (Maybe Double) -> Parser CloudFormationTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetVersionWeight")
)
instance Prelude.Hashable CloudFormationTarget
instance Prelude.NFData CloudFormationTarget