{-# 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 #-}
module Amazonka.CloudFormation.Types.StackSetOperationPreferences where
import Amazonka.CloudFormation.Types.RegionConcurrencyType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StackSetOperationPreferences = StackSetOperationPreferences'
{
StackSetOperationPreferences -> Maybe [Text]
regionOrder :: Prelude.Maybe [Prelude.Text],
StackSetOperationPreferences -> Maybe Natural
maxConcurrentCount :: Prelude.Maybe Prelude.Natural,
StackSetOperationPreferences -> Maybe Natural
maxConcurrentPercentage :: Prelude.Maybe Prelude.Natural,
StackSetOperationPreferences -> Maybe Natural
failureToleranceCount :: Prelude.Maybe Prelude.Natural,
StackSetOperationPreferences -> Maybe RegionConcurrencyType
regionConcurrencyType :: Prelude.Maybe RegionConcurrencyType,
StackSetOperationPreferences -> Maybe Natural
failureTolerancePercentage :: Prelude.Maybe Prelude.Natural
}
deriving (StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool
(StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool)
-> (StackSetOperationPreferences
-> StackSetOperationPreferences -> Bool)
-> Eq StackSetOperationPreferences
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]
(Int -> ReadS StackSetOperationPreferences)
-> ReadS [StackSetOperationPreferences]
-> ReadPrec StackSetOperationPreferences
-> ReadPrec [StackSetOperationPreferences]
-> Read 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
(Int -> StackSetOperationPreferences -> ShowS)
-> (StackSetOperationPreferences -> String)
-> ([StackSetOperationPreferences] -> ShowS)
-> Show StackSetOperationPreferences
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.
StackSetOperationPreferences -> Rep StackSetOperationPreferences x)
-> (forall x.
Rep StackSetOperationPreferences x -> StackSetOperationPreferences)
-> Generic StackSetOperationPreferences
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)
newStackSetOperationPreferences ::
StackSetOperationPreferences
newStackSetOperationPreferences :: StackSetOperationPreferences
newStackSetOperationPreferences =
StackSetOperationPreferences' :: Maybe [Text]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences
StackSetOperationPreferences'
{ $sel:regionOrder:StackSetOperationPreferences' :: Maybe [Text]
regionOrder =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:maxConcurrentCount:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: Maybe Natural
maxConcurrentPercentage = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:failureToleranceCount:StackSetOperationPreferences' :: Maybe Natural
failureToleranceCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:regionConcurrencyType:StackSetOperationPreferences' :: Maybe RegionConcurrencyType
regionConcurrencyType = Maybe RegionConcurrencyType
forall a. Maybe a
Prelude.Nothing,
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: Maybe Natural
failureTolerancePercentage = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
stackSetOperationPreferences_regionOrder :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe [Prelude.Text])
stackSetOperationPreferences_regionOrder :: (Maybe [Text] -> f (Maybe [Text]))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_regionOrder = (StackSetOperationPreferences -> Maybe [Text])
-> (StackSetOperationPreferences
-> Maybe [Text] -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe [Text])
(Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
-> StackSetOperationPreferences -> f StackSetOperationPreferences)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StackSetOperationPreferences
-> f StackSetOperationPreferences
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
stackSetOperationPreferences_maxConcurrentCount :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_maxConcurrentCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_maxConcurrentCount = (StackSetOperationPreferences -> Maybe Natural)
-> (StackSetOperationPreferences
-> Maybe Natural -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe Natural)
(Maybe Natural)
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)
stackSetOperationPreferences_maxConcurrentPercentage :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_maxConcurrentPercentage :: (Maybe Natural -> f (Maybe Natural))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_maxConcurrentPercentage = (StackSetOperationPreferences -> Maybe Natural)
-> (StackSetOperationPreferences
-> Maybe Natural -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe Natural)
(Maybe Natural)
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)
stackSetOperationPreferences_failureToleranceCount :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_failureToleranceCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_failureToleranceCount = (StackSetOperationPreferences -> Maybe Natural)
-> (StackSetOperationPreferences
-> Maybe Natural -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe Natural)
(Maybe Natural)
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)
stackSetOperationPreferences_regionConcurrencyType :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe RegionConcurrencyType)
stackSetOperationPreferences_regionConcurrencyType :: (Maybe RegionConcurrencyType -> f (Maybe RegionConcurrencyType))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_regionConcurrencyType = (StackSetOperationPreferences -> Maybe RegionConcurrencyType)
-> (StackSetOperationPreferences
-> Maybe RegionConcurrencyType -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe RegionConcurrencyType)
(Maybe 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)
stackSetOperationPreferences_failureTolerancePercentage :: Lens.Lens' StackSetOperationPreferences (Prelude.Maybe Prelude.Natural)
stackSetOperationPreferences_failureTolerancePercentage :: (Maybe Natural -> f (Maybe Natural))
-> StackSetOperationPreferences -> f StackSetOperationPreferences
stackSetOperationPreferences_failureTolerancePercentage = (StackSetOperationPreferences -> Maybe Natural)
-> (StackSetOperationPreferences
-> Maybe Natural -> StackSetOperationPreferences)
-> Lens
StackSetOperationPreferences
StackSetOperationPreferences
(Maybe Natural)
(Maybe Natural)
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)
instance Core.FromXML StackSetOperationPreferences where
parseXML :: [Node] -> Either String StackSetOperationPreferences
parseXML [Node]
x =
Maybe [Text]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences
StackSetOperationPreferences'
(Maybe [Text]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
-> Either String (Maybe [Text])
-> Either
String
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RegionOrder" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
-> Either String (Maybe Natural)
-> Either
String
(Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxConcurrentCount")
Either
String
(Maybe Natural
-> Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
-> Either String (Maybe Natural)
-> Either
String
(Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxConcurrentPercentage")
Either
String
(Maybe Natural
-> Maybe RegionConcurrencyType
-> Maybe Natural
-> StackSetOperationPreferences)
-> Either String (Maybe Natural)
-> Either
String
(Maybe RegionConcurrencyType
-> Maybe Natural -> StackSetOperationPreferences)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureToleranceCount")
Either
String
(Maybe RegionConcurrencyType
-> Maybe Natural -> StackSetOperationPreferences)
-> Either String (Maybe RegionConcurrencyType)
-> Either String (Maybe Natural -> StackSetOperationPreferences)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe RegionConcurrencyType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RegionConcurrencyType")
Either String (Maybe Natural -> StackSetOperationPreferences)
-> Either String (Maybe Natural)
-> Either String StackSetOperationPreferences
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureTolerancePercentage")
instance
Prelude.Hashable
StackSetOperationPreferences
instance Prelude.NFData StackSetOperationPreferences
instance Core.ToQuery StackSetOperationPreferences where
toQuery :: StackSetOperationPreferences -> QueryString
toQuery StackSetOperationPreferences' {Maybe Natural
Maybe [Text]
Maybe RegionConcurrencyType
failureTolerancePercentage :: Maybe Natural
regionConcurrencyType :: Maybe RegionConcurrencyType
failureToleranceCount :: Maybe Natural
maxConcurrentPercentage :: Maybe Natural
maxConcurrentCount :: Maybe Natural
regionOrder :: Maybe [Text]
$sel:failureTolerancePercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:regionConcurrencyType:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe RegionConcurrencyType
$sel:failureToleranceCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:maxConcurrentPercentage:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:maxConcurrentCount:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe Natural
$sel:regionOrder:StackSetOperationPreferences' :: StackSetOperationPreferences -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"RegionOrder"
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]
regionOrder),
ByteString
"MaxConcurrentCount" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxConcurrentCount,
ByteString
"MaxConcurrentPercentage"
ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxConcurrentPercentage,
ByteString
"FailureToleranceCount"
ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
failureToleranceCount,
ByteString
"RegionConcurrencyType"
ByteString -> Maybe RegionConcurrencyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RegionConcurrencyType
regionConcurrencyType,
ByteString
"FailureTolerancePercentage"
ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
failureTolerancePercentage
]