{-# 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.StackSetOperation
-- 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.StackSetOperation where

import Amazonka.CloudFormation.Types.DeploymentTargets
import Amazonka.CloudFormation.Types.StackSetDriftDetectionDetails
import Amazonka.CloudFormation.Types.StackSetOperationAction
import Amazonka.CloudFormation.Types.StackSetOperationPreferences
import Amazonka.CloudFormation.Types.StackSetOperationStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The structure that contains information about a stack set operation.
--
-- /See:/ 'newStackSetOperation' smart constructor.
data StackSetOperation = StackSetOperation'
  { -- | Detailed information about the drift status of the stack set. This
    -- includes information about drift operations currently being performed on
    -- the stack set.
    --
    -- this information will only be present for stack set operations whose
    -- @Action@ type is @DETECT_DRIFT@.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
    -- in the CloudFormation User Guide.
    StackSetOperation -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails :: Prelude.Maybe StackSetDriftDetectionDetails,
    -- | The status of the operation.
    --
    -- -   @FAILED@: The operation exceeded the specified failure tolerance.
    --     The failure tolerance value that you\'ve set for an operation is
    --     applied for each Region during stack create and update operations.
    --     If the number of failed stacks within a Region exceeds the failure
    --     tolerance, the status of the operation in the Region is set to
    --     @FAILED@. This in turn sets the status of the operation as a whole
    --     to @FAILED@, and CloudFormation cancels the operation in any
    --     remaining Regions.
    --
    -- -   @QUEUED@: [Service-managed permissions] For automatic deployments
    --     that require a sequence of operations, the operation is queued to be
    --     performed. For more information, see the
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
    --     in the CloudFormation User Guide.
    --
    -- -   @RUNNING@: The operation is currently being performed.
    --
    -- -   @STOPPED@: The user has cancelled the operation.
    --
    -- -   @STOPPING@: The operation is in the process of stopping, at user
    --     request.
    --
    -- -   @SUCCEEDED@: The operation completed creating or updating all the
    --     specified stacks without exceeding the failure tolerance for the
    --     operation.
    StackSetOperation -> Maybe StackSetOperationStatus
status :: Prelude.Maybe StackSetOperationStatus,
    -- | The Amazon Resource Number (ARN) of the IAM role used to perform this
    -- stack set operation.
    --
    -- Use customized administrator roles to control which users or groups can
    -- manage specific stack sets within the same administrator account. For
    -- more information, see
    -- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Define Permissions for Multiple Administrators>
    -- in the /CloudFormation User Guide/.
    StackSetOperation -> Maybe Text
administrationRoleARN :: Prelude.Maybe Prelude.Text,
    -- | The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
    -- and delete operations affect only the specified stack set instances that
    -- are associated with the specified stack set. Update operations affect
    -- both the stack set itself, as well as /all/ associated stack set
    -- instances.
    StackSetOperation -> Maybe StackSetOperationAction
action :: Prelude.Maybe StackSetOperationAction,
    -- | The time at which the stack set operation ended, across all accounts and
    -- Regions specified. Note that this doesn\'t necessarily mean that the
    -- stack set operation was successful, or even attempted, in each account
    -- or Region.
    StackSetOperation -> Maybe ISO8601
endTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | The time at which the operation was initiated. Note that the creation
    -- times for the stack set operation might differ from the creation time of
    -- the individual stacks themselves. This is because CloudFormation needs
    -- to perform preparatory work for the operation, such as dispatching the
    -- work to the requested Regions, before actually creating the first
    -- stacks.
    StackSetOperation -> Maybe ISO8601
creationTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | The preferences for how CloudFormation performs this stack set
    -- operation.
    StackSetOperation -> Maybe StackSetOperationPreferences
operationPreferences :: Prelude.Maybe StackSetOperationPreferences,
    -- | The unique ID of a stack set operation.
    StackSetOperation -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | For stack set operations of action type @DELETE@, specifies whether to
    -- remove the stack instances from the specified stack set, but doesn\'t
    -- delete the stacks. You can\'t reassociate a retained stack, or add an
    -- existing, saved stack to a new stack set.
    StackSetOperation -> Maybe Bool
retainStacks :: Prelude.Maybe Prelude.Bool,
    -- | [Service-managed permissions] The Organizations accounts affected by the
    -- stack operation.
    StackSetOperation -> Maybe DeploymentTargets
deploymentTargets :: Prelude.Maybe DeploymentTargets,
    -- | The ID of the stack set.
    StackSetOperation -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text,
    -- | The name of the IAM execution role used to create or update the stack
    -- set.
    --
    -- Use customized execution roles to control which stack resources users
    -- and groups can include in their stack sets.
    StackSetOperation -> Maybe Text
executionRoleName :: Prelude.Maybe Prelude.Text
  }
  deriving (StackSetOperation -> StackSetOperation -> Bool
(StackSetOperation -> StackSetOperation -> Bool)
-> (StackSetOperation -> StackSetOperation -> Bool)
-> Eq StackSetOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetOperation -> StackSetOperation -> Bool
$c/= :: StackSetOperation -> StackSetOperation -> Bool
== :: StackSetOperation -> StackSetOperation -> Bool
$c== :: StackSetOperation -> StackSetOperation -> Bool
Prelude.Eq, ReadPrec [StackSetOperation]
ReadPrec StackSetOperation
Int -> ReadS StackSetOperation
ReadS [StackSetOperation]
(Int -> ReadS StackSetOperation)
-> ReadS [StackSetOperation]
-> ReadPrec StackSetOperation
-> ReadPrec [StackSetOperation]
-> Read StackSetOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetOperation]
$creadListPrec :: ReadPrec [StackSetOperation]
readPrec :: ReadPrec StackSetOperation
$creadPrec :: ReadPrec StackSetOperation
readList :: ReadS [StackSetOperation]
$creadList :: ReadS [StackSetOperation]
readsPrec :: Int -> ReadS StackSetOperation
$creadsPrec :: Int -> ReadS StackSetOperation
Prelude.Read, Int -> StackSetOperation -> ShowS
[StackSetOperation] -> ShowS
StackSetOperation -> String
(Int -> StackSetOperation -> ShowS)
-> (StackSetOperation -> String)
-> ([StackSetOperation] -> ShowS)
-> Show StackSetOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetOperation] -> ShowS
$cshowList :: [StackSetOperation] -> ShowS
show :: StackSetOperation -> String
$cshow :: StackSetOperation -> String
showsPrec :: Int -> StackSetOperation -> ShowS
$cshowsPrec :: Int -> StackSetOperation -> ShowS
Prelude.Show, (forall x. StackSetOperation -> Rep StackSetOperation x)
-> (forall x. Rep StackSetOperation x -> StackSetOperation)
-> Generic StackSetOperation
forall x. Rep StackSetOperation x -> StackSetOperation
forall x. StackSetOperation -> Rep StackSetOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackSetOperation x -> StackSetOperation
$cfrom :: forall x. StackSetOperation -> Rep StackSetOperation x
Prelude.Generic)

-- |
-- Create a value of 'StackSetOperation' 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:
--
-- 'stackSetDriftDetectionDetails', 'stackSetOperation_stackSetDriftDetectionDetails' - Detailed information about the drift status of the stack set. This
-- includes information about drift operations currently being performed on
-- the stack set.
--
-- this information will only be present for stack set operations whose
-- @Action@ type is @DETECT_DRIFT@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
-- in the CloudFormation User Guide.
--
-- 'status', 'stackSetOperation_status' - The status of the operation.
--
-- -   @FAILED@: The operation exceeded the specified failure tolerance.
--     The failure tolerance value that you\'ve set for an operation is
--     applied for each Region during stack create and update operations.
--     If the number of failed stacks within a Region exceeds the failure
--     tolerance, the status of the operation in the Region is set to
--     @FAILED@. This in turn sets the status of the operation as a whole
--     to @FAILED@, and CloudFormation cancels the operation in any
--     remaining Regions.
--
-- -   @QUEUED@: [Service-managed permissions] For automatic deployments
--     that require a sequence of operations, the operation is queued to be
--     performed. For more information, see the
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
--     in the CloudFormation User Guide.
--
-- -   @RUNNING@: The operation is currently being performed.
--
-- -   @STOPPED@: The user has cancelled the operation.
--
-- -   @STOPPING@: The operation is in the process of stopping, at user
--     request.
--
-- -   @SUCCEEDED@: The operation completed creating or updating all the
--     specified stacks without exceeding the failure tolerance for the
--     operation.
--
-- 'administrationRoleARN', 'stackSetOperation_administrationRoleARN' - The Amazon Resource Number (ARN) of the IAM role used to perform this
-- stack set operation.
--
-- Use customized administrator roles to control which users or groups can
-- manage specific stack sets within the same administrator account. For
-- more information, see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Define Permissions for Multiple Administrators>
-- in the /CloudFormation User Guide/.
--
-- 'action', 'stackSetOperation_action' - The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
-- and delete operations affect only the specified stack set instances that
-- are associated with the specified stack set. Update operations affect
-- both the stack set itself, as well as /all/ associated stack set
-- instances.
--
-- 'endTimestamp', 'stackSetOperation_endTimestamp' - The time at which the stack set operation ended, across all accounts and
-- Regions specified. Note that this doesn\'t necessarily mean that the
-- stack set operation was successful, or even attempted, in each account
-- or Region.
--
-- 'creationTimestamp', 'stackSetOperation_creationTimestamp' - The time at which the operation was initiated. Note that the creation
-- times for the stack set operation might differ from the creation time of
-- the individual stacks themselves. This is because CloudFormation needs
-- to perform preparatory work for the operation, such as dispatching the
-- work to the requested Regions, before actually creating the first
-- stacks.
--
-- 'operationPreferences', 'stackSetOperation_operationPreferences' - The preferences for how CloudFormation performs this stack set
-- operation.
--
-- 'operationId', 'stackSetOperation_operationId' - The unique ID of a stack set operation.
--
-- 'retainStacks', 'stackSetOperation_retainStacks' - For stack set operations of action type @DELETE@, specifies whether to
-- remove the stack instances from the specified stack set, but doesn\'t
-- delete the stacks. You can\'t reassociate a retained stack, or add an
-- existing, saved stack to a new stack set.
--
-- 'deploymentTargets', 'stackSetOperation_deploymentTargets' - [Service-managed permissions] The Organizations accounts affected by the
-- stack operation.
--
-- 'stackSetId', 'stackSetOperation_stackSetId' - The ID of the stack set.
--
-- 'executionRoleName', 'stackSetOperation_executionRoleName' - The name of the IAM execution role used to create or update the stack
-- set.
--
-- Use customized execution roles to control which stack resources users
-- and groups can include in their stack sets.
newStackSetOperation ::
  StackSetOperation
newStackSetOperation :: StackSetOperation
newStackSetOperation =
  StackSetOperation' :: Maybe StackSetDriftDetectionDetails
-> Maybe StackSetOperationStatus
-> Maybe Text
-> Maybe StackSetOperationAction
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe StackSetOperationPreferences
-> Maybe Text
-> Maybe Bool
-> Maybe DeploymentTargets
-> Maybe Text
-> Maybe Text
-> StackSetOperation
StackSetOperation'
    { $sel:stackSetDriftDetectionDetails:StackSetOperation' :: Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails =
        Maybe StackSetDriftDetectionDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:status:StackSetOperation' :: Maybe StackSetOperationStatus
status = Maybe StackSetOperationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:administrationRoleARN:StackSetOperation' :: Maybe Text
administrationRoleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:action:StackSetOperation' :: Maybe StackSetOperationAction
action = Maybe StackSetOperationAction
forall a. Maybe a
Prelude.Nothing,
      $sel:endTimestamp:StackSetOperation' :: Maybe ISO8601
endTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:StackSetOperation' :: Maybe ISO8601
creationTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:operationPreferences:StackSetOperation' :: Maybe StackSetOperationPreferences
operationPreferences = Maybe StackSetOperationPreferences
forall a. Maybe a
Prelude.Nothing,
      $sel:operationId:StackSetOperation' :: Maybe Text
operationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:retainStacks:StackSetOperation' :: Maybe Bool
retainStacks = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentTargets:StackSetOperation' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetId:StackSetOperation' :: Maybe Text
stackSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionRoleName:StackSetOperation' :: Maybe Text
executionRoleName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Detailed information about the drift status of the stack set. This
-- includes information about drift operations currently being performed on
-- the stack set.
--
-- this information will only be present for stack set operations whose
-- @Action@ type is @DETECT_DRIFT@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
-- in the CloudFormation User Guide.
stackSetOperation_stackSetDriftDetectionDetails :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetDriftDetectionDetails)
stackSetOperation_stackSetDriftDetectionDetails :: (Maybe StackSetDriftDetectionDetails
 -> f (Maybe StackSetDriftDetectionDetails))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_stackSetDriftDetectionDetails = (StackSetOperation -> Maybe StackSetDriftDetectionDetails)
-> (StackSetOperation
    -> Maybe StackSetDriftDetectionDetails -> StackSetOperation)
-> Lens
     StackSetOperation
     StackSetOperation
     (Maybe StackSetDriftDetectionDetails)
     (Maybe StackSetDriftDetectionDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails :: Maybe StackSetDriftDetectionDetails
$sel:stackSetDriftDetectionDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails} -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetDriftDetectionDetails
a -> StackSetOperation
s {$sel:stackSetDriftDetectionDetails:StackSetOperation' :: Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails = Maybe StackSetDriftDetectionDetails
a} :: StackSetOperation)

-- | The status of the operation.
--
-- -   @FAILED@: The operation exceeded the specified failure tolerance.
--     The failure tolerance value that you\'ve set for an operation is
--     applied for each Region during stack create and update operations.
--     If the number of failed stacks within a Region exceeds the failure
--     tolerance, the status of the operation in the Region is set to
--     @FAILED@. This in turn sets the status of the operation as a whole
--     to @FAILED@, and CloudFormation cancels the operation in any
--     remaining Regions.
--
-- -   @QUEUED@: [Service-managed permissions] For automatic deployments
--     that require a sequence of operations, the operation is queued to be
--     performed. For more information, see the
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
--     in the CloudFormation User Guide.
--
-- -   @RUNNING@: The operation is currently being performed.
--
-- -   @STOPPED@: The user has cancelled the operation.
--
-- -   @STOPPING@: The operation is in the process of stopping, at user
--     request.
--
-- -   @SUCCEEDED@: The operation completed creating or updating all the
--     specified stacks without exceeding the failure tolerance for the
--     operation.
stackSetOperation_status :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationStatus)
stackSetOperation_status :: (Maybe StackSetOperationStatus
 -> f (Maybe StackSetOperationStatus))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_status = (StackSetOperation -> Maybe StackSetOperationStatus)
-> (StackSetOperation
    -> Maybe StackSetOperationStatus -> StackSetOperation)
-> Lens
     StackSetOperation
     StackSetOperation
     (Maybe StackSetOperationStatus)
     (Maybe StackSetOperationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationStatus
status :: Maybe StackSetOperationStatus
$sel:status:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatus
status} -> Maybe StackSetOperationStatus
status) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationStatus
a -> StackSetOperation
s {$sel:status:StackSetOperation' :: Maybe StackSetOperationStatus
status = Maybe StackSetOperationStatus
a} :: StackSetOperation)

-- | The Amazon Resource Number (ARN) of the IAM role used to perform this
-- stack set operation.
--
-- Use customized administrator roles to control which users or groups can
-- manage specific stack sets within the same administrator account. For
-- more information, see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Define Permissions for Multiple Administrators>
-- in the /CloudFormation User Guide/.
stackSetOperation_administrationRoleARN :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_administrationRoleARN :: (Maybe Text -> f (Maybe Text))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_administrationRoleARN = (StackSetOperation -> Maybe Text)
-> (StackSetOperation -> Maybe Text -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
administrationRoleARN :: Maybe Text
$sel:administrationRoleARN:StackSetOperation' :: StackSetOperation -> Maybe Text
administrationRoleARN} -> Maybe Text
administrationRoleARN) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:administrationRoleARN:StackSetOperation' :: Maybe Text
administrationRoleARN = Maybe Text
a} :: StackSetOperation)

-- | The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
-- and delete operations affect only the specified stack set instances that
-- are associated with the specified stack set. Update operations affect
-- both the stack set itself, as well as /all/ associated stack set
-- instances.
stackSetOperation_action :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationAction)
stackSetOperation_action :: (Maybe StackSetOperationAction
 -> f (Maybe StackSetOperationAction))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_action = (StackSetOperation -> Maybe StackSetOperationAction)
-> (StackSetOperation
    -> Maybe StackSetOperationAction -> StackSetOperation)
-> Lens
     StackSetOperation
     StackSetOperation
     (Maybe StackSetOperationAction)
     (Maybe StackSetOperationAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationAction
action :: Maybe StackSetOperationAction
$sel:action:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationAction
action} -> Maybe StackSetOperationAction
action) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationAction
a -> StackSetOperation
s {$sel:action:StackSetOperation' :: Maybe StackSetOperationAction
action = Maybe StackSetOperationAction
a} :: StackSetOperation)

-- | The time at which the stack set operation ended, across all accounts and
-- Regions specified. Note that this doesn\'t necessarily mean that the
-- stack set operation was successful, or even attempted, in each account
-- or Region.
stackSetOperation_endTimestamp :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.UTCTime)
stackSetOperation_endTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_endTimestamp = (StackSetOperation -> Maybe ISO8601)
-> (StackSetOperation -> Maybe ISO8601 -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe ISO8601
endTimestamp :: Maybe ISO8601
$sel:endTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
endTimestamp} -> Maybe ISO8601
endTimestamp) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe ISO8601
a -> StackSetOperation
s {$sel:endTimestamp:StackSetOperation' :: Maybe ISO8601
endTimestamp = Maybe ISO8601
a} :: StackSetOperation) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> StackSetOperation -> f StackSetOperation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetOperation
-> f StackSetOperation
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

-- | The time at which the operation was initiated. Note that the creation
-- times for the stack set operation might differ from the creation time of
-- the individual stacks themselves. This is because CloudFormation needs
-- to perform preparatory work for the operation, such as dispatching the
-- work to the requested Regions, before actually creating the first
-- stacks.
stackSetOperation_creationTimestamp :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.UTCTime)
stackSetOperation_creationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_creationTimestamp = (StackSetOperation -> Maybe ISO8601)
-> (StackSetOperation -> Maybe ISO8601 -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe ISO8601
creationTimestamp :: Maybe ISO8601
$sel:creationTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
creationTimestamp} -> Maybe ISO8601
creationTimestamp) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe ISO8601
a -> StackSetOperation
s {$sel:creationTimestamp:StackSetOperation' :: Maybe ISO8601
creationTimestamp = Maybe ISO8601
a} :: StackSetOperation) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> StackSetOperation -> f StackSetOperation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetOperation
-> f StackSetOperation
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

-- | The preferences for how CloudFormation performs this stack set
-- operation.
stackSetOperation_operationPreferences :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationPreferences)
stackSetOperation_operationPreferences :: (Maybe StackSetOperationPreferences
 -> f (Maybe StackSetOperationPreferences))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_operationPreferences = (StackSetOperation -> Maybe StackSetOperationPreferences)
-> (StackSetOperation
    -> Maybe StackSetOperationPreferences -> StackSetOperation)
-> Lens
     StackSetOperation
     StackSetOperation
     (Maybe StackSetOperationPreferences)
     (Maybe StackSetOperationPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationPreferences
operationPreferences :: Maybe StackSetOperationPreferences
$sel:operationPreferences:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationPreferences
operationPreferences} -> Maybe StackSetOperationPreferences
operationPreferences) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationPreferences
a -> StackSetOperation
s {$sel:operationPreferences:StackSetOperation' :: Maybe StackSetOperationPreferences
operationPreferences = Maybe StackSetOperationPreferences
a} :: StackSetOperation)

-- | The unique ID of a stack set operation.
stackSetOperation_operationId :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_operationId :: (Maybe Text -> f (Maybe Text))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_operationId = (StackSetOperation -> Maybe Text)
-> (StackSetOperation -> Maybe Text -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
operationId :: Maybe Text
$sel:operationId:StackSetOperation' :: StackSetOperation -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:operationId:StackSetOperation' :: Maybe Text
operationId = Maybe Text
a} :: StackSetOperation)

-- | For stack set operations of action type @DELETE@, specifies whether to
-- remove the stack instances from the specified stack set, but doesn\'t
-- delete the stacks. You can\'t reassociate a retained stack, or add an
-- existing, saved stack to a new stack set.
stackSetOperation_retainStacks :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Bool)
stackSetOperation_retainStacks :: (Maybe Bool -> f (Maybe Bool))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_retainStacks = (StackSetOperation -> Maybe Bool)
-> (StackSetOperation -> Maybe Bool -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Bool
retainStacks :: Maybe Bool
$sel:retainStacks:StackSetOperation' :: StackSetOperation -> Maybe Bool
retainStacks} -> Maybe Bool
retainStacks) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Bool
a -> StackSetOperation
s {$sel:retainStacks:StackSetOperation' :: Maybe Bool
retainStacks = Maybe Bool
a} :: StackSetOperation)

-- | [Service-managed permissions] The Organizations accounts affected by the
-- stack operation.
stackSetOperation_deploymentTargets :: Lens.Lens' StackSetOperation (Prelude.Maybe DeploymentTargets)
stackSetOperation_deploymentTargets :: (Maybe DeploymentTargets -> f (Maybe DeploymentTargets))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_deploymentTargets = (StackSetOperation -> Maybe DeploymentTargets)
-> (StackSetOperation
    -> Maybe DeploymentTargets -> StackSetOperation)
-> Lens
     StackSetOperation
     StackSetOperation
     (Maybe DeploymentTargets)
     (Maybe DeploymentTargets)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe DeploymentTargets
deploymentTargets :: Maybe DeploymentTargets
$sel:deploymentTargets:StackSetOperation' :: StackSetOperation -> Maybe DeploymentTargets
deploymentTargets} -> Maybe DeploymentTargets
deploymentTargets) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe DeploymentTargets
a -> StackSetOperation
s {$sel:deploymentTargets:StackSetOperation' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
a} :: StackSetOperation)

-- | The ID of the stack set.
stackSetOperation_stackSetId :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_stackSetId :: (Maybe Text -> f (Maybe Text))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_stackSetId = (StackSetOperation -> Maybe Text)
-> (StackSetOperation -> Maybe Text -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
stackSetId :: Maybe Text
$sel:stackSetId:StackSetOperation' :: StackSetOperation -> Maybe Text
stackSetId} -> Maybe Text
stackSetId) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:stackSetId:StackSetOperation' :: Maybe Text
stackSetId = Maybe Text
a} :: StackSetOperation)

-- | The name of the IAM execution role used to create or update the stack
-- set.
--
-- Use customized execution roles to control which stack resources users
-- and groups can include in their stack sets.
stackSetOperation_executionRoleName :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_executionRoleName :: (Maybe Text -> f (Maybe Text))
-> StackSetOperation -> f StackSetOperation
stackSetOperation_executionRoleName = (StackSetOperation -> Maybe Text)
-> (StackSetOperation -> Maybe Text -> StackSetOperation)
-> Lens
     StackSetOperation StackSetOperation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
executionRoleName :: Maybe Text
$sel:executionRoleName:StackSetOperation' :: StackSetOperation -> Maybe Text
executionRoleName} -> Maybe Text
executionRoleName) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:executionRoleName:StackSetOperation' :: Maybe Text
executionRoleName = Maybe Text
a} :: StackSetOperation)

instance Core.FromXML StackSetOperation where
  parseXML :: [Node] -> Either String StackSetOperation
parseXML [Node]
x =
    Maybe StackSetDriftDetectionDetails
-> Maybe StackSetOperationStatus
-> Maybe Text
-> Maybe StackSetOperationAction
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe StackSetOperationPreferences
-> Maybe Text
-> Maybe Bool
-> Maybe DeploymentTargets
-> Maybe Text
-> Maybe Text
-> StackSetOperation
StackSetOperation'
      (Maybe StackSetDriftDetectionDetails
 -> Maybe StackSetOperationStatus
 -> Maybe Text
 -> Maybe StackSetOperationAction
 -> Maybe ISO8601
 -> Maybe ISO8601
 -> Maybe StackSetOperationPreferences
 -> Maybe Text
 -> Maybe Bool
 -> Maybe DeploymentTargets
 -> Maybe Text
 -> Maybe Text
 -> StackSetOperation)
-> Either String (Maybe StackSetDriftDetectionDetails)
-> Either
     String
     (Maybe StackSetOperationStatus
      -> Maybe Text
      -> Maybe StackSetOperationAction
      -> Maybe ISO8601
      -> Maybe ISO8601
      -> Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text -> Either String (Maybe StackSetDriftDetectionDetails)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackSetDriftDetectionDetails")
      Either
  String
  (Maybe StackSetOperationStatus
   -> Maybe Text
   -> Maybe StackSetOperationAction
   -> Maybe ISO8601
   -> Maybe ISO8601
   -> Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe StackSetOperationStatus)
-> Either
     String
     (Maybe Text
      -> Maybe StackSetOperationAction
      -> Maybe ISO8601
      -> Maybe ISO8601
      -> Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StackSetOperationStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Text
   -> Maybe StackSetOperationAction
   -> Maybe ISO8601
   -> Maybe ISO8601
   -> Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StackSetOperationAction
      -> Maybe ISO8601
      -> Maybe ISO8601
      -> Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
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
"AdministrationRoleARN")
      Either
  String
  (Maybe StackSetOperationAction
   -> Maybe ISO8601
   -> Maybe ISO8601
   -> Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe StackSetOperationAction)
-> Either
     String
     (Maybe ISO8601
      -> Maybe ISO8601
      -> Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StackSetOperationAction)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Action")
      Either
  String
  (Maybe ISO8601
   -> Maybe ISO8601
   -> Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe ISO8601
      -> Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
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
"EndTimestamp")
      Either
  String
  (Maybe ISO8601
   -> Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe StackSetOperationPreferences
      -> Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
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
"CreationTimestamp")
      Either
  String
  (Maybe StackSetOperationPreferences
   -> Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe StackSetOperationPreferences)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe StackSetOperationPreferences)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OperationPreferences")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe DeploymentTargets
      -> Maybe Text
      -> Maybe Text
      -> StackSetOperation)
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
"OperationId")
      Either
  String
  (Maybe Bool
   -> Maybe DeploymentTargets
   -> Maybe Text
   -> Maybe Text
   -> StackSetOperation)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe DeploymentTargets
      -> Maybe Text -> Maybe Text -> StackSetOperation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RetainStacks")
      Either
  String
  (Maybe DeploymentTargets
   -> Maybe Text -> Maybe Text -> StackSetOperation)
-> Either String (Maybe DeploymentTargets)
-> Either String (Maybe Text -> Maybe Text -> StackSetOperation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DeploymentTargets)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DeploymentTargets")
      Either String (Maybe Text -> Maybe Text -> StackSetOperation)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> StackSetOperation)
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")
      Either String (Maybe Text -> StackSetOperation)
-> Either String (Maybe Text) -> Either String StackSetOperation
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
"ExecutionRoleName")

instance Prelude.Hashable StackSetOperation

instance Prelude.NFData StackSetOperation