{-# 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.Amplify.Types.AutoBranchCreationConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Amplify.Types.AutoBranchCreationConfig where

import Amazonka.Amplify.Types.Stage
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the automated branch creation configuration.
--
-- /See:/ 'newAutoBranchCreationConfig' smart constructor.
data AutoBranchCreationConfig = AutoBranchCreationConfig'
  { -- | The framework for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Text
framework :: Prelude.Maybe Prelude.Text,
    -- | Describes the current stage for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Stage
stage :: Prelude.Maybe Stage,
    -- | Enables pull request previews for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Bool
enablePullRequestPreview :: Prelude.Maybe Prelude.Bool,
    -- | The basic authorization credentials for the autocreated branch.
    AutoBranchCreationConfig -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The build specification (build spec) for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Text
buildSpec :: Prelude.Maybe Prelude.Text,
    -- | Enables performance mode for the branch.
    --
    -- Performance mode optimizes for faster hosting performance by keeping
    -- content cached at the edge for a longer interval. When performance mode
    -- is enabled, hosting configuration or code changes can take up to 10
    -- minutes to roll out.
    AutoBranchCreationConfig -> Maybe Bool
enablePerformanceMode :: Prelude.Maybe Prelude.Bool,
    -- | The environment variables for the autocreated branch.
    AutoBranchCreationConfig -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Enables auto building for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Bool
enableAutoBuild :: Prelude.Maybe Prelude.Bool,
    -- | Enables basic authorization for the autocreated branch.
    AutoBranchCreationConfig -> Maybe Bool
enableBasicAuth :: Prelude.Maybe Prelude.Bool,
    -- | The Amplify environment name for the pull request.
    AutoBranchCreationConfig -> Maybe Text
pullRequestEnvironmentName :: Prelude.Maybe Prelude.Text
  }
  deriving (AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool
(AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool)
-> (AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool)
-> Eq AutoBranchCreationConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool
$c/= :: AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool
== :: AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool
$c== :: AutoBranchCreationConfig -> AutoBranchCreationConfig -> Bool
Prelude.Eq, Int -> AutoBranchCreationConfig -> ShowS
[AutoBranchCreationConfig] -> ShowS
AutoBranchCreationConfig -> String
(Int -> AutoBranchCreationConfig -> ShowS)
-> (AutoBranchCreationConfig -> String)
-> ([AutoBranchCreationConfig] -> ShowS)
-> Show AutoBranchCreationConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoBranchCreationConfig] -> ShowS
$cshowList :: [AutoBranchCreationConfig] -> ShowS
show :: AutoBranchCreationConfig -> String
$cshow :: AutoBranchCreationConfig -> String
showsPrec :: Int -> AutoBranchCreationConfig -> ShowS
$cshowsPrec :: Int -> AutoBranchCreationConfig -> ShowS
Prelude.Show, (forall x.
 AutoBranchCreationConfig -> Rep AutoBranchCreationConfig x)
-> (forall x.
    Rep AutoBranchCreationConfig x -> AutoBranchCreationConfig)
-> Generic AutoBranchCreationConfig
forall x.
Rep AutoBranchCreationConfig x -> AutoBranchCreationConfig
forall x.
AutoBranchCreationConfig -> Rep AutoBranchCreationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoBranchCreationConfig x -> AutoBranchCreationConfig
$cfrom :: forall x.
AutoBranchCreationConfig -> Rep AutoBranchCreationConfig x
Prelude.Generic)

-- |
-- Create a value of 'AutoBranchCreationConfig' 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:
--
-- 'framework', 'autoBranchCreationConfig_framework' - The framework for the autocreated branch.
--
-- 'stage', 'autoBranchCreationConfig_stage' - Describes the current stage for the autocreated branch.
--
-- 'enablePullRequestPreview', 'autoBranchCreationConfig_enablePullRequestPreview' - Enables pull request previews for the autocreated branch.
--
-- 'basicAuthCredentials', 'autoBranchCreationConfig_basicAuthCredentials' - The basic authorization credentials for the autocreated branch.
--
-- 'buildSpec', 'autoBranchCreationConfig_buildSpec' - The build specification (build spec) for the autocreated branch.
--
-- 'enablePerformanceMode', 'autoBranchCreationConfig_enablePerformanceMode' - Enables performance mode for the branch.
--
-- Performance mode optimizes for faster hosting performance by keeping
-- content cached at the edge for a longer interval. When performance mode
-- is enabled, hosting configuration or code changes can take up to 10
-- minutes to roll out.
--
-- 'environmentVariables', 'autoBranchCreationConfig_environmentVariables' - The environment variables for the autocreated branch.
--
-- 'enableAutoBuild', 'autoBranchCreationConfig_enableAutoBuild' - Enables auto building for the autocreated branch.
--
-- 'enableBasicAuth', 'autoBranchCreationConfig_enableBasicAuth' - Enables basic authorization for the autocreated branch.
--
-- 'pullRequestEnvironmentName', 'autoBranchCreationConfig_pullRequestEnvironmentName' - The Amplify environment name for the pull request.
newAutoBranchCreationConfig ::
  AutoBranchCreationConfig
newAutoBranchCreationConfig :: AutoBranchCreationConfig
newAutoBranchCreationConfig =
  AutoBranchCreationConfig' :: Maybe Text
-> Maybe Stage
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> AutoBranchCreationConfig
AutoBranchCreationConfig'
    { $sel:framework:AutoBranchCreationConfig' :: Maybe Text
framework =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stage:AutoBranchCreationConfig' :: Maybe Stage
stage = Maybe Stage
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePullRequestPreview:AutoBranchCreationConfig' :: Maybe Bool
enablePullRequestPreview = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:AutoBranchCreationConfig' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:AutoBranchCreationConfig' :: Maybe Text
buildSpec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePerformanceMode:AutoBranchCreationConfig' :: Maybe Bool
enablePerformanceMode = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:AutoBranchCreationConfig' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBuild:AutoBranchCreationConfig' :: Maybe Bool
enableAutoBuild = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:AutoBranchCreationConfig' :: Maybe Bool
enableBasicAuth = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestEnvironmentName:AutoBranchCreationConfig' :: Maybe Text
pullRequestEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The framework for the autocreated branch.
autoBranchCreationConfig_framework :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Text)
autoBranchCreationConfig_framework :: (Maybe Text -> f (Maybe Text))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_framework = (AutoBranchCreationConfig -> Maybe Text)
-> (AutoBranchCreationConfig
    -> Maybe Text -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Text
framework :: Maybe Text
$sel:framework:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
framework} -> Maybe Text
framework) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Text
a -> AutoBranchCreationConfig
s {$sel:framework:AutoBranchCreationConfig' :: Maybe Text
framework = Maybe Text
a} :: AutoBranchCreationConfig)

-- | Describes the current stage for the autocreated branch.
autoBranchCreationConfig_stage :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Stage)
autoBranchCreationConfig_stage :: (Maybe Stage -> f (Maybe Stage))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_stage = (AutoBranchCreationConfig -> Maybe Stage)
-> (AutoBranchCreationConfig
    -> Maybe Stage -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Stage)
     (Maybe Stage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Stage
stage :: Maybe Stage
$sel:stage:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Stage
stage} -> Maybe Stage
stage) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Stage
a -> AutoBranchCreationConfig
s {$sel:stage:AutoBranchCreationConfig' :: Maybe Stage
stage = Maybe Stage
a} :: AutoBranchCreationConfig)

-- | Enables pull request previews for the autocreated branch.
autoBranchCreationConfig_enablePullRequestPreview :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Bool)
autoBranchCreationConfig_enablePullRequestPreview :: (Maybe Bool -> f (Maybe Bool))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_enablePullRequestPreview = (AutoBranchCreationConfig -> Maybe Bool)
-> (AutoBranchCreationConfig
    -> Maybe Bool -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Bool
enablePullRequestPreview :: Maybe Bool
$sel:enablePullRequestPreview:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
enablePullRequestPreview} -> Maybe Bool
enablePullRequestPreview) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Bool
a -> AutoBranchCreationConfig
s {$sel:enablePullRequestPreview:AutoBranchCreationConfig' :: Maybe Bool
enablePullRequestPreview = Maybe Bool
a} :: AutoBranchCreationConfig)

-- | The basic authorization credentials for the autocreated branch.
autoBranchCreationConfig_basicAuthCredentials :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Text)
autoBranchCreationConfig_basicAuthCredentials :: (Maybe Text -> f (Maybe Text))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_basicAuthCredentials = (AutoBranchCreationConfig -> Maybe (Sensitive Text))
-> (AutoBranchCreationConfig
    -> Maybe (Sensitive Text) -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
$sel:basicAuthCredentials:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe (Sensitive Text)
basicAuthCredentials} -> Maybe (Sensitive Text)
basicAuthCredentials) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe (Sensitive Text)
a -> AutoBranchCreationConfig
s {$sel:basicAuthCredentials:AutoBranchCreationConfig' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
a} :: AutoBranchCreationConfig) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> AutoBranchCreationConfig -> f AutoBranchCreationConfig)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AutoBranchCreationConfig
-> f AutoBranchCreationConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The build specification (build spec) for the autocreated branch.
autoBranchCreationConfig_buildSpec :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Text)
autoBranchCreationConfig_buildSpec :: (Maybe Text -> f (Maybe Text))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_buildSpec = (AutoBranchCreationConfig -> Maybe Text)
-> (AutoBranchCreationConfig
    -> Maybe Text -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Text
buildSpec :: Maybe Text
$sel:buildSpec:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
buildSpec} -> Maybe Text
buildSpec) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Text
a -> AutoBranchCreationConfig
s {$sel:buildSpec:AutoBranchCreationConfig' :: Maybe Text
buildSpec = Maybe Text
a} :: AutoBranchCreationConfig)

-- | Enables performance mode for the branch.
--
-- Performance mode optimizes for faster hosting performance by keeping
-- content cached at the edge for a longer interval. When performance mode
-- is enabled, hosting configuration or code changes can take up to 10
-- minutes to roll out.
autoBranchCreationConfig_enablePerformanceMode :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Bool)
autoBranchCreationConfig_enablePerformanceMode :: (Maybe Bool -> f (Maybe Bool))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_enablePerformanceMode = (AutoBranchCreationConfig -> Maybe Bool)
-> (AutoBranchCreationConfig
    -> Maybe Bool -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Bool
enablePerformanceMode :: Maybe Bool
$sel:enablePerformanceMode:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
enablePerformanceMode} -> Maybe Bool
enablePerformanceMode) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Bool
a -> AutoBranchCreationConfig
s {$sel:enablePerformanceMode:AutoBranchCreationConfig' :: Maybe Bool
enablePerformanceMode = Maybe Bool
a} :: AutoBranchCreationConfig)

-- | The environment variables for the autocreated branch.
autoBranchCreationConfig_environmentVariables :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
autoBranchCreationConfig_environmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_environmentVariables = (AutoBranchCreationConfig -> Maybe (HashMap Text Text))
-> (AutoBranchCreationConfig
    -> Maybe (HashMap Text Text) -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe (HashMap Text Text)
a -> AutoBranchCreationConfig
s {$sel:environmentVariables:AutoBranchCreationConfig' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: AutoBranchCreationConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AutoBranchCreationConfig -> f AutoBranchCreationConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AutoBranchCreationConfig
-> f AutoBranchCreationConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Enables auto building for the autocreated branch.
autoBranchCreationConfig_enableAutoBuild :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Bool)
autoBranchCreationConfig_enableAutoBuild :: (Maybe Bool -> f (Maybe Bool))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_enableAutoBuild = (AutoBranchCreationConfig -> Maybe Bool)
-> (AutoBranchCreationConfig
    -> Maybe Bool -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Bool
enableAutoBuild :: Maybe Bool
$sel:enableAutoBuild:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
enableAutoBuild} -> Maybe Bool
enableAutoBuild) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Bool
a -> AutoBranchCreationConfig
s {$sel:enableAutoBuild:AutoBranchCreationConfig' :: Maybe Bool
enableAutoBuild = Maybe Bool
a} :: AutoBranchCreationConfig)

-- | Enables basic authorization for the autocreated branch.
autoBranchCreationConfig_enableBasicAuth :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Bool)
autoBranchCreationConfig_enableBasicAuth :: (Maybe Bool -> f (Maybe Bool))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_enableBasicAuth = (AutoBranchCreationConfig -> Maybe Bool)
-> (AutoBranchCreationConfig
    -> Maybe Bool -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Bool
enableBasicAuth :: Maybe Bool
$sel:enableBasicAuth:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
enableBasicAuth} -> Maybe Bool
enableBasicAuth) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Bool
a -> AutoBranchCreationConfig
s {$sel:enableBasicAuth:AutoBranchCreationConfig' :: Maybe Bool
enableBasicAuth = Maybe Bool
a} :: AutoBranchCreationConfig)

-- | The Amplify environment name for the pull request.
autoBranchCreationConfig_pullRequestEnvironmentName :: Lens.Lens' AutoBranchCreationConfig (Prelude.Maybe Prelude.Text)
autoBranchCreationConfig_pullRequestEnvironmentName :: (Maybe Text -> f (Maybe Text))
-> AutoBranchCreationConfig -> f AutoBranchCreationConfig
autoBranchCreationConfig_pullRequestEnvironmentName = (AutoBranchCreationConfig -> Maybe Text)
-> (AutoBranchCreationConfig
    -> Maybe Text -> AutoBranchCreationConfig)
-> Lens
     AutoBranchCreationConfig
     AutoBranchCreationConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoBranchCreationConfig' {Maybe Text
pullRequestEnvironmentName :: Maybe Text
$sel:pullRequestEnvironmentName:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
pullRequestEnvironmentName} -> Maybe Text
pullRequestEnvironmentName) (\s :: AutoBranchCreationConfig
s@AutoBranchCreationConfig' {} Maybe Text
a -> AutoBranchCreationConfig
s {$sel:pullRequestEnvironmentName:AutoBranchCreationConfig' :: Maybe Text
pullRequestEnvironmentName = Maybe Text
a} :: AutoBranchCreationConfig)

instance Core.FromJSON AutoBranchCreationConfig where
  parseJSON :: Value -> Parser AutoBranchCreationConfig
parseJSON =
    String
-> (Object -> Parser AutoBranchCreationConfig)
-> Value
-> Parser AutoBranchCreationConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoBranchCreationConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe Stage
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> AutoBranchCreationConfig
AutoBranchCreationConfig'
            (Maybe Text
 -> Maybe Stage
 -> Maybe Bool
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe Bool
 -> Maybe (HashMap Text Text)
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> AutoBranchCreationConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Stage
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framework")
            Parser
  (Maybe Stage
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe Stage)
-> Parser
     (Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Stage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stage")
            Parser
  (Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enablePullRequestPreview")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"basicAuthCredentials")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"buildSpec")
            Parser
  (Maybe Bool
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enablePerformanceMode")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> AutoBranchCreationConfig)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Bool
      -> Maybe Bool -> Maybe Text -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environmentVariables"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Bool
   -> Maybe Bool -> Maybe Text -> AutoBranchCreationConfig)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> Maybe Text -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enableAutoBuild")
            Parser (Maybe Bool -> Maybe Text -> AutoBranchCreationConfig)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> AutoBranchCreationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enableBasicAuth")
            Parser (Maybe Text -> AutoBranchCreationConfig)
-> Parser (Maybe Text) -> Parser AutoBranchCreationConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestEnvironmentName")
      )

instance Prelude.Hashable AutoBranchCreationConfig

instance Prelude.NFData AutoBranchCreationConfig

instance Core.ToJSON AutoBranchCreationConfig where
  toJSON :: AutoBranchCreationConfig -> Value
toJSON AutoBranchCreationConfig' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
pullRequestEnvironmentName :: Maybe Text
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
enablePerformanceMode :: Maybe Bool
buildSpec :: Maybe Text
basicAuthCredentials :: Maybe (Sensitive Text)
enablePullRequestPreview :: Maybe Bool
stage :: Maybe Stage
framework :: Maybe Text
$sel:pullRequestEnvironmentName:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
$sel:enableBasicAuth:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
$sel:enableAutoBuild:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
$sel:environmentVariables:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe (HashMap Text Text)
$sel:enablePerformanceMode:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
$sel:buildSpec:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
$sel:basicAuthCredentials:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe (Sensitive Text)
$sel:enablePullRequestPreview:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Bool
$sel:stage:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Stage
$sel:framework:AutoBranchCreationConfig' :: AutoBranchCreationConfig -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"framework" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
framework,
            (Text
"stage" Text -> Stage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Stage -> Pair) -> Maybe Stage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Stage
stage,
            (Text
"enablePullRequestPreview" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enablePullRequestPreview,
            (Text
"basicAuthCredentials" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
basicAuthCredentials,
            (Text
"buildSpec" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
buildSpec,
            (Text
"enablePerformanceMode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enablePerformanceMode,
            (Text
"environmentVariables" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environmentVariables,
            (Text
"enableAutoBuild" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableAutoBuild,
            (Text
"enableBasicAuth" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableBasicAuth,
            (Text
"pullRequestEnvironmentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pullRequestEnvironmentName
          ]
      )