{-# 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.CloudFormation.Types.StackResource where
import Amazonka.CloudFormation.Types.ModuleInfo
import Amazonka.CloudFormation.Types.ResourceStatus
import Amazonka.CloudFormation.Types.StackResourceDriftInformation
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StackResource = StackResource'
{
StackResource -> Maybe Text
physicalResourceId :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe Text
resourceStatusReason :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe StackResourceDriftInformation
driftInformation :: Prelude.Maybe StackResourceDriftInformation,
StackResource -> Maybe ModuleInfo
moduleInfo :: Prelude.Maybe ModuleInfo,
StackResource -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text,
StackResource -> Text
logicalResourceId :: Prelude.Text,
StackResource -> Text
resourceType :: Prelude.Text,
StackResource -> ISO8601
timestamp :: Core.ISO8601,
StackResource -> ResourceStatus
resourceStatus :: ResourceStatus
}
deriving (StackResource -> StackResource -> Bool
(StackResource -> StackResource -> Bool)
-> (StackResource -> StackResource -> Bool) -> Eq StackResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackResource -> StackResource -> Bool
$c/= :: StackResource -> StackResource -> Bool
== :: StackResource -> StackResource -> Bool
$c== :: StackResource -> StackResource -> Bool
Prelude.Eq, ReadPrec [StackResource]
ReadPrec StackResource
Int -> ReadS StackResource
ReadS [StackResource]
(Int -> ReadS StackResource)
-> ReadS [StackResource]
-> ReadPrec StackResource
-> ReadPrec [StackResource]
-> Read StackResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackResource]
$creadListPrec :: ReadPrec [StackResource]
readPrec :: ReadPrec StackResource
$creadPrec :: ReadPrec StackResource
readList :: ReadS [StackResource]
$creadList :: ReadS [StackResource]
readsPrec :: Int -> ReadS StackResource
$creadsPrec :: Int -> ReadS StackResource
Prelude.Read, Int -> StackResource -> ShowS
[StackResource] -> ShowS
StackResource -> String
(Int -> StackResource -> ShowS)
-> (StackResource -> String)
-> ([StackResource] -> ShowS)
-> Show StackResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackResource] -> ShowS
$cshowList :: [StackResource] -> ShowS
show :: StackResource -> String
$cshow :: StackResource -> String
showsPrec :: Int -> StackResource -> ShowS
$cshowsPrec :: Int -> StackResource -> ShowS
Prelude.Show, (forall x. StackResource -> Rep StackResource x)
-> (forall x. Rep StackResource x -> StackResource)
-> Generic StackResource
forall x. Rep StackResource x -> StackResource
forall x. StackResource -> Rep StackResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackResource x -> StackResource
$cfrom :: forall x. StackResource -> Rep StackResource x
Prelude.Generic)
newStackResource ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
ResourceStatus ->
StackResource
newStackResource :: Text -> Text -> UTCTime -> ResourceStatus -> StackResource
newStackResource
Text
pLogicalResourceId_
Text
pResourceType_
UTCTime
pTimestamp_
ResourceStatus
pResourceStatus_ =
StackResource' :: Maybe Text
-> Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource
StackResource'
{ $sel:physicalResourceId:StackResource' :: Maybe Text
physicalResourceId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceStatusReason:StackResource' :: Maybe Text
resourceStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:driftInformation:StackResource' :: Maybe StackResourceDriftInformation
driftInformation = Maybe StackResourceDriftInformation
forall a. Maybe a
Prelude.Nothing,
$sel:moduleInfo:StackResource' :: Maybe ModuleInfo
moduleInfo = Maybe ModuleInfo
forall a. Maybe a
Prelude.Nothing,
$sel:stackId:StackResource' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:StackResource' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:StackResource' :: Maybe Text
stackName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logicalResourceId:StackResource' :: Text
logicalResourceId = Text
pLogicalResourceId_,
$sel:resourceType:StackResource' :: Text
resourceType = Text
pResourceType_,
$sel:timestamp:StackResource' :: ISO8601
timestamp = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pTimestamp_,
$sel:resourceStatus:StackResource' :: ResourceStatus
resourceStatus = ResourceStatus
pResourceStatus_
}
stackResource_physicalResourceId :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_physicalResourceId :: (Maybe Text -> f (Maybe Text)) -> StackResource -> f StackResource
stackResource_physicalResourceId = (StackResource -> Maybe Text)
-> (StackResource -> Maybe Text -> StackResource)
-> Lens StackResource StackResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe Text
physicalResourceId :: Maybe Text
$sel:physicalResourceId:StackResource' :: StackResource -> Maybe Text
physicalResourceId} -> Maybe Text
physicalResourceId) (\s :: StackResource
s@StackResource' {} Maybe Text
a -> StackResource
s {$sel:physicalResourceId:StackResource' :: Maybe Text
physicalResourceId = Maybe Text
a} :: StackResource)
stackResource_resourceStatusReason :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_resourceStatusReason :: (Maybe Text -> f (Maybe Text)) -> StackResource -> f StackResource
stackResource_resourceStatusReason = (StackResource -> Maybe Text)
-> (StackResource -> Maybe Text -> StackResource)
-> Lens StackResource StackResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe Text
resourceStatusReason :: Maybe Text
$sel:resourceStatusReason:StackResource' :: StackResource -> Maybe Text
resourceStatusReason} -> Maybe Text
resourceStatusReason) (\s :: StackResource
s@StackResource' {} Maybe Text
a -> StackResource
s {$sel:resourceStatusReason:StackResource' :: Maybe Text
resourceStatusReason = Maybe Text
a} :: StackResource)
stackResource_driftInformation :: Lens.Lens' StackResource (Prelude.Maybe StackResourceDriftInformation)
stackResource_driftInformation :: (Maybe StackResourceDriftInformation
-> f (Maybe StackResourceDriftInformation))
-> StackResource -> f StackResource
stackResource_driftInformation = (StackResource -> Maybe StackResourceDriftInformation)
-> (StackResource
-> Maybe StackResourceDriftInformation -> StackResource)
-> Lens
StackResource
StackResource
(Maybe StackResourceDriftInformation)
(Maybe StackResourceDriftInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe StackResourceDriftInformation
driftInformation :: Maybe StackResourceDriftInformation
$sel:driftInformation:StackResource' :: StackResource -> Maybe StackResourceDriftInformation
driftInformation} -> Maybe StackResourceDriftInformation
driftInformation) (\s :: StackResource
s@StackResource' {} Maybe StackResourceDriftInformation
a -> StackResource
s {$sel:driftInformation:StackResource' :: Maybe StackResourceDriftInformation
driftInformation = Maybe StackResourceDriftInformation
a} :: StackResource)
stackResource_moduleInfo :: Lens.Lens' StackResource (Prelude.Maybe ModuleInfo)
stackResource_moduleInfo :: (Maybe ModuleInfo -> f (Maybe ModuleInfo))
-> StackResource -> f StackResource
stackResource_moduleInfo = (StackResource -> Maybe ModuleInfo)
-> (StackResource -> Maybe ModuleInfo -> StackResource)
-> Lens
StackResource StackResource (Maybe ModuleInfo) (Maybe ModuleInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe ModuleInfo
moduleInfo :: Maybe ModuleInfo
$sel:moduleInfo:StackResource' :: StackResource -> Maybe ModuleInfo
moduleInfo} -> Maybe ModuleInfo
moduleInfo) (\s :: StackResource
s@StackResource' {} Maybe ModuleInfo
a -> StackResource
s {$sel:moduleInfo:StackResource' :: Maybe ModuleInfo
moduleInfo = Maybe ModuleInfo
a} :: StackResource)
stackResource_stackId :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_stackId :: (Maybe Text -> f (Maybe Text)) -> StackResource -> f StackResource
stackResource_stackId = (StackResource -> Maybe Text)
-> (StackResource -> Maybe Text -> StackResource)
-> Lens StackResource StackResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe Text
stackId :: Maybe Text
$sel:stackId:StackResource' :: StackResource -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: StackResource
s@StackResource' {} Maybe Text
a -> StackResource
s {$sel:stackId:StackResource' :: Maybe Text
stackId = Maybe Text
a} :: StackResource)
stackResource_description :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_description :: (Maybe Text -> f (Maybe Text)) -> StackResource -> f StackResource
stackResource_description = (StackResource -> Maybe Text)
-> (StackResource -> Maybe Text -> StackResource)
-> Lens StackResource StackResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe Text
description :: Maybe Text
$sel:description:StackResource' :: StackResource -> Maybe Text
description} -> Maybe Text
description) (\s :: StackResource
s@StackResource' {} Maybe Text
a -> StackResource
s {$sel:description:StackResource' :: Maybe Text
description = Maybe Text
a} :: StackResource)
stackResource_stackName :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_stackName :: (Maybe Text -> f (Maybe Text)) -> StackResource -> f StackResource
stackResource_stackName = (StackResource -> Maybe Text)
-> (StackResource -> Maybe Text -> StackResource)
-> Lens StackResource StackResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Maybe Text
stackName :: Maybe Text
$sel:stackName:StackResource' :: StackResource -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: StackResource
s@StackResource' {} Maybe Text
a -> StackResource
s {$sel:stackName:StackResource' :: Maybe Text
stackName = Maybe Text
a} :: StackResource)
stackResource_logicalResourceId :: Lens.Lens' StackResource Prelude.Text
stackResource_logicalResourceId :: (Text -> f Text) -> StackResource -> f StackResource
stackResource_logicalResourceId = (StackResource -> Text)
-> (StackResource -> Text -> StackResource)
-> Lens StackResource StackResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Text
logicalResourceId :: Text
$sel:logicalResourceId:StackResource' :: StackResource -> Text
logicalResourceId} -> Text
logicalResourceId) (\s :: StackResource
s@StackResource' {} Text
a -> StackResource
s {$sel:logicalResourceId:StackResource' :: Text
logicalResourceId = Text
a} :: StackResource)
stackResource_resourceType :: Lens.Lens' StackResource Prelude.Text
stackResource_resourceType :: (Text -> f Text) -> StackResource -> f StackResource
stackResource_resourceType = (StackResource -> Text)
-> (StackResource -> Text -> StackResource)
-> Lens StackResource StackResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {Text
resourceType :: Text
$sel:resourceType:StackResource' :: StackResource -> Text
resourceType} -> Text
resourceType) (\s :: StackResource
s@StackResource' {} Text
a -> StackResource
s {$sel:resourceType:StackResource' :: Text
resourceType = Text
a} :: StackResource)
stackResource_timestamp :: Lens.Lens' StackResource Prelude.UTCTime
stackResource_timestamp :: (UTCTime -> f UTCTime) -> StackResource -> f StackResource
stackResource_timestamp = (StackResource -> ISO8601)
-> (StackResource -> ISO8601 -> StackResource)
-> Lens StackResource StackResource ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {ISO8601
timestamp :: ISO8601
$sel:timestamp:StackResource' :: StackResource -> ISO8601
timestamp} -> ISO8601
timestamp) (\s :: StackResource
s@StackResource' {} ISO8601
a -> StackResource
s {$sel:timestamp:StackResource' :: ISO8601
timestamp = ISO8601
a} :: StackResource) ((ISO8601 -> f ISO8601) -> StackResource -> f StackResource)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> StackResource
-> f StackResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
stackResource_resourceStatus :: Lens.Lens' StackResource ResourceStatus
stackResource_resourceStatus :: (ResourceStatus -> f ResourceStatus)
-> StackResource -> f StackResource
stackResource_resourceStatus = (StackResource -> ResourceStatus)
-> (StackResource -> ResourceStatus -> StackResource)
-> Lens StackResource StackResource ResourceStatus ResourceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackResource' {ResourceStatus
resourceStatus :: ResourceStatus
$sel:resourceStatus:StackResource' :: StackResource -> ResourceStatus
resourceStatus} -> ResourceStatus
resourceStatus) (\s :: StackResource
s@StackResource' {} ResourceStatus
a -> StackResource
s {$sel:resourceStatus:StackResource' :: ResourceStatus
resourceStatus = ResourceStatus
a} :: StackResource)
instance Core.FromXML StackResource where
parseXML :: [Node] -> Either String StackResource
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource
StackResource'
(Maybe Text
-> Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PhysicalResourceId")
Either
String
(Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe Text)
-> Either
String
(Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourceStatusReason")
Either
String
(Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe StackResourceDriftInformation)
-> Either
String
(Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe StackResourceDriftInformation)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftInformation")
Either
String
(Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe ModuleInfo)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ModuleInfo)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ModuleInfo")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackId")
Either
String
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Text -> Text -> ISO8601 -> ResourceStatus -> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Description")
Either
String
(Maybe Text
-> Text -> Text -> ISO8601 -> ResourceStatus -> StackResource)
-> Either String (Maybe Text)
-> Either
String (Text -> Text -> ISO8601 -> ResourceStatus -> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackName")
Either
String (Text -> Text -> ISO8601 -> ResourceStatus -> StackResource)
-> Either String Text
-> Either
String (Text -> ISO8601 -> ResourceStatus -> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LogicalResourceId")
Either String (Text -> ISO8601 -> ResourceStatus -> StackResource)
-> Either String Text
-> Either String (ISO8601 -> ResourceStatus -> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ResourceType")
Either String (ISO8601 -> ResourceStatus -> StackResource)
-> Either String ISO8601
-> Either String (ResourceStatus -> StackResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Timestamp")
Either String (ResourceStatus -> StackResource)
-> Either String ResourceStatus -> Either String StackResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ResourceStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ResourceStatus")
instance Prelude.Hashable StackResource
instance Prelude.NFData StackResource