{-# 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.ServiceCatalog.Types.ProvisioningArtifactPreferences
-- 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.ServiceCatalog.Types.ProvisioningArtifactPreferences 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

-- | The user-defined preferences that will be applied during product
-- provisioning, unless overridden by @ProvisioningPreferences@ or
-- @UpdateProvisioningPreferences@.
--
-- For more information on 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>
-- in the /CloudFormation User Guide/.
--
-- /See:/ 'newProvisioningArtifactPreferences' smart constructor.
data ProvisioningArtifactPreferences = ProvisioningArtifactPreferences'
  { -- | One or more Amazon Web Services accounts where stack instances are
    -- deployed from the stack set. These accounts can be scoped in
    -- @ProvisioningPreferences$StackSetAccounts@ and
    -- @UpdateProvisioningPreferences$StackSetAccounts@.
    --
    -- Applicable only to a @CFN_STACKSET@ provisioned product type.
    ProvisioningArtifactPreferences -> Maybe [Text]
stackSetAccounts :: Prelude.Maybe [Prelude.Text],
    -- | One or more Amazon Web Services Regions where stack instances are
    -- deployed from the stack set. These Regions can be scoped in
    -- @ProvisioningPreferences$StackSetRegions@ and
    -- @UpdateProvisioningPreferences$StackSetRegions@.
    --
    -- Applicable only to a @CFN_STACKSET@ provisioned product type.
    ProvisioningArtifactPreferences -> Maybe [Text]
stackSetRegions :: Prelude.Maybe [Prelude.Text]
  }
  deriving (ProvisioningArtifactPreferences
-> ProvisioningArtifactPreferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactPreferences
-> ProvisioningArtifactPreferences -> Bool
$c/= :: ProvisioningArtifactPreferences
-> ProvisioningArtifactPreferences -> Bool
== :: ProvisioningArtifactPreferences
-> ProvisioningArtifactPreferences -> Bool
$c== :: ProvisioningArtifactPreferences
-> ProvisioningArtifactPreferences -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactPreferences]
ReadPrec ProvisioningArtifactPreferences
Int -> ReadS ProvisioningArtifactPreferences
ReadS [ProvisioningArtifactPreferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactPreferences]
$creadListPrec :: ReadPrec [ProvisioningArtifactPreferences]
readPrec :: ReadPrec ProvisioningArtifactPreferences
$creadPrec :: ReadPrec ProvisioningArtifactPreferences
readList :: ReadS [ProvisioningArtifactPreferences]
$creadList :: ReadS [ProvisioningArtifactPreferences]
readsPrec :: Int -> ReadS ProvisioningArtifactPreferences
$creadsPrec :: Int -> ReadS ProvisioningArtifactPreferences
Prelude.Read, Int -> ProvisioningArtifactPreferences -> ShowS
[ProvisioningArtifactPreferences] -> ShowS
ProvisioningArtifactPreferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactPreferences] -> ShowS
$cshowList :: [ProvisioningArtifactPreferences] -> ShowS
show :: ProvisioningArtifactPreferences -> String
$cshow :: ProvisioningArtifactPreferences -> String
showsPrec :: Int -> ProvisioningArtifactPreferences -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactPreferences -> ShowS
Prelude.Show, forall x.
Rep ProvisioningArtifactPreferences x
-> ProvisioningArtifactPreferences
forall x.
ProvisioningArtifactPreferences
-> Rep ProvisioningArtifactPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactPreferences x
-> ProvisioningArtifactPreferences
$cfrom :: forall x.
ProvisioningArtifactPreferences
-> Rep ProvisioningArtifactPreferences x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactPreferences' 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:
--
-- 'stackSetAccounts', 'provisioningArtifactPreferences_stackSetAccounts' - One or more Amazon Web Services accounts where stack instances are
-- deployed from the stack set. These accounts can be scoped in
-- @ProvisioningPreferences$StackSetAccounts@ and
-- @UpdateProvisioningPreferences$StackSetAccounts@.
--
-- Applicable only to a @CFN_STACKSET@ provisioned product type.
--
-- 'stackSetRegions', 'provisioningArtifactPreferences_stackSetRegions' - One or more Amazon Web Services Regions where stack instances are
-- deployed from the stack set. These Regions can be scoped in
-- @ProvisioningPreferences$StackSetRegions@ and
-- @UpdateProvisioningPreferences$StackSetRegions@.
--
-- Applicable only to a @CFN_STACKSET@ provisioned product type.
newProvisioningArtifactPreferences ::
  ProvisioningArtifactPreferences
