{-# 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.UpdateStackInstances
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the parameter values for stack instances for the specified
-- accounts, within the specified Amazon Web Services Regions. A stack
-- instance refers to a stack in a specific account and Region.
--
-- You can only update stack instances in Amazon Web Services Regions and
-- accounts where they already exist; to create additional stack instances,
-- use
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html CreateStackInstances>.
--
-- During stack set updates, any parameters overridden for a stack instance
-- aren\'t updated, but retain their overridden value.
--
-- You can only update the parameter /values/ that are specified in the
-- stack set; to add or delete a parameter itself, use
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html UpdateStackSet>
-- to update the stack set template. If you add a parameter to a template,
-- before you can override the parameter value specified in the stack set
-- you must first use
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html UpdateStackSet>
-- to update all stack instances with the updated template and parameter
-- value specified in the stack set. Once a stack instance has been updated
-- with the new parameter, you can then override the parameter value using
-- @UpdateStackInstances@.
module Amazonka.CloudFormation.UpdateStackInstances
  ( -- * Creating a Request
    UpdateStackInstances (..),
    newUpdateStackInstances,

    -- * Request Lenses
    updateStackInstances_accounts,
    updateStackInstances_callAs,
    updateStackInstances_deploymentTargets,
    updateStackInstances_operationId,
    updateStackInstances_operationPreferences,
    updateStackInstances_parameterOverrides,
    updateStackInstances_stackSetName,
    updateStackInstances_regions,

    -- * Destructuring the Response
    UpdateStackInstancesResponse (..),
    newUpdateStackInstancesResponse,

    -- * Response Lenses
    updateStackInstancesResponse_operationId,
    updateStackInstancesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateStackInstances' smart constructor.
data UpdateStackInstances = UpdateStackInstances'
  { -- | [Self-managed permissions] The names of one or more Amazon Web Services
    -- accounts for which you want to update parameter values for stack
    -- instances. The overridden parameter values will be applied to all stack
    -- instances in the specified accounts and Amazon Web Services Regions.
    --
    -- You can specify @Accounts@ or @DeploymentTargets@, but not both.
    UpdateStackInstances -> 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/.
    UpdateStackInstances -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | [Service-managed permissions] The Organizations accounts for which you
    -- want to update parameter values for stack instances. If your update
    -- targets OUs, the overridden parameter values only apply to the accounts
    -- that are currently in the target OUs and their child OUs. Accounts added
    -- to the target OUs and their child OUs in the future won\'t use the
    -- overridden values.
    --
    -- You can specify @Accounts@ or @DeploymentTargets@, but not both.
    UpdateStackInstances -> Maybe DeploymentTargets
deploymentTargets :: Prelude.Maybe DeploymentTargets,
    -- | The unique identifier 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, the SDK generates one
    -- automatically.
    UpdateStackInstances -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | Preferences for how CloudFormation performs this stack set operation.
    UpdateStackInstances -> Maybe StackSetOperationPreferences
operationPreferences :: Prelude.Maybe StackSetOperationPreferences,
    -- | A list of input parameters whose values you want to update for the
    -- specified stack instances.
    --
    -- Any overridden parameter values will be applied to all stack instances
    -- in the specified accounts and Amazon Web Services Regions. When
    -- specifying parameters and their values, be aware of how CloudFormation
    -- sets parameter values during stack instance update operations:
    --
    -- -   To override the current value for a parameter, include the parameter
    --     and specify its value.
    --
    -- -   To leave an overridden parameter set to its present value, include
    --     the parameter and specify @UsePreviousValue@ as @true@. (You can\'t
    --     specify both a value and set @UsePreviousValue@ to @true@.)
    --
    -- -   To set an overridden parameter back to the value specified in the
    --     stack set, specify a parameter list but don\'t include the parameter
    --     in the list.
    --
    -- -   To leave all parameters set to their present values, don\'t specify
    --     this property at all.
    --
    -- During stack set updates, any parameter values overridden for a stack
    -- instance aren\'t updated, but retain their overridden value.
    --
    -- You can only override the parameter /values/ that are specified in the
    -- stack set; to add or delete a parameter itself, use @UpdateStackSet@ to
    -- update the stack set template. If you add a parameter to a template,
    -- before you can override the parameter value specified in the stack set
    -- you must first use
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html UpdateStackSet>
    -- to update all stack instances with the updated template and parameter
    -- value specified in the stack set. Once a stack instance has been updated
    -- with the new parameter, you can then override the parameter value using
    -- @UpdateStackInstances@.
    UpdateStackInstances -> Maybe [Parameter]
parameterOverrides :: Prelude.Maybe [Parameter],
    -- | The name or unique ID of the stack set associated with the stack
    -- instances.
    UpdateStackInstances -> Text
stackSetName :: Prelude.Text,
    -- | The names of one or more Amazon Web Services Regions in which you want
    -- to update parameter values for stack instances. The overridden parameter
    -- values will be applied to all stack instances in the specified accounts
    -- and Amazon Web Services Regions.
    UpdateStackInstances -> [Text]
regions :: [Prelude.Text]
  }
  deriving (UpdateStackInstances -> UpdateStackInstances -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStackInstances -> UpdateStackInstances -> Bool
$c/= :: UpdateStackInstances -> UpdateStackInstances -> Bool
== :: UpdateStackInstances -> UpdateStackInstances -> Bool
$c== :: UpdateStackInstances -> UpdateStackInstances -> Bool
Prelude.Eq, ReadPrec [UpdateStackInstances]
ReadPrec UpdateStackInstances
Int -> ReadS UpdateStackInstances
ReadS [UpdateStackInstances]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStackInstances]
$creadListPrec :: ReadPrec [UpdateStackInstances]
readPrec :: ReadPrec UpdateStackInstances
$creadPrec :: ReadPrec UpdateStackInstances
readList :: ReadS [UpdateStackInstances]
$creadList :: ReadS [UpdateStackInstances]
readsPrec :: Int -> ReadS UpdateStackInstances
$creadsPrec :: Int -> ReadS UpdateStackInstances
Prelude.Read, Int -> UpdateStackInstances -> ShowS
[UpdateStackInstances] -> ShowS
UpdateStackInstances -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStackInstances] -> ShowS
$cshowList :: [UpdateStackInstances] -> ShowS
show :: UpdateStackInstances -> String
$cshow :: UpdateStackInstances -> String
showsPrec :: Int -> UpdateStackInstances -> ShowS
$cshowsPrec :: Int -> UpdateStackInstances -> ShowS
Prelude.Show, forall x. Rep UpdateStackInstances x -> UpdateStackInstances
forall x. UpdateStackInstances -> Rep UpdateStackInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStackInstances x -> UpdateStackInstances
$cfrom :: forall x. UpdateStackInstances -> Rep UpdateStackInstances x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStackInstances' 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:
--
-- 'accounts', 'updateStackInstances_accounts' - [Self-managed permissions] The names of one or more Amazon Web Services
-- accounts for which you want to update parameter values for stack
-- instances. The overridden parameter values will be applied to all stack
-- instances in the specified accounts and Amazon Web Services Regions.
--
-- You can specify @Accounts@ or @DeploymentTargets@, but not both.
--
-- 'callAs', 'updateStackInstances_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/.
--
-- 'deploymentTargets', 'updateStackInstances_deploymentTargets' - [Service-managed permissions] The Organizations accounts for which you
-- want to update parameter values for stack instances. If your update
-- targets OUs, the overridden parameter values only apply to the accounts
-- that are currently in the target OUs and their child OUs. Accounts added
-- to the target OUs and their child OUs in the future won\'t use the
-- overridden values.
--
-- You can specify @Accounts@ or @DeploymentTargets@, but not both.
--
-- 'operationId', 'updateStackInstances_operationId' - The unique identifier 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, the SDK generates one
-- automatically.
--
-- 'operationPreferences', 'updateStackInstances_operationPreferences' - Preferences for how CloudFormation performs this stack set operation.
--
-- 'parameterOverrides', 'updateStackInstances_parameterOverrides' - A list of input parameters whose values you want to update for the
-- specified stack instances.
--
-- Any overridden parameter values will be applied to all stack instances
-- in the specified accounts and Amazon Web Services Regions. When
-- specifying parameters and their values, be aware of how CloudFormation
-- sets parameter values during stack instance update operations:
--
-- -   To override the current value for a parameter, include the parameter
--     and specify its value.
--
-- -   To leave an overridden parameter set to its present value, include
--     the parameter and specify @UsePreviousValue@ as @true@. (You can\'t
--     specify both a value and set @UsePreviousValue@ to @true@.)
--
-- -   To set an overridden parameter back to the value specified in the
--     stack set, specify a parameter list but don\'t include the parameter
--     in the list.
--
-- -   To leave all parameters set to their present values, don\'t specify
--     this property at all.
--
-- During stack set updates, any parameter values overridden for a stack
-- instance aren\'t updated, but retain their overridden value.
--
-- You can only override the parameter /values/ that are specified in the
-- stack set; to add or delete a parameter itself, use @UpdateStackSet@ to
-- update the stack set template. If you add a parameter to a template,
-- before you can override the parameter value specified in the stack set
-- you must first use
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html UpdateStackSet>
-- to update all stack instances with the updated template and parameter
-- value specified in the stack set. Once a stack instance has been updated
-- with the new parameter, you can then override the parameter value using
-- @UpdateStackInstances@.
--
-- 'stackSetName', 'updateStackInstances_stackSetName' - The name or unique ID of the stack set associated with the stack
-- instances.
--
-- 'regions', 'updateStackInstances_regions' - The names of one or more Amazon Web Services Regions in which you want
-- to update parameter values for stack instances. The overridden parameter
-- values will be applied to all stack instances in the specified accounts
-- and Amazon Web Services Regions.
newUpdateStackInstances ::
  -- | 'stackSetName'
  Prelude.Text ->
  UpdateStackInstances
newUpdateStackInstances :: Text -> UpdateStackInstances
newUpdateStackInstances Text
pStackSetName_ =
  UpdateStackInstances'
    { $sel:accounts:UpdateStackInstances' :: Maybe [Text]
accounts = forall a. Maybe a
Prelude.Nothing,
      $sel:callAs:UpdateStackInstances' :: Maybe CallAs
callAs = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentTargets:UpdateStackInstances' :: Maybe DeploymentTargets
deploymentTargets = forall a. Maybe a
Prelude.Nothing,
      $sel:operationId:UpdateStackInstances' :: Maybe Text
operationId = forall a. Maybe a
Prelude.Nothing,
      $sel:operationPreferences:UpdateStackInstances' :: Maybe StackSetOperationPreferences
operationPreferences = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterOverrides:UpdateStackInstances' :: Maybe [Parameter]
parameterOverrides = forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetName:UpdateStackInstances' :: Text
stackSetName = Text
pStackSetName_,
      $sel:regions:UpdateStackInstances' :: [Text]
regions = forall a. Monoid a => a
Prelude.mempty
    }

-- | [Self-managed permissions] The names of one or more Amazon Web Services
-- accounts for which you want to update parameter values for stack
-- instances. The overridden parameter values will be applied to all stack
-- instances in the specified accounts and Amazon Web Services Regions.
--
-- You can specify @Accounts@ or @DeploymentTargets@, but not both.
updateStackInstances_accounts :: Lens.Lens' UpdateStackInstances (Prelude.Maybe [Prelude.Text])
updateStackInstances_accounts :: Lens' UpdateStackInstances (Maybe [Text])
updateStackInstances_accounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Maybe [Text]
accounts :: Maybe [Text]
$sel:accounts:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Text]
accounts} -> Maybe [Text]
accounts) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Maybe [Text]
a -> UpdateStackInstances
s {$sel:accounts:UpdateStackInstances' :: Maybe [Text]
accounts = Maybe [Text]
a} :: UpdateStackInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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/.
updateStackInstances_callAs :: Lens.Lens' UpdateStackInstances (Prelude.Maybe CallAs)
updateStackInstances_callAs :: Lens' UpdateStackInstances (Maybe CallAs)
updateStackInstances_callAs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:UpdateStackInstances' :: UpdateStackInstances -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Maybe CallAs
a -> UpdateStackInstances
s {$sel:callAs:UpdateStackInstances' :: Maybe CallAs
callAs = Maybe CallAs
a} :: UpdateStackInstances)

