{-# 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.StackSetOperationResultSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.StackSetOperationResultSummary where

import Amazonka.CloudFormation.Types.AccountGateResult
import Amazonka.CloudFormation.Types.StackSetOperationResultStatus
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

-- | The structure that contains information about a specified operation\'s
-- results for a given account in a given Region.
--
-- /See:/ 'newStackSetOperationResultSummary' smart constructor.
data StackSetOperationResultSummary = StackSetOperationResultSummary'
  { -- | [Self-managed permissions] The name of the Amazon Web Services account
    -- for this operation result.
    StackSetOperationResultSummary -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
    -- | The results of the account gate function CloudFormation invokes, if
    -- present, before proceeding with stack set operations in an account.
    StackSetOperationResultSummary -> Maybe AccountGateResult
accountGateResult :: Prelude.Maybe AccountGateResult,
    -- | [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>.
    StackSetOperationResultSummary -> Maybe Text
organizationalUnitId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Web Services Region for this operation result.
    StackSetOperationResultSummary -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The result status of the stack set operation for the given account in
    -- the given Region.
    --
    -- -   @CANCELLED@: The operation in the specified account and Region has
    --     been canceled. This is either because a user has stopped the stack
    --     set operation, or because the failure tolerance of the stack set
    --     operation has been exceeded.
    --
    -- -   @FAILED@: The operation in the specified account and Region failed.
    --
    --     If the stack set operation fails in enough accounts within a Region,
    --     the failure tolerance for the stack set operation as a whole might
    --     be exceeded.
    --
    -- -   @RUNNING@: The operation in the specified account and Region is
    --     currently in progress.
    --
    -- -   @PENDING@: The operation in the specified account and Region has yet
    --     to start.
    --
    -- -   @SUCCEEDED@: The operation in the specified account and Region
    --     completed successfully.
    StackSetOperationResultSummary
-> Maybe StackSetOperationResultStatus
status :: Prelude.Maybe StackSetOperationResultStatus,
    -- | The reason for the assigned result status.
    StackSetOperationResultSummary -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text
  }
  deriving (StackSetOperationResultSummary
-> StackSetOperationResultSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetOperationResultSummary
-> StackSetOperationResultSummary -> Bool
$c/= :: StackSetOperationResultSummary
-> StackSetOperationResultSummary -> Bool
== :: StackSetOperationResultSummary
-> StackSetOperationResultSummary -> Bool
$c== :: StackSetOperationResultSummary
-> StackSetOperationResultSummary -> Bool
Prelude.Eq, ReadPrec [StackSetOperationResultSummary]
ReadPrec StackSetOperationResultSummary
Int -> ReadS StackSetOperationResultSummary
ReadS [StackSetOperationResultSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetOperationResultSummary]
$creadListPrec :: ReadPrec [StackSetOperationResultSummary]
readPrec :: ReadPrec StackSetOperationResultSummary
$creadPrec :: ReadPrec StackSetOperationResultSummary
readList :: ReadS [StackSetOperationResultSummary]
$creadList :: ReadS [StackSetOperationResultSummary]
readsPrec :: Int -> ReadS StackSetOperationResultSummary
$creadsPrec :: Int -> ReadS StackSetOperationResultSummary
Prelude.Read, Int -> StackSetOperationResultSummary -> ShowS
[StackSetOperationResultSummary] -> ShowS
StackSetOperationResultSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetOperationResultSummary] -> ShowS
$cshowList :: [StackSetOperationResultSummary] -> ShowS
show :: StackSetOperationResultSummary -> String
$cshow :: StackSetOperationResultSummary -> String
showsPrec :: Int -> StackSetOperationResultSummary -> ShowS
$cshowsPrec :: Int -> StackSetOperationResultSummary -> ShowS
Prelude.Show, forall x.
Rep StackSetOperationResultSummary x
-> StackSetOperationResultSummary
forall x.
StackSetOperationResultSummary
-> Rep StackSetOperationResultSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackSetOperationResultSummary x
-> StackSetOperationResultSummary
$cfrom :: forall x.
StackSetOperationResultSummary
-> Rep StackSetOperationResultSummary x
Prelude.Generic)

-- |
-- Create a value of 'StackSetOperationResultSummary' 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:
--
-- 'account', 'stackSetOperationResultSummary_account' - [Self-managed permissions] The name of the Amazon Web Services account
-- for this operation result.
--
-- 'accountGateResult', 'stackSetOperationResultSummary_accountGateResult' - The results of the account gate function CloudFormation invokes, if
-- present, before proceeding with stack set operations in an account.
--
-- 'organizationalUnitId', 'stackSetOperationResultSummary_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', 'stackSetOperationResultSummary_region' - The name of the Amazon Web Services Region for this operation result.
--
-- 'status', 'stackSetOperationResultSummary_status' - The result status of the stack set operation for the given account in
-- the given Region.
--
-- -   @CANCELLED@: The operation in the specified account and Region has
--     been canceled. This is either because a user has stopped the stack
--     set operation, or because the failure tolerance of the stack set
--     operation has been exceeded.
--
-- -   @FAILED@: The operation in the specified account and Region failed.
--
--     If the stack set operation fails in enough accounts within a Region,
--     the failure tolerance for the stack set operation as a whole might
--     be exceeded.
--
-- -   @RUNNING@: The operation in the specified account and Region is
--     currently in progress.
--
-- -   @PENDING@: The operation in the specified account and Region has yet
--     to start.
--
-- -   @SUCCEEDED@: The operation in the specified account and Region
--     completed successfully.
--
-- 'statusReason', 'stackSetOperationResultSummary_statusReason' - The reason for the assigned result status.
newStackSetOperationResultSummary ::
  StackSetOperationResultSummary
newStackSetOperationResultSummary :: StackSetOperationResultSummary
newStackSetOperationResultSummary =
  StackSetOperationResultSummary'
    { $sel:account:StackSetOperationResultSummary' :: Maybe Text
account =
        forall a. Maybe a
Prelude.Nothing,
      $sel:accountGateResult:StackSetOperationResultSummary' :: Maybe AccountGateResult
accountGateResult = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationalUnitId:StackSetOperationResultSummary' :: Maybe Text
organizationalUnitId = forall a. Maybe a
Prelude.Nothing,
      $sel:region:StackSetOperationResultSummary' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:status:StackSetOperationResultSummary' :: Maybe StackSetOperationResultStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:StackSetOperationResultSummary' :: Maybe Text
statusReason = forall a. Maybe a
Prelude.Nothing
    }

-- | [Self-managed permissions] The name of the Amazon Web Services account
-- for this operation result.
stackSetOperationResultSummary_account :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe Prelude.Text)
stackSetOperationResultSummary_account :: Lens' StackSetOperationResultSummary (Maybe Text)
stackSetOperationResultSummary_account = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe Text
account :: Maybe Text
$sel:account:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
account} -> Maybe Text
account) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe Text
a -> StackSetOperationResultSummary
s {$sel:account:StackSetOperationResultSummary' :: Maybe Text
account = Maybe Text
a} :: StackSetOperationResultSummary)

