{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data StackResource = StackResource'
{
StackResource -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe StackResourceDriftInformation
driftInformation :: Prelude.Maybe StackResourceDriftInformation,
StackResource -> Maybe ModuleInfo
moduleInfo :: Prelude.Maybe ModuleInfo,
StackResource -> Maybe Text
physicalResourceId :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe Text
resourceStatusReason :: Prelude.Maybe Prelude.Text,
StackResource -> Maybe Text
stackId :: 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 :: Data.ISO8601,
StackResource -> ResourceStatus
resourceStatus :: ResourceStatus
}
deriving (StackResource -> StackResource -> Bool
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]
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
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. 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'
{ $sel:description:StackResource' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:driftInformation:StackResource' :: Maybe StackResourceDriftInformation
driftInformation = forall a. Maybe a
Prelude.Nothing,
$sel:moduleInfo:StackResource' :: Maybe ModuleInfo
moduleInfo = forall a. Maybe a
Prelude.Nothing,
$sel:physicalResourceId:StackResource' :: Maybe Text
physicalResourceId = forall a. Maybe a
Prelude.Nothing,
$sel:resourceStatusReason:StackResource' :: Maybe Text
resourceStatusReason = forall a. Maybe a
Prelude.Nothing,
$sel:stackId:StackResource' :: Maybe Text
stackId = forall a. Maybe a
Prelude.Nothing,
$sel:stackName:StackResource' :: Maybe Text
stackName = 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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pTimestamp_,
$sel:resourceStatus:StackResource' :: ResourceStatus
resourceStatus = ResourceStatus
pResourceStatus_
}
stackResource_description :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_description :: Lens' StackResource (Maybe Text)
stackResource_description = 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_driftInformation :: Lens.Lens' StackResource (Prelude.Maybe StackResourceDriftInformation)
stackResource_driftInformation :: Lens' StackResource (Maybe StackResourceDriftInformation)
stackResource_driftInformation = 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 :: Lens' StackResource (Maybe ModuleInfo)
stackResource_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_physicalResourceId :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_physicalResourceId :: Lens' StackResource (Maybe Text)
stackResource_physicalResourceId = 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 :: Lens' StackResource (Maybe Text)
stackResource_resourceStatusReason = 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_stackId :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_stackId :: Lens' StackResource (Maybe Text)
stackResource_stackId = 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_stackName :: Lens.Lens' StackResource (Prelude.Maybe Prelude.Text)
stackResource_stackName :: Lens' StackResource (Maybe Text)
stackResource_stackName = 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 :: Lens' StackResource Text
stackResource_logicalResourceId = 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 :: Lens' StackResource Text
stackResource_resourceType = 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 :: Lens' StackResource UTCTime
stackResource_timestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
stackResource_resourceStatus :: Lens.Lens' StackResource ResourceStatus
stackResource_resourceStatus :: Lens' StackResource ResourceStatus
stackResource_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 Data.FromXML StackResource where
parseXML :: [Node] -> Either String StackResource
parseXML [Node]
x =
Maybe Text
-> Maybe StackResourceDriftInformation
-> Maybe ModuleInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> ISO8601
-> ResourceStatus
-> StackResource
StackResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DriftInformation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ModuleInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PhysicalResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ResourceStatusReason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LogicalResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ResourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Timestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ResourceStatus")
instance Prelude.Hashable StackResource where
hashWithSalt :: Int -> StackResource -> Int
hashWithSalt Int
_salt StackResource' {Maybe Text
Maybe ModuleInfo
Maybe StackResourceDriftInformation
Text
ISO8601
ResourceStatus
resourceStatus :: ResourceStatus
timestamp :: ISO8601
resourceType :: Text
logicalResourceId :: Text
stackName :: Maybe Text
stackId :: Maybe Text
resourceStatusReason :: Maybe Text
physicalResourceId :: Maybe Text
moduleInfo :: Maybe ModuleInfo
driftInformation :: Maybe StackResourceDriftInformation
description :: Maybe Text
$sel:resourceStatus:StackResource' :: StackResource -> ResourceStatus
$sel:timestamp:StackResource' :: StackResource -> ISO8601
$sel:resourceType:StackResource' :: StackResource -> Text
$sel:logicalResourceId:StackResource' :: StackResource -> Text
$sel:stackName:StackResource' :: StackResource -> Maybe Text
$sel:stackId:StackResource' :: StackResource -> Maybe Text
$sel:resourceStatusReason:StackResource' :: StackResource -> Maybe Text
$sel:physicalResourceId:StackResource' :: StackResource -> Maybe Text
$sel:moduleInfo:StackResource' :: StackResource -> Maybe ModuleInfo
$sel:driftInformation:StackResource' :: StackResource -> Maybe StackResourceDriftInformation
$sel:description:StackResource' :: StackResource -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackResourceDriftInformation
driftInformation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModuleInfo
moduleInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
physicalResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceStatusReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
logicalResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceStatus
resourceStatus
instance Prelude.NFData StackResource where
rnf :: StackResource -> ()
rnf StackResource' {Maybe Text
Maybe ModuleInfo
Maybe StackResourceDriftInformation
Text
ISO8601
ResourceStatus
resourceStatus :: ResourceStatus
timestamp :: ISO8601
resourceType :: Text
logicalResourceId :: Text
stackName :: Maybe Text
stackId :: Maybe Text
resourceStatusReason :: Maybe Text
physicalResourceId :: Maybe Text
moduleInfo :: Maybe ModuleInfo
driftInformation :: Maybe StackResourceDriftInformation
description :: Maybe Text
$sel:resourceStatus:StackResource' :: StackResource -> ResourceStatus
$sel:timestamp:StackResource' :: StackResource -> ISO8601
$sel:resourceType:StackResource' :: StackResource -> Text
$sel:logicalResourceId:StackResource' :: StackResource -> Text
$sel:stackName:StackResource' :: StackResource -> Maybe Text
$sel:stackId:StackResource' :: StackResource -> Maybe Text
$sel:resourceStatusReason:StackResource' :: StackResource -> Maybe Text
$sel:physicalResourceId:StackResource' :: StackResource -> Maybe Text
$sel:moduleInfo:StackResource' :: StackResource -> Maybe ModuleInfo
$sel:driftInformation:StackResource' :: StackResource -> Maybe StackResourceDriftInformation
$sel:description:StackResource' :: StackResource -> Maybe Text
..} =
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 Maybe StackResourceDriftInformation
driftInformation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModuleInfo
moduleInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
physicalResourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceStatusReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
logicalResourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceStatus
resourceStatus