-- | [Service-managed permissions] The Organizations accounts for which you
-- want to update parameter values for stack instances. If your update
-- targets OUs, the overridden parameter values only apply to the accounts
-- that are currently in the target OUs and their child OUs. Accounts added
-- to the target OUs and their child OUs in the future won\'t use the
-- overridden values.
--
-- You can specify @Accounts@ or @DeploymentTargets@, but not both.
updateStackInstances_deploymentTargets :: Lens.Lens' UpdateStackInstances (Prelude.Maybe DeploymentTargets)
updateStackInstances_deploymentTargets :: Lens' UpdateStackInstances (Maybe DeploymentTargets)
updateStackInstances_deploymentTargets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Maybe DeploymentTargets
deploymentTargets :: Maybe DeploymentTargets
$sel:deploymentTargets:UpdateStackInstances' :: UpdateStackInstances -> Maybe DeploymentTargets
deploymentTargets} -> Maybe DeploymentTargets
deploymentTargets) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Maybe DeploymentTargets
a -> UpdateStackInstances
s {$sel:deploymentTargets:UpdateStackInstances' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
a} :: UpdateStackInstances)

-- | The unique identifier 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, the SDK generates one
-- automatically.
updateStackInstances_operationId :: Lens.Lens' UpdateStackInstances (Prelude.Maybe Prelude.Text)
updateStackInstances_operationId :: Lens' UpdateStackInstances (Maybe Text)
updateStackInstances_operationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Maybe Text
operationId :: Maybe Text
$sel:operationId:UpdateStackInstances' :: UpdateStackInstances -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Maybe Text
a -> UpdateStackInstances
s {$sel:operationId:UpdateStackInstances' :: Maybe Text
operationId = Maybe Text
a} :: UpdateStackInstances)

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

-- | A list of input parameters whose values you want to update for the
-- specified stack instances.
--
-- Any overridden parameter values will be applied to all stack instances
-- in the specified accounts and Amazon Web Services Regions. When
-- specifying parameters and their values, be aware of how CloudFormation
-- sets parameter values during stack instance update operations:
--
-- -   To override the current value for a parameter, include the parameter
--     and specify its value.
--
-- -   To leave an overridden parameter set to its present value, include
--     the parameter and specify @UsePreviousValue@ as @true@. (You can\'t
--     specify both a value and set @UsePreviousValue@ to @true@.)
--
-- -   To set an overridden parameter back to the value specified in the
--     stack set, specify a parameter list but don\'t include the parameter
--     in the list.
--
-- -   To leave all parameters set to their present values, don\'t specify
--     this property at all.
--
-- During stack set updates, any parameter values overridden for a stack
-- instance aren\'t updated, but retain their overridden value.
--
-- You can only override the parameter /values/ that are specified in the
-- stack set; to add or delete a parameter itself, use @UpdateStackSet@ to
-- update the stack set template. If you add a parameter to a template,
-- before you can override the parameter value specified in the stack set
-- you must first use
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html UpdateStackSet>
-- to update all stack instances with the updated template and parameter
-- value specified in the stack set. Once a stack instance has been updated
-- with the new parameter, you can then override the parameter value using
-- @UpdateStackInstances@.
updateStackInstances_parameterOverrides :: Lens.Lens' UpdateStackInstances (Prelude.Maybe [Parameter])
updateStackInstances_parameterOverrides :: Lens' UpdateStackInstances (Maybe [Parameter])
updateStackInstances_parameterOverrides = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Maybe [Parameter]
parameterOverrides :: Maybe [Parameter]
$sel:parameterOverrides:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Parameter]
parameterOverrides} -> Maybe [Parameter]
parameterOverrides) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Maybe [Parameter]
a -> UpdateStackInstances
s {$sel:parameterOverrides:UpdateStackInstances' :: Maybe [Parameter]
parameterOverrides = Maybe [Parameter]
a} :: UpdateStackInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name or unique ID of the stack set associated with the stack
-- instances.
updateStackInstances_stackSetName :: Lens.Lens' UpdateStackInstances Prelude.Text
updateStackInstances_stackSetName :: Lens' UpdateStackInstances Text
updateStackInstances_stackSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {Text
stackSetName :: Text
$sel:stackSetName:UpdateStackInstances' :: UpdateStackInstances -> Text
stackSetName} -> Text
stackSetName) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} Text
a -> UpdateStackInstances
s {$sel:stackSetName:UpdateStackInstances' :: Text
stackSetName = Text
a} :: UpdateStackInstances)

-- | The names of one or more Amazon Web Services Regions in which you want
-- to update parameter values for stack instances. The overridden parameter
-- values will be applied to all stack instances in the specified accounts
-- and Amazon Web Services Regions.
updateStackInstances_regions :: Lens.Lens' UpdateStackInstances [Prelude.Text]
updateStackInstances_regions :: Lens' UpdateStackInstances [Text]
updateStackInstances_regions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackInstances' {[Text]
regions :: [Text]
$sel:regions:UpdateStackInstances' :: UpdateStackInstances -> [Text]
regions} -> [Text]
regions) (\s :: UpdateStackInstances
s@UpdateStackInstances' {} [Text]
a -> UpdateStackInstances
s {$sel:regions:UpdateStackInstances' :: [Text]
regions = [Text]
a} :: UpdateStackInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable UpdateStackInstances where
  hashWithSalt :: Int -> UpdateStackInstances -> Int
hashWithSalt Int
_salt UpdateStackInstances' {[Text]
Maybe [Text]
Maybe [Parameter]
Maybe Text
Maybe CallAs
Maybe DeploymentTargets
Maybe StackSetOperationPreferences
Text
regions :: [Text]
stackSetName :: Text
parameterOverrides :: Maybe [Parameter]
operationPreferences :: Maybe StackSetOperationPreferences
operationId :: Maybe Text
deploymentTargets :: Maybe DeploymentTargets
callAs :: Maybe CallAs
accounts :: Maybe [Text]
$sel:regions:UpdateStackInstances' :: UpdateStackInstances -> [Text]
$sel:stackSetName:UpdateStackInstances' :: UpdateStackInstances -> Text
$sel:parameterOverrides:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Parameter]
$sel:operationPreferences:UpdateStackInstances' :: UpdateStackInstances -> Maybe StackSetOperationPreferences
$sel:operationId:UpdateStackInstances' :: UpdateStackInstances -> Maybe Text
$sel:deploymentTargets:UpdateStackInstances' :: UpdateStackInstances -> Maybe DeploymentTargets
$sel:callAs:UpdateStackInstances' :: UpdateStackInstances -> Maybe CallAs
$sel:accounts:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
accounts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CallAs
callAs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentTargets
deploymentTargets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
operationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationPreferences
operationPreferences
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Parameter]
parameterOverrides
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
regions

instance Prelude.NFData UpdateStackInstances where
  rnf :: UpdateStackInstances -> ()
rnf UpdateStackInstances' {[Text]
Maybe [Text]
Maybe [Parameter]
Maybe Text
Maybe CallAs
Maybe DeploymentTargets
Maybe StackSetOperationPreferences
Text
regions :: [Text]
stackSetName :: Text
parameterOverrides :: Maybe [Parameter]
operationPreferences :: Maybe StackSetOperationPreferences
operationId :: Maybe Text
deploymentTargets :: Maybe DeploymentTargets
callAs :: Maybe CallAs
accounts :: Maybe [Text]
$sel:regions:UpdateStackInstances' :: UpdateStackInstances -> [Text]
$sel:stackSetName:UpdateStackInstances' :: UpdateStackInstances -> Text
$sel:parameterOverrides:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Parameter]
$sel:operationPreferences:UpdateStackInstances' :: UpdateStackInstances -> Maybe StackSetOperationPreferences
$sel:operationId:UpdateStackInstances' :: UpdateStackInstances -> Maybe Text
$sel:deploymentTargets:UpdateStackInstances' :: UpdateStackInstances -> Maybe DeploymentTargets
$sel:callAs:UpdateStackInstances' :: UpdateStackInstances -> Maybe CallAs
$sel:accounts:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
accounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CallAs
callAs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentTargets
deploymentTargets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationPreferences
operationPreferences
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Parameter]
parameterOverrides
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stackSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
regions

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

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