-- | The results of the account gate function CloudFormation invokes, if
-- present, before proceeding with stack set operations in an account.
stackSetOperationResultSummary_accountGateResult :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe AccountGateResult)
stackSetOperationResultSummary_accountGateResult :: Lens' StackSetOperationResultSummary (Maybe AccountGateResult)
stackSetOperationResultSummary_accountGateResult = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe AccountGateResult
accountGateResult :: Maybe AccountGateResult
$sel:accountGateResult:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe AccountGateResult
accountGateResult} -> Maybe AccountGateResult
accountGateResult) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe AccountGateResult
a -> StackSetOperationResultSummary
s {$sel:accountGateResult:StackSetOperationResultSummary' :: Maybe AccountGateResult
accountGateResult = Maybe AccountGateResult
a} :: StackSetOperationResultSummary)

-- | [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>.
stackSetOperationResultSummary_organizationalUnitId :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe Prelude.Text)
stackSetOperationResultSummary_organizationalUnitId :: Lens' StackSetOperationResultSummary (Maybe Text)
stackSetOperationResultSummary_organizationalUnitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe Text
organizationalUnitId :: Maybe Text
$sel:organizationalUnitId:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
organizationalUnitId} -> Maybe Text
organizationalUnitId) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe Text
a -> StackSetOperationResultSummary
s {$sel:organizationalUnitId:StackSetOperationResultSummary' :: Maybe Text
organizationalUnitId = Maybe Text
a} :: StackSetOperationResultSummary)

-- | The name of the Amazon Web Services Region for this operation result.
stackSetOperationResultSummary_region :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe Prelude.Text)
stackSetOperationResultSummary_region :: Lens' StackSetOperationResultSummary (Maybe Text)
stackSetOperationResultSummary_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe Text
region :: Maybe Text
$sel:region:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
region} -> Maybe Text
region) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe Text
a -> StackSetOperationResultSummary
s {$sel:region:StackSetOperationResultSummary' :: Maybe Text
region = Maybe Text
a} :: StackSetOperationResultSummary)

-- | The result status of the stack set operation for the given account in
-- the given Region.
--
-- -   @CANCELLED@: The operation in the specified account and Region has
--     been canceled. This is either because a user has stopped the stack
--     set operation, or because the failure tolerance of the stack set
--     operation has been exceeded.
--
-- -   @FAILED@: The operation in the specified account and Region failed.
--
--     If the stack set operation fails in enough accounts within a Region,
--     the failure tolerance for the stack set operation as a whole might
--     be exceeded.
--
-- -   @RUNNING@: The operation in the specified account and Region is
--     currently in progress.
--
-- -   @PENDING@: The operation in the specified account and Region has yet
--     to start.
--
-- -   @SUCCEEDED@: The operation in the specified account and Region
--     completed successfully.
stackSetOperationResultSummary_status :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe StackSetOperationResultStatus)
stackSetOperationResultSummary_status :: Lens'
  StackSetOperationResultSummary
  (Maybe StackSetOperationResultStatus)
stackSetOperationResultSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe StackSetOperationResultStatus
status :: Maybe StackSetOperationResultStatus
$sel:status:StackSetOperationResultSummary' :: StackSetOperationResultSummary
-> Maybe StackSetOperationResultStatus
status} -> Maybe StackSetOperationResultStatus
status) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe StackSetOperationResultStatus
a -> StackSetOperationResultSummary
s {$sel:status:StackSetOperationResultSummary' :: Maybe StackSetOperationResultStatus
status = Maybe StackSetOperationResultStatus
a} :: StackSetOperationResultSummary)

-- | The reason for the assigned result status.
stackSetOperationResultSummary_statusReason :: Lens.Lens' StackSetOperationResultSummary (Prelude.Maybe Prelude.Text)
stackSetOperationResultSummary_statusReason :: Lens' StackSetOperationResultSummary (Maybe Text)
stackSetOperationResultSummary_statusReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationResultSummary' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: StackSetOperationResultSummary
s@StackSetOperationResultSummary' {} Maybe Text
a -> StackSetOperationResultSummary
s {$sel:statusReason:StackSetOperationResultSummary' :: Maybe Text
statusReason = Maybe Text
a} :: StackSetOperationResultSummary)

instance Data.FromXML StackSetOperationResultSummary where
  parseXML :: [Node] -> Either String StackSetOperationResultSummary
parseXML [Node]
x =
    Maybe Text
-> Maybe AccountGateResult
-> Maybe Text
-> Maybe Text
-> Maybe StackSetOperationResultStatus
-> Maybe Text
-> StackSetOperationResultSummary
StackSetOperationResultSummary'
      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
"Account")
      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
"AccountGateResult")
      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
"OrganizationalUnitId")
      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
"Region")
      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
"Status")
      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
"StatusReason")

instance
  Prelude.Hashable
    StackSetOperationResultSummary
  where
  hashWithSalt :: Int -> StackSetOperationResultSummary -> Int
hashWithSalt
    Int
_salt
    StackSetOperationResultSummary' {Maybe Text
Maybe AccountGateResult
Maybe StackSetOperationResultStatus
statusReason :: Maybe Text
status :: Maybe StackSetOperationResultStatus
region :: Maybe Text
organizationalUnitId :: Maybe Text
accountGateResult :: Maybe AccountGateResult
account :: Maybe Text
$sel:statusReason:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:status:StackSetOperationResultSummary' :: StackSetOperationResultSummary
-> Maybe StackSetOperationResultStatus
$sel:region:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:organizationalUnitId:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:accountGateResult:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe AccountGateResult
$sel:account:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
account
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccountGateResult
accountGateResult
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
organizationalUnitId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationResultStatus
status
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusReason

instance
  Prelude.NFData
    StackSetOperationResultSummary
  where
  rnf :: StackSetOperationResultSummary -> ()
rnf StackSetOperationResultSummary' {Maybe Text
Maybe AccountGateResult
Maybe StackSetOperationResultStatus
statusReason :: Maybe Text
status :: Maybe StackSetOperationResultStatus
region :: Maybe Text
organizationalUnitId :: Maybe Text
accountGateResult :: Maybe AccountGateResult
account :: Maybe Text
$sel:statusReason:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:status:StackSetOperationResultSummary' :: StackSetOperationResultSummary
-> Maybe StackSetOperationResultStatus
$sel:region:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:organizationalUnitId:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
$sel:accountGateResult:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe AccountGateResult
$sel:account:StackSetOperationResultSummary' :: StackSetOperationResultSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
account
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AccountGateResult
accountGateResult
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationalUnitId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationResultStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusReason