{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFormation.Types.StackInstanceSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.StackInstanceSummary where

import Amazonka.CloudFormation.Types.StackDriftStatus
import Amazonka.CloudFormation.Types.StackInstanceComprehensiveStatus
import Amazonka.CloudFormation.Types.StackInstanceStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The structure that contains summary information about a stack instance.
--
-- /See:/ 'newStackInstanceSummary' smart constructor.
data StackInstanceSummary = StackInstanceSummary'
  { -- | The status of the stack instance, in terms of its synchronization with
    -- its associated stack set.
    --
    -- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
    --     the stack in an unstable state. Stacks in this state are excluded
    --     from further @UpdateStackSet@ operations. You might need to perform
    --     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
    --     @true@, to delete the stack instance, and then delete the stack
    --     manually.
    --
    -- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
    --     because:
    --
    --     -   The associated stack failed during a @CreateStackSet@ or
    --         @UpdateStackSet@ operation.
    --
    --     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
    --         operation that failed or was stopped before the stack was
    --         created or updated.
    --
    -- -   @CURRENT@: The stack is currently up to date with the stack set.
    StackInstanceSummary -> Maybe StackInstanceStatus
status :: Prelude.Maybe StackInstanceStatus,
    -- | Most recent time when CloudFormation performed a drift detection
    -- operation on the stack instance. This value will be @NULL@ for any stack
    -- instance on which drift detection has not yet been performed.
    StackInstanceSummary -> Maybe ISO8601
lastDriftCheckTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | [Self-managed permissions] The name of the Amazon Web Services account
    -- that the stack instance is associated with.
    StackInstanceSummary -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
    -- | Status of the stack instance\'s actual configuration compared to the
    -- expected template and parameter configuration of the stack set to which
    -- it belongs.
    --
    -- -   @DRIFTED@: The stack differs from the expected template and
    --     parameter configuration of the stack set to which it belongs. A
    --     stack instance is considered to have drifted if one or more of the
    --     resources in the associated stack have drifted.
    --
    -- -   @NOT_CHECKED@: CloudFormation has not checked if the stack instance
    --     differs from its expected stack set configuration.
    --
    -- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
    --     expected stack set configuration.
    --
    -- -   @UNKNOWN@: This value is reserved for future use.
    StackInstanceSummary -> Maybe StackDriftStatus
driftStatus :: Prelude.Maybe StackDriftStatus,
    -- | [Service-managed permissions] The organization root ID or organizational
    -- unit (OU) IDs that you specified for
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
    StackInstanceSummary -> Maybe Text
organizationalUnitId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Web Services Region that the stack instance is
    -- associated with.
    StackInstanceSummary -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The explanation for the specific status code assigned to this stack
    -- instance.
    StackInstanceSummary -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The ID of the stack instance.
    StackInstanceSummary -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | The detailed status of the stack instance.
    StackInstanceSummary -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus :: Prelude.Maybe StackInstanceComprehensiveStatus,
    -- | The name or unique ID of the stack set that the stack instance is
    -- associated with.
    StackInstanceSummary -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text
  }
  deriving (StackInstanceSummary -> StackInstanceSummary -> Bool
(StackInstanceSummary -> StackInstanceSummary -> Bool)
-> (StackInstanceSummary -> StackInstanceSummary -> Bool)
-> Eq StackInstanceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackInstanceSummary -> StackInstanceSummary -> Bool
$c/= :: StackInstanceSummary -> StackInstanceSummary -> Bool
== :: StackInstanceSummary -> StackInstanceSummary -> Bool
$c== :: StackInstanceSummary -> StackInstanceSummary -> Bool
Prelude.Eq, ReadPrec [StackInstanceSummary]
ReadPrec StackInstanceSummary
Int -> ReadS StackInstanceSummary
ReadS [StackInstanceSummary]
(Int -> ReadS StackInstanceSummary)
-> ReadS [StackInstanceSummary]
-> ReadPrec StackInstanceSummary
-> ReadPrec [StackInstanceSummary]
-> Read StackInstanceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackInstanceSummary]
$creadListPrec :: ReadPrec [StackInstanceSummary]
readPrec :: ReadPrec StackInstanceSummary
$creadPrec :: ReadPrec StackInstanceSummary
readList :: ReadS [StackInstanceSummary]
$creadList :: ReadS [StackInstanceSummary]
readsPrec :: Int -> ReadS StackInstanceSummary
$creadsPrec :: Int -> ReadS StackInstanceSummary
Prelude.Read, Int -> StackInstanceSummary -> ShowS
[StackInstanceSummary] -> ShowS
StackInstanceSummary -> String
(Int -> StackInstanceSummary -> ShowS)
-> (StackInstanceSummary -> String)
-> ([StackInstanceSummary] -> ShowS)
-> Show StackInstanceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackInstanceSummary] -> ShowS
$cshowList :: [StackInstanceSummary] -> ShowS
show :: StackInstanceSummary -> String
$cshow :: StackInstanceSummary -> String
showsPrec :: Int -> StackInstanceSummary -> ShowS
$cshowsPrec :: Int -> StackInstanceSummary -> ShowS
Prelude.Show, (forall x. StackInstanceSummary -> Rep StackInstanceSummary x)
-> (forall x. Rep StackInstanceSummary x -> StackInstanceSummary)
-> Generic StackInstanceSummary
forall x. Rep StackInstanceSummary x -> StackInstanceSummary
forall x. StackInstanceSummary -> Rep StackInstanceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackInstanceSummary x -> StackInstanceSummary
$cfrom :: forall x. StackInstanceSummary -> Rep StackInstanceSummary x
Prelude.Generic)