instance Data.ToQuery UpdateStackInstances where
  toQuery :: UpdateStackInstances -> QueryString
toQuery UpdateStackInstances' {[Text]
Maybe [Text]
Maybe [Parameter]
Maybe Text
Maybe CallAs
Maybe DeploymentTargets
Maybe StackSetOperationPreferences
Text
regions :: [Text]
stackSetName :: Text
parameterOverrides :: Maybe [Parameter]
operationPreferences :: Maybe StackSetOperationPreferences
operationId :: Maybe Text
deploymentTargets :: Maybe DeploymentTargets
callAs :: Maybe CallAs
accounts :: Maybe [Text]
$sel:regions:UpdateStackInstances' :: UpdateStackInstances -> [Text]
$sel:stackSetName:UpdateStackInstances' :: UpdateStackInstances -> Text
$sel:parameterOverrides:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Parameter]
$sel:operationPreferences:UpdateStackInstances' :: UpdateStackInstances -> Maybe StackSetOperationPreferences
$sel:operationId:UpdateStackInstances' :: UpdateStackInstances -> Maybe Text
$sel:deploymentTargets:UpdateStackInstances' :: UpdateStackInstances -> Maybe DeploymentTargets
$sel:callAs:UpdateStackInstances' :: UpdateStackInstances -> Maybe CallAs
$sel:accounts:UpdateStackInstances' :: UpdateStackInstances -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"UpdateStackInstances" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"Accounts"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accounts),
        ByteString
"CallAs" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe CallAs
callAs,
        ByteString
"DeploymentTargets" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe DeploymentTargets
deploymentTargets,
        ByteString
"OperationId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
operationId,
        ByteString
"OperationPreferences" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe StackSetOperationPreferences
operationPreferences,
        ByteString
"ParameterOverrides"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Parameter]
parameterOverrides
            ),
        ByteString
"StackSetName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
stackSetName,
        ByteString
"Regions" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [Text]
regions
      ]

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

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

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

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

instance Prelude.NFData UpdateStackInstancesResponse where
  rnf :: UpdateStackInstancesResponse -> ()
rnf UpdateStackInstancesResponse' {Int
Maybe Text
httpStatus :: Int
operationId :: Maybe Text
$sel:httpStatus:UpdateStackInstancesResponse' :: UpdateStackInstancesResponse -> Int
$sel:operationId:UpdateStackInstancesResponse' :: UpdateStackInstancesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus