{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateBranch
-- 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)
--
-- Creates a new branch for an Amplify app.
module Amazonka.Amplify.CreateBranch
  ( -- * Creating a Request
    CreateBranch (..),
    newCreateBranch,

    -- * Request Lenses
    createBranch_framework,
    createBranch_ttl,
    createBranch_enableNotification,
    createBranch_stage,
    createBranch_backendEnvironmentArn,
    createBranch_enablePullRequestPreview,
    createBranch_basicAuthCredentials,
    createBranch_buildSpec,
    createBranch_enablePerformanceMode,
    createBranch_displayName,
    createBranch_environmentVariables,
    createBranch_enableAutoBuild,
    createBranch_enableBasicAuth,
    createBranch_pullRequestEnvironmentName,
    createBranch_description,
    createBranch_tags,
    createBranch_appId,
    createBranch_branchName,

    -- * Destructuring the Response
    CreateBranchResponse (..),
    newCreateBranchResponse,

    -- * Response Lenses
    createBranchResponse_httpStatus,
    createBranchResponse_branch,
  )
where

import Amazonka.Amplify.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The request structure for the create branch request.
--
-- /See:/ 'newCreateBranch' smart constructor.
data CreateBranch = CreateBranch'
  { -- | The framework for the branch.
    CreateBranch -> Maybe Text
framework :: Prelude.Maybe Prelude.Text,
    -- | The content Time To Live (TTL) for the website in seconds.
    CreateBranch -> Maybe Text
ttl :: Prelude.Maybe Prelude.Text,
    -- | Enables notifications for the branch.
    CreateBranch -> Maybe Bool
enableNotification :: Prelude.Maybe Prelude.Bool,
    -- | Describes the current stage for the branch.
    CreateBranch -> Maybe Stage
stage :: Prelude.Maybe Stage,
    -- | The Amazon Resource Name (ARN) for a backend environment that is part of
    -- an Amplify app.
    CreateBranch -> Maybe Text
backendEnvironmentArn :: Prelude.Maybe Prelude.Text,
    -- | Enables pull request previews for this branch.
    CreateBranch -> Maybe Bool
enablePullRequestPreview :: Prelude.Maybe Prelude.Bool,
    -- | The basic authorization credentials for the branch.
    CreateBranch -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The build specification (build spec) for the branch.
    CreateBranch -> 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.
    CreateBranch -> Maybe Bool
enablePerformanceMode :: Prelude.Maybe Prelude.Bool,
    -- | The display name for a branch. This is used as the default domain
    -- prefix.
    CreateBranch -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The environment variables for the branch.
    CreateBranch -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Enables auto building for the branch.
    CreateBranch -> Maybe Bool
enableAutoBuild :: Prelude.Maybe Prelude.Bool,
    -- | Enables basic authorization for the branch.
    CreateBranch -> Maybe Bool
enableBasicAuth :: Prelude.Maybe Prelude.Bool,
    -- | The Amplify environment name for the pull request.
    CreateBranch -> Maybe Text
pullRequestEnvironmentName :: Prelude.Maybe Prelude.Text,
    -- | The description for the branch.
    CreateBranch -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tag for the branch.
    CreateBranch -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique ID for an Amplify app.
    CreateBranch -> Text
appId :: Prelude.Text,
    -- | The name for the branch.
    CreateBranch -> Text
branchName :: Prelude.Text
  }
  deriving (CreateBranch -> CreateBranch -> Bool
(CreateBranch -> CreateBranch -> Bool)
-> (CreateBranch -> CreateBranch -> Bool) -> Eq CreateBranch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBranch -> CreateBranch -> Bool
$c/= :: CreateBranch -> CreateBranch -> Bool
== :: CreateBranch -> CreateBranch -> Bool
$c== :: CreateBranch -> CreateBranch -> Bool
Prelude.Eq, Int -> CreateBranch -> ShowS
[CreateBranch] -> ShowS
CreateBranch -> String
(Int -> CreateBranch -> ShowS)
-> (CreateBranch -> String)
-> ([CreateBranch] -> ShowS)
-> Show CreateBranch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBranch] -> ShowS
$cshowList :: [CreateBranch] -> ShowS
show :: CreateBranch -> String
$cshow :: CreateBranch -> String
showsPrec :: Int -> CreateBranch -> ShowS
$cshowsPrec :: Int -> CreateBranch -> ShowS
Prelude.Show, (forall x. CreateBranch -> Rep CreateBranch x)
-> (forall x. Rep CreateBranch x -> CreateBranch)
-> Generic CreateBranch
forall x. Rep CreateBranch x -> CreateBranch
forall x. CreateBranch -> Rep CreateBranch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBranch x -> CreateBranch
$cfrom :: forall x. CreateBranch -> Rep CreateBranch x
Prelude.Generic)

-- |
-- Create a value of 'CreateBranch' 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', 'createBranch_framework' - The framework for the branch.
--
-- 'ttl', 'createBranch_ttl' - The content Time To Live (TTL) for the website in seconds.
--
-- 'enableNotification', 'createBranch_enableNotification' - Enables notifications for the branch.
--
-- 'stage', 'createBranch_stage' - Describes the current stage for the branch.
--
-- 'backendEnvironmentArn', 'createBranch_backendEnvironmentArn' - The Amazon Resource Name (ARN) for a backend environment that is part of
-- an Amplify app.
--
-- 'enablePullRequestPreview', 'createBranch_enablePullRequestPreview' - Enables pull request previews for this branch.
--
-- 'basicAuthCredentials', 'createBranch_basicAuthCredentials' - The basic authorization credentials for the branch.
--
-- 'buildSpec', 'createBranch_buildSpec' - The build specification (build spec) for the branch.
--
-- 'enablePerformanceMode', 'createBranch_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.
--
-- 'displayName', 'createBranch_displayName' - The display name for a branch. This is used as the default domain
-- prefix.
--
-- 'environmentVariables', 'createBranch_environmentVariables' - The environment variables for the branch.
--
-- 'enableAutoBuild', 'createBranch_enableAutoBuild' - Enables auto building for the branch.
--
-- 'enableBasicAuth', 'createBranch_enableBasicAuth' - Enables basic authorization for the branch.
--
-- 'pullRequestEnvironmentName', 'createBranch_pullRequestEnvironmentName' - The Amplify environment name for the pull request.
--
-- 'description', 'createBranch_description' - The description for the branch.
--
-- 'tags', 'createBranch_tags' - The tag for the branch.
--
-- 'appId', 'createBranch_appId' - The unique ID for an Amplify app.
--
-- 'branchName', 'createBranch_branchName' - The name for the branch.
newCreateBranch ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'branchName'
  Prelude.Text ->
  CreateBranch
newCreateBranch :: Text -> Text -> CreateBranch
newCreateBranch Text
pAppId_ Text
pBranchName_ =
  CreateBranch' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Stage
-> Maybe Text
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> CreateBranch
CreateBranch'
    { $sel:framework:CreateBranch' :: Maybe Text
framework = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ttl:CreateBranch' :: Maybe Text
ttl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableNotification:CreateBranch' :: Maybe Bool
enableNotification = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:stage:CreateBranch' :: Maybe Stage
stage = Maybe Stage
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentArn:CreateBranch' :: Maybe Text
backendEnvironmentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePullRequestPreview:CreateBranch' :: Maybe Bool
enablePullRequestPreview = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:CreateBranch' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:CreateBranch' :: Maybe Text
buildSpec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePerformanceMode:CreateBranch' :: Maybe Bool
enablePerformanceMode = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:CreateBranch' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:CreateBranch' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBuild:CreateBranch' :: Maybe Bool
enableAutoBuild = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:CreateBranch' :: Maybe Bool
enableBasicAuth = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestEnvironmentName:CreateBranch' :: Maybe Text
pullRequestEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateBranch' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateBranch' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:CreateBranch' :: Text
appId = Text
pAppId_,
      $sel:branchName:CreateBranch' :: Text
branchName = Text
pBranchName_
    }

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

-- | The content Time To Live (TTL) for the website in seconds.
createBranch_ttl :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_ttl :: (Maybe Text -> f (Maybe Text)) -> CreateBranch -> f CreateBranch
createBranch_ttl = (CreateBranch -> Maybe Text)
-> (CreateBranch -> Maybe Text -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Text
ttl :: Maybe Text
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
ttl} -> Maybe Text
ttl) (\s :: CreateBranch
s@CreateBranch' {} Maybe Text
a -> CreateBranch
s {$sel:ttl:CreateBranch' :: Maybe Text
ttl = Maybe Text
a} :: CreateBranch)

-- | Enables notifications for the branch.
createBranch_enableNotification :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enableNotification :: (Maybe Bool -> f (Maybe Bool)) -> CreateBranch -> f CreateBranch
createBranch_enableNotification = (CreateBranch -> Maybe Bool)
-> (CreateBranch -> Maybe Bool -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Bool
enableNotification :: Maybe Bool
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
enableNotification} -> Maybe Bool
enableNotification) (\s :: CreateBranch
s@CreateBranch' {} Maybe Bool
a -> CreateBranch
s {$sel:enableNotification:CreateBranch' :: Maybe Bool
enableNotification = Maybe Bool
a} :: CreateBranch)

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

-- | The Amazon Resource Name (ARN) for a backend environment that is part of
-- an Amplify app.
createBranch_backendEnvironmentArn :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_backendEnvironmentArn :: (Maybe Text -> f (Maybe Text)) -> CreateBranch -> f CreateBranch
createBranch_backendEnvironmentArn = (CreateBranch -> Maybe Text)
-> (CreateBranch -> Maybe Text -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Text
backendEnvironmentArn :: Maybe Text
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
backendEnvironmentArn} -> Maybe Text
backendEnvironmentArn) (\s :: CreateBranch
s@CreateBranch' {} Maybe Text
a -> CreateBranch
s {$sel:backendEnvironmentArn:CreateBranch' :: Maybe Text
backendEnvironmentArn = Maybe Text
a} :: CreateBranch)

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

-- | The basic authorization credentials for the branch.
createBranch_basicAuthCredentials :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_basicAuthCredentials :: (Maybe Text -> f (Maybe Text)) -> CreateBranch -> f CreateBranch
createBranch_basicAuthCredentials = (CreateBranch -> Maybe (Sensitive Text))
-> (CreateBranch -> Maybe (Sensitive Text) -> CreateBranch)
-> Lens
     CreateBranch
     CreateBranch
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
basicAuthCredentials} -> Maybe (Sensitive Text)
basicAuthCredentials) (\s :: CreateBranch
s@CreateBranch' {} Maybe (Sensitive Text)
a -> CreateBranch
s {$sel:basicAuthCredentials:CreateBranch' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
a} :: CreateBranch) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateBranch -> f CreateBranch)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateBranch
-> f CreateBranch
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 branch.
createBranch_buildSpec :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_buildSpec :: (Maybe Text -> f (Maybe Text)) -> CreateBranch -> f CreateBranch
createBranch_buildSpec = (CreateBranch -> Maybe Text)
-> (CreateBranch -> Maybe Text -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Text
buildSpec :: Maybe Text
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe Text
buildSpec} -> Maybe Text
buildSpec) (\s :: CreateBranch
s@CreateBranch' {} Maybe Text
a -> CreateBranch
s {$sel:buildSpec:CreateBranch' :: Maybe Text
buildSpec = Maybe Text
a} :: CreateBranch)

-- | 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.
createBranch_enablePerformanceMode :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enablePerformanceMode :: (Maybe Bool -> f (Maybe Bool)) -> CreateBranch -> f CreateBranch
createBranch_enablePerformanceMode = (CreateBranch -> Maybe Bool)
-> (CreateBranch -> Maybe Bool -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Bool
enablePerformanceMode :: Maybe Bool
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
enablePerformanceMode} -> Maybe Bool
enablePerformanceMode) (\s :: CreateBranch
s@CreateBranch' {} Maybe Bool
a -> CreateBranch
s {$sel:enablePerformanceMode:CreateBranch' :: Maybe Bool
enablePerformanceMode = Maybe Bool
a} :: CreateBranch)

-- | The display name for a branch. This is used as the default domain
-- prefix.
createBranch_displayName :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_displayName :: (Maybe Text -> f (Maybe Text)) -> CreateBranch -> f CreateBranch
createBranch_displayName = (CreateBranch -> Maybe Text)
-> (CreateBranch -> Maybe Text -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Text
displayName :: Maybe Text
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: CreateBranch
s@CreateBranch' {} Maybe Text
a -> CreateBranch
s {$sel:displayName:CreateBranch' :: Maybe Text
displayName = Maybe Text
a} :: CreateBranch)

-- | The environment variables for the branch.
createBranch_environmentVariables :: Lens.Lens' CreateBranch (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createBranch_environmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateBranch -> f CreateBranch
createBranch_environmentVariables = (CreateBranch -> Maybe (HashMap Text Text))
-> (CreateBranch -> Maybe (HashMap Text Text) -> CreateBranch)
-> Lens
     CreateBranch
     CreateBranch
     (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 (\CreateBranch' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: CreateBranch
s@CreateBranch' {} Maybe (HashMap Text Text)
a -> CreateBranch
s {$sel:environmentVariables:CreateBranch' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: CreateBranch) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateBranch -> f CreateBranch)
-> ((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)))
-> CreateBranch
-> f CreateBranch
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 branch.
createBranch_enableAutoBuild :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enableAutoBuild :: (Maybe Bool -> f (Maybe Bool)) -> CreateBranch -> f CreateBranch
createBranch_enableAutoBuild = (CreateBranch -> Maybe Bool)
-> (CreateBranch -> Maybe Bool -> CreateBranch)
-> Lens CreateBranch CreateBranch (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe Bool
enableAutoBuild :: Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
enableAutoBuild} -> Maybe Bool
enableAutoBuild) (\s :: CreateBranch
s@CreateBranch' {} Maybe Bool
a -> CreateBranch
s {$sel:enableAutoBuild:CreateBranch' :: Maybe Bool
enableAutoBuild = Maybe Bool
a} :: CreateBranch)

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

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

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

-- | The tag for the branch.
createBranch_tags :: Lens.Lens' CreateBranch (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createBranch_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateBranch -> f CreateBranch
createBranch_tags = (CreateBranch -> Maybe (HashMap Text Text))
-> (CreateBranch -> Maybe (HashMap Text Text) -> CreateBranch)
-> Lens
     CreateBranch
     CreateBranch
     (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 (\CreateBranch' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateBranch
s@CreateBranch' {} Maybe (HashMap Text Text)
a -> CreateBranch
s {$sel:tags:CreateBranch' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateBranch) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateBranch -> f CreateBranch)
-> ((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)))
-> CreateBranch
-> f CreateBranch
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

-- | The unique ID for an Amplify app.
createBranch_appId :: Lens.Lens' CreateBranch Prelude.Text
createBranch_appId :: (Text -> f Text) -> CreateBranch -> f CreateBranch
createBranch_appId = (CreateBranch -> Text)
-> (CreateBranch -> Text -> CreateBranch)
-> Lens CreateBranch CreateBranch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Text
appId :: Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
appId} -> Text
appId) (\s :: CreateBranch
s@CreateBranch' {} Text
a -> CreateBranch
s {$sel:appId:CreateBranch' :: Text
appId = Text
a} :: CreateBranch)

-- | The name for the branch.
createBranch_branchName :: Lens.Lens' CreateBranch Prelude.Text
createBranch_branchName :: (Text -> f Text) -> CreateBranch -> f CreateBranch
createBranch_branchName = (CreateBranch -> Text)
-> (CreateBranch -> Text -> CreateBranch)
-> Lens CreateBranch CreateBranch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Text
branchName :: Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
branchName} -> Text
branchName) (\s :: CreateBranch
s@CreateBranch' {} Text
a -> CreateBranch
s {$sel:branchName:CreateBranch' :: Text
branchName = Text
a} :: CreateBranch)

instance Core.AWSRequest CreateBranch where
  type AWSResponse CreateBranch = CreateBranchResponse
  request :: CreateBranch -> Request CreateBranch
request = Service -> CreateBranch -> Request CreateBranch
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateBranch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateBranch)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateBranch))
-> Logger
-> Service
-> Proxy CreateBranch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateBranch)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Branch -> CreateBranchResponse
CreateBranchResponse'
            (Int -> Branch -> CreateBranchResponse)
-> Either String Int
-> Either String (Branch -> CreateBranchResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Branch -> CreateBranchResponse)
-> Either String Branch -> Either String CreateBranchResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Branch
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"branch")
      )

instance Prelude.Hashable CreateBranch

instance Prelude.NFData CreateBranch

instance Core.ToHeaders CreateBranch where
  toHeaders :: CreateBranch -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateBranch -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateBranch where
  toJSON :: CreateBranch -> Value
toJSON CreateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
pullRequestEnvironmentName :: Maybe Text
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
displayName :: Maybe Text
enablePerformanceMode :: Maybe Bool
buildSpec :: Maybe Text
basicAuthCredentials :: Maybe (Sensitive Text)
enablePullRequestPreview :: Maybe Bool
backendEnvironmentArn :: Maybe Text
stage :: Maybe Stage
enableNotification :: Maybe Bool
ttl :: Maybe Text
framework :: Maybe Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:description:CreateBranch' :: CreateBranch -> Maybe Text
$sel:pullRequestEnvironmentName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:enableBasicAuth:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe Text
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:enablePullRequestPreview:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
$sel:stage:CreateBranch' :: CreateBranch -> Maybe Stage
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
$sel:framework:CreateBranch' :: CreateBranch -> 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
"ttl" 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
ttl,
            (Text
"enableNotification" 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
enableNotification,
            (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
"backendEnvironmentArn" 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
backendEnvironmentArn,
            (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
"displayName" 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
displayName,
            (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,
            (Text
"description" 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
description,
            (Text
"tags" 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)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"branchName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
branchName)
          ]
      )

instance Core.ToPath CreateBranch where
  toPath :: CreateBranch -> ByteString
toPath CreateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
pullRequestEnvironmentName :: Maybe Text
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
displayName :: Maybe Text
enablePerformanceMode :: Maybe Bool
buildSpec :: Maybe Text
basicAuthCredentials :: Maybe (Sensitive Text)
enablePullRequestPreview :: Maybe Bool
backendEnvironmentArn :: Maybe Text
stage :: Maybe Stage
enableNotification :: Maybe Bool
ttl :: Maybe Text
framework :: Maybe Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:description:CreateBranch' :: CreateBranch -> Maybe Text
$sel:pullRequestEnvironmentName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:enableBasicAuth:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe Text
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:enablePullRequestPreview:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
$sel:stage:CreateBranch' :: CreateBranch -> Maybe Stage
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
$sel:framework:CreateBranch' :: CreateBranch -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/apps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId, ByteString
"/branches"]

instance Core.ToQuery CreateBranch where
  toQuery :: CreateBranch -> QueryString
toQuery = QueryString -> CreateBranch -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The result structure for create branch request.
--
-- /See:/ 'newCreateBranchResponse' smart constructor.
data CreateBranchResponse = CreateBranchResponse'
  { -- | The response's http status code.
    CreateBranchResponse -> Int
httpStatus :: Prelude.Int,
    -- | Describes the branch for an Amplify app, which maps to a third-party
    -- repository branch.
    CreateBranchResponse -> Branch
branch :: Branch
  }
  deriving (CreateBranchResponse -> CreateBranchResponse -> Bool
(CreateBranchResponse -> CreateBranchResponse -> Bool)
-> (CreateBranchResponse -> CreateBranchResponse -> Bool)
-> Eq CreateBranchResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBranchResponse -> CreateBranchResponse -> Bool
$c/= :: CreateBranchResponse -> CreateBranchResponse -> Bool
== :: CreateBranchResponse -> CreateBranchResponse -> Bool
$c== :: CreateBranchResponse -> CreateBranchResponse -> Bool
Prelude.Eq, Int -> CreateBranchResponse -> ShowS
[CreateBranchResponse] -> ShowS
CreateBranchResponse -> String
(Int -> CreateBranchResponse -> ShowS)
-> (CreateBranchResponse -> String)
-> ([CreateBranchResponse] -> ShowS)
-> Show CreateBranchResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBranchResponse] -> ShowS
$cshowList :: [CreateBranchResponse] -> ShowS
show :: CreateBranchResponse -> String
$cshow :: CreateBranchResponse -> String
showsPrec :: Int -> CreateBranchResponse -> ShowS
$cshowsPrec :: Int -> CreateBranchResponse -> ShowS
Prelude.Show, (forall x. CreateBranchResponse -> Rep CreateBranchResponse x)
-> (forall x. Rep CreateBranchResponse x -> CreateBranchResponse)
-> Generic CreateBranchResponse
forall x. Rep CreateBranchResponse x -> CreateBranchResponse
forall x. CreateBranchResponse -> Rep CreateBranchResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBranchResponse x -> CreateBranchResponse
$cfrom :: forall x. CreateBranchResponse -> Rep CreateBranchResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateBranchResponse' 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:
--
-- 'httpStatus', 'createBranchResponse_httpStatus' - The response's http status code.
--
-- 'branch', 'createBranchResponse_branch' - Describes the branch for an Amplify app, which maps to a third-party
-- repository branch.
newCreateBranchResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'branch'
  Branch ->
  CreateBranchResponse
newCreateBranchResponse :: Int -> Branch -> CreateBranchResponse
newCreateBranchResponse Int
pHttpStatus_ Branch
pBranch_ =
  CreateBranchResponse' :: Int -> Branch -> CreateBranchResponse
CreateBranchResponse'
    { $sel:httpStatus:CreateBranchResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:branch:CreateBranchResponse' :: Branch
branch = Branch
pBranch_
    }

-- | The response's http status code.
createBranchResponse_httpStatus :: Lens.Lens' CreateBranchResponse Prelude.Int
createBranchResponse_httpStatus :: (Int -> f Int) -> CreateBranchResponse -> f CreateBranchResponse
createBranchResponse_httpStatus = (CreateBranchResponse -> Int)
-> (CreateBranchResponse -> Int -> CreateBranchResponse)
-> Lens CreateBranchResponse CreateBranchResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranchResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateBranchResponse' :: CreateBranchResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateBranchResponse
s@CreateBranchResponse' {} Int
a -> CreateBranchResponse
s {$sel:httpStatus:CreateBranchResponse' :: Int
httpStatus = Int
a} :: CreateBranchResponse)

-- | Describes the branch for an Amplify app, which maps to a third-party
-- repository branch.
createBranchResponse_branch :: Lens.Lens' CreateBranchResponse Branch
createBranchResponse_branch :: (Branch -> f Branch)
-> CreateBranchResponse -> f CreateBranchResponse
createBranchResponse_branch = (CreateBranchResponse -> Branch)
-> (CreateBranchResponse -> Branch -> CreateBranchResponse)
-> Lens CreateBranchResponse CreateBranchResponse Branch Branch
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranchResponse' {Branch
branch :: Branch
$sel:branch:CreateBranchResponse' :: CreateBranchResponse -> Branch
branch} -> Branch
branch) (\s :: CreateBranchResponse
s@CreateBranchResponse' {} Branch
a -> CreateBranchResponse
s {$sel:branch:CreateBranchResponse' :: Branch
branch = Branch
a} :: CreateBranchResponse)

instance Prelude.NFData CreateBranchResponse