{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CloudFormation.Types.StackSetOperationPreferences
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.StackSetOperationPreferences where

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

-- | The user-specified preferences for how CloudFormation performs a stack
-- set operation.
--
-- For more information about maximum concurrent accounts and failure
-- tolerance, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options Stack set operation options>.
--
-- /See:/ 'newStackSetOperationPreferences' smart constructor.
data StackSetOperationPreferences = StackSetOperationPreferences'
  { -- | The number of accounts, per Region, for which this operation can fail
    -- before CloudFormation stops the operation in that Region. If the
    -- operation is stopped in a Region, CloudFormation doesn\'t attempt the
    -- operation in any subsequent Regions.
    --
    -- Conditional: You must specify either @FailureToleranceCount@ or
    -- @FailureTolerancePercentage@ (but not both).
    --
    -- By default, @0@ is specified.
    StackSetOperationPreferences -> Maybe Natural
failureToleranceCount :: Prelude.Maybe Prelude.Natural,
    -- | The percentage of accounts, per Region, for which this stack operation
    -- can fail before CloudFormation stops the operation in that Region. If
    -- the operation is stopped in a Region, CloudFormation doesn\'t attempt
    -- the operation in any subsequent Regions.
    --
    -- When calculating the number of accounts based on the specified
    -- percentage, CloudFormation rounds /down/ to the next whole number.
    --
    -- Conditional: You must specify either @FailureToleranceCount@ or
    -- @FailureTolerancePercentage@, but not both.
    --
    -- By default, @0@ is specified.
    StackSetOperationPreferences -> Maybe Natural
failureTolerancePercentage :: Prelude.Maybe Prelude.Natural,
    -- | The maximum number of accounts in which to perform this operation at one
    -- time. This is dependent on the value of
    -- @FailureToleranceCount@.@MaxConcurrentCount@ is at most one more than
    -- the @FailureToleranceCount@.
    --
    -- Note that this setting lets you specify the /maximum/ for operations.
    -- For large deployments, under certain circumstances the actual number of
    -- accounts acted upon concurrently may be lower due to service throttling.
    --
    -- Conditional: You must specify either @MaxConcurrentCount@ or
    -- @MaxConcurrentPercentage@, but not both.
    --
    -- By default, @1@ is specified.
    StackSetOperationPreferences -> Maybe Natural
maxConcurrentCount :: Prelude.Maybe Prelude.Natural,
    -- | The maximum percentage of accounts in which to perform this operation at
    -- one time.
    --
    -- When calculating the number of accounts based on the specified
    -- percentage, CloudFormation rounds down to the next whole number. This is
    -- true except in cases where rounding down would result is zero. In this
    -- case, CloudFormation sets the number as one instead.
    --
    -- Note that this setting lets you specify the /maximum/ for operations.
    -- For large deployments, under certain circumstances the actual number of
    -- accounts acted upon concurrently may be lower due to service throttling.
    --
    -- Conditional: You must specify either @MaxConcurrentCount@ or
    -- @MaxConcurrentPercentage@, but not both.
    --
    -- By default, @1@ is specified.
    StackSetOperationPreferences -> Maybe Natural
maxConcurrentPercentage :: Prelude.Maybe Prelude.Natural,
    -- | The concurrency type of deploying StackSets operations in Regions, could
    -- be in parallel or one Region at a time.
    StackSetOperationPreferences -> Maybe RegionConcurrencyType
regionConcurrencyType :: Prelude.Maybe RegionConcurrencyType,
    -- | The order of the Regions in where you want to perform the stack
    -- operation.
    StackSetOperationPreferences -> Maybe [Text]
regionOrder :: Prelude.Maybe [Prelude.Text]
  }
  deriving (StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
$c/= :: StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
== :: StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
$c== :: StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
Prelude.Eq, ReadPrec [StackSetOperationPreferences]
ReadPrec StackSetOperationPreferences
Int -> ReadS StackSetOperationPreferences
ReadS [StackSetOperationPreferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetOperationPreferences]
$creadListPrec :: ReadPrec [StackSetOperationPreferences]
readPrec :: ReadPrec StackSetOperationPreferences
$creadPrec :: ReadPrec StackSetOperationPreferences
readList :: ReadS [StackSetOperationPreferences]
$creadList :: ReadS [StackSetOperationPreferences]
readsPrec :: Int -> ReadS StackSetOperationPreferences
$creadsPrec :: Int -> ReadS StackSetOperationPreferences
Prelude.Read, Int -> StackSetOperationPreferences -> ShowS
[StackSetOperationPreferences] -> ShowS
StackSetOperationPreferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetOperationPreferences] -> ShowS
$cshowList :: [StackSetOperationPreferences] -> ShowS
show :: StackSetOperationPreferences -> String
$cshow :: StackSetOperationPreferences -> String
showsPrec :: Int -> StackSetOperationPreferences -> ShowS
$cshowsPrec :: Int -> StackSetOperationPreferences -> ShowS
Prelude.Show, forall x.
Rep StackSetOperationPreferences x -> StackSetOperationPreferences
forall x.
StackSetOperationPreferences -> Rep StackSetOperationPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackSetOperationPreferences x -> StackSetOperationPreferences
$cfrom :: forall x.
StackSetOperationPreferences -> Rep StackSetOperationPreferences x
Prelude.Generic)

-- |
-- Create a value of 'StackSetOperationPreferences' 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:
--
-- 'failureToleranceCount', 'stackSetOperationPreferences_failureToleranceCount' - The number of accounts, per Region, for which this operation can fail
-- before CloudFormation stops the operation in that Region. If the
-- operation is stopped in a Region, CloudFormation doesn\'t attempt the
-- operation in any subsequent Regions.
--
-- Conditional: You must specify either @FailureToleranceCount@ or
-- @FailureTolerancePercentage@ (but not both).
--
-- By default, @0@ is specified.
--
-- 'failureTolerancePercentage', 'stackSetOperationPreferences_failureTolerancePercentage' - The percentage of accounts, per Region, for which this stack operation
-- can fail before CloudFormation stops the operation in that Region. If
-- the operation is stopped in a Region, CloudFormation doesn\'t attempt
-- the operation in any subsequent Regions.
--
-- When calculating the number of accounts based on the specified
-- percentage, CloudFormation rounds /down/ to the next whole number.
--
-- Conditional: You must specify either @FailureToleranceCount@ or
-- @FailureTolerancePercentage@, but not both.
--
-- By default, @0@ is specified.
--
-- 'maxConcurrentCount', 'stackSetOperationPreferences_maxConcurrentCount' - The maximum number of accounts in which to perform this operation at one
-- time. This is dependent on the value of
-- @FailureToleranceCount@.@MaxConcurrentCount@ is at most one more than
-- the @FailureToleranceCount@.
--
-- Note that this setting lets you specify the /maximum/ for operations.
-- For large deployments, under certain circumstances the actual number of
-- accounts acted upon concurrently may be lower due to service throttling.
--
-- Conditional: You must specify either @MaxConcurrentCount@ or
-- @MaxConcurrentPercentage@, but not both.
--
-- By default, @1@ is specified.
--
-- 'maxConcurrentPercentage', 'stackSetOperationPreferences_maxConcurrentPercentage' - The maximum percentage of accounts in which to perform this operation at
-- one time.
--
-- When calculating the number of accounts based on the specified
-- percentage, CloudFormation rounds down to the next whole number. This is
-- true except in cases where rounding down would result is zero. In this
-- case, CloudFormation sets the number as one instead.
--
-- Note that this setting lets you specify the /maximum/ for operations.
-- For large deployments, under certain circumstances the actual number of
-- accounts acted upon concurrently may be lower due to service throttling.
--
-- Conditional: You must specify either @MaxConcurrentCount@ or
-- @MaxConcurrentPercentage@, but not both.
--
-- By default, @1@ is specified.
--
-- 'regionConcurrencyType', 'stackSetOperationPreferences_regionConcurrencyType' - The concurrency type of deploying StackSets operations in Regions, could
-- be in parallel or one Region at a time.
--
-- 'regionOrder', 'stackSetOperationPreferences_regionOrder' - The order of the Regions in where you want to perform the stack
-- operation.
newStackSetOperationPreferences ::
  StackSetOperationPreferences
newStackSetOperationPreferences :: StackSetOperationPreferences
newStackSetOperationPreferences =
  StackSetOperationPreferences'
    { $sel:failureToleranceCount:StackSetOperationPreferences' :: Maybe Natural
failureToleranceCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:failureTolerancePercentage:StackSetOperationPreferences' :: Maybe Natural
failureTolerancePercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:maxConcurrentCount:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentCount = forall a. Maybe a
Prelude.Nothing,
      $sel:maxConcurrentPercentage:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:regionConcurrencyType:StackSetOperationPreferences' :: Maybe RegionConcurrencyType
regionConcurrencyType = forall a. Maybe a
Prelude.Nothing,
      $sel:regionOrder:StackSetOperationPreferences' :: Maybe [Text]
regionOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of accounts, per Region, for which this operation can fail
-- before CloudFormation stops the operation in that Region. If the
-- operation is stopped in a Region, CloudFormation doesn\'t attempt the
-- operation in any subsequent Regions.
--
-- Conditional: You must specify either @FailureToleranceCount@ or
-- @FailureTolerancePercentage@ (but not both).
--
-- By default, @0@ is specified.
stackSetOperationPreferences_failureToleranceCount :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_failureToleranceCount :: Lens' StackSetOperationPreferences (Maybe Natural)
stackSetOperationPreferences_failureToleranceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe Natural
failureToleranceCount :: Maybe Natural
$sel:failureToleranceCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
failureToleranceCount} -> Maybe Natural
failureToleranceCount) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe Natural
a -> StackSetOperationPreferences
s {$sel:failureToleranceCount:StackSetOperationPreferences' :: Maybe Natural
failureToleranceCount = Maybe Natural
a} :: StackSetOperationPreferences)

-- | The percentage of accounts, per Region, for which this stack operation
-- can fail before CloudFormation stops the operation in that Region. If
-- the operation is stopped in a Region, CloudFormation doesn\'t attempt
-- the operation in any subsequent Regions.
--
-- When calculating the number of accounts based on the specified
-- percentage, CloudFormation rounds /down/ to the next whole number.
--
-- Conditional: You must specify either @FailureToleranceCount@ or
-- @FailureTolerancePercentage@, but not both.
--
-- By default, @0@ is specified.
stackSetOperationPreferences_failureTolerancePercentage :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_failureTolerancePercentage :: Lens' StackSetOperationPreferences (Maybe Natural)
stackSetOperationPreferences_failureTolerancePercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe Natural
failureTolerancePercentage :: Maybe Natural
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
failureTolerancePercentage} -> Maybe Natural
failureTolerancePercentage) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe Natural
a -> StackSetOperationPreferences
s {$sel:failureTolerancePercentage:StackSetOperationPreferences' :: Maybe Natural
failureTolerancePercentage = Maybe Natural
a} :: StackSetOperationPreferences)

-- | The maximum number of accounts in which to perform this operation at one
-- time. This is dependent on the value of
-- @FailureToleranceCount@.@MaxConcurrentCount@ is at most one more than
-- the @FailureToleranceCount@.
--
-- Note that this setting lets you specify the /maximum/ for operations.
-- For large deployments, under certain circumstances the actual number of
-- accounts acted upon concurrently may be lower due to service throttling.
--
-- Conditional: You must specify either @MaxConcurrentCount@ or
-- @MaxConcurrentPercentage@, but not both.
--
-- By default, @1@ is specified.
stackSetOperationPreferences_maxConcurrentCount :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_maxConcurrentCount :: Lens' StackSetOperationPreferences (Maybe Natural)
stackSetOperationPreferences_maxConcurrentCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe Natural
maxConcurrentCount :: Maybe Natural
$sel:maxConcurrentCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
maxConcurrentCount} -> Maybe Natural
maxConcurrentCount) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe Natural
a -> StackSetOperationPreferences
s {$sel:maxConcurrentCount:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentCount = Maybe Natural
a} :: StackSetOperationPreferences)

-- | The maximum percentage of accounts in which to perform this operation at
-- one time.
--
-- When calculating the number of accounts based on the specified
-- percentage, CloudFormation rounds down to the next whole number. This is
-- true except in cases where rounding down would result is zero. In this
-- case, CloudFormation sets the number as one instead.
--
-- Note that this setting lets you specify the /maximum/ for operations.
-- For large deployments, under certain circumstances the actual number of
-- accounts acted upon concurrently may be lower due to service throttling.
--
-- Conditional: You must specify either @MaxConcurrentCount@ or
-- @MaxConcurrentPercentage@, but not both.
--
-- By default, @1@ is specified.
stackSetOperationPreferences_maxConcurrentPercentage :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_maxConcurrentPercentage :: Lens' StackSetOperationPreferences (Maybe Natural)
stackSetOperationPreferences_maxConcurrentPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe Natural
maxConcurrentPercentage :: Maybe Natural
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
maxConcurrentPercentage} -> Maybe Natural
maxConcurrentPercentage) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe Natural
a -> StackSetOperationPreferences
s {$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentPercentage = Maybe Natural
a} :: StackSetOperationPreferences)

-- | The concurrency type of deploying StackSets operations in Regions, could
-- be in parallel or one Region at a time.
stackSetOperationPreferences_regionConcurrencyType :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe RegionConcurrencyType)
stackSetOperationPreferences_regionConcurrencyType :: Lens' StackSetOperationPreferences (Maybe RegionConcurrencyType)
stackSetOperationPreferences_regionConcurrencyType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe RegionConcurrencyType
regionConcurrencyType :: Maybe RegionConcurrencyType
$sel:regionConcurrencyType:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe RegionConcurrencyType
regionConcurrencyType} -> Maybe RegionConcurrencyType
regionConcurrencyType) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe RegionConcurrencyType
a -> StackSetOperationPreferences
s {$sel:regionConcurrencyType:StackSetOperationPreferences' :: Maybe RegionConcurrencyType
regionConcurrencyType = Maybe RegionConcurrencyType
a} :: StackSetOperationPreferences)

-- | The order of the Regions in where you want to perform the stack
-- operation.
stackSetOperationPreferences_regionOrder :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe [Prelude.Text])
stackSetOperationPreferences_regionOrder :: Lens' StackSetOperationPreferences (Maybe [Text])
stackSetOperationPreferences_regionOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationPreferences' {Maybe [Text]
regionOrder :: Maybe [Text]
$sel:regionOrder:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe [Text]
regionOrder} -> Maybe [Text]
regionOrder) (\s :: StackSetOperationPreferences
s@StackSetOperationPreferences' {} Maybe [Text]
a -> StackSetOperationPreferences
s {$sel:regionOrder:StackSetOperationPreferences' :: Maybe [Text]
regionOrder = Maybe [Text]
a} :: StackSetOperationPreferences) 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

instance Data.FromXML StackSetOperationPreferences where
  parseXML :: [Node] -> Either String StackSetOperationPreferences
parseXML [Node]
x =
    Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe [Text]
-> StackSetOperationPreferences
StackSetOperationPreferences'
      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
"FailureToleranceCount")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FailureTolerancePercentage")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MaxConcurrentCount")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MaxConcurrentPercentage")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RegionConcurrencyType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RegionOrder"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )

instance
  Prelude.Hashable
    StackSetOperationPreferences
  where
  hashWithSalt :: Int -> StackSetOperationPreferences -> Int
hashWithSalt Int
_salt StackSetOperationPreferences' {Maybe Natural
Maybe [Text]
Maybe RegionConcurrencyType
regionOrder :: Maybe [Text]
regionConcurrencyType :: Maybe RegionConcurrencyType
maxConcurrentPercentage :: Maybe Natural
maxConcurrentCount :: Maybe Natural
failureTolerancePercentage :: Maybe Natural
failureToleranceCount :: Maybe Natural
$sel:regionOrder:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe [Text]
$sel:regionConcurrencyType:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe RegionConcurrencyType
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:maxConcurrentCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureToleranceCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
failureToleranceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
failureTolerancePercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxConcurrentCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxConcurrentPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegionConcurrencyType
regionConcurrencyType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
regionOrder

instance Prelude.NFData StackSetOperationPreferences where
  rnf :: StackSetOperationPreferences -> ()
rnf StackSetOperationPreferences' {Maybe Natural
Maybe [Text]
Maybe RegionConcurrencyType
regionOrder :: Maybe [Text]
regionConcurrencyType :: Maybe RegionConcurrencyType
maxConcurrentPercentage :: Maybe Natural
maxConcurrentCount :: Maybe Natural
failureTolerancePercentage :: Maybe Natural
failureToleranceCount :: Maybe Natural
$sel:regionOrder:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe [Text]
$sel:regionConcurrencyType:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe RegionConcurrencyType
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:maxConcurrentCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureToleranceCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
failureToleranceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
failureTolerancePercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxConcurrentCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxConcurrentPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegionConcurrencyType
regionConcurrencyType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
regionOrder

instance Data.ToQuery StackSetOperationPreferences where
  toQuery :: StackSetOperationPreferences -> QueryString
toQuery StackSetOperationPreferences' {Maybe Natural
Maybe [Text]
Maybe RegionConcurrencyType
regionOrder :: Maybe [Text]
regionConcurrencyType :: Maybe RegionConcurrencyType
maxConcurrentPercentage :: Maybe Natural
maxConcurrentCount :: Maybe Natural
failureTolerancePercentage :: Maybe Natural
failureToleranceCount :: Maybe Natural
$sel:regionOrder:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe [Text]
$sel:regionConcurrencyType:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe RegionConcurrencyType
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:maxConcurrentCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:failureToleranceCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"FailureToleranceCount"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
failureToleranceCount,
        ByteString
"FailureTolerancePercentage"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
failureTolerancePercentage,
        ByteString
"MaxConcurrentCount" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxConcurrentCount,
        ByteString
"MaxConcurrentPercentage"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxConcurrentPercentage,
        ByteString
"RegionConcurrencyType"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe RegionConcurrencyType
regionConcurrencyType,
        ByteString
"RegionOrder"
          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]
regionOrder)
      ]