{-# 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.UpdateBranch
-- 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)
--
-- Updates a branch for an Amplify app.
module Amazonka.Amplify.UpdateBranch
  ( -- * Creating a Request
    UpdateBranch (..),
    newUpdateBranch,

    -- * Request Lenses
    updateBranch_framework,
    updateBranch_ttl,
    updateBranch_enableNotification,
    updateBranch_stage,
    updateBranch_backendEnvironmentArn,
    updateBranch_enablePullRequestPreview,
    updateBranch_basicAuthCredentials,
    updateBranch_buildSpec,
    updateBranch_enablePerformanceMode,
    updateBranch_displayName,
    updateBranch_environmentVariables,
    updateBranch_enableAutoBuild,
    updateBranch_enableBasicAuth,
    updateBranch_pullRequestEnvironmentName,
    updateBranch_description,
    updateBranch_appId,
    updateBranch_branchName,

    -- * Destructuring the Response
    UpdateBranchResponse (..),
    newUpdateBranchResponse,

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

-- |
-- Create a value of 'UpdateBranch' 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', 'updateBranch_framework' - The framework for the branch.
--
-- 'ttl', 'updateBranch_ttl' - The content Time to Live (TTL) for the website in seconds.
--
-- 'enableNotification', 'updateBranch_enableNotification' - Enables notifications for the branch.
--
-- 'stage', 'updateBranch_stage' - Describes the current stage for the branch.
--
-- 'backendEnvironmentArn', 'updateBranch_backendEnvironmentArn' - The Amazon Resource Name (ARN) for a backend environment that is part of
-- an Amplify app.
--
-- 'enablePullRequestPreview', 'updateBranch_enablePullRequestPreview' - Enables pull request previews for this branch.
--
-- 'basicAuthCredentials', 'updateBranch_basicAuthCredentials' - The basic authorization credentials for the branch.
--
-- 'buildSpec', 'updateBranch_buildSpec' - The build specification (build spec) for the branch.
--
-- 'enablePerformanceMode', 'updateBranch_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', 'updateBranch_displayName' - The display name for a branch. This is used as the default domain
-- prefix.
--
-- 'environmentVariables', 'updateBranch_environmentVariables' - The environment variables for the branch.
--
-- 'enableAutoBuild', 'updateBranch_enableAutoBuild' - Enables auto building for the branch.
--
-- 'enableBasicAuth', 'updateBranch_enableBasicAuth' - Enables basic authorization for the branch.
--
-- 'pullRequestEnvironmentName', 'updateBranch_pullRequestEnvironmentName' - The Amplify environment name for the pull request.
--
-- 'description', 'updateBranch_description' - The description for the branch.
--
-- 'appId', 'updateBranch_appId' - The unique ID for an Amplify app.
--
-- 'branchName', 'updateBranch_branchName' - The name for the branch.
newUpdateBranch ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'branchName'
  Prelude.Text ->
  UpdateBranch
newUpdateBranch :: Text -> Text -> UpdateBranch
newUpdateBranch Text
pAppId_ Text
pBranchName_ =
  UpdateBranch' :: 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
-> Text
-> Text
-> UpdateBranch
UpdateBranch'
    { $sel:framework:UpdateBranch' :: Maybe Text
framework = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ttl:UpdateBranch' :: Maybe Text
ttl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableNotification:UpdateBranch' :: Maybe Bool
enableNotification = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:stage:UpdateBranch' :: Maybe Stage
stage = Maybe Stage
forall a. Maybe a
Prelude.Nothing,
      $sel:backendEnvironmentArn:UpdateBranch' :: Maybe Text
backendEnvironmentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePullRequestPreview:UpdateBranch' :: Maybe Bool
enablePullRequestPreview = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:UpdateBranch' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:UpdateBranch' :: Maybe Text
buildSpec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablePerformanceMode:UpdateBranch' :: Maybe Bool
enablePerformanceMode = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateBranch' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:UpdateBranch' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBuild:UpdateBranch' :: Maybe Bool
enableAutoBuild = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:UpdateBranch' :: Maybe Bool
enableBasicAuth = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestEnvironmentName:UpdateBranch' :: Maybe Text
pullRequestEnvironmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateBranch' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateBranch' :: Text
appId = Text
pAppId_,
      $sel:branchName:UpdateBranch' :: Text
branchName = Text
pBranchName_
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

instance Core.AWSRequest UpdateBranch where
  type AWSResponse UpdateBranch = UpdateBranchResponse
  request :: UpdateBranch -> Request UpdateBranch
request = Service -> UpdateBranch -> Request UpdateBranch
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateBranch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBranch)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateBranch))
-> Logger
-> Service
-> Proxy UpdateBranch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBranch)))
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 -> UpdateBranchResponse
UpdateBranchResponse'
            (Int -> Branch -> UpdateBranchResponse)
-> Either String Int
-> Either String (Branch -> UpdateBranchResponse)
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 -> UpdateBranchResponse)
-> Either String Branch -> Either String UpdateBranchResponse
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 UpdateBranch

instance Prelude.NFData UpdateBranch

instance Core.ToHeaders UpdateBranch where
  toHeaders :: UpdateBranch -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateBranch -> 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 UpdateBranch where
  toJSON :: UpdateBranch -> Value
toJSON UpdateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: 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:UpdateBranch' :: UpdateBranch -> Text
$sel:appId:UpdateBranch' :: UpdateBranch -> Text
$sel:description:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:pullRequestEnvironmentName:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:enableBasicAuth:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:enableAutoBuild:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:environmentVariables:UpdateBranch' :: UpdateBranch -> Maybe (HashMap Text Text)
$sel:displayName:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:enablePerformanceMode:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:buildSpec:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:basicAuthCredentials:UpdateBranch' :: UpdateBranch -> Maybe (Sensitive Text)
$sel:enablePullRequestPreview:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:backendEnvironmentArn:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:stage:UpdateBranch' :: UpdateBranch -> Maybe Stage
$sel:enableNotification:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:ttl:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:framework:UpdateBranch' :: UpdateBranch -> 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
          ]
      )

instance Core.ToPath UpdateBranch where
  toPath :: UpdateBranch -> ByteString
toPath UpdateBranch' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Stage
Text
branchName :: Text
appId :: 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:UpdateBranch' :: UpdateBranch -> Text
$sel:appId:UpdateBranch' :: UpdateBranch -> Text
$sel:description:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:pullRequestEnvironmentName:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:enableBasicAuth:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:enableAutoBuild:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:environmentVariables:UpdateBranch' :: UpdateBranch -> Maybe (HashMap Text Text)
$sel:displayName:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:enablePerformanceMode:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:buildSpec:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:basicAuthCredentials:UpdateBranch' :: UpdateBranch -> Maybe (Sensitive Text)
$sel:enablePullRequestPreview:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:backendEnvironmentArn:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:stage:UpdateBranch' :: UpdateBranch -> Maybe Stage
$sel:enableNotification:UpdateBranch' :: UpdateBranch -> Maybe Bool
$sel:ttl:UpdateBranch' :: UpdateBranch -> Maybe Text
$sel:framework:UpdateBranch' :: UpdateBranch -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
branchName
      ]

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

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

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

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

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

instance Prelude.NFData UpdateBranchResponse