{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_accessToken,
    updateApp_autoBranchCreationConfig,
    updateApp_autoBranchCreationPatterns,
    updateApp_basicAuthCredentials,
    updateApp_buildSpec,
    updateApp_customHeaders,
    updateApp_customRules,
    updateApp_description,
    updateApp_enableAutoBranchCreation,
    updateApp_enableBasicAuth,
    updateApp_enableBranchAutoBuild,
    updateApp_enableBranchAutoDeletion,
    updateApp_environmentVariables,
    updateApp_iamServiceRoleArn,
    updateApp_name,
    updateApp_oauthToken,
    updateApp_platform,
    updateApp_repository,
    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.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 update app request.
--
-- /See:/ 'newUpdateApp' smart constructor.
data UpdateApp = UpdateApp'
  { -- | The personal access token for a GitHub repository for an Amplify app.
    -- The personal access token is used to authorize access to a GitHub
    -- repository using the Amplify GitHub App. The token is not stored.
    --
    -- Use @accessToken@ for GitHub repositories only. To authorize access to a
    -- repository provider such as Bitbucket or CodeCommit, use @oauthToken@.
    --
    -- You must specify either @accessToken@ or @oauthToken@ when you update an
    -- app.
    --
    -- Existing Amplify apps deployed from a GitHub repository using OAuth
    -- continue to work with CI\/CD. However, we strongly recommend that you
    -- migrate these apps to use the GitHub App. For more information, see
    -- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
    -- in the /Amplify User Guide/ .
    UpdateApp -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The automated branch creation configuration for an Amplify app.
    UpdateApp -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig :: Prelude.Maybe AutoBranchCreationConfig,
    -- | Describes the automated branch creation glob patterns for an Amplify
    -- app.
    UpdateApp -> Maybe [Text]
autoBranchCreationPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The basic authorization credentials for an Amplify app. You must
    -- base64-encode the authorization credentials and provide them in the
    -- format @user:password@.
    UpdateApp -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The build specification (build spec) for an Amplify app.
    UpdateApp -> Maybe (Sensitive Text)
buildSpec :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The custom HTTP headers for an Amplify app.
    UpdateApp -> Maybe Text
customHeaders :: Prelude.Maybe Prelude.Text,
    -- | The custom redirect and rewrite rules for an Amplify app.
    UpdateApp -> Maybe [CustomRule]
customRules :: Prelude.Maybe [CustomRule],
    -- | The description for an Amplify app.
    UpdateApp -> Maybe Text
description :: Prelude.Maybe 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,
    -- | Enables branch auto-building for an Amplify app.
    UpdateApp -> Maybe Bool
enableBranchAutoBuild :: Prelude.Maybe Prelude.Bool,
    -- | 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 environment variables for an Amplify app.
    UpdateApp -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The AWS Identity and Access Management (IAM) service role for an Amplify
    -- app.
    UpdateApp -> Maybe Text
iamServiceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The name for an Amplify app.
    UpdateApp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The OAuth token for a third-party source control system for an Amplify
    -- app. The OAuth token is used to create a webhook and a read-only deploy
    -- key using SSH cloning. The OAuth token is not stored.
    --
    -- Use @oauthToken@ for repository providers other than GitHub, such as
    -- Bitbucket or CodeCommit.
    --
    -- To authorize access to GitHub as your repository provider, use
    -- @accessToken@.
    --
    -- You must specify either @oauthToken@ or @accessToken@ when you update an
    -- app.
    --
    -- Existing Amplify apps deployed from a GitHub repository using OAuth
    -- continue to work with CI\/CD. However, we strongly recommend that you
    -- migrate these apps to use the GitHub App. For more information, see
    -- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
    -- in the /Amplify User Guide/ .
    UpdateApp -> Maybe (Sensitive Text)
oauthToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The platform for the Amplify app. For a static app, set the platform
    -- type to @WEB@. For a dynamic server-side rendered (SSR) app, set the
    -- platform type to @WEB_COMPUTE@. For an app requiring Amplify Hosting\'s
    -- original SSR support only, set the platform type to @WEB_DYNAMIC@.
    UpdateApp -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | The name of the repository for an Amplify app
    UpdateApp -> Maybe Text
repository :: Prelude.Maybe Prelude.Text,
    -- | The unique ID for an Amplify app.
    UpdateApp -> Text
appId :: Prelude.Text
  }
  deriving (UpdateApp -> UpdateApp -> Bool
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
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. 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:
--
-- 'accessToken', 'updateApp_accessToken' - The personal access token for a GitHub repository for an Amplify app.
-- The personal access token is used to authorize access to a GitHub
-- repository using the Amplify GitHub App. The token is not stored.
--
-- Use @accessToken@ for GitHub repositories only. To authorize access to a
-- repository provider such as Bitbucket or CodeCommit, use @oauthToken@.
--
-- You must specify either @accessToken@ or @oauthToken@ when you update an
-- app.
--
-- Existing Amplify apps deployed from a GitHub repository using OAuth
-- continue to work with CI\/CD. However, we strongly recommend that you
-- migrate these apps to use the GitHub App. For more information, see
-- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
-- in the /Amplify User Guide/ .
--
-- 'autoBranchCreationConfig', 'updateApp_autoBranchCreationConfig' - The automated branch creation configuration for an Amplify app.
--
-- 'autoBranchCreationPatterns', 'updateApp_autoBranchCreationPatterns' - Describes the automated branch creation glob patterns for an Amplify
-- app.
--
-- 'basicAuthCredentials', 'updateApp_basicAuthCredentials' - The basic authorization credentials for an Amplify app. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
--
-- 'buildSpec', 'updateApp_buildSpec' - The build specification (build spec) for an Amplify app.
--
-- 'customHeaders', 'updateApp_customHeaders' - The custom HTTP headers for an Amplify app.
--
-- 'customRules', 'updateApp_customRules' - The custom redirect and rewrite rules for an Amplify app.
--
-- 'description', 'updateApp_description' - The description 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.
--
-- 'enableBranchAutoBuild', 'updateApp_enableBranchAutoBuild' - Enables branch auto-building for an Amplify app.
--
-- 'enableBranchAutoDeletion', 'updateApp_enableBranchAutoDeletion' - Automatically disconnects a branch in the Amplify Console when you
-- delete a branch from your Git repository.
--
-- 'environmentVariables', 'updateApp_environmentVariables' - The environment variables for an Amplify app.
--
-- 'iamServiceRoleArn', 'updateApp_iamServiceRoleArn' - The AWS Identity and Access Management (IAM) service role for an Amplify
-- app.
--
-- 'name', 'updateApp_name' - The name for an Amplify app.
--
-- 'oauthToken', 'updateApp_oauthToken' - The OAuth token for a third-party source control system for an Amplify
-- app. The OAuth token is used to create a webhook and a read-only deploy
-- key using SSH cloning. The OAuth token is not stored.
--
-- Use @oauthToken@ for repository providers other than GitHub, such as
-- Bitbucket or CodeCommit.
--
-- To authorize access to GitHub as your repository provider, use
-- @accessToken@.
--
-- You must specify either @oauthToken@ or @accessToken@ when you update an
-- app.
--
-- Existing Amplify apps deployed from a GitHub repository using OAuth
-- continue to work with CI\/CD. However, we strongly recommend that you
-- migrate these apps to use the GitHub App. For more information, see
-- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
-- in the /Amplify User Guide/ .
--
-- 'platform', 'updateApp_platform' - The platform for the Amplify app. For a static app, set the platform
-- type to @WEB@. For a dynamic server-side rendered (SSR) app, set the
-- platform type to @WEB_COMPUTE@. For an app requiring Amplify Hosting\'s
-- original SSR support only, set the platform type to @WEB_DYNAMIC@.
--
-- 'repository', 'updateApp_repository' - The name of the repository 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'
    { $sel:accessToken:UpdateApp' :: Maybe (Sensitive Text)
accessToken = forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationConfig:UpdateApp' :: Maybe AutoBranchCreationConfig
autoBranchCreationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationPatterns:UpdateApp' :: Maybe [Text]
autoBranchCreationPatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:UpdateApp' :: Maybe (Sensitive Text)
basicAuthCredentials = forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:UpdateApp' :: Maybe (Sensitive Text)
buildSpec = forall a. Maybe a
Prelude.Nothing,
      $sel:customHeaders:UpdateApp' :: Maybe Text
customHeaders = forall a. Maybe a
Prelude.Nothing,
      $sel:customRules:UpdateApp' :: Maybe [CustomRule]
customRules = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApp' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBranchCreation:UpdateApp' :: Maybe Bool
enableAutoBranchCreation = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:UpdateApp' :: Maybe Bool
enableBasicAuth = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBranchAutoBuild:UpdateApp' :: Maybe Bool
enableBranchAutoBuild = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBranchAutoDeletion:UpdateApp' :: Maybe Bool
enableBranchAutoDeletion = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:UpdateApp' :: Maybe (HashMap Text Text)
environmentVariables = forall a. Maybe a
Prelude.Nothing,
      $sel:iamServiceRoleArn:UpdateApp' :: Maybe Text
iamServiceRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApp' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:oauthToken:UpdateApp' :: Maybe (Sensitive Text)
oauthToken = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:UpdateApp' :: Maybe Platform
platform = forall a. Maybe a
Prelude.Nothing,
      $sel:repository:UpdateApp' :: Maybe Text
repository = forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateApp' :: Text
appId = Text
pAppId_
    }

-- | The personal access token for a GitHub repository for an Amplify app.
-- The personal access token is used to authorize access to a GitHub
-- repository using the Amplify GitHub App. The token is not stored.
--
-- Use @accessToken@ for GitHub repositories only. To authorize access to a
-- repository provider such as Bitbucket or CodeCommit, use @oauthToken@.
--
-- You must specify either @accessToken@ or @oauthToken@ when you update an
-- app.
--
-- Existing Amplify apps deployed from a GitHub repository using OAuth
-- continue to work with CI\/CD. However, we strongly recommend that you
-- migrate these apps to use the GitHub App. For more information, see
-- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
-- in the /Amplify User Guide/ .
updateApp_accessToken :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_accessToken :: Lens' UpdateApp (Maybe Text)
updateApp_accessToken = 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) 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 automated branch creation configuration for an Amplify app.
updateApp_autoBranchCreationConfig :: Lens.Lens' UpdateApp (Prelude.Maybe AutoBranchCreationConfig)
updateApp_autoBranchCreationConfig :: Lens' UpdateApp (Maybe AutoBranchCreationConfig)
updateApp_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)

