{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_backendEnvironmentArn,
    createBranch_basicAuthCredentials,
    createBranch_buildSpec,
    createBranch_description,
    createBranch_displayName,
    createBranch_enableAutoBuild,
    createBranch_enableBasicAuth,
    createBranch_enableNotification,
    createBranch_enablePerformanceMode,
    createBranch_enablePullRequestPreview,
    createBranch_environmentVariables,
    createBranch_framework,
    createBranch_pullRequestEnvironmentName,
    createBranch_stage,
    createBranch_tags,
    createBranch_ttl,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 Amazon Resource Name (ARN) for a backend environment that is part of
    -- an Amplify app.
    CreateBranch -> Maybe Text
backendEnvironmentArn :: Prelude.Maybe Prelude.Text,
    -- | The basic authorization credentials for the branch. You must
    -- base64-encode the authorization credentials and provide them in the
    -- format @user:password@.
    CreateBranch -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The build specification (build spec) for the branch.
    CreateBranch -> Maybe (Sensitive Text)
buildSpec :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The description for the branch.
    CreateBranch -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The display name for a branch. This is used as the default domain
    -- prefix.
    CreateBranch -> Maybe Text
displayName :: Prelude.Maybe 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,
    -- | Enables notifications for the branch.
    CreateBranch -> Maybe Bool
enableNotification :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | Enables pull request previews for this branch.
    CreateBranch -> Maybe Bool
enablePullRequestPreview :: Prelude.Maybe Prelude.Bool,
    -- | The environment variables for the branch.
    CreateBranch -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The framework for the branch.
    CreateBranch -> Maybe Text
framework :: Prelude.Maybe Prelude.Text,
    -- | The Amplify environment name for the pull request.
    CreateBranch -> Maybe Text
pullRequestEnvironmentName :: Prelude.Maybe Prelude.Text,
    -- | Describes the current stage for the branch.
    CreateBranch -> Maybe Stage
stage :: Prelude.Maybe Stage,
    -- | The tag for the branch.
    CreateBranch -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The content Time To Live (TTL) for the website in seconds.
    CreateBranch -> Maybe Text
ttl :: Prelude.Maybe 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
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
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. 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:
--
-- 'backendEnvironmentArn', 'createBranch_backendEnvironmentArn' - The Amazon Resource Name (ARN) for a backend environment that is part of
-- an Amplify app.
--
-- 'basicAuthCredentials', 'createBranch_basicAuthCredentials' - The basic authorization credentials for the branch. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
--
-- 'buildSpec', 'createBranch_buildSpec' - The build specification (build spec) for the branch.
--
-- 'description', 'createBranch_description' - The description for the branch.
--
-- 'displayName', 'createBranch_displayName' - The display name for a branch. This is used as the default domain
-- prefix.
--
-- 'enableAutoBuild', 'createBranch_enableAutoBuild' - Enables auto building for the branch.
--
-- 'enableBasicAuth', 'createBranch_enableBasicAuth' - Enables basic authorization for the branch.
--
-- 'enableNotification', 'createBranch_enableNotification' - Enables notifications 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.
--
-- 'enablePullRequestPreview', 'createBranch_enablePullRequestPreview' - Enables pull request previews for this branch.
--
-- 'environmentVariables', 'createBranch_environmentVariables' - The environment variables for the branch.
--
-- 'framework', 'createBranch_framework' - The framework for the branch.
--
-- 'pullRequestEnvironmentName', 'createBranch_pullRequestEnvironmentName' - The Amplify environment name for the pull request.
--
-- 'stage', 'createBranch_stage' - Describes the current stage for the branch.
--
-- 'tags', 'createBranch_tags' - The tag for the branch.
--
-- 'ttl', 'createBranch_ttl' - The content Time To Live (TTL) for the website in seconds.
--
-- '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'
    { $sel:backendEnvironmentArn:CreateBranch' :: Maybe Text
backendEnvironmentArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:CreateBranch' :: Maybe (Sensitive Text)
basicAuthCredentials = forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:CreateBranch' :: Maybe (Sensitive Text)
buildSpec = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateBranch' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:CreateBranch' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBuild:CreateBranch' :: Maybe Bool
enableAutoBuild = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:CreateBranch' :: Maybe Bool
enableBasicAuth = forall a. Maybe a
Prelude.Nothing,
      $sel:enableNotification:CreateBranch' :: Maybe Bool
enableNotification = forall a. Maybe a
Prelude.Nothing,
      $sel:enablePerformanceMode:CreateBranch' :: Maybe Bool
enablePerformanceMode = forall a. Maybe a
Prelude.Nothing,
      $sel:enablePullRequestPreview:CreateBranch' :: Maybe Bool
enablePullRequestPreview = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:CreateBranch' :: Maybe (HashMap Text Text)
environmentVariables = forall a. Maybe a
Prelude.Nothing,
      $sel:framework:CreateBranch' :: Maybe Text
framework = forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestEnvironmentName:CreateBranch' :: Maybe Text
pullRequestEnvironmentName = forall a. Maybe a
Prelude.Nothing,
      $sel:stage:CreateBranch' :: Maybe Stage
stage = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateBranch' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:ttl:CreateBranch' :: Maybe Text
ttl = forall a. Maybe a
Prelude.Nothing,
      $sel:appId:CreateBranch' :: Text
appId = Text
pAppId_,
      $sel:branchName:CreateBranch' :: Text
branchName = Text
pBranchName_
    }

-- | 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 :: Lens' CreateBranch (Maybe Text)
createBranch_backendEnvironmentArn = 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)

-- | The basic authorization credentials for the branch. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
createBranch_basicAuthCredentials :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_basicAuthCredentials :: Lens' CreateBranch (Maybe Text)
createBranch_basicAuthCredentials = 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) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The build specification (build spec) for the branch.
createBranch_buildSpec :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_buildSpec :: Lens' CreateBranch (Maybe Text)
createBranch_buildSpec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBranch' {Maybe (Sensitive Text)
buildSpec :: Maybe (Sensitive Text)
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
buildSpec} -> Maybe (Sensitive Text)
buildSpec) (\s :: CreateBranch
s@CreateBranch' {} Maybe (Sensitive Text)
a -> CreateBranch
s {$sel:buildSpec:CreateBranch' :: Maybe (Sensitive Text)
buildSpec = Maybe (Sensitive Text)
a} :: CreateBranch) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The description for the branch.
createBranch_description :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_description :: Lens' CreateBranch (Maybe Text)
createBranch_description = 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 display name for a branch. This is used as the default domain
-- prefix.
createBranch_displayName :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_displayName :: Lens' CreateBranch (Maybe Text)
createBranch_displayName = 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)

-- | Enables auto building for the branch.
createBranch_enableAutoBuild :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enableAutoBuild :: Lens' CreateBranch (Maybe Bool)
createBranch_enableAutoBuild = 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 :: Lens' CreateBranch (Maybe Bool)
createBranch_enableBasicAuth = 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)

-- | Enables notifications for the branch.
createBranch_enableNotification :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enableNotification :: Lens' CreateBranch (Maybe Bool)
createBranch_enableNotification = 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)

-- | 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 :: Lens' CreateBranch (Maybe Bool)
createBranch_enablePerformanceMode = 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)

-- | Enables pull request previews for this branch.
createBranch_enablePullRequestPreview :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Bool)
createBranch_enablePullRequestPreview :: Lens' CreateBranch (Maybe Bool)
createBranch_enablePullRequestPreview = 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 environment variables for the branch.
createBranch_environmentVariables :: Lens.Lens' CreateBranch (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createBranch_environmentVariables :: Lens' CreateBranch (Maybe (HashMap Text Text))
createBranch_environmentVariables = 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) 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

-- | The framework for the branch.
createBranch_framework :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_framework :: Lens' CreateBranch (Maybe Text)
createBranch_framework = 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 Amplify environment name for the pull request.
createBranch_pullRequestEnvironmentName :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_pullRequestEnvironmentName :: Lens' CreateBranch (Maybe Text)
createBranch_pullRequestEnvironmentName = 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)

-- | Describes the current stage for the branch.
createBranch_stage :: Lens.Lens' CreateBranch (Prelude.Maybe Stage)
createBranch_stage :: Lens' CreateBranch (Maybe Stage)
createBranch_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 tag for the branch.
createBranch_tags :: Lens.Lens' CreateBranch (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createBranch_tags :: Lens' CreateBranch (Maybe (HashMap Text Text))
createBranch_tags = 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) 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

-- | The content Time To Live (TTL) for the website in seconds.
createBranch_ttl :: Lens.Lens' CreateBranch (Prelude.Maybe Prelude.Text)
createBranch_ttl :: Lens' CreateBranch (Maybe Text)
createBranch_ttl = 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)

-- | The unique ID for an Amplify app.
createBranch_appId :: Lens.Lens' CreateBranch Prelude.Text
createBranch_appId :: Lens' CreateBranch Text
createBranch_appId = 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 :: Lens' CreateBranch Text
createBranch_branchName = 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 :: (Service -> Service) -> CreateBranch -> Request CreateBranch
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateBranch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateBranch)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Branch -> CreateBranchResponse
CreateBranchResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"branch")
      )

instance Prelude.Hashable CreateBranch where
  hashWithSalt :: Int -> CreateBranch -> Int
hashWithSalt Int
_salt CreateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: Text
ttl :: Maybe Text
tags :: Maybe (HashMap Text Text)
stage :: Maybe Stage
pullRequestEnvironmentName :: Maybe Text
framework :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enablePullRequestPreview :: Maybe Bool
enablePerformanceMode :: Maybe Bool
enableNotification :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
displayName :: Maybe Text
description :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
backendEnvironmentArn :: Maybe Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:stage:CreateBranch' :: CreateBranch -> Maybe Stage
$sel:pullRequestEnvironmentName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:framework:CreateBranch' :: CreateBranch -> Maybe Text
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:enablePullRequestPreview:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableBasicAuth:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:description:CreateBranch' :: CreateBranch -> Maybe Text
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
backendEnvironmentArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
basicAuthCredentials
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
buildSpec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableAutoBuild
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableBasicAuth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableNotification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enablePerformanceMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enablePullRequestPreview
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
environmentVariables
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
framework
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pullRequestEnvironmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Stage
stage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ttl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branchName

instance Prelude.NFData CreateBranch where
  rnf :: CreateBranch -> ()
rnf CreateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: Text
ttl :: Maybe Text
tags :: Maybe (HashMap Text Text)
stage :: Maybe Stage
pullRequestEnvironmentName :: Maybe Text
framework :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enablePullRequestPreview :: Maybe Bool
enablePerformanceMode :: Maybe Bool
enableNotification :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
displayName :: Maybe Text
description :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
backendEnvironmentArn :: Maybe Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:stage:CreateBranch' :: CreateBranch -> Maybe Stage
$sel:pullRequestEnvironmentName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:framework:CreateBranch' :: CreateBranch -> Maybe Text
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:enablePullRequestPreview:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableBasicAuth:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:description:CreateBranch' :: CreateBranch -> Maybe Text
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backendEnvironmentArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
basicAuthCredentials
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
buildSpec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableAutoBuild
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableBasicAuth
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableNotification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enablePerformanceMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enablePullRequestPreview
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
environmentVariables
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
framework
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pullRequestEnvironmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Stage
stage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ttl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
branchName

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

instance Data.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
ttl :: Maybe Text
tags :: Maybe (HashMap Text Text)
stage :: Maybe Stage
pullRequestEnvironmentName :: Maybe Text
framework :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enablePullRequestPreview :: Maybe Bool
enablePerformanceMode :: Maybe Bool
enableNotification :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBuild :: Maybe Bool
displayName :: Maybe Text
description :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
backendEnvironmentArn :: Maybe Text
$sel:branchName:CreateBranch' :: CreateBranch -> Text
$sel:appId:CreateBranch' :: CreateBranch -> Text
$sel:ttl:CreateBranch' :: CreateBranch -> Maybe Text
$sel:tags:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:stage:CreateBranch' :: CreateBranch -> Maybe Stage
$sel:pullRequestEnvironmentName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:framework:CreateBranch' :: CreateBranch -> Maybe Text
$sel:environmentVariables:CreateBranch' :: CreateBranch -> Maybe (HashMap Text Text)
$sel:enablePullRequestPreview:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enablePerformanceMode:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableNotification:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableBasicAuth:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:enableAutoBuild:CreateBranch' :: CreateBranch -> Maybe Bool
$sel:displayName:CreateBranch' :: CreateBranch -> Maybe Text
$sel:description:CreateBranch' :: CreateBranch -> Maybe Text
$sel:buildSpec:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateBranch' :: CreateBranch -> Maybe (Sensitive Text)
$sel:backendEnvironmentArn:CreateBranch' :: CreateBranch -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"backendEnvironmentArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
backendEnvironmentArn,
            (Key
"basicAuthCredentials" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
basicAuthCredentials,
            (Key
"buildSpec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
buildSpec,
            (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"displayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
displayName,
            (Key
"enableAutoBuild" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableAutoBuild,
            (Key
"enableBasicAuth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableBasicAuth,
            (Key
"enableNotification" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableNotification,
            (Key
"enablePerformanceMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enablePerformanceMode,
            (Key
"enablePullRequestPreview" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enablePullRequestPreview,
            (Key
"environmentVariables" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environmentVariables,
            (Key
"framework" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
framework,
            (Key
"pullRequestEnvironmentName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pullRequestEnvironmentName,
            (Key
"stage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Stage
stage,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Key
"ttl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ttl,
            forall a. a -> Maybe a
Prelude.Just (Key
"branchName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
branchName)
          ]
      )

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

instance Data.ToQuery CreateBranch where
  toQuery :: CreateBranch -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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
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. 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'
    { $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 :: Lens' CreateBranchResponse Int
createBranchResponse_httpStatus = 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 :: Lens' CreateBranchResponse Branch
createBranchResponse_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 where
  rnf :: CreateBranchResponse -> ()
rnf CreateBranchResponse' {Int
Branch
branch :: Branch
httpStatus :: Int
$sel:branch:CreateBranchResponse' :: CreateBranchResponse -> Branch
$sel:httpStatus:CreateBranchResponse' :: CreateBranchResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Branch
branch