newProvisioningArtifactPreferences :: ProvisioningArtifactPreferences
newProvisioningArtifactPreferences =
  ProvisioningArtifactPreferences'
    { $sel:stackSetAccounts:ProvisioningArtifactPreferences' :: Maybe [Text]
stackSetAccounts =
        forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetRegions:ProvisioningArtifactPreferences' :: Maybe [Text]
stackSetRegions = forall a. Maybe a
Prelude.Nothing
    }

-- | One or more Amazon Web Services accounts where stack instances are
-- deployed from the stack set. These accounts can be scoped in
-- @ProvisioningPreferences$StackSetAccounts@ and
-- @UpdateProvisioningPreferences$StackSetAccounts@.
--
-- Applicable only to a @CFN_STACKSET@ provisioned product type.
provisioningArtifactPreferences_stackSetAccounts :: Lens.Lens' ProvisioningArtifactPreferences (Prelude.Maybe [Prelude.Text])
provisioningArtifactPreferences_stackSetAccounts :: Lens' ProvisioningArtifactPreferences (Maybe [Text])
provisioningArtifactPreferences_stackSetAccounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactPreferences' {Maybe [Text]
stackSetAccounts :: Maybe [Text]
$sel:stackSetAccounts:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
stackSetAccounts} -> Maybe [Text]
stackSetAccounts) (\s :: ProvisioningArtifactPreferences
s@ProvisioningArtifactPreferences' {} Maybe [Text]
a -> ProvisioningArtifactPreferences
s {$sel:stackSetAccounts:ProvisioningArtifactPreferences' :: Maybe [Text]
stackSetAccounts = Maybe [Text]
a} :: ProvisioningArtifactPreferences) 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

-- | One or more Amazon Web Services Regions where stack instances are
-- deployed from the stack set. These Regions can be scoped in
-- @ProvisioningPreferences$StackSetRegions@ and
-- @UpdateProvisioningPreferences$StackSetRegions@.
--
-- Applicable only to a @CFN_STACKSET@ provisioned product type.
provisioningArtifactPreferences_stackSetRegions :: Lens.Lens' ProvisioningArtifactPreferences (Prelude.Maybe [Prelude.Text])
provisioningArtifactPreferences_stackSetRegions :: Lens' ProvisioningArtifactPreferences (Maybe [Text])
provisioningArtifactPreferences_stackSetRegions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactPreferences' {Maybe [Text]
stackSetRegions :: Maybe [Text]
$sel:stackSetRegions:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
stackSetRegions} -> Maybe [Text]
stackSetRegions) (\s :: ProvisioningArtifactPreferences
s@ProvisioningArtifactPreferences' {} Maybe [Text]
a -> ProvisioningArtifactPreferences
s {$sel:stackSetRegions:ProvisioningArtifactPreferences' :: Maybe [Text]
stackSetRegions = Maybe [Text]
a} :: ProvisioningArtifactPreferences) 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.FromJSON
    ProvisioningArtifactPreferences
  where
  parseJSON :: Value -> Parser ProvisioningArtifactPreferences
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProvisioningArtifactPreferences"
      ( \Object
x ->
          Maybe [Text] -> Maybe [Text] -> ProvisioningArtifactPreferences
ProvisioningArtifactPreferences'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StackSetAccounts"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StackSetRegions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    ProvisioningArtifactPreferences
  where
  hashWithSalt :: Int -> ProvisioningArtifactPreferences -> Int
hashWithSalt
    Int
_salt
    ProvisioningArtifactPreferences' {Maybe [Text]
stackSetRegions :: Maybe [Text]
stackSetAccounts :: Maybe [Text]
$sel:stackSetRegions:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
$sel:stackSetAccounts:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
stackSetAccounts
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
stackSetRegions

instance
  Prelude.NFData
    ProvisioningArtifactPreferences
  where
  rnf :: ProvisioningArtifactPreferences -> ()
rnf ProvisioningArtifactPreferences' {Maybe [Text]
stackSetRegions :: Maybe [Text]
stackSetAccounts :: Maybe [Text]
$sel:stackSetRegions:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
$sel:stackSetAccounts:ProvisioningArtifactPreferences' :: ProvisioningArtifactPreferences -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
stackSetAccounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
stackSetRegions