{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateStackSet
-- 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)
--
-- Updates the stack set, and associated stack instances in the specified
-- accounts and Regions.
--
-- Even if the stack set operation created by updating the stack set fails
-- (completely or partially, below or above a specified failure tolerance),
-- the stack set is updated with your changes. Subsequent
-- CreateStackInstances calls on the specified stack set use the updated
-- stack set.
module Amazonka.CloudFormation.UpdateStackSet
  ( -- * Creating a Request
    UpdateStackSet (..),
    newUpdateStackSet,

    -- * Request Lenses
    updateStackSet_administrationRoleARN,
    updateStackSet_usePreviousTemplate,
    updateStackSet_accounts,
    updateStackSet_callAs,
    updateStackSet_regions,
    updateStackSet_autoDeployment,
    updateStackSet_permissionModel,
    updateStackSet_parameters,
    updateStackSet_operationPreferences,
    updateStackSet_operationId,
    updateStackSet_templateBody,
    updateStackSet_templateURL,
    updateStackSet_deploymentTargets,
    updateStackSet_description,
    updateStackSet_capabilities,
    updateStackSet_tags,
    updateStackSet_executionRoleName,
    updateStackSet_stackSetName,

    -- * Destructuring the Response
    UpdateStackSetResponse (..),
    newUpdateStackSetResponse,

    -- * Response Lenses
    updateStackSetResponse_operationId,
    updateStackSetResponse_httpStatus,
  )
where