-- | Describes the automated branch creation glob patterns for an Amplify
-- app.
updateApp_autoBranchCreationPatterns :: Lens.Lens' UpdateApp (Prelude.Maybe [Prelude.Text])
updateApp_autoBranchCreationPatterns :: Lens' UpdateApp (Maybe [Text])
updateApp_autoBranchCreationPatterns = 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) 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 basic authorization credentials for an Amplify app. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
updateApp_basicAuthCredentials :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_basicAuthCredentials :: Lens' UpdateApp (Maybe Text)
updateApp_basicAuthCredentials = 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) 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 an Amplify app.
updateApp_buildSpec :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_buildSpec :: Lens' UpdateApp (Maybe Text)
updateApp_buildSpec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe (Sensitive Text)
buildSpec :: Maybe (Sensitive Text)
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
buildSpec} -> Maybe (Sensitive Text)
buildSpec) (\s :: UpdateApp
s@UpdateApp' {} Maybe (Sensitive Text)
a -> UpdateApp
s {$sel:buildSpec:UpdateApp' :: Maybe (Sensitive Text)
buildSpec = Maybe (Sensitive Text)
a} :: UpdateApp) 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 custom HTTP headers for an Amplify app.
updateApp_customHeaders :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_customHeaders :: Lens' UpdateApp (Maybe Text)
updateApp_customHeaders = 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 custom redirect and rewrite rules for an Amplify app.
updateApp_customRules :: Lens.Lens' UpdateApp (Prelude.Maybe [CustomRule])
updateApp_customRules :: Lens' UpdateApp (Maybe [CustomRule])
updateApp_customRules = 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) 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 description for an Amplify app.
updateApp_description :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_description :: Lens' UpdateApp (Maybe Text)
updateApp_description = 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)

-- | Enables automated branch creation for an Amplify app.
updateApp_enableAutoBranchCreation :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableAutoBranchCreation :: Lens' UpdateApp (Maybe Bool)
updateApp_enableAutoBranchCreation = 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 :: Lens' UpdateApp (Maybe Bool)
updateApp_enableBasicAuth = 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)

-- | Enables branch auto-building for an Amplify app.
updateApp_enableBranchAutoBuild :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableBranchAutoBuild :: Lens' UpdateApp (Maybe Bool)
updateApp_enableBranchAutoBuild = 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)

-- | 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 :: Lens' UpdateApp (Maybe Bool)
updateApp_enableBranchAutoDeletion = 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 environment variables for an Amplify app.
updateApp_environmentVariables :: Lens.Lens' UpdateApp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateApp_environmentVariables :: Lens' UpdateApp (Maybe (HashMap Text Text))
updateApp_environmentVariables = 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) 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 AWS Identity and Access Management (IAM) service role for an Amplify
-- app.
updateApp_iamServiceRoleArn :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_iamServiceRoleArn :: Lens' UpdateApp (Maybe Text)
updateApp_iamServiceRoleArn = 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)

-- | The name for an Amplify app.
updateApp_name :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_name :: Lens' UpdateApp (Maybe Text)
updateApp_name = 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 OAuth token for a third-party source control system for an Amplify
-- app. The OAuth token is used to create a webhook and a read-only deploy
-- key using SSH cloning. The OAuth token is not stored.
--
-- Use @oauthToken@ for repository providers other than GitHub, such as
-- Bitbucket or CodeCommit.
--
-- To authorize access to GitHub as your repository provider, use
-- @accessToken@.
--
-- You must specify either @oauthToken@ or @accessToken@ when you update an
-- app.
--
-- Existing Amplify apps deployed from a GitHub repository using OAuth
-- continue to work with CI\/CD. However, we strongly recommend that you
-- migrate these apps to use the GitHub App. For more information, see
-- <https://docs.aws.amazon.com/amplify/latest/UserGuide/setting-up-GitHub-access.html#migrating-to-github-app-auth Migrating an existing OAuth app to the Amplify GitHub App>
-- in the /Amplify User Guide/ .
updateApp_oauthToken :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_oauthToken :: Lens' UpdateApp (Maybe Text)
updateApp_oauthToken = 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) 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 platform for the Amplify app. For a static app, set the platform
-- type to @WEB@. For a dynamic server-side rendered (SSR) app, set the
-- platform type to @WEB_COMPUTE@. For an app requiring Amplify Hosting\'s
-- original SSR support only, set the platform type to @WEB_DYNAMIC@.
updateApp_platform :: Lens.Lens' UpdateApp (Prelude.Maybe Platform)
updateApp_platform :: Lens' UpdateApp (Maybe Platform)
updateApp_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 name of the repository for an Amplify app
updateApp_repository :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_repository :: Lens' UpdateApp (Maybe Text)
updateApp_repository = 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 unique ID for an Amplify app.
updateApp_appId :: Lens.Lens' UpdateApp Prelude.Text
updateApp_appId :: Lens' UpdateApp Text
updateApp_appId = 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 :: (Service -> Service) -> UpdateApp -> Request UpdateApp
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 UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
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 -> App -> UpdateAppResponse
UpdateAppResponse'
            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
"app")
      )

instance Prelude.Hashable UpdateApp where
  hashWithSalt :: Int -> UpdateApp -> Int
hashWithSalt Int
_salt UpdateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
appId :: Text
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive Text)
name :: Maybe Text
iamServiceRoleArn :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enableBranchAutoDeletion :: Maybe Bool
enableBranchAutoBuild :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
description :: Maybe Text
customRules :: Maybe [CustomRule]
customHeaders :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
autoBranchCreationPatterns :: Maybe [Text]
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
accessToken :: Maybe (Sensitive Text)
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accessToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoBranchCreationConfig
autoBranchCreationConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
autoBranchCreationPatterns
      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
customHeaders
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CustomRule]
customRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableAutoBranchCreation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableBasicAuth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableBranchAutoBuild
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableBranchAutoDeletion
      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
iamServiceRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
oauthToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Platform
platform
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
repository
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appId

instance Prelude.NFData UpdateApp where
  rnf :: UpdateApp -> ()
rnf UpdateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
appId :: Text
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive Text)
name :: Maybe Text
iamServiceRoleArn :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enableBranchAutoDeletion :: Maybe Bool
enableBranchAutoBuild :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
description :: Maybe Text
customRules :: Maybe [CustomRule]
customHeaders :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
autoBranchCreationPatterns :: Maybe [Text]
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
accessToken :: Maybe (Sensitive Text)
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accessToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoBranchCreationConfig
autoBranchCreationConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
autoBranchCreationPatterns
      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
customHeaders
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomRule]
customRules
      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 Bool
enableAutoBranchCreation
      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
enableBranchAutoBuild
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableBranchAutoDeletion
      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
iamServiceRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
oauthToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Platform
platform
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
repository
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appId

instance Data.ToHeaders UpdateApp where
  toHeaders :: UpdateApp -> 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 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
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive Text)
name :: Maybe Text
iamServiceRoleArn :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enableBranchAutoDeletion :: Maybe Bool
enableBranchAutoBuild :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
description :: Maybe Text
customRules :: Maybe [CustomRule]
customHeaders :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
autoBranchCreationPatterns :: Maybe [Text]
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
accessToken :: Maybe (Sensitive Text)
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accessToken" 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)
accessToken,
            (Key
"autoBranchCreationConfig" 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 AutoBranchCreationConfig
autoBranchCreationConfig,
            (Key
"autoBranchCreationPatterns" 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]
autoBranchCreationPatterns,
            (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
"customHeaders" 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
customHeaders,
            (Key
"customRules" 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 [CustomRule]
customRules,
            (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
"enableAutoBranchCreation" 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
enableAutoBranchCreation,
            (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
"enableBranchAutoBuild" 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
enableBranchAutoBuild,
            (Key
"enableBranchAutoDeletion" 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
enableBranchAutoDeletion,
            (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
"iamServiceRoleArn" 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
iamServiceRoleArn,
            (Key
"name" 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
name,
            (Key
"oauthToken" 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)
oauthToken,
            (Key
"platform" 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 Platform
platform,
            (Key
"repository" 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
repository
          ]
      )

instance Data.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
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive Text)
name :: Maybe Text
iamServiceRoleArn :: Maybe Text
environmentVariables :: Maybe (HashMap Text Text)
enableBranchAutoDeletion :: Maybe Bool
enableBranchAutoBuild :: Maybe Bool
enableBasicAuth :: Maybe Bool
enableAutoBranchCreation :: Maybe Bool
description :: Maybe Text
customRules :: Maybe [CustomRule]
customHeaders :: Maybe Text
buildSpec :: Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
autoBranchCreationPatterns :: Maybe [Text]
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
accessToken :: Maybe (Sensitive Text)
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:repository:UpdateApp' :: UpdateApp -> Maybe Text
$sel:platform:UpdateApp' :: UpdateApp -> Maybe Platform
$sel:oauthToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:iamServiceRoleArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:environmentVariables:UpdateApp' :: UpdateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBranchAutoBuild:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableBasicAuth:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:enableAutoBranchCreation:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:customRules:UpdateApp' :: UpdateApp -> Maybe [CustomRule]
$sel:customHeaders:UpdateApp' :: UpdateApp -> Maybe Text
$sel:buildSpec:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:UpdateApp' :: UpdateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:UpdateApp' :: UpdateApp -> Maybe (Sensitive Text)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/apps/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
appId]

instance Data.ToQuery UpdateApp where
  toQuery :: UpdateApp -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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
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. 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'
    { $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 :: Lens' UpdateAppResponse Int
updateAppResponse_httpStatus = 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 :: Lens' UpdateAppResponse App
updateAppResponse_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 where
  rnf :: UpdateAppResponse -> ()
rnf UpdateAppResponse' {Int
App
app :: App
httpStatus :: Int
$sel:app:UpdateAppResponse' :: UpdateAppResponse -> App
$sel:httpStatus:UpdateAppResponse' :: UpdateAppResponse -> 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 App
app