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

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

-- | Describes whether StackSets performs non-conflicting operations
-- concurrently and queues conflicting operations.
--
-- /See:/ 'newManagedExecution' smart constructor.
data ManagedExecution = ManagedExecution'
  { -- | When @true@, StackSets performs non-conflicting operations concurrently
    -- and queues conflicting operations. After conflicting operations finish,
    -- StackSets starts queued operations in request order.
    --
    -- If there are already running or queued operations, StackSets queues all
    -- incoming operations even if they are non-conflicting.
    --
    -- You can\'t modify your stack set\'s execution configuration while there
    -- are running or queued operations for that stack set.
    --
    -- When @false@ (default), StackSets performs one operation at a time in
    -- request order.
    ManagedExecution -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool
  }
  deriving (ManagedExecution -> ManagedExecution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedExecution -> ManagedExecution -> Bool
$c/= :: ManagedExecution -> ManagedExecution -> Bool
== :: ManagedExecution -> ManagedExecution -> Bool
$c== :: ManagedExecution -> ManagedExecution -> Bool
Prelude.Eq, ReadPrec [ManagedExecution]
ReadPrec ManagedExecution
Int -> ReadS ManagedExecution
ReadS [ManagedExecution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedExecution]
$creadListPrec :: ReadPrec [ManagedExecution]
readPrec :: ReadPrec ManagedExecution
$creadPrec :: ReadPrec ManagedExecution
readList :: ReadS [ManagedExecution]
$creadList :: ReadS [ManagedExecution]
readsPrec :: Int -> ReadS ManagedExecution
$creadsPrec :: Int -> ReadS ManagedExecution
Prelude.Read, Int -> ManagedExecution -> ShowS
[ManagedExecution] -> ShowS
ManagedExecution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedExecution] -> ShowS
$cshowList :: [ManagedExecution] -> ShowS
show :: ManagedExecution -> String
$cshow :: ManagedExecution -> String
showsPrec :: Int -> ManagedExecution -> ShowS
$cshowsPrec :: Int -> ManagedExecution -> ShowS
Prelude.Show, forall x. Rep ManagedExecution x -> ManagedExecution
forall x. ManagedExecution -> Rep ManagedExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedExecution x -> ManagedExecution
$cfrom :: forall x. ManagedExecution -> Rep ManagedExecution x
Prelude.Generic)

-- |
-- Create a value of 'ManagedExecution' 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:
--
-- 'active', 'managedExecution_active' - When @true@, StackSets performs non-conflicting operations concurrently
-- and queues conflicting operations. After conflicting operations finish,
-- StackSets starts queued operations in request order.
--
-- If there are already running or queued operations, StackSets queues all
-- incoming operations even if they are non-conflicting.
--
-- You can\'t modify your stack set\'s execution configuration while there
-- are running or queued operations for that stack set.
--
-- When @false@ (default), StackSets performs one operation at a time in
-- request order.
newManagedExecution ::
  ManagedExecution
newManagedExecution :: ManagedExecution
newManagedExecution =
  ManagedExecution' {$sel:active:ManagedExecution' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing}

-- | When @true@, StackSets performs non-conflicting operations concurrently
-- and queues conflicting operations. After conflicting operations finish,
-- StackSets starts queued operations in request order.
--
-- If there are already running or queued operations, StackSets queues all
-- incoming operations even if they are non-conflicting.
--
-- You can\'t modify your stack set\'s execution configuration while there
-- are running or queued operations for that stack set.
--
-- When @false@ (default), StackSets performs one operation at a time in
-- request order.
managedExecution_active :: Lens.Lens' ManagedExecution (Prelude.Maybe Prelude.Bool)
managedExecution_active :: Lens' ManagedExecution (Maybe Bool)
managedExecution_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedExecution' {Maybe Bool
active :: Maybe Bool
$sel:active:ManagedExecution' :: ManagedExecution -> Maybe Bool
active} -> Maybe Bool
active) (\s :: ManagedExecution
s@ManagedExecution' {} Maybe Bool
a -> ManagedExecution
s {$sel:active:ManagedExecution' :: Maybe Bool
active = Maybe Bool
a} :: ManagedExecution)

instance Data.FromXML ManagedExecution where
  parseXML :: [Node] -> Either String ManagedExecution
parseXML [Node]
x =
    Maybe Bool -> ManagedExecution
ManagedExecution' 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
"Active")

instance Prelude.Hashable ManagedExecution where
  hashWithSalt :: Int -> ManagedExecution -> Int
hashWithSalt Int
_salt ManagedExecution' {Maybe Bool
active :: Maybe Bool
$sel:active:ManagedExecution' :: ManagedExecution -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active

instance Prelude.NFData ManagedExecution where
  rnf :: ManagedExecution -> ()
rnf ManagedExecution' {Maybe Bool
active :: Maybe Bool
$sel:active:ManagedExecution' :: ManagedExecution -> Maybe Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active

instance Data.ToQuery ManagedExecution where
  toQuery :: ManagedExecution -> QueryString
toQuery ManagedExecution' {Maybe Bool
active :: Maybe Bool
$sel:active:ManagedExecution' :: ManagedExecution -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Active" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
active]