import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateStackSet' smart constructor.
data UpdateStackSet = UpdateStackSet'
  { -- | The Amazon Resource Number (ARN) of the IAM role to use to update this
    -- stack set.
    --
    -- Specify an IAM role only if you are using 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 Granting Permissions for Stack Set Operations>
    -- in the /CloudFormation User Guide/.
    --
    -- If you specified a customized administrator role when you created the
    -- stack set, you must specify a customized administrator role, even if it
    -- is the same customized administrator role used with this stack set
    -- previously.
    UpdateStackSet -> Maybe Text
administrationRoleARN :: Prelude.Maybe Prelude.Text,
    -- | Use the existing template that\'s associated with the stack set that
    -- you\'re updating.
    --
    -- Conditional: You must specify only one of the following parameters:
    -- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
    UpdateStackSet -> Maybe Bool
usePreviousTemplate :: Prelude.Maybe Prelude.Bool,
    -- | [Self-managed permissions] The accounts in which to update associated
    -- stack instances. If you specify accounts, you must also specify the
    -- Regions in which to update stack set instances.
    --
    -- To update /all/ the stack instances associated with this stack set, do
    -- not specify the @Accounts@ or @Regions@ properties.
    --
    -- If the stack set update includes changes to the template (that is, if
    -- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
    -- @Parameters@ property, CloudFormation marks all stack instances with a
    -- status of @OUTDATED@ prior to updating the stack instances in the
    -- specified accounts and Regions. If the stack set update does not include
    -- changes to the template or parameters, CloudFormation updates the stack
    -- instances in the specified accounts and Regions, while leaving all other
    -- stack instances with their existing stack instance status.
    UpdateStackSet -> Maybe [Text]
accounts :: Prelude.Maybe [Prelude.Text],
    -- | [Service-managed permissions] Specifies whether you are acting as an
    -- account administrator in the organization\'s management account or as a
    -- delegated administrator in a member account.
    --
    -- By default, @SELF@ is specified. Use @SELF@ for stack sets with
    -- self-managed permissions.
    --
    -- -   If you are signed in to the management account, specify @SELF@.
    --
    -- -   If you are signed in to a delegated administrator account, specify
    --     @DELEGATED_ADMIN@.
    --
    --     Your Amazon Web Services account must be registered as a delegated
    --     administrator in the management account. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
    --     in the /CloudFormation User Guide/.
    UpdateStackSet -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | The Regions in which to update associated stack instances. If you
    -- specify Regions, you must also specify accounts in which to update stack
    -- set instances.
    --
    -- To update /all/ the stack instances associated with this stack set, do
    -- not specify the @Accounts@ or @Regions@ properties.
    --
    -- If the stack set update includes changes to the template (that is, if
    -- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
    -- @Parameters@ property, CloudFormation marks all stack instances with a
    -- status of @OUTDATED@ prior to updating the stack instances in the
    -- specified accounts and Regions. If the stack set update does not include
    -- changes to the template or parameters, CloudFormation updates the stack
    -- instances in the specified accounts and Regions, while leaving all other
    -- stack instances with their existing stack instance status.
    UpdateStackSet -> Maybe [Text]
regions :: Prelude.Maybe [Prelude.Text],
    -- | [Service-managed permissions] Describes whether StackSets automatically
    -- deploys to Organizations accounts that are added to a target
    -- organization or organizational unit (OU).
    --
    -- If you specify @AutoDeployment@, do not specify @DeploymentTargets@ or
    -- @Regions@.
    UpdateStackSet -> Maybe AutoDeployment
autoDeployment :: Prelude.Maybe AutoDeployment,
    -- | Describes how the IAM roles required for stack set operations are
    -- created. You cannot modify @PermissionModel@ if there are stack
    -- instances associated with your stack set.
    --
    -- -   With @self-managed@ permissions, you must create the administrator
    --     and execution roles required to deploy to target accounts. For more
    --     information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
    --
    -- -   With @service-managed@ permissions, StackSets automatically creates
    --     the IAM roles required to deploy to accounts managed by
    --     Organizations. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
    UpdateStackSet -> Maybe PermissionModels
permissionModel :: Prelude.Maybe PermissionModels,
    -- | A list of input parameters for the stack set template.
    UpdateStackSet -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
    -- | Preferences for how CloudFormation performs this stack set operation.
    UpdateStackSet -> Maybe StackSetOperationPreferences
operationPreferences :: Prelude.Maybe StackSetOperationPreferences,
    -- | The unique ID for this stack set operation.
    --
    -- The operation ID also functions as an idempotency token, to ensure that
    -- CloudFormation performs the stack set operation only once, even if you
    -- retry the request multiple times. You might retry stack set operation
    -- requests to ensure that CloudFormation successfully received them.
    --
    -- If you don\'t specify an operation ID, CloudFormation generates one
    -- automatically.
    --
    -- Repeating this stack set operation with a new operation ID retries all
    -- stack instances whose status is @OUTDATED@.
    UpdateStackSet -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | The structure that contains the template body, with a minimum length of
    -- 1 byte and a maximum length of 51,200 bytes. For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
    -- in the CloudFormation User Guide.
    --
    -- Conditional: You must specify only one of the following parameters:
    -- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
    UpdateStackSet -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | The location of the file that contains the template body. The URL must
    -- point to a template (maximum size: 460,800 bytes) that is located in an
    -- Amazon S3 bucket or a Systems Manager document. For more information,
    -- see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
    -- in the CloudFormation User Guide.
    --
    -- Conditional: You must specify only one of the following parameters:
    -- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
    UpdateStackSet -> Maybe Text
templateURL :: Prelude.Maybe Prelude.Text,
    -- | [Service-managed permissions] The Organizations accounts in which to
    -- update associated stack instances.
    --
    -- To update all the stack instances associated with this stack set, do not
    -- specify @DeploymentTargets@ or @Regions@.
    --
    -- If the stack set update includes changes to the template (that is, if
    -- @TemplateBody@ or @TemplateURL@ is specified), or the @Parameters@,
    -- CloudFormation marks all stack instances with a status of @OUTDATED@
    -- prior to updating the stack instances in the specified accounts and
    -- Regions. If the stack set update does not include changes to the
    -- template or parameters, CloudFormation updates the stack instances in
    -- the specified accounts and Regions, while leaving all other stack
    -- instances with their existing stack instance status.
    UpdateStackSet -> Maybe DeploymentTargets
deploymentTargets :: Prelude.Maybe DeploymentTargets,
    -- | A brief description of updates that you are making.
    UpdateStackSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | In some cases, you must explicitly acknowledge that your stack template
    -- contains certain capabilities in order for CloudFormation to update the
    -- stack set and its associated stack instances.
    --
    -- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
    --
    --     Some stack templates might include resources that can affect
    --     permissions in your Amazon Web Services account; for example, by
    --     creating new Identity and Access Management (IAM) users. For those
    --     stacks sets, you must explicitly acknowledge this by specifying one
    --     of these capabilities.
    --
    --     The following IAM resources require you to specify either the
    --     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
    --
    --     -   If you have IAM resources, you can specify either capability.
    --
    --     -   If you have IAM resources with custom names, you /must/ specify
    --         @CAPABILITY_NAMED_IAM@.
    --
    --     -   If you don\'t specify either of these capabilities,
    --         CloudFormation returns an @InsufficientCapabilities@ error.
    --
    --     If your stack template contains these resources, we recommend that
    --     you review all permissions associated with them and edit their
    --     permissions if necessary.
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
    --
    --     For more information, see
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
    --
    -- -   @CAPABILITY_AUTO_EXPAND@
    --
    --     Some templates reference macros. If your stack set template
    --     references one or more macros, you must update the stack set
    --     directly from the processed template, without first reviewing the
    --     resulting changes in a change set. To update the stack set directly,
    --     you must acknowledge this capability. For more information, see
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
    --
    --     Stack sets with service-managed permissions do not currently support
    --     the use of macros in templates. (This includes the
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
    --     and
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
    --     transforms, which are macros hosted by CloudFormation.) Even if you
    --     specify this capability for a stack set with service-managed
    --     permissions, if you reference a macro in your template the stack set
    --     operation will fail.
    UpdateStackSet -> Maybe [Capability]
capabilities :: Prelude.Maybe [Capability],
    -- | The key-value pairs to associate with this stack set and the stacks
    -- created from it. CloudFormation also propagates these tags to supported
    -- resources that are created in the stacks. You can specify a maximum
    -- number of 50 tags.
    --
    -- If you specify tags for this parameter, those tags replace any list of
    -- tags that are currently associated with this stack set. This means:
    --
    -- -   If you don\'t specify this parameter, CloudFormation doesn\'t modify
    --     the stack\'s tags.
    --
    -- -   If you specify /any/ tags using this parameter, you must specify
    --     /all/ the tags that you want associated with this stack set, even
    --     tags you\'ve specifed before (for example, when creating the stack
    --     set or during a previous update of the stack set.). Any tags that
    --     you don\'t include in the updated list of tags are removed from the
    --     stack set, and therefore from the stacks and resources as well.
    --
    -- -   If you specify an empty value, CloudFormation removes all currently
    --     associated tags.
    --
    -- If you specify new tags as part of an @UpdateStackSet@ action,
    -- CloudFormation checks to see if you have the required IAM permission to
    -- tag resources. If you omit tags that are currently associated with the
    -- stack set from the list of tags you specify, CloudFormation assumes that
    -- you want to remove those tags from the stack set, and checks to see if
    -- you have permission to untag resources. If you don\'t have the necessary
    -- permission(s), the entire @UpdateStackSet@ action fails with an
    -- @access denied@ error, and the stack set is not updated.
    UpdateStackSet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the IAM execution role to use to update the stack set. If
    -- you do not specify an execution role, CloudFormation uses the
    -- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
    -- operation.
    --
    -- Specify an IAM role only if you are using customized execution roles to
    -- control which stack resources users and groups can include in their
    -- stack sets.
    --
    -- If you specify a customized execution role, CloudFormation uses that
    -- role to update the stack. If you do not specify a customized execution
    -- role, CloudFormation performs the update using the role previously
    -- associated with the stack set, so long as you have permissions to
    -- perform operations on the stack set.
    UpdateStackSet -> Maybe Text
executionRoleName :: Prelude.Maybe Prelude.Text,
    -- | The name or unique ID of the stack set that you want to update.
    UpdateStackSet -> Text
stackSetName :: Prelude.Text
  }
  deriving (UpdateStackSet -> UpdateStackSet -> Bool
(UpdateStackSet -> UpdateStackSet -> Bool)
-> (UpdateStackSet -> UpdateStackSet -> Bool) -> Eq UpdateStackSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStackSet -> UpdateStackSet -> Bool
$c/= :: UpdateStackSet -> UpdateStackSet -> Bool
== :: UpdateStackSet -> UpdateStackSet -> Bool
$c== :: UpdateStackSet -> UpdateStackSet -> Bool
Prelude.Eq, ReadPrec [UpdateStackSet]
ReadPrec UpdateStackSet
Int -> ReadS UpdateStackSet
ReadS [UpdateStackSet]
(Int -> ReadS UpdateStackSet)
-> ReadS [UpdateStackSet]
-> ReadPrec UpdateStackSet
-> ReadPrec [UpdateStackSet]
-> Read UpdateStackSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStackSet]
$creadListPrec :: ReadPrec [UpdateStackSet]
readPrec :: ReadPrec UpdateStackSet
$creadPrec :: ReadPrec UpdateStackSet
readList :: ReadS [UpdateStackSet]
$creadList :: ReadS [UpdateStackSet]
readsPrec :: Int -> ReadS UpdateStackSet
$creadsPrec :: Int -> ReadS UpdateStackSet
Prelude.Read, Int -> UpdateStackSet -> ShowS
[UpdateStackSet] -> ShowS
UpdateStackSet -> String
(Int -> UpdateStackSet -> ShowS)
-> (UpdateStackSet -> String)
-> ([UpdateStackSet] -> ShowS)
-> Show UpdateStackSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStackSet] -> ShowS
$cshowList :: [UpdateStackSet] -> ShowS
show :: UpdateStackSet -> String
$cshow :: UpdateStackSet -> String
showsPrec :: Int -> UpdateStackSet -> ShowS
$cshowsPrec :: Int -> UpdateStackSet -> ShowS
Prelude.Show, (forall x. UpdateStackSet -> Rep UpdateStackSet x)
-> (forall x. Rep UpdateStackSet x -> UpdateStackSet)
-> Generic UpdateStackSet
forall x. Rep UpdateStackSet x -> UpdateStackSet
forall x. UpdateStackSet -> Rep UpdateStackSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStackSet x -> UpdateStackSet
$cfrom :: forall x. UpdateStackSet -> Rep UpdateStackSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStackSet' 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:
--
-- 'administrationRoleARN', 'updateStackSet_administrationRoleARN' - The Amazon Resource Number (ARN) of the IAM role to use to update this
-- stack set.
--
-- Specify an IAM role only if you are using 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 Granting Permissions for Stack Set Operations>
-- in the /CloudFormation User Guide/.
--
-- If you specified a customized administrator role when you created the
-- stack set, you must specify a customized administrator role, even if it
-- is the same customized administrator role used with this stack set
-- previously.
--
-- 'usePreviousTemplate', 'updateStackSet_usePreviousTemplate' - Use the existing template that\'s associated with the stack set that
-- you\'re updating.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
--
-- 'accounts', 'updateStackSet_accounts' - [Self-managed permissions] The accounts in which to update associated
-- stack instances. If you specify accounts, you must also specify the
-- Regions in which to update stack set instances.
--
-- To update /all/ the stack instances associated with this stack set, do
-- not specify the @Accounts@ or @Regions@ properties.
--
-- If the stack set update includes changes to the template (that is, if
-- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
-- @Parameters@ property, CloudFormation marks all stack instances with a
-- status of @OUTDATED@ prior to updating the stack instances in the
-- specified accounts and Regions. If the stack set update does not include
-- changes to the template or parameters, CloudFormation updates the stack
-- instances in the specified accounts and Regions, while leaving all other
-- stack instances with their existing stack instance status.
--
-- 'callAs', 'updateStackSet_callAs' - [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
--
-- 'regions', 'updateStackSet_regions' - The Regions in which to update associated stack instances. If you
-- specify Regions, you must also specify accounts in which to update stack
-- set instances.
--
-- To update /all/ the stack instances associated with this stack set, do
-- not specify the @Accounts@ or @Regions@ properties.
--
-- If the stack set update includes changes to the template (that is, if
-- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
-- @Parameters@ property, CloudFormation marks all stack instances with a
-- status of @OUTDATED@ prior to updating the stack instances in the
-- specified accounts and Regions. If the stack set update does not include
-- changes to the template or parameters, CloudFormation updates the stack
-- instances in the specified accounts and Regions, while leaving all other
-- stack instances with their existing stack instance status.
--
-- 'autoDeployment', 'updateStackSet_autoDeployment' - [Service-managed permissions] Describes whether StackSets automatically
-- deploys to Organizations accounts that are added to a target
-- organization or organizational unit (OU).
--
-- If you specify @AutoDeployment@, do not specify @DeploymentTargets@ or
-- @Regions@.
--
-- 'permissionModel', 'updateStackSet_permissionModel' - Describes how the IAM roles required for stack set operations are
-- created. You cannot modify @PermissionModel@ if there are stack
-- instances associated with your stack set.
--
-- -   With @self-managed@ permissions, you must create the administrator
--     and execution roles required to deploy to target accounts. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
--
-- -   With @service-managed@ permissions, StackSets automatically creates
--     the IAM roles required to deploy to accounts managed by
--     Organizations. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
--
-- 'parameters', 'updateStackSet_parameters' - A list of input parameters for the stack set template.
--
-- 'operationPreferences', 'updateStackSet_operationPreferences' - Preferences for how CloudFormation performs this stack set operation.
--
-- 'operationId', 'updateStackSet_operationId' - The unique ID for this stack set operation.
--
-- The operation ID also functions as an idempotency token, to ensure that
-- CloudFormation performs the stack set operation only once, even if you
-- retry the request multiple times. You might retry stack set operation
-- requests to ensure that CloudFormation successfully received them.
--
-- If you don\'t specify an operation ID, CloudFormation generates one
-- automatically.
--
-- Repeating this stack set operation with a new operation ID retries all
-- stack instances whose status is @OUTDATED@.
--
-- 'templateBody', 'updateStackSet_templateBody' - The structure that contains the template body, with a minimum length of
-- 1 byte and a maximum length of 51,200 bytes. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
--
-- 'templateURL', 'updateStackSet_templateURL' - The location of the file that contains the template body. The URL must
-- point to a template (maximum size: 460,800 bytes) that is located in an
-- Amazon S3 bucket or a Systems Manager document. For more information,
-- see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
--
-- 'deploymentTargets', 'updateStackSet_deploymentTargets' - [Service-managed permissions] The Organizations accounts in which to
-- update associated stack instances.
--
-- To update all the stack instances associated with this stack set, do not
-- specify @DeploymentTargets@ or @Regions@.
--
-- If the stack set update includes changes to the template (that is, if
-- @TemplateBody@ or @TemplateURL@ is specified), or the @Parameters@,
-- CloudFormation marks all stack instances with a status of @OUTDATED@
-- prior to updating the stack instances in the specified accounts and
-- Regions. If the stack set update does not include changes to the
-- template or parameters, CloudFormation updates the stack instances in
-- the specified accounts and Regions, while leaving all other stack
-- instances with their existing stack instance status.
--
-- 'description', 'updateStackSet_description' - A brief description of updates that you are making.
--
-- 'capabilities', 'updateStackSet_capabilities' - In some cases, you must explicitly acknowledge that your stack template
-- contains certain capabilities in order for CloudFormation to update the
-- stack set and its associated stack instances.
--
-- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
--
--     Some stack templates might include resources that can affect
--     permissions in your Amazon Web Services account; for example, by
--     creating new Identity and Access Management (IAM) users. For those
--     stacks sets, you must explicitly acknowledge this by specifying one
--     of these capabilities.
--
--     The following IAM resources require you to specify either the
--     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
--
--     -   If you have IAM resources, you can specify either capability.
--
--     -   If you have IAM resources with custom names, you /must/ specify
--         @CAPABILITY_NAMED_IAM@.
--
--     -   If you don\'t specify either of these capabilities,
--         CloudFormation returns an @InsufficientCapabilities@ error.
--
--     If your stack template contains these resources, we recommend that
--     you review all permissions associated with them and edit their
--     permissions if necessary.
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
--
-- -   @CAPABILITY_AUTO_EXPAND@
--
--     Some templates reference macros. If your stack set template
--     references one or more macros, you must update the stack set
--     directly from the processed template, without first reviewing the
--     resulting changes in a change set. To update the stack set directly,
--     you must acknowledge this capability. For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
--
--     Stack sets with service-managed permissions do not currently support
--     the use of macros in templates. (This includes the
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
--     and
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
--     transforms, which are macros hosted by CloudFormation.) Even if you
--     specify this capability for a stack set with service-managed
--     permissions, if you reference a macro in your template the stack set
--     operation will fail.
--
-- 'tags', 'updateStackSet_tags' - The key-value pairs to associate with this stack set and the stacks
-- created from it. CloudFormation also propagates these tags to supported
-- resources that are created in the stacks. You can specify a maximum
-- number of 50 tags.
--
-- If you specify tags for this parameter, those tags replace any list of
-- tags that are currently associated with this stack set. This means:
--
-- -   If you don\'t specify this parameter, CloudFormation doesn\'t modify
--     the stack\'s tags.
--
-- -   If you specify /any/ tags using this parameter, you must specify
--     /all/ the tags that you want associated with this stack set, even
--     tags you\'ve specifed before (for example, when creating the stack
--     set or during a previous update of the stack set.). Any tags that
--     you don\'t include in the updated list of tags are removed from the
--     stack set, and therefore from the stacks and resources as well.
--
-- -   If you specify an empty value, CloudFormation removes all currently
--     associated tags.
--
-- If you specify new tags as part of an @UpdateStackSet@ action,
-- CloudFormation checks to see if you have the required IAM permission to
-- tag resources. If you omit tags that are currently associated with the
-- stack set from the list of tags you specify, CloudFormation assumes that
-- you want to remove those tags from the stack set, and checks to see if
-- you have permission to untag resources. If you don\'t have the necessary
-- permission(s), the entire @UpdateStackSet@ action fails with an
-- @access denied@ error, and the stack set is not updated.
--
-- 'executionRoleName', 'updateStackSet_executionRoleName' - The name of the IAM execution role to use to update the stack set. If
-- you do not specify an execution role, CloudFormation uses the
-- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
-- operation.
--
-- Specify an IAM role only if you are using customized execution roles to
-- control which stack resources users and groups can include in their
-- stack sets.
--
-- If you specify a customized execution role, CloudFormation uses that
-- role to update the stack. If you do not specify a customized execution
-- role, CloudFormation performs the update using the role previously
-- associated with the stack set, so long as you have permissions to
-- perform operations on the stack set.
--
-- 'stackSetName', 'updateStackSet_stackSetName' - The name or unique ID of the stack set that you want to update.
newUpdateStackSet ::
  -- | 'stackSetName'
  Prelude.Text ->
  UpdateStackSet
newUpdateStackSet :: Text -> UpdateStackSet
newUpdateStackSet Text
pStackSetName_ =
  UpdateStackSet' :: Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe CallAs
-> Maybe [Text]
-> Maybe AutoDeployment
-> Maybe PermissionModels
-> Maybe [Parameter]
-> Maybe StackSetOperationPreferences
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeploymentTargets
-> Maybe Text
-> Maybe [Capability]
-> Maybe [Tag]
-> Maybe Text
-> Text
-> UpdateStackSet
UpdateStackSet'
    { $sel:administrationRoleARN:UpdateStackSet' :: Maybe Text
administrationRoleARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usePreviousTemplate:UpdateStackSet' :: Maybe Bool
usePreviousTemplate = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:accounts:UpdateStackSet' :: Maybe [Text]
accounts = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:callAs:UpdateStackSet' :: Maybe CallAs
callAs = Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
      $sel:regions:UpdateStackSet' :: Maybe [Text]
regions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:autoDeployment:UpdateStackSet' :: Maybe AutoDeployment
autoDeployment = Maybe AutoDeployment
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionModel:UpdateStackSet' :: Maybe PermissionModels
permissionModel = Maybe PermissionModels
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:UpdateStackSet' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:operationPreferences:UpdateStackSet' :: Maybe StackSetOperationPreferences
operationPreferences = Maybe StackSetOperationPreferences
forall a. Maybe a
Prelude.Nothing,
      $sel:operationId:UpdateStackSet' :: Maybe Text
operationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:UpdateStackSet' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateURL:UpdateStackSet' :: Maybe Text
templateURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentTargets:UpdateStackSet' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateStackSet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:capabilities:UpdateStackSet' :: Maybe [Capability]
capabilities = Maybe [Capability]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:UpdateStackSet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:executionRoleName:UpdateStackSet' :: Maybe Text
executionRoleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetName:UpdateStackSet' :: Text
stackSetName = Text
pStackSetName_
    }

-- | The Amazon Resource Number (ARN) of the IAM role to use to update this
-- stack set.
--
-- Specify an IAM role only if you are using 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 Granting Permissions for Stack Set Operations>
-- in the /CloudFormation User Guide/.
--
-- If you specified a customized administrator role when you created the
-- stack set, you must specify a customized administrator role, even if it
-- is the same customized administrator role used with this stack set
-- previously.
updateStackSet_administrationRoleARN :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_administrationRoleARN :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_administrationRoleARN = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
administrationRoleARN :: Maybe Text
$sel:administrationRoleARN:UpdateStackSet' :: UpdateStackSet -> Maybe Text
administrationRoleARN} -> Maybe Text
administrationRoleARN) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:administrationRoleARN:UpdateStackSet' :: Maybe Text
administrationRoleARN = Maybe Text
a} :: UpdateStackSet)