-- |
-- Create a value of 'StackInstanceSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'stackInstanceSummary_status' - The status of the stack instance, in terms of its synchronization with
-- its associated stack set.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
--     because:
--
--     -   The associated stack failed during a @CreateStackSet@ or
--         @UpdateStackSet@ operation.
--
--     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
--         operation that failed or was stopped before the stack was
--         created or updated.
--
-- -   @CURRENT@: The stack is currently up to date with the stack set.
--
-- 'lastDriftCheckTimestamp', 'stackInstanceSummary_lastDriftCheckTimestamp' - Most recent time when CloudFormation performed a drift detection
-- operation on the stack instance. This value will be @NULL@ for any stack
-- instance on which drift detection has not yet been performed.
--
-- 'account', 'stackInstanceSummary_account' - [Self-managed permissions] The name of the Amazon Web Services account
-- that the stack instance is associated with.
--
-- 'driftStatus', 'stackInstanceSummary_driftStatus' - Status of the stack instance\'s actual configuration compared to the
-- expected template and parameter configuration of the stack set to which
-- it belongs.
--
-- -   @DRIFTED@: The stack differs from the expected template and
--     parameter configuration of the stack set to which it belongs. A
--     stack instance is considered to have drifted if one or more of the
--     resources in the associated stack have drifted.
--
-- -   @NOT_CHECKED@: CloudFormation has not checked if the stack instance
--     differs from its expected stack set configuration.
--
-- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
--     expected stack set configuration.
--
-- -   @UNKNOWN@: This value is reserved for future use.
--
-- 'organizationalUnitId', 'stackInstanceSummary_organizationalUnitId' - [Service-managed permissions] The organization root ID or organizational
-- unit (OU) IDs that you specified for
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
--
-- 'region', 'stackInstanceSummary_region' - The name of the Amazon Web Services Region that the stack instance is
-- associated with.
--
-- 'statusReason', 'stackInstanceSummary_statusReason' - The explanation for the specific status code assigned to this stack
-- instance.
--
-- 'stackId', 'stackInstanceSummary_stackId' - The ID of the stack instance.
--
-- 'stackInstanceStatus', 'stackInstanceSummary_stackInstanceStatus' - The detailed status of the stack instance.
--
-- 'stackSetId', 'stackInstanceSummary_stackSetId' - The name or unique ID of the stack set that the stack instance is
-- associated with.
newStackInstanceSummary ::
  StackInstanceSummary
newStackInstanceSummary :: StackInstanceSummary
newStackInstanceSummary =
  StackInstanceSummary' :: Maybe StackInstanceStatus
-> Maybe ISO8601
-> Maybe Text
-> Maybe StackDriftStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StackInstanceComprehensiveStatus
-> Maybe Text
-> StackInstanceSummary
StackInstanceSummary'
    { $sel:status:StackInstanceSummary' :: Maybe StackInstanceStatus
status = Maybe StackInstanceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastDriftCheckTimestamp:StackInstanceSummary' :: Maybe ISO8601
lastDriftCheckTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:account:StackInstanceSummary' :: Maybe Text
account = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:driftStatus:StackInstanceSummary' :: Maybe StackDriftStatus
driftStatus = Maybe StackDriftStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationalUnitId:StackInstanceSummary' :: Maybe Text
organizationalUnitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:StackInstanceSummary' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:StackInstanceSummary' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:StackInstanceSummary' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackInstanceStatus:StackInstanceSummary' :: Maybe StackInstanceComprehensiveStatus
stackInstanceStatus = Maybe StackInstanceComprehensiveStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetId:StackInstanceSummary' :: Maybe Text
stackSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the stack instance, in terms of its synchronization with
-- its associated stack set.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
--     because:
--
--     -   The associated stack failed during a @CreateStackSet@ or
--         @UpdateStackSet@ operation.
--
--     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
--         operation that failed or was stopped before the stack was
--         created or updated.
--
-- -   @CURRENT@: The stack is currently up to date with the stack set.
stackInstanceSummary_status :: Lens.Lens' StackInstanceSummary (Prelude.Maybe StackInstanceStatus)
stackInstanceSummary_status :: (Maybe StackInstanceStatus -> f (Maybe StackInstanceStatus))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_status = (StackInstanceSummary -> Maybe StackInstanceStatus)
-> (StackInstanceSummary
    -> Maybe StackInstanceStatus -> StackInstanceSummary)
-> Lens
     StackInstanceSummary
     StackInstanceSummary
     (Maybe StackInstanceStatus)
     (Maybe StackInstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe StackInstanceStatus
status :: Maybe StackInstanceStatus
$sel:status:StackInstanceSummary' :: StackInstanceSummary -> Maybe StackInstanceStatus
status} -> Maybe StackInstanceStatus
status) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe StackInstanceStatus
a -> StackInstanceSummary
s {$sel:status:StackInstanceSummary' :: Maybe StackInstanceStatus
status = Maybe StackInstanceStatus
a} :: StackInstanceSummary)

-- | Most recent time when CloudFormation performed a drift detection
-- operation on the stack instance. This value will be @NULL@ for any stack
-- instance on which drift detection has not yet been performed.
stackInstanceSummary_lastDriftCheckTimestamp :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.UTCTime)
stackInstanceSummary_lastDriftCheckTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_lastDriftCheckTimestamp = (StackInstanceSummary -> Maybe ISO8601)
-> (StackInstanceSummary -> Maybe ISO8601 -> StackInstanceSummary)
-> Lens
     StackInstanceSummary
     StackInstanceSummary
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe ISO8601
lastDriftCheckTimestamp :: Maybe ISO8601
$sel:lastDriftCheckTimestamp:StackInstanceSummary' :: StackInstanceSummary -> Maybe ISO8601
lastDriftCheckTimestamp} -> Maybe ISO8601
lastDriftCheckTimestamp) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe ISO8601
a -> StackInstanceSummary
s {$sel:lastDriftCheckTimestamp:StackInstanceSummary' :: Maybe ISO8601
lastDriftCheckTimestamp = Maybe ISO8601
a} :: StackInstanceSummary) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> StackInstanceSummary -> f StackInstanceSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StackInstanceSummary
-> f StackInstanceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | [Self-managed permissions] The name of the Amazon Web Services account
-- that the stack instance is associated with.
stackInstanceSummary_account :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_account :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_account = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
account :: Maybe Text
$sel:account:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
account} -> Maybe Text
account) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:account:StackInstanceSummary' :: Maybe Text
account = Maybe Text
a} :: StackInstanceSummary)

-- | Status of the stack instance\'s actual configuration compared to the
-- expected template and parameter configuration of the stack set to which
-- it belongs.
--
-- -   @DRIFTED@: The stack differs from the expected template and
--     parameter configuration of the stack set to which it belongs. A
--     stack instance is considered to have drifted if one or more of the
--     resources in the associated stack have drifted.
--
-- -   @NOT_CHECKED@: CloudFormation has not checked if the stack instance
--     differs from its expected stack set configuration.
--
-- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
--     expected stack set configuration.
--
-- -   @UNKNOWN@: This value is reserved for future use.
stackInstanceSummary_driftStatus :: Lens.Lens' StackInstanceSummary (Prelude.Maybe StackDriftStatus)
stackInstanceSummary_driftStatus :: (Maybe StackDriftStatus -> f (Maybe StackDriftStatus))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_driftStatus = (StackInstanceSummary -> Maybe StackDriftStatus)
-> (StackInstanceSummary
    -> Maybe StackDriftStatus -> StackInstanceSummary)
-> Lens
     StackInstanceSummary
     StackInstanceSummary
     (Maybe StackDriftStatus)
     (Maybe StackDriftStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe StackDriftStatus
driftStatus :: Maybe StackDriftStatus
$sel:driftStatus:StackInstanceSummary' :: StackInstanceSummary -> Maybe StackDriftStatus
driftStatus} -> Maybe StackDriftStatus
driftStatus) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe StackDriftStatus
a -> StackInstanceSummary
s {$sel:driftStatus:StackInstanceSummary' :: Maybe StackDriftStatus
driftStatus = Maybe StackDriftStatus
a} :: StackInstanceSummary)

-- | [Service-managed permissions] The organization root ID or organizational
-- unit (OU) IDs that you specified for
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
stackInstanceSummary_organizationalUnitId :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_organizationalUnitId :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_organizationalUnitId = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
organizationalUnitId :: Maybe Text
$sel:organizationalUnitId:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
organizationalUnitId} -> Maybe Text
organizationalUnitId) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:organizationalUnitId:StackInstanceSummary' :: Maybe Text
organizationalUnitId = Maybe Text
a} :: StackInstanceSummary)

-- | The name of the Amazon Web Services Region that the stack instance is
-- associated with.
stackInstanceSummary_region :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_region :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_region = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
region :: Maybe Text
$sel:region:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
region} -> Maybe Text
region) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:region:StackInstanceSummary' :: Maybe Text
region = Maybe Text
a} :: StackInstanceSummary)

-- | The explanation for the specific status code assigned to this stack
-- instance.
stackInstanceSummary_statusReason :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_statusReason :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_statusReason = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:statusReason:StackInstanceSummary' :: Maybe Text
statusReason = Maybe Text
a} :: StackInstanceSummary)

-- | The ID of the stack instance.
stackInstanceSummary_stackId :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_stackId :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_stackId = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
stackId :: Maybe Text
$sel:stackId:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:stackId:StackInstanceSummary' :: Maybe Text
stackId = Maybe Text
a} :: StackInstanceSummary)

-- | The detailed status of the stack instance.
stackInstanceSummary_stackInstanceStatus :: Lens.Lens' StackInstanceSummary (Prelude.Maybe StackInstanceComprehensiveStatus)
stackInstanceSummary_stackInstanceStatus :: (Maybe StackInstanceComprehensiveStatus
 -> f (Maybe StackInstanceComprehensiveStatus))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_stackInstanceStatus = (StackInstanceSummary -> Maybe StackInstanceComprehensiveStatus)
-> (StackInstanceSummary
    -> Maybe StackInstanceComprehensiveStatus -> StackInstanceSummary)
-> Lens
     StackInstanceSummary
     StackInstanceSummary
     (Maybe StackInstanceComprehensiveStatus)
     (Maybe StackInstanceComprehensiveStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe StackInstanceComprehensiveStatus
stackInstanceStatus :: Maybe StackInstanceComprehensiveStatus
$sel:stackInstanceStatus:StackInstanceSummary' :: StackInstanceSummary -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus} -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe StackInstanceComprehensiveStatus
a -> StackInstanceSummary
s {$sel:stackInstanceStatus:StackInstanceSummary' :: Maybe StackInstanceComprehensiveStatus
stackInstanceStatus = Maybe StackInstanceComprehensiveStatus
a} :: StackInstanceSummary)

-- | The name or unique ID of the stack set that the stack instance is
-- associated with.
stackInstanceSummary_stackSetId :: Lens.Lens' StackInstanceSummary (Prelude.Maybe Prelude.Text)
stackInstanceSummary_stackSetId :: (Maybe Text -> f (Maybe Text))
-> StackInstanceSummary -> f StackInstanceSummary
stackInstanceSummary_stackSetId = (StackInstanceSummary -> Maybe Text)
-> (StackInstanceSummary -> Maybe Text -> StackInstanceSummary)
-> Lens
     StackInstanceSummary StackInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceSummary' {Maybe Text
stackSetId :: Maybe Text
$sel:stackSetId:StackInstanceSummary' :: StackInstanceSummary -> Maybe Text
stackSetId} -> Maybe Text
stackSetId) (\s :: StackInstanceSummary
s@StackInstanceSummary' {} Maybe Text
a -> StackInstanceSummary
s {$sel:stackSetId:StackInstanceSummary' :: Maybe Text
stackSetId = Maybe Text
a} :: StackInstanceSummary)

instance Core.FromXML StackInstanceSummary where
  parseXML :: [Node] -> Either String StackInstanceSummary
parseXML [Node]
x =
    Maybe StackInstanceStatus
-> Maybe ISO8601
-> Maybe Text
-> Maybe StackDriftStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StackInstanceComprehensiveStatus
-> Maybe Text
-> StackInstanceSummary
StackInstanceSummary'
      (Maybe StackInstanceStatus
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe StackDriftStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe StackInstanceComprehensiveStatus
 -> Maybe Text
 -> StackInstanceSummary)
-> Either String (Maybe StackInstanceStatus)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe StackInstanceStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastDriftCheckTimestamp")
      Either
  String
  (Maybe Text
   -> Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
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
"Account")
      Either
  String
  (Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe StackDriftStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StackDriftStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftStatus")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
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
"OrganizationalUnitId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
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
"Region")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe Text
      -> StackInstanceSummary)
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
"StatusReason")
      Either
  String
  (Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe Text
   -> StackInstanceSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StackInstanceComprehensiveStatus
      -> Maybe Text -> StackInstanceSummary)
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 StackInstanceComprehensiveStatus
   -> Maybe Text -> StackInstanceSummary)
-> Either String (Maybe StackInstanceComprehensiveStatus)
-> Either String (Maybe Text -> StackInstanceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe StackInstanceComprehensiveStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackInstanceStatus")
      Either String (Maybe Text -> StackInstanceSummary)
-> Either String (Maybe Text) -> Either String StackInstanceSummary
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
"StackSetId")

instance Prelude.Hashable StackInstanceSummary

instance Prelude.NFData StackInstanceSummary