{-# 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.UpdateApp
-- 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 an existing Amplify app.
module Amazonka.Amplify.UpdateApp
  ( -- * Creating a Request
    UpdateApp (..),
    newUpdateApp,

    -- * Request Lenses
    updateApp_enableBranchAutoBuild,
    updateApp_oauthToken,
    updateApp_accessToken,
    updateApp_customHeaders,
    updateApp_platform,
    updateApp_basicAuthCredentials,
    updateApp_repository,
    updateApp_buildSpec,
    updateApp_enableBranchAutoDeletion,
    updateApp_customRules,
    updateApp_iamServiceRoleArn,
    updateApp_autoBranchCreationPatterns,
    updateApp_name,
    updateApp_autoBranchCreationConfig,
    updateApp_environmentVariables,
    updateApp_enableAutoBranchCreation,
    updateApp_enableBasicAuth,
    updateApp_description,
    updateApp_appId,

    -- * Destructuring the Response
    UpdateAppResponse (..),
    newUpdateAppResponse,

    -- * Response Lenses
    updateAppResponse_httpStatus,
    updateAppResponse_app,
  )
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 app request.
--
-- /See:/ 'newUpdateApp' smart constructor.
data UpdateApp = UpdateApp'
  { -- | Enables branch auto-building for an Amplify app.
    UpdateApp -> Maybe Bool
enableBranchAutoBuild :: Prelude.Maybe Prelude.Bool,
    -- | The OAuth token for a third-party source control system for an Amplify
    -- app. The token is used to create a webhook and a read-only deploy key.
    -- The OAuth token is not stored.
    UpdateApp -> Maybe (Sensitive Text)
oauthToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The personal access token for a third-party source control system for an
    -- Amplify app. The token is used to create webhook and a read-only deploy
    -- key. The token is not stored.
    UpdateApp -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The custom HTTP headers for an Amplify app.
    UpdateApp -> Maybe Text
customHeaders :: Prelude.Maybe Prelude.Text,
    -- | The platform for an Amplify app.
    UpdateApp -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | The basic authorization credentials for an Amplify app.
    UpdateApp -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name of the repository for an Amplify app
    UpdateApp -> Maybe Text
repository :: Prelude.Maybe Prelude.Text,
    -- | The build specification (build spec) for an Amplify app.
    UpdateApp -> Maybe Text
buildSpec :: Prelude.Maybe Prelude.Text,
    -- | Automatically disconnects a branch in the Amplify Console when you
    -- delete a branch from your Git repository.
    UpdateApp -> Maybe Bool
enableBranchAutoDeletion :: Prelude.Maybe Prelude.Bool,
    -- | The custom redirect and rewrite rules for an Amplify app.
    UpdateApp -> Maybe [CustomRule]
customRules :: Prelude.Maybe [CustomRule],
    -- | The AWS Identity and Access Management (IAM) service role for an Amplify
    -- app.
    UpdateApp -> Maybe Text
iamServiceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Describes the automated branch creation glob patterns for an Amplify
    -- app.
    UpdateApp -> Maybe [Text]
autoBranchCreationPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The name for an Amplify app.
    UpdateApp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The automated branch creation configuration for an Amplify app.
    UpdateApp -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig :: Prelude.Maybe AutoBranchCreationConfig,
    -- | The environment variables for an Amplify app.
    UpdateApp -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Enables automated branch creation for an Amplify app.
    UpdateApp -> Maybe Bool
enableAutoBranchCreation :: Prelude.Maybe Prelude.Bool,
    -- | Enables basic authorization for an Amplify app.
    UpdateApp -> Maybe Bool
enableBasicAuth :: Prelude.Maybe Prelude.Bool,
    -- | The description for an Amplify app.
    UpdateApp -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique ID for an Amplify app.
    UpdateApp -> Text
appId :: Prelude.Text
  }
  deriving (UpdateApp -> UpdateApp -> Bool
(UpdateApp -> UpdateApp -> Bool)
-> (UpdateApp -> UpdateApp -> Bool) -> Eq UpdateApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApp -> UpdateApp -> Bool
$c/= :: UpdateApp -> UpdateApp -> Bool
== :: UpdateApp -> UpdateApp -> Bool
$c== :: UpdateApp -> UpdateApp -> Bool
Prelude.Eq, Int -> UpdateApp -> ShowS
[UpdateApp] -> ShowS
UpdateApp -> String
(Int -> UpdateApp -> ShowS)
-> (UpdateApp -> String)
-> ([UpdateApp] -> ShowS)
-> Show UpdateApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApp] -> ShowS
$cshowList :: [UpdateApp] -> ShowS
show :: UpdateApp -> String
$cshow :: UpdateApp -> String
showsPrec :: Int -> UpdateApp -> ShowS
$cshowsPrec :: Int -> UpdateApp -> ShowS
Prelude.Show, (forall x. UpdateApp -> Rep UpdateApp x)
-> (forall x. Rep UpdateApp x -> UpdateApp) -> Generic UpdateApp
forall x. Rep UpdateApp x -> UpdateApp
forall x. UpdateApp -> Rep UpdateApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApp x -> UpdateApp
$cfrom :: forall x. UpdateApp -> Rep UpdateApp x
Prelude.Generic)

-- |
-- Create a value of 'UpdateApp' 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:
--
-- 'enableBranchAutoBuild', 'updateApp_enableBranchAutoBuild' - Enables branch auto-building for an Amplify app.
--
-- 'oauthToken', 'updateApp_oauthToken' - The OAuth token for a third-party source control system for an Amplify
-- app. The token is used to create a webhook and a read-only deploy key.
-- The OAuth token is not stored.
--
-- 'accessToken', 'updateApp_accessToken' - The personal access token for a third-party source control system for an
-- Amplify app. The token is used to create webhook and a read-only deploy
-- key. The token is not stored.
--
-- 'customHeaders', 'updateApp_customHeaders' - The custom HTTP headers for an Amplify app.
--
-- 'platform', 'updateApp_platform' - The platform for an Amplify app.
--
-- 'basicAuthCredentials', 'updateApp_basicAuthCredentials' - The basic authorization credentials for an Amplify app.
--
-- 'repository', 'updateApp_repository' - The name of the repository for an Amplify app
--
-- 'buildSpec', 'updateApp_buildSpec' - The build specification (build spec) for an Amplify app.
--
-- 'enableBranchAutoDeletion', 'updateApp_enableBranchAutoDeletion' - Automatically disconnects a branch in the Amplify Console when you
-- delete a branch from your Git repository.
--
-- 'customRules', 'updateApp_customRules' - The custom redirect and rewrite rules for an Amplify app.
--
-- 'iamServiceRoleArn', 'updateApp_iamServiceRoleArn' - The AWS Identity and Access Management (IAM) service role for an Amplify
-- app.
--
-- 'autoBranchCreationPatterns', 'updateApp_autoBranchCreationPatterns' - Describes the automated branch creation glob patterns for an Amplify
-- app.
--
-- 'name', 'updateApp_name' - The name for an Amplify app.
--
-- 'autoBranchCreationConfig', 'updateApp_autoBranchCreationConfig' - The automated branch creation configuration for an Amplify app.
--
-- 'environmentVariables', 'updateApp_environmentVariables' - The environment variables for an Amplify app.
--
-- 'enableAutoBranchCreation', 'updateApp_enableAutoBranchCreation' - Enables automated branch creation for an Amplify app.
--
-- 'enableBasicAuth', 'updateApp_enableBasicAuth' - Enables basic authorization for an Amplify app.
--
-- 'description', 'updateApp_description' - The description for an Amplify app.
--
-- 'appId', 'updateApp_appId' - The unique ID for an Amplify app.
newUpdateApp ::
  -- | 'appId'
  Prelude.Text ->
  UpdateApp
newUpdateApp :: Text -> UpdateApp
newUpdateApp Text
pAppId_ =
  UpdateApp' :: Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Platform
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [CustomRule]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe AutoBranchCreationConfig
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Text
-> UpdateApp
UpdateApp'
    { $sel:enableBranchAutoBuild:UpdateApp' :: Maybe Bool
enableBranchAutoBuild = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:oauthToken:UpdateApp' :: Maybe (Sensitive Text)
oauthToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:accessToken:UpdateApp' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:customHeaders:UpdateApp' :: Maybe Text
customHeaders = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:UpdateApp' :: Maybe Platform
platform = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:UpdateApp' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:repository:UpdateApp' :: Maybe Text
repository = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:UpdateApp' :: Maybe Text
buildSpec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableBranchAutoDeletion:UpdateApp' :: Maybe Bool
enableBranchAutoDeletion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:customRules:UpdateApp' :: Maybe [CustomRule]
customRules = Maybe [CustomRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:iamServiceRoleArn:UpdateApp' :: Maybe Text
iamServiceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationPatterns:UpdateApp' :: Maybe [Text]
autoBranchCreationPatterns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApp' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationConfig:UpdateApp' :: Maybe AutoBranchCreationConfig
autoBranchCreationConfig = Maybe AutoBranchCreationConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:UpdateApp' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBranchCreation:UpdateApp' :: Maybe Bool
enableAutoBranchCreation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:UpdateApp' :: Maybe Bool
enableBasicAuth = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApp' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateApp' :: Text
appId = Text
pAppId_
    }

-- | Enables branch auto-building for an Amplify app.
updateApp_enableBranchAutoBuild :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableBranchAutoBuild :: (Maybe Bool -> f (Maybe Bool)) -> UpdateApp -> f UpdateApp
updateApp_enableBranchAutoBuild = (UpdateApp -> Maybe Bool)
-> (UpdateApp -> Maybe Bool -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
enableBranchAutoBuild :: Maybe Bool
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
enableBranchAutoBuild} -> Maybe Bool
enableBranchAutoBuild) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:enableBranchAutoBuild:UpdateApp' :: Maybe Bool
enableBranchAutoBuild = Maybe Bool
a} :: UpdateApp)

-- | The OAuth token for a third-party source control system for an Amplify
-- app. The token is used to create a webhook and a read-only deploy key.
-- The OAuth token is not stored.
updateApp_oauthToken :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_oauthToken :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_oauthToken = (UpdateApp -> Maybe (Sensitive Text))
-> (UpdateApp -> Maybe (Sensitive Text) -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe (Sensitive Text)
oauthToken :: Maybe (Sensitive Text)
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
oauthToken} -> Maybe (Sensitive Text)
oauthToken) (\s :: UpdateApp
s@UpdateApp' {} Maybe (Sensitive Text)
a -> UpdateApp
s {$sel:oauthToken:UpdateApp' :: Maybe (Sensitive Text)
oauthToken = Maybe (Sensitive Text)
a} :: UpdateApp) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateApp
-> f UpdateApp
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 personal access token for a third-party source control system for an
-- Amplify app. The token is used to create webhook and a read-only deploy
-- key. The token is not stored.
updateApp_accessToken :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_accessToken :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_accessToken = (UpdateApp -> Maybe (Sensitive Text))
-> (UpdateApp -> Maybe (Sensitive Text) -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: UpdateApp
s@UpdateApp' {} Maybe (Sensitive Text)
a -> UpdateApp
s {$sel:accessToken:UpdateApp' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: UpdateApp) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateApp
-> f UpdateApp
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 custom HTTP headers for an Amplify app.
updateApp_customHeaders :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_customHeaders :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_customHeaders = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
customHeaders :: Maybe Text
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
customHeaders} -> Maybe Text
customHeaders) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:customHeaders:UpdateApp' :: Maybe Text
customHeaders = Maybe Text
a} :: UpdateApp)