-- | Use the existing template that\'s associated with the stack set that
-- you\'re updating.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
updateStackSet_usePreviousTemplate :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Bool)
updateStackSet_usePreviousTemplate :: (Maybe Bool -> f (Maybe Bool))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_usePreviousTemplate = (UpdateStackSet -> Maybe Bool)
-> (UpdateStackSet -> Maybe Bool -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Bool
usePreviousTemplate :: Maybe Bool
$sel:usePreviousTemplate:UpdateStackSet' :: UpdateStackSet -> Maybe Bool
usePreviousTemplate} -> Maybe Bool
usePreviousTemplate) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Bool
a -> UpdateStackSet
s {$sel:usePreviousTemplate:UpdateStackSet' :: Maybe Bool
usePreviousTemplate = Maybe Bool
a} :: UpdateStackSet)

-- | [Self-managed permissions] The accounts in which to update associated
-- stack instances. If you specify accounts, you must also specify the
-- Regions in which to update stack set instances.
--
-- To update /all/ the stack instances associated with this stack set, do
-- not specify the @Accounts@ or @Regions@ properties.
--
-- If the stack set update includes changes to the template (that is, if
-- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
-- @Parameters@ property, CloudFormation marks all stack instances with a
-- status of @OUTDATED@ prior to updating the stack instances in the
-- specified accounts and Regions. If the stack set update does not include
-- changes to the template or parameters, CloudFormation updates the stack
-- instances in the specified accounts and Regions, while leaving all other
-- stack instances with their existing stack instance status.
updateStackSet_accounts :: Lens.Lens' UpdateStackSet (Prelude.Maybe [Prelude.Text])
updateStackSet_accounts :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_accounts = (UpdateStackSet -> Maybe [Text])
-> (UpdateStackSet -> Maybe [Text] -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe [Text]
accounts :: Maybe [Text]
$sel:accounts:UpdateStackSet' :: UpdateStackSet -> Maybe [Text]
accounts} -> Maybe [Text]
accounts) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe [Text]
a -> UpdateStackSet
s {$sel:accounts:UpdateStackSet' :: Maybe [Text]
accounts = Maybe [Text]
a} :: UpdateStackSet) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateStackSet -> f UpdateStackSet)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStackSet
-> f UpdateStackSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
updateStackSet_callAs :: Lens.Lens' UpdateStackSet (Prelude.Maybe CallAs)
updateStackSet_callAs :: (Maybe CallAs -> f (Maybe CallAs))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_callAs = (UpdateStackSet -> Maybe CallAs)
-> (UpdateStackSet -> Maybe CallAs -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe CallAs) (Maybe CallAs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:UpdateStackSet' :: UpdateStackSet -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe CallAs
a -> UpdateStackSet
s {$sel:callAs:UpdateStackSet' :: Maybe CallAs
callAs = Maybe CallAs
a} :: UpdateStackSet)

-- | The Regions in which to update associated stack instances. If you
-- specify Regions, you must also specify accounts in which to update stack
-- set instances.
--
-- To update /all/ the stack instances associated with this stack set, do
-- not specify the @Accounts@ or @Regions@ properties.
--
-- If the stack set update includes changes to the template (that is, if
-- the @TemplateBody@ or @TemplateURL@ properties are specified), or the
-- @Parameters@ property, CloudFormation marks all stack instances with a
-- status of @OUTDATED@ prior to updating the stack instances in the
-- specified accounts and Regions. If the stack set update does not include
-- changes to the template or parameters, CloudFormation updates the stack
-- instances in the specified accounts and Regions, while leaving all other
-- stack instances with their existing stack instance status.
updateStackSet_regions :: Lens.Lens' UpdateStackSet (Prelude.Maybe [Prelude.Text])
updateStackSet_regions :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_regions = (UpdateStackSet -> Maybe [Text])
-> (UpdateStackSet -> Maybe [Text] -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe [Text]
regions :: Maybe [Text]
$sel:regions:UpdateStackSet' :: UpdateStackSet -> Maybe [Text]
regions} -> Maybe [Text]
regions) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe [Text]
a -> UpdateStackSet
s {$sel:regions:UpdateStackSet' :: Maybe [Text]
regions = Maybe [Text]
a} :: UpdateStackSet) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateStackSet -> f UpdateStackSet)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStackSet
-> f UpdateStackSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Service-managed permissions] Describes whether StackSets automatically
-- deploys to Organizations accounts that are added to a target
-- organization or organizational unit (OU).
--
-- If you specify @AutoDeployment@, do not specify @DeploymentTargets@ or
-- @Regions@.
updateStackSet_autoDeployment :: Lens.Lens' UpdateStackSet (Prelude.Maybe AutoDeployment)
updateStackSet_autoDeployment :: (Maybe AutoDeployment -> f (Maybe AutoDeployment))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_autoDeployment = (UpdateStackSet -> Maybe AutoDeployment)
-> (UpdateStackSet -> Maybe AutoDeployment -> UpdateStackSet)
-> Lens
     UpdateStackSet
     UpdateStackSet
     (Maybe AutoDeployment)
     (Maybe AutoDeployment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe AutoDeployment
autoDeployment :: Maybe AutoDeployment
$sel:autoDeployment:UpdateStackSet' :: UpdateStackSet -> Maybe AutoDeployment
autoDeployment} -> Maybe AutoDeployment
autoDeployment) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe AutoDeployment
a -> UpdateStackSet
s {$sel:autoDeployment:UpdateStackSet' :: Maybe AutoDeployment
autoDeployment = Maybe AutoDeployment
a} :: UpdateStackSet)

-- | Describes how the IAM roles required for stack set operations are
-- created. You cannot modify @PermissionModel@ if there are stack
-- instances associated with your stack set.
--
-- -   With @self-managed@ permissions, you must create the administrator
--     and execution roles required to deploy to target accounts. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
--
-- -   With @service-managed@ permissions, StackSets automatically creates
--     the IAM roles required to deploy to accounts managed by
--     Organizations. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
updateStackSet_permissionModel :: Lens.Lens' UpdateStackSet (Prelude.Maybe PermissionModels)
updateStackSet_permissionModel :: (Maybe PermissionModels -> f (Maybe PermissionModels))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_permissionModel = (UpdateStackSet -> Maybe PermissionModels)
-> (UpdateStackSet -> Maybe PermissionModels -> UpdateStackSet)
-> Lens
     UpdateStackSet
     UpdateStackSet
     (Maybe PermissionModels)
     (Maybe PermissionModels)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe PermissionModels
permissionModel :: Maybe PermissionModels
$sel:permissionModel:UpdateStackSet' :: UpdateStackSet -> Maybe PermissionModels
permissionModel} -> Maybe PermissionModels
permissionModel) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe PermissionModels
a -> UpdateStackSet
s {$sel:permissionModel:UpdateStackSet' :: Maybe PermissionModels
permissionModel = Maybe PermissionModels
a} :: UpdateStackSet)

-- | A list of input parameters for the stack set template.
updateStackSet_parameters :: Lens.Lens' UpdateStackSet (Prelude.Maybe [Parameter])
updateStackSet_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_parameters = (UpdateStackSet -> Maybe [Parameter])
-> (UpdateStackSet -> Maybe [Parameter] -> UpdateStackSet)
-> Lens
     UpdateStackSet
     UpdateStackSet
     (Maybe [Parameter])
     (Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:UpdateStackSet' :: UpdateStackSet -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe [Parameter]
a -> UpdateStackSet
s {$sel:parameters:UpdateStackSet' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: UpdateStackSet) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> UpdateStackSet -> f UpdateStackSet)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> UpdateStackSet
-> f UpdateStackSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Parameter] [Parameter] [Parameter] [Parameter]
-> Iso
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
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 [Parameter] [Parameter] [Parameter] [Parameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The unique ID for this stack set operation.
--
-- The operation ID also functions as an idempotency token, to ensure that
-- CloudFormation performs the stack set operation only once, even if you
-- retry the request multiple times. You might retry stack set operation
-- requests to ensure that CloudFormation successfully received them.
--
-- If you don\'t specify an operation ID, CloudFormation generates one
-- automatically.
--
-- Repeating this stack set operation with a new operation ID retries all
-- stack instances whose status is @OUTDATED@.
updateStackSet_operationId :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_operationId :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_operationId = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
operationId :: Maybe Text
$sel:operationId:UpdateStackSet' :: UpdateStackSet -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:operationId:UpdateStackSet' :: Maybe Text
operationId = Maybe Text
a} :: UpdateStackSet)

-- | The structure that contains the template body, with a minimum length of
-- 1 byte and a maximum length of 51,200 bytes. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
updateStackSet_templateBody :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_templateBody :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_templateBody = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:UpdateStackSet' :: UpdateStackSet -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:templateBody:UpdateStackSet' :: Maybe Text
templateBody = Maybe Text
a} :: UpdateStackSet)

-- | The location of the file that contains the template body. The URL must
-- point to a template (maximum size: 460,800 bytes) that is located in an
-- Amazon S3 bucket or a Systems Manager document. For more information,
-- see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify only one of the following parameters:
-- @TemplateBody@ or @TemplateURL@—or set @UsePreviousTemplate@ to true.
updateStackSet_templateURL :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_templateURL :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_templateURL = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
templateURL :: Maybe Text
$sel:templateURL:UpdateStackSet' :: UpdateStackSet -> Maybe Text
templateURL} -> Maybe Text
templateURL) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:templateURL:UpdateStackSet' :: Maybe Text
templateURL = Maybe Text
a} :: UpdateStackSet)

-- | [Service-managed permissions] The Organizations accounts in which to
-- update associated stack instances.
--
-- To update all the stack instances associated with this stack set, do not
-- specify @DeploymentTargets@ or @Regions@.
--
-- If the stack set update includes changes to the template (that is, if
-- @TemplateBody@ or @TemplateURL@ is specified), or the @Parameters@,
-- CloudFormation marks all stack instances with a status of @OUTDATED@
-- prior to updating the stack instances in the specified accounts and
-- Regions. If the stack set update does not include changes to the
-- template or parameters, CloudFormation updates the stack instances in
-- the specified accounts and Regions, while leaving all other stack
-- instances with their existing stack instance status.
updateStackSet_deploymentTargets :: Lens.Lens' UpdateStackSet (Prelude.Maybe DeploymentTargets)
updateStackSet_deploymentTargets :: (Maybe DeploymentTargets -> f (Maybe DeploymentTargets))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_deploymentTargets = (UpdateStackSet -> Maybe DeploymentTargets)
-> (UpdateStackSet -> Maybe DeploymentTargets -> UpdateStackSet)
-> Lens
     UpdateStackSet
     UpdateStackSet
     (Maybe DeploymentTargets)
     (Maybe DeploymentTargets)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe DeploymentTargets
deploymentTargets :: Maybe DeploymentTargets
$sel:deploymentTargets:UpdateStackSet' :: UpdateStackSet -> Maybe DeploymentTargets
deploymentTargets} -> Maybe DeploymentTargets
deploymentTargets) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe DeploymentTargets
a -> UpdateStackSet
s {$sel:deploymentTargets:UpdateStackSet' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
a} :: UpdateStackSet)

-- | A brief description of updates that you are making.
updateStackSet_description :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_description :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_description = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
description :: Maybe Text
$sel:description:UpdateStackSet' :: UpdateStackSet -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:description:UpdateStackSet' :: Maybe Text
description = Maybe Text
a} :: UpdateStackSet)

-- | In some cases, you must explicitly acknowledge that your stack template
-- contains certain capabilities in order for CloudFormation to update the
-- stack set and its associated stack instances.
--
-- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
--
--     Some stack templates might include resources that can affect
--     permissions in your Amazon Web Services account; for example, by
--     creating new Identity and Access Management (IAM) users. For those
--     stacks sets, you must explicitly acknowledge this by specifying one
--     of these capabilities.
--
--     The following IAM resources require you to specify either the
--     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
--
--     -   If you have IAM resources, you can specify either capability.
--
--     -   If you have IAM resources with custom names, you /must/ specify
--         @CAPABILITY_NAMED_IAM@.
--
--     -   If you don\'t specify either of these capabilities,
--         CloudFormation returns an @InsufficientCapabilities@ error.
--
--     If your stack template contains these resources, we recommend that
--     you review all permissions associated with them and edit their
--     permissions if necessary.
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
--
-- -   @CAPABILITY_AUTO_EXPAND@
--
--     Some templates reference macros. If your stack set template
--     references one or more macros, you must update the stack set
--     directly from the processed template, without first reviewing the
--     resulting changes in a change set. To update the stack set directly,
--     you must acknowledge this capability. For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
--
--     Stack sets with service-managed permissions do not currently support
--     the use of macros in templates. (This includes the
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
--     and
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
--     transforms, which are macros hosted by CloudFormation.) Even if you
--     specify this capability for a stack set with service-managed
--     permissions, if you reference a macro in your template the stack set
--     operation will fail.
updateStackSet_capabilities :: Lens.Lens' UpdateStackSet (Prelude.Maybe [Capability])
updateStackSet_capabilities :: (Maybe [Capability] -> f (Maybe [Capability]))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_capabilities = (UpdateStackSet -> Maybe [Capability])
-> (UpdateStackSet -> Maybe [Capability] -> UpdateStackSet)
-> Lens
     UpdateStackSet
     UpdateStackSet
     (Maybe [Capability])
     (Maybe [Capability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe [Capability]
capabilities :: Maybe [Capability]
$sel:capabilities:UpdateStackSet' :: UpdateStackSet -> Maybe [Capability]
capabilities} -> Maybe [Capability]
capabilities) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe [Capability]
a -> UpdateStackSet
s {$sel:capabilities:UpdateStackSet' :: Maybe [Capability]
capabilities = Maybe [Capability]
a} :: UpdateStackSet) ((Maybe [Capability] -> f (Maybe [Capability]))
 -> UpdateStackSet -> f UpdateStackSet)
-> ((Maybe [Capability] -> f (Maybe [Capability]))
    -> Maybe [Capability] -> f (Maybe [Capability]))
-> (Maybe [Capability] -> f (Maybe [Capability]))
-> UpdateStackSet
-> f UpdateStackSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Capability] [Capability] [Capability] [Capability]
-> Iso
     (Maybe [Capability])
     (Maybe [Capability])
     (Maybe [Capability])
     (Maybe [Capability])
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 [Capability] [Capability] [Capability] [Capability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The key-value pairs to associate with this stack set and the stacks
-- created from it. CloudFormation also propagates these tags to supported
-- resources that are created in the stacks. You can specify a maximum
-- number of 50 tags.
--
-- If you specify tags for this parameter, those tags replace any list of
-- tags that are currently associated with this stack set. This means:
--
-- -   If you don\'t specify this parameter, CloudFormation doesn\'t modify
--     the stack\'s tags.
--
-- -   If you specify /any/ tags using this parameter, you must specify
--     /all/ the tags that you want associated with this stack set, even
--     tags you\'ve specifed before (for example, when creating the stack
--     set or during a previous update of the stack set.). Any tags that
--     you don\'t include in the updated list of tags are removed from the
--     stack set, and therefore from the stacks and resources as well.
--
-- -   If you specify an empty value, CloudFormation removes all currently
--     associated tags.
--
-- If you specify new tags as part of an @UpdateStackSet@ action,
-- CloudFormation checks to see if you have the required IAM permission to
-- tag resources. If you omit tags that are currently associated with the
-- stack set from the list of tags you specify, CloudFormation assumes that
-- you want to remove those tags from the stack set, and checks to see if
-- you have permission to untag resources. If you don\'t have the necessary
-- permission(s), the entire @UpdateStackSet@ action fails with an
-- @access denied@ error, and the stack set is not updated.
updateStackSet_tags :: Lens.Lens' UpdateStackSet (Prelude.Maybe [Tag])
updateStackSet_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_tags = (UpdateStackSet -> Maybe [Tag])
-> (UpdateStackSet -> Maybe [Tag] -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:UpdateStackSet' :: UpdateStackSet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe [Tag]
a -> UpdateStackSet
s {$sel:tags:UpdateStackSet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: UpdateStackSet) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> UpdateStackSet -> f UpdateStackSet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateStackSet
-> f UpdateStackSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the IAM execution role to use to update the stack set. If
-- you do not specify an execution role, CloudFormation uses the
-- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
-- operation.
--
-- Specify an IAM role only if you are using customized execution roles to
-- control which stack resources users and groups can include in their
-- stack sets.
--
-- If you specify a customized execution role, CloudFormation uses that
-- role to update the stack. If you do not specify a customized execution
-- role, CloudFormation performs the update using the role previously
-- associated with the stack set, so long as you have permissions to
-- perform operations on the stack set.
updateStackSet_executionRoleName :: Lens.Lens' UpdateStackSet (Prelude.Maybe Prelude.Text)
updateStackSet_executionRoleName :: (Maybe Text -> f (Maybe Text))
-> UpdateStackSet -> f UpdateStackSet
updateStackSet_executionRoleName = (UpdateStackSet -> Maybe Text)
-> (UpdateStackSet -> Maybe Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Maybe Text
executionRoleName :: Maybe Text
$sel:executionRoleName:UpdateStackSet' :: UpdateStackSet -> Maybe Text
executionRoleName} -> Maybe Text
executionRoleName) (\s :: UpdateStackSet
s@UpdateStackSet' {} Maybe Text
a -> UpdateStackSet
s {$sel:executionRoleName:UpdateStackSet' :: Maybe Text
executionRoleName = Maybe Text
a} :: UpdateStackSet)

-- | The name or unique ID of the stack set that you want to update.
updateStackSet_stackSetName :: Lens.Lens' UpdateStackSet Prelude.Text
updateStackSet_stackSetName :: (Text -> f Text) -> UpdateStackSet -> f UpdateStackSet
updateStackSet_stackSetName = (UpdateStackSet -> Text)
-> (UpdateStackSet -> Text -> UpdateStackSet)
-> Lens UpdateStackSet UpdateStackSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSet' {Text
stackSetName :: Text
$sel:stackSetName:UpdateStackSet' :: UpdateStackSet -> Text
stackSetName} -> Text
stackSetName) (\s :: UpdateStackSet
s@UpdateStackSet' {} Text
a -> UpdateStackSet
s {$sel:stackSetName:UpdateStackSet' :: Text
stackSetName = Text
a} :: UpdateStackSet)

instance Core.AWSRequest UpdateStackSet where
  type
    AWSResponse UpdateStackSet =
      UpdateStackSetResponse
  request :: UpdateStackSet -> Request UpdateStackSet
request = Service -> UpdateStackSet -> Request UpdateStackSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateStackSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStackSet)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse UpdateStackSet))
-> Logger
-> Service
-> Proxy UpdateStackSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStackSet)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"UpdateStackSetResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Int -> UpdateStackSetResponse
UpdateStackSetResponse'
            (Maybe Text -> Int -> UpdateStackSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateStackSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OperationId")
            Either String (Int -> UpdateStackSetResponse)
-> Either String Int -> Either String UpdateStackSetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateStackSet

instance Prelude.NFData UpdateStackSet

instance Core.ToHeaders UpdateStackSet where
  toHeaders :: UpdateStackSet -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateStackSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath UpdateStackSet where
  toPath :: UpdateStackSet -> ByteString
toPath = ByteString -> UpdateStackSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateStackSet where
  toQuery :: UpdateStackSet -> QueryString
toQuery UpdateStackSet' {Maybe Bool
Maybe [Text]
Maybe [Capability]
Maybe [Parameter]
Maybe [Tag]
Maybe Text
Maybe AutoDeployment
Maybe CallAs
Maybe DeploymentTargets
Maybe PermissionModels
Maybe StackSetOperationPreferences
Text
stackSetName :: Text
executionRoleName :: Maybe Text
tags :: Maybe [Tag]
capabilities :: Maybe [Capability]
description :: Maybe Text
deploymentTargets :: Maybe DeploymentTargets
templateURL :: Maybe Text
templateBody :: Maybe Text
operationId :: Maybe Text
operationPreferences :: Maybe StackSetOperationPreferences
parameters :: Maybe [Parameter]
permissionModel :: Maybe PermissionModels
autoDeployment :: Maybe AutoDeployment
regions :: Maybe [Text]
callAs :: Maybe CallAs
accounts :: Maybe [Text]
usePreviousTemplate :: Maybe Bool
administrationRoleARN :: Maybe Text
$sel:stackSetName:UpdateStackSet' :: UpdateStackSet -> Text
$sel:executionRoleName:UpdateStackSet' :: UpdateStackSet -> Maybe Text
$sel:tags:UpdateStackSet' :: UpdateStackSet -> Maybe [Tag]
$sel:capabilities:UpdateStackSet' :: UpdateStackSet -> Maybe [Capability]
$sel:description:UpdateStackSet' :: UpdateStackSet -> Maybe Text
$sel:deploymentTargets:UpdateStackSet' :: UpdateStackSet -> Maybe DeploymentTargets
$sel:templateURL:UpdateStackSet' :: UpdateStackSet -> Maybe Text
$sel:templateBody:UpdateStackSet' :: UpdateStackSet -> Maybe Text
$sel:operationId:UpdateStackSet' :: UpdateStackSet -> Maybe Text
$sel:operationPreferences:UpdateStackSet' :: UpdateStackSet -> Maybe StackSetOperationPreferences
$sel:parameters:UpdateStackSet' :: UpdateStackSet -> Maybe [Parameter]
$sel:permissionModel:UpdateStackSet' :: UpdateStackSet -> Maybe PermissionModels
$sel:autoDeployment:UpdateStackSet' :: UpdateStackSet -> Maybe AutoDeployment
$sel:regions:UpdateStackSet' :: UpdateStackSet -> Maybe [Text]
$sel:callAs:UpdateStackSet' :: UpdateStackSet -> Maybe CallAs
$sel:accounts:UpdateStackSet' :: UpdateStackSet -> Maybe [Text]
$sel:usePreviousTemplate:UpdateStackSet' :: UpdateStackSet -> Maybe Bool
$sel:administrationRoleARN:UpdateStackSet' :: UpdateStackSet -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"UpdateStackSet" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"AdministrationRoleARN"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
administrationRoleARN,
        ByteString
"UsePreviousTemplate" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
usePreviousTemplate,
        ByteString
"Accounts"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accounts),
        ByteString
"CallAs" ByteString -> Maybe CallAs -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CallAs
callAs,
        ByteString
"Regions"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
regions),
        ByteString
"AutoDeployment" ByteString -> Maybe AutoDeployment -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AutoDeployment
autoDeployment,
        ByteString
"PermissionModel" ByteString -> Maybe PermissionModels -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PermissionModels
permissionModel,
        ByteString
"Parameters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Parameter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Parameter] -> QueryString)
-> Maybe [Parameter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Parameter]
parameters),
        ByteString
"OperationPreferences" ByteString -> Maybe StackSetOperationPreferences -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe StackSetOperationPreferences
operationPreferences,
        ByteString
"OperationId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
operationId,
        ByteString
"TemplateBody" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateBody,
        ByteString
"TemplateURL" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateURL,
        ByteString
"DeploymentTargets" ByteString -> Maybe DeploymentTargets -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DeploymentTargets
deploymentTargets,
        ByteString
"Description" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
description,
        ByteString
"Capabilities"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Capability] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Capability] -> QueryString)
-> Maybe [Capability] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Capability]
capabilities),
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"ExecutionRoleName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
executionRoleName,
        ByteString
"StackSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackSetName
      ]

-- | /See:/ 'newUpdateStackSetResponse' smart constructor.
data UpdateStackSetResponse = UpdateStackSetResponse'
  { -- | The unique ID for this stack set operation.
    UpdateStackSetResponse -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateStackSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateStackSetResponse -> UpdateStackSetResponse -> Bool
(UpdateStackSetResponse -> UpdateStackSetResponse -> Bool)
-> (UpdateStackSetResponse -> UpdateStackSetResponse -> Bool)
-> Eq UpdateStackSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStackSetResponse -> UpdateStackSetResponse -> Bool
$c/= :: UpdateStackSetResponse -> UpdateStackSetResponse -> Bool
== :: UpdateStackSetResponse -> UpdateStackSetResponse -> Bool
$c== :: UpdateStackSetResponse -> UpdateStackSetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStackSetResponse]
ReadPrec UpdateStackSetResponse
Int -> ReadS UpdateStackSetResponse
ReadS [UpdateStackSetResponse]
(Int -> ReadS UpdateStackSetResponse)
-> ReadS [UpdateStackSetResponse]
-> ReadPrec UpdateStackSetResponse
-> ReadPrec [UpdateStackSetResponse]
-> Read UpdateStackSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStackSetResponse]
$creadListPrec :: ReadPrec [UpdateStackSetResponse]
readPrec :: ReadPrec UpdateStackSetResponse
$creadPrec :: ReadPrec UpdateStackSetResponse
readList :: ReadS [UpdateStackSetResponse]
$creadList :: ReadS [UpdateStackSetResponse]
readsPrec :: Int -> ReadS UpdateStackSetResponse
$creadsPrec :: Int -> ReadS UpdateStackSetResponse
Prelude.Read, Int -> UpdateStackSetResponse -> ShowS
[UpdateStackSetResponse] -> ShowS
UpdateStackSetResponse -> String
(Int -> UpdateStackSetResponse -> ShowS)
-> (UpdateStackSetResponse -> String)
-> ([UpdateStackSetResponse] -> ShowS)
-> Show UpdateStackSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStackSetResponse] -> ShowS
$cshowList :: [UpdateStackSetResponse] -> ShowS
show :: UpdateStackSetResponse -> String
$cshow :: UpdateStackSetResponse -> String
showsPrec :: Int -> UpdateStackSetResponse -> ShowS
$cshowsPrec :: Int -> UpdateStackSetResponse -> ShowS
Prelude.Show, (forall x. UpdateStackSetResponse -> Rep UpdateStackSetResponse x)
-> (forall x.
    Rep UpdateStackSetResponse x -> UpdateStackSetResponse)
-> Generic UpdateStackSetResponse
forall x. Rep UpdateStackSetResponse x -> UpdateStackSetResponse
forall x. UpdateStackSetResponse -> Rep UpdateStackSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStackSetResponse x -> UpdateStackSetResponse
$cfrom :: forall x. UpdateStackSetResponse -> Rep UpdateStackSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStackSetResponse' 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:
--
-- 'operationId', 'updateStackSetResponse_operationId' - The unique ID for this stack set operation.
--
-- 'httpStatus', 'updateStackSetResponse_httpStatus' - The response's http status code.
newUpdateStackSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateStackSetResponse
newUpdateStackSetResponse :: Int -> UpdateStackSetResponse
newUpdateStackSetResponse Int
pHttpStatus_ =
  UpdateStackSetResponse' :: Maybe Text -> Int -> UpdateStackSetResponse
UpdateStackSetResponse'
    { $sel:operationId:UpdateStackSetResponse' :: Maybe Text
operationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateStackSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The response's http status code.
updateStackSetResponse_httpStatus :: Lens.Lens' UpdateStackSetResponse Prelude.Int
updateStackSetResponse_httpStatus :: (Int -> f Int)
-> UpdateStackSetResponse -> f UpdateStackSetResponse
updateStackSetResponse_httpStatus = (UpdateStackSetResponse -> Int)
-> (UpdateStackSetResponse -> Int -> UpdateStackSetResponse)
-> Lens UpdateStackSetResponse UpdateStackSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateStackSetResponse' :: UpdateStackSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateStackSetResponse
s@UpdateStackSetResponse' {} Int
a -> UpdateStackSetResponse
s {$sel:httpStatus:UpdateStackSetResponse' :: Int
httpStatus = Int
a} :: UpdateStackSetResponse)

instance Prelude.NFData UpdateStackSetResponse