-- | The platform for an Amplify app.
updateApp_platform :: Lens.Lens' UpdateApp (Prelude.Maybe Platform)
updateApp_platform :: (Maybe Platform -> f (Maybe Platform)) -> UpdateApp -> f UpdateApp
updateApp_platform = (UpdateApp -> Maybe Platform)
-> (UpdateApp -> Maybe Platform -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Platform) (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Platform
platform :: Maybe Platform
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: UpdateApp
s@UpdateApp' {} Maybe Platform
a -> UpdateApp
s {$sel:platform:UpdateApp' :: Maybe Platform
platform = Maybe Platform
a} :: UpdateApp)

-- | The basic authorization credentials for an Amplify app.
updateApp_basicAuthCredentials :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_basicAuthCredentials :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_basicAuthCredentials = (UpdateApp -> Maybe (Sensitive Text))
-> (UpdateApp -> Maybe (Sensitive Text) -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
basicAuthCredentials} -> Maybe (Sensitive Text)
basicAuthCredentials) (\s :: UpdateApp
s@UpdateApp' {} Maybe (Sensitive Text)
a -> UpdateApp
s {$sel:basicAuthCredentials:UpdateApp' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
a} :: UpdateApp) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateApp
-> f UpdateApp
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 name of the repository for an Amplify app
updateApp_repository :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_repository :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_repository = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
repository :: Maybe Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
repository} -> Maybe Text
repository) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:repository:UpdateApp' :: Maybe Text
repository = Maybe Text
a} :: UpdateApp)

-- | The build specification (build spec) for an Amplify app.
updateApp_buildSpec :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_buildSpec :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_buildSpec = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
buildSpec :: Maybe Text
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe Text
buildSpec} -> Maybe Text
buildSpec) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:buildSpec:UpdateApp' :: Maybe Text
buildSpec = Maybe Text
a} :: UpdateApp)

-- | Automatically disconnects a branch in the Amplify Console when you
-- delete a branch from your Git repository.
updateApp_enableBranchAutoDeletion :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableBranchAutoDeletion :: (Maybe Bool -> f (Maybe Bool)) -> UpdateApp -> f UpdateApp
updateApp_enableBranchAutoDeletion = (UpdateApp -> Maybe Bool)
-> (UpdateApp -> Maybe Bool -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
enableBranchAutoDeletion :: Maybe Bool
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
enableBranchAutoDeletion} -> Maybe Bool
enableBranchAutoDeletion) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:enableBranchAutoDeletion:UpdateApp' :: Maybe Bool
enableBranchAutoDeletion = Maybe Bool
a} :: UpdateApp)

-- | The custom redirect and rewrite rules for an Amplify app.
updateApp_customRules :: Lens.Lens' UpdateApp (Prelude.Maybe [CustomRule])
updateApp_customRules :: (Maybe [CustomRule] -> f (Maybe [CustomRule]))
-> UpdateApp -> f UpdateApp
updateApp_customRules = (UpdateApp -> Maybe [CustomRule])
-> (UpdateApp -> Maybe [CustomRule] -> UpdateApp)
-> Lens
     UpdateApp UpdateApp (Maybe [CustomRule]) (Maybe [CustomRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe [CustomRule]
customRules :: Maybe [CustomRule]
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
customRules} -> Maybe [CustomRule]
customRules) (\s :: UpdateApp
s@UpdateApp' {} Maybe [CustomRule]
a -> UpdateApp
s {$sel:customRules:UpdateApp' :: Maybe [CustomRule]
customRules = Maybe [CustomRule]
a} :: UpdateApp) ((Maybe [CustomRule] -> f (Maybe [CustomRule]))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe [CustomRule] -> f (Maybe [CustomRule]))
    -> Maybe [CustomRule] -> f (Maybe [CustomRule]))
-> (Maybe [CustomRule] -> f (Maybe [CustomRule]))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CustomRule] [CustomRule] [CustomRule] [CustomRule]
-> Iso
     (Maybe [CustomRule])
     (Maybe [CustomRule])
     (Maybe [CustomRule])
     (Maybe [CustomRule])
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 [CustomRule] [CustomRule] [CustomRule] [CustomRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The AWS Identity and Access Management (IAM) service role for an Amplify
-- app.
updateApp_iamServiceRoleArn :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_iamServiceRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_iamServiceRoleArn = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
iamServiceRoleArn :: Maybe Text
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
iamServiceRoleArn} -> Maybe Text
iamServiceRoleArn) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:iamServiceRoleArn:UpdateApp' :: Maybe Text
iamServiceRoleArn = Maybe Text
a} :: UpdateApp)

-- | Describes the automated branch creation glob patterns for an Amplify
-- app.
updateApp_autoBranchCreationPatterns :: Lens.Lens' UpdateApp (Prelude.Maybe [Prelude.Text])
updateApp_autoBranchCreationPatterns :: (Maybe [Text] -> f (Maybe [Text])) -> UpdateApp -> f UpdateApp
updateApp_autoBranchCreationPatterns = (UpdateApp -> Maybe [Text])
-> (UpdateApp -> Maybe [Text] -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe [Text]
autoBranchCreationPatterns :: Maybe [Text]
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
autoBranchCreationPatterns} -> Maybe [Text]
autoBranchCreationPatterns) (\s :: UpdateApp
s@UpdateApp' {} Maybe [Text]
a -> UpdateApp
s {$sel:autoBranchCreationPatterns:UpdateApp' :: Maybe [Text]
autoBranchCreationPatterns = Maybe [Text]
a} :: UpdateApp) ((Maybe [Text] -> f (Maybe [Text])) -> UpdateApp -> f UpdateApp)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name for an Amplify app.
updateApp_name :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_name :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_name = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
name :: Maybe Text
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:name:UpdateApp' :: Maybe Text
name = Maybe Text
a} :: UpdateApp)

-- | The automated branch creation configuration for an Amplify app.
updateApp_autoBranchCreationConfig :: Lens.Lens' UpdateApp (Prelude.Maybe AutoBranchCreationConfig)
updateApp_autoBranchCreationConfig :: (Maybe AutoBranchCreationConfig
 -> f (Maybe AutoBranchCreationConfig))
-> UpdateApp -> f UpdateApp
updateApp_autoBranchCreationConfig = (UpdateApp -> Maybe AutoBranchCreationConfig)
-> (UpdateApp -> Maybe AutoBranchCreationConfig -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe AutoBranchCreationConfig)
     (Maybe AutoBranchCreationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe AutoBranchCreationConfig
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig} -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig) (\s :: UpdateApp
s@UpdateApp' {} Maybe AutoBranchCreationConfig
a -> UpdateApp
s {$sel:autoBranchCreationConfig:UpdateApp' :: Maybe AutoBranchCreationConfig
autoBranchCreationConfig = Maybe AutoBranchCreationConfig
a} :: UpdateApp)

-- | The environment variables for an Amplify app.
updateApp_environmentVariables :: Lens.Lens' UpdateApp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateApp_environmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateApp -> f UpdateApp
updateApp_environmentVariables = (UpdateApp -> Maybe (HashMap Text Text))
-> (UpdateApp -> Maybe (HashMap Text Text) -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (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 (\UpdateApp' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: UpdateApp
s@UpdateApp' {} Maybe (HashMap Text Text)
a -> UpdateApp
s {$sel:environmentVariables:UpdateApp' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: UpdateApp) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateApp -> f UpdateApp)
-> ((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)))
-> UpdateApp
-> f UpdateApp
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 automated branch creation for an Amplify app.
updateApp_enableAutoBranchCreation :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableAutoBranchCreation :: (Maybe Bool -> f (Maybe Bool)) -> UpdateApp -> f UpdateApp
updateApp_enableAutoBranchCreation = (UpdateApp -> Maybe Bool)
-> (UpdateApp -> Maybe Bool -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
enableAutoBranchCreation :: Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
enableAutoBranchCreation} -> Maybe Bool
enableAutoBranchCreation) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:enableAutoBranchCreation:UpdateApp' :: Maybe Bool
enableAutoBranchCreation = Maybe Bool
a} :: UpdateApp)

-- | Enables basic authorization for an Amplify app.
updateApp_enableBasicAuth :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableBasicAuth :: (Maybe Bool -> f (Maybe Bool)) -> UpdateApp -> f UpdateApp
updateApp_enableBasicAuth = (UpdateApp -> Maybe Bool)
-> (UpdateApp -> Maybe Bool -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
enableBasicAuth :: Maybe Bool
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
enableBasicAuth} -> Maybe Bool
enableBasicAuth) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:enableBasicAuth:UpdateApp' :: Maybe Bool
enableBasicAuth = Maybe Bool
a} :: UpdateApp)

-- | The description for an Amplify app.
updateApp_description :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_description :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_description = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:description:UpdateApp' :: Maybe Text
description = Maybe Text
a} :: UpdateApp)

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

instance Core.AWSRequest UpdateApp where
  type AWSResponse UpdateApp = UpdateAppResponse
  request :: UpdateApp -> Request UpdateApp
request = Service -> UpdateApp -> Request UpdateApp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateApp))
-> Logger
-> Service
-> Proxy UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
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 -> App -> UpdateAppResponse
UpdateAppResponse'
            (Int -> App -> UpdateAppResponse)
-> Either String Int -> Either String (App -> UpdateAppResponse)
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 (App -> UpdateAppResponse)
-> Either String App -> Either String UpdateAppResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String App
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"app")
      )

instance Prelude.Hashable UpdateApp

instance Prelude.NFData UpdateApp

instance Core.ToHeaders UpdateApp where
  toHeaders :: UpdateApp -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateApp -> 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 UpdateApp where
  toJSON :: UpdateApp -> Value
toJSON UpdateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
appId :: Text
description :: Maybe Text
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
name :: Maybe Text
autoBranchCreationPatterns :: Maybe [Text]
iamServiceRoleArn :: Maybe Text
customRules :: Maybe [CustomRule]
enableBranchAutoDeletion :: Maybe Bool
buildSpec :: Maybe Text
repository :: Maybe Text
basicAuthCredentials :: Maybe (Sensitive Text)
platform :: Maybe Platform
customHeaders :: Maybe Text
accessToken :: Maybe (Sensitive Text)
oauthToken :: Maybe (Sensitive Text)
enableBranchAutoBuild :: Maybe Bool
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"enableBranchAutoBuild" 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
enableBranchAutoBuild,
            (Text
"oauthToken" 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)
oauthToken,
            (Text
"accessToken" 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)
accessToken,
            (Text
"customHeaders" 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
customHeaders,
            (Text
"platform" Text -> Platform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Platform -> Pair) -> Maybe Platform -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Platform
platform,
            (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
"repository" 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
repository,
            (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
"enableBranchAutoDeletion" 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
enableBranchAutoDeletion,
            (Text
"customRules" Text -> [CustomRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([CustomRule] -> Pair) -> Maybe [CustomRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CustomRule]
customRules,
            (Text
"iamServiceRoleArn" 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
iamServiceRoleArn,
            (Text
"autoBranchCreationPatterns" 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]
autoBranchCreationPatterns,
            (Text
"name" 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
name,
            (Text
"autoBranchCreationConfig" Text -> AutoBranchCreationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AutoBranchCreationConfig -> Pair)
-> Maybe AutoBranchCreationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoBranchCreationConfig
autoBranchCreationConfig,
            (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
"enableAutoBranchCreation" 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
enableAutoBranchCreation,
            (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
"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 UpdateApp where
  toPath :: UpdateApp -> ByteString
toPath UpdateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
appId :: Text
description :: Maybe Text
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
name :: Maybe Text
autoBranchCreationPatterns :: Maybe [Text]
iamServiceRoleArn :: Maybe Text
customRules :: Maybe [CustomRule]
enableBranchAutoDeletion :: Maybe Bool
buildSpec :: Maybe Text
repository :: Maybe Text
basicAuthCredentials :: Maybe (Sensitive Text)
platform :: Maybe Platform
customHeaders :: Maybe Text
accessToken :: Maybe (Sensitive Text)
oauthToken :: Maybe (Sensitive Text)
enableBranchAutoBuild :: Maybe Bool
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/apps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId]

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

-- | The result structure for an Amplify app update request.
--
-- /See:/ 'newUpdateAppResponse' smart constructor.
data UpdateAppResponse = UpdateAppResponse'
  { -- | The response's http status code.
    UpdateAppResponse -> Int
httpStatus :: Prelude.Int,
    -- | Represents the updated Amplify app.
    UpdateAppResponse -> App
app :: App
  }
  deriving (UpdateAppResponse -> UpdateAppResponse -> Bool
(UpdateAppResponse -> UpdateAppResponse -> Bool)
-> (UpdateAppResponse -> UpdateAppResponse -> Bool)
-> Eq UpdateAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
== :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c== :: UpdateAppResponse -> UpdateAppResponse -> Bool
Prelude.Eq, Int -> UpdateAppResponse -> ShowS
[UpdateAppResponse] -> ShowS
UpdateAppResponse -> String
(Int -> UpdateAppResponse -> ShowS)
-> (UpdateAppResponse -> String)
-> ([UpdateAppResponse] -> ShowS)
-> Show UpdateAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppResponse] -> ShowS
$cshowList :: [UpdateAppResponse] -> ShowS
show :: UpdateAppResponse -> String
$cshow :: UpdateAppResponse -> String
showsPrec :: Int -> UpdateAppResponse -> ShowS
$cshowsPrec :: Int -> UpdateAppResponse -> ShowS
Prelude.Show, (forall x. UpdateAppResponse -> Rep UpdateAppResponse x)
-> (forall x. Rep UpdateAppResponse x -> UpdateAppResponse)
-> Generic UpdateAppResponse
forall x. Rep UpdateAppResponse x -> UpdateAppResponse
forall x. UpdateAppResponse -> Rep UpdateAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAppResponse x -> UpdateAppResponse
$cfrom :: forall x. UpdateAppResponse -> Rep UpdateAppResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAppResponse' 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', 'updateAppResponse_httpStatus' - The response's http status code.
--
-- 'app', 'updateAppResponse_app' - Represents the updated Amplify app.
newUpdateAppResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'app'
  App ->
  UpdateAppResponse
newUpdateAppResponse :: Int -> App -> UpdateAppResponse
newUpdateAppResponse Int
pHttpStatus_ App
pApp_ =
  UpdateAppResponse' :: Int -> App -> UpdateAppResponse
UpdateAppResponse'
    { $sel:httpStatus:UpdateAppResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:app:UpdateAppResponse' :: App
app = App
pApp_
    }

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

-- | Represents the updated Amplify app.
updateAppResponse_app :: Lens.Lens' UpdateAppResponse App
updateAppResponse_app :: (App -> f App) -> UpdateAppResponse -> f UpdateAppResponse
updateAppResponse_app = (UpdateAppResponse -> App)
-> (UpdateAppResponse -> App -> UpdateAppResponse)
-> Lens UpdateAppResponse UpdateAppResponse App App
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppResponse' {App
app :: App
$sel:app:UpdateAppResponse' :: UpdateAppResponse -> App
app} -> App
app) (\s :: UpdateAppResponse
s@UpdateAppResponse' {} App
a -> UpdateAppResponse
s {$sel:app:UpdateAppResponse' :: App
app = App
a} :: UpdateAppResponse)

instance Prelude.NFData UpdateAppResponse