{-# 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.CreateApp
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new Amplify app.
module Amazonka.Amplify.CreateApp
  ( -- * Creating a Request
    CreateApp (..),
    newCreateApp,

    -- * Request Lenses
    createApp_accessToken,
    createApp_autoBranchCreationConfig,
    createApp_autoBranchCreationPatterns,
    createApp_basicAuthCredentials,
    createApp_buildSpec,
    createApp_customHeaders,
    createApp_customRules,
    createApp_description,
    createApp_enableAutoBranchCreation,
    createApp_enableBasicAuth,
    createApp_enableBranchAutoBuild,
    createApp_enableBranchAutoDeletion,
    createApp_environmentVariables,
    createApp_iamServiceRoleArn,
    createApp_oauthToken,
    createApp_platform,
    createApp_repository,
    createApp_tags,
    createApp_name,

    -- * Destructuring the Response
    CreateAppResponse (..),
    newCreateAppResponse,

    -- * Response Lenses
    createAppResponse_httpStatus,
    createAppResponse_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 used to create apps in Amplify.
--
-- /See:/ 'newCreateApp' smart constructor.
data CreateApp = CreateApp'
  { -- | 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 create a
    -- new 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/ .
    CreateApp -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The automated branch creation configuration for an Amplify app.
    CreateApp -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig :: Prelude.Maybe AutoBranchCreationConfig,
    -- | The automated branch creation glob patterns for an Amplify app.
    CreateApp -> Maybe [Text]
autoBranchCreationPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The credentials for basic authorization for an Amplify app. You must
    -- base64-encode the authorization credentials and provide them in the
    -- format @user:password@.
    CreateApp -> Maybe (Sensitive Text)
basicAuthCredentials :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The build specification (build spec) for an Amplify app.
    CreateApp -> Maybe (Sensitive Text)
buildSpec :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The custom HTTP headers for an Amplify app.
    CreateApp -> Maybe Text
customHeaders :: Prelude.Maybe Prelude.Text,
    -- | The custom rewrite and redirect rules for an Amplify app.
    CreateApp -> Maybe [CustomRule]
customRules :: Prelude.Maybe [CustomRule],
    -- | The description for an Amplify app.
    CreateApp -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Enables automated branch creation for an Amplify app.
    CreateApp -> Maybe Bool
enableAutoBranchCreation :: Prelude.Maybe Prelude.Bool,
    -- | Enables basic authorization for an Amplify app. This will apply to all
    -- branches that are part of this app.
    CreateApp -> Maybe Bool
enableBasicAuth :: Prelude.Maybe Prelude.Bool,
    -- | Enables the auto building of branches for an Amplify app.
    CreateApp -> Maybe Bool
enableBranchAutoBuild :: Prelude.Maybe Prelude.Bool,
    -- | Automatically disconnects a branch in the Amplify Console when you
    -- delete a branch from your Git repository.
    CreateApp -> Maybe Bool
enableBranchAutoDeletion :: Prelude.Maybe Prelude.Bool,
    -- | The environment variables map for an Amplify app.
    CreateApp -> 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.
    CreateApp -> Maybe Text
iamServiceRoleArn :: 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 create a
    -- new 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/ .
    CreateApp -> 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@.
    CreateApp -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | The repository for an Amplify app.
    CreateApp -> Maybe Text
repository :: Prelude.Maybe Prelude.Text,
    -- | The tag for an Amplify app.
    CreateApp -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name for an Amplify app.
    CreateApp -> Text
name :: Prelude.Text
  }
  deriving (CreateApp -> CreateApp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApp -> CreateApp -> Bool
$c/= :: CreateApp -> CreateApp -> Bool
== :: CreateApp -> CreateApp -> Bool
$c== :: CreateApp -> CreateApp -> Bool
Prelude.Eq, Int -> CreateApp -> ShowS
[CreateApp] -> ShowS
CreateApp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApp] -> ShowS
$cshowList :: [CreateApp] -> ShowS
show :: CreateApp -> String
$cshow :: CreateApp -> String
showsPrec :: Int -> CreateApp -> ShowS
$cshowsPrec :: Int -> CreateApp -> ShowS
Prelude.Show, forall x. Rep CreateApp x -> CreateApp
forall x. CreateApp -> Rep CreateApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApp x -> CreateApp
$cfrom :: forall x. CreateApp -> Rep CreateApp x
Prelude.Generic)

-- |
-- Create a value of 'CreateApp' 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', 'createApp_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 create a
-- new 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', 'createApp_autoBranchCreationConfig' - The automated branch creation configuration for an Amplify app.
--
-- 'autoBranchCreationPatterns', 'createApp_autoBranchCreationPatterns' - The automated branch creation glob patterns for an Amplify app.
--
-- 'basicAuthCredentials', 'createApp_basicAuthCredentials' - The credentials for basic authorization for an Amplify app. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
--
-- 'buildSpec', 'createApp_buildSpec' - The build specification (build spec) for an Amplify app.
--
-- 'customHeaders', 'createApp_customHeaders' - The custom HTTP headers for an Amplify app.
--
-- 'customRules', 'createApp_customRules' - The custom rewrite and redirect rules for an Amplify app.
--
-- 'description', 'createApp_description' - The description for an Amplify app.
--
-- 'enableAutoBranchCreation', 'createApp_enableAutoBranchCreation' - Enables automated branch creation for an Amplify app.
--
-- 'enableBasicAuth', 'createApp_enableBasicAuth' - Enables basic authorization for an Amplify app. This will apply to all
-- branches that are part of this app.
--
-- 'enableBranchAutoBuild', 'createApp_enableBranchAutoBuild' - Enables the auto building of branches for an Amplify app.
--
-- 'enableBranchAutoDeletion', 'createApp_enableBranchAutoDeletion' - Automatically disconnects a branch in the Amplify Console when you
-- delete a branch from your Git repository.
--
-- 'environmentVariables', 'createApp_environmentVariables' - The environment variables map for an Amplify app.
--
-- 'iamServiceRoleArn', 'createApp_iamServiceRoleArn' - The AWS Identity and Access Management (IAM) service role for an Amplify
-- app.
--
-- 'oauthToken', 'createApp_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 create a
-- new 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', 'createApp_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', 'createApp_repository' - The repository for an Amplify app.
--
-- 'tags', 'createApp_tags' - The tag for an Amplify app.
--
-- 'name', 'createApp_name' - The name for an Amplify app.
newCreateApp ::
  -- | 'name'
  Prelude.Text ->
  CreateApp
newCreateApp :: Text -> CreateApp
newCreateApp Text
pName_ =
  CreateApp'
    { $sel:accessToken:CreateApp' :: Maybe (Sensitive Text)
accessToken = forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationConfig:CreateApp' :: Maybe AutoBranchCreationConfig
autoBranchCreationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:autoBranchCreationPatterns:CreateApp' :: Maybe [Text]
autoBranchCreationPatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthCredentials:CreateApp' :: Maybe (Sensitive Text)
basicAuthCredentials = forall a. Maybe a
Prelude.Nothing,
      $sel:buildSpec:CreateApp' :: Maybe (Sensitive Text)
buildSpec = forall a. Maybe a
Prelude.Nothing,
      $sel:customHeaders:CreateApp' :: Maybe Text
customHeaders = forall a. Maybe a
Prelude.Nothing,
      $sel:customRules:CreateApp' :: Maybe [CustomRule]
customRules = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateApp' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoBranchCreation:CreateApp' :: Maybe Bool
enableAutoBranchCreation = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBasicAuth:CreateApp' :: Maybe Bool
enableBasicAuth = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBranchAutoBuild:CreateApp' :: Maybe Bool
enableBranchAutoBuild = forall a. Maybe a
Prelude.Nothing,
      $sel:enableBranchAutoDeletion:CreateApp' :: Maybe Bool
enableBranchAutoDeletion = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:CreateApp' :: Maybe (HashMap Text Text)
environmentVariables = forall a. Maybe a
Prelude.Nothing,
      $sel:iamServiceRoleArn:CreateApp' :: Maybe Text
iamServiceRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:oauthToken:CreateApp' :: Maybe (Sensitive Text)
oauthToken = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:CreateApp' :: Maybe Platform
platform = forall a. Maybe a
Prelude.Nothing,
      $sel:repository:CreateApp' :: Maybe Text
repository = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateApp' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateApp' :: Text
name = Text
pName_
    }

-- | 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 create a
-- new 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/ .
createApp_accessToken :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_accessToken :: Lens' CreateApp (Maybe Text)
createApp_accessToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: CreateApp
s@CreateApp' {} Maybe (Sensitive Text)
a -> CreateApp
s {$sel:accessToken:CreateApp' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: CreateApp) 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.
createApp_autoBranchCreationConfig :: Lens.Lens' CreateApp (Prelude.Maybe AutoBranchCreationConfig)
createApp_autoBranchCreationConfig :: Lens' CreateApp (Maybe AutoBranchCreationConfig)
createApp_autoBranchCreationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe AutoBranchCreationConfig
autoBranchCreationConfig :: Maybe AutoBranchCreationConfig
$sel:autoBranchCreationConfig:CreateApp' :: CreateApp -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig} -> Maybe AutoBranchCreationConfig
autoBranchCreationConfig) (\s :: CreateApp
s@CreateApp' {} Maybe AutoBranchCreationConfig
a -> CreateApp
s {$sel:autoBranchCreationConfig:CreateApp' :: Maybe AutoBranchCreationConfig
autoBranchCreationConfig = Maybe AutoBranchCreationConfig
a} :: CreateApp)

-- | The automated branch creation glob patterns for an Amplify app.
createApp_autoBranchCreationPatterns :: Lens.Lens' CreateApp (Prelude.Maybe [Prelude.Text])
createApp_autoBranchCreationPatterns :: Lens' CreateApp (Maybe [Text])
createApp_autoBranchCreationPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe [Text]
autoBranchCreationPatterns :: Maybe [Text]
$sel:autoBranchCreationPatterns:CreateApp' :: CreateApp -> Maybe [Text]
autoBranchCreationPatterns} -> Maybe [Text]
autoBranchCreationPatterns) (\s :: CreateApp
s@CreateApp' {} Maybe [Text]
a -> CreateApp
s {$sel:autoBranchCreationPatterns:CreateApp' :: Maybe [Text]
autoBranchCreationPatterns = Maybe [Text]
a} :: CreateApp) 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 credentials for basic authorization for an Amplify app. You must
-- base64-encode the authorization credentials and provide them in the
-- format @user:password@.
createApp_basicAuthCredentials :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_basicAuthCredentials :: Lens' CreateApp (Maybe Text)
createApp_basicAuthCredentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (Sensitive Text)
basicAuthCredentials :: Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
basicAuthCredentials} -> Maybe (Sensitive Text)
basicAuthCredentials) (\s :: CreateApp
s@CreateApp' {} Maybe (Sensitive Text)
a -> CreateApp
s {$sel:basicAuthCredentials:CreateApp' :: Maybe (Sensitive Text)
basicAuthCredentials = Maybe (Sensitive Text)
a} :: CreateApp) 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.
createApp_buildSpec :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_buildSpec :: Lens' CreateApp (Maybe Text)
createApp_buildSpec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (Sensitive Text)
buildSpec :: Maybe (Sensitive Text)
$sel:buildSpec:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
buildSpec} -> Maybe (Sensitive Text)
buildSpec) (\s :: CreateApp
s@CreateApp' {} Maybe (Sensitive Text)
a -> CreateApp
s {$sel:buildSpec:CreateApp' :: Maybe (Sensitive Text)
buildSpec = Maybe (Sensitive Text)
a} :: CreateApp) 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.
createApp_customHeaders :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_customHeaders :: Lens' CreateApp (Maybe Text)
createApp_customHeaders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
customHeaders :: Maybe Text
$sel:customHeaders:CreateApp' :: CreateApp -> Maybe Text
customHeaders} -> Maybe Text
customHeaders) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:customHeaders:CreateApp' :: Maybe Text
customHeaders = Maybe Text
a} :: CreateApp)

-- | The custom rewrite and redirect rules for an Amplify app.
createApp_customRules :: Lens.Lens' CreateApp (Prelude.Maybe [CustomRule])
createApp_customRules :: Lens' CreateApp (Maybe [CustomRule])
createApp_customRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe [CustomRule]
customRules :: Maybe [CustomRule]
$sel:customRules:CreateApp' :: CreateApp -> Maybe [CustomRule]
customRules} -> Maybe [CustomRule]
customRules) (\s :: CreateApp
s@CreateApp' {} Maybe [CustomRule]
a -> CreateApp
s {$sel:customRules:CreateApp' :: Maybe [CustomRule]
customRules = Maybe [CustomRule]
a} :: CreateApp) 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.
createApp_description :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_description :: Lens' CreateApp (Maybe Text)
createApp_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
description :: Maybe Text
$sel:description:CreateApp' :: CreateApp -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:description:CreateApp' :: Maybe Text
description = Maybe Text
a} :: CreateApp)

-- | Enables automated branch creation for an Amplify app.
createApp_enableAutoBranchCreation :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Bool)
createApp_enableAutoBranchCreation :: Lens' CreateApp (Maybe Bool)
createApp_enableAutoBranchCreation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Bool
enableAutoBranchCreation :: Maybe Bool
$sel:enableAutoBranchCreation:CreateApp' :: CreateApp -> Maybe Bool
enableAutoBranchCreation} -> Maybe Bool
enableAutoBranchCreation) (\s :: CreateApp
s@CreateApp' {} Maybe Bool
a -> CreateApp
s {$sel:enableAutoBranchCreation:CreateApp' :: Maybe Bool
enableAutoBranchCreation = Maybe Bool
a} :: CreateApp)

-- | Enables basic authorization for an Amplify app. This will apply to all
-- branches that are part of this app.
createApp_enableBasicAuth :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Bool)
createApp_enableBasicAuth :: Lens' CreateApp (Maybe Bool)
createApp_enableBasicAuth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Bool
enableBasicAuth :: Maybe Bool
$sel:enableBasicAuth:CreateApp' :: CreateApp -> Maybe Bool
enableBasicAuth} -> Maybe Bool
enableBasicAuth) (\s :: CreateApp
s@CreateApp' {} Maybe Bool
a -> CreateApp
s {$sel:enableBasicAuth:CreateApp' :: Maybe Bool
enableBasicAuth = Maybe Bool
a} :: CreateApp)

-- | Enables the auto building of branches for an Amplify app.
createApp_enableBranchAutoBuild :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Bool)
createApp_enableBranchAutoBuild :: Lens' CreateApp (Maybe Bool)
createApp_enableBranchAutoBuild = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Bool
enableBranchAutoBuild :: Maybe Bool
$sel:enableBranchAutoBuild:CreateApp' :: CreateApp -> Maybe Bool
enableBranchAutoBuild} -> Maybe Bool
enableBranchAutoBuild) (\s :: CreateApp
s@CreateApp' {} Maybe Bool
a -> CreateApp
s {$sel:enableBranchAutoBuild:CreateApp' :: Maybe Bool
enableBranchAutoBuild = Maybe Bool
a} :: CreateApp)

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

-- | The environment variables map for an Amplify app.
createApp_environmentVariables :: Lens.Lens' CreateApp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApp_environmentVariables :: Lens' CreateApp (Maybe (HashMap Text Text))
createApp_environmentVariables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: CreateApp
s@CreateApp' {} Maybe (HashMap Text Text)
a -> CreateApp
s {$sel:environmentVariables:CreateApp' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: CreateApp) 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.
createApp_iamServiceRoleArn :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_iamServiceRoleArn :: Lens' CreateApp (Maybe Text)
createApp_iamServiceRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
iamServiceRoleArn :: Maybe Text
$sel:iamServiceRoleArn:CreateApp' :: CreateApp -> Maybe Text
iamServiceRoleArn} -> Maybe Text
iamServiceRoleArn) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:iamServiceRoleArn:CreateApp' :: Maybe Text
iamServiceRoleArn = Maybe Text
a} :: CreateApp)

-- | 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 create a
-- new 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/ .
createApp_oauthToken :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_oauthToken :: Lens' CreateApp (Maybe Text)
createApp_oauthToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (Sensitive Text)
oauthToken :: Maybe (Sensitive Text)
$sel:oauthToken:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
oauthToken} -> Maybe (Sensitive Text)
oauthToken) (\s :: CreateApp
s@CreateApp' {} Maybe (Sensitive Text)
a -> CreateApp
s {$sel:oauthToken:CreateApp' :: Maybe (Sensitive Text)
oauthToken = Maybe (Sensitive Text)
a} :: CreateApp) 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@.
createApp_platform :: Lens.Lens' CreateApp (Prelude.Maybe Platform)
createApp_platform :: Lens' CreateApp (Maybe Platform)
createApp_platform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Platform
platform :: Maybe Platform
$sel:platform:CreateApp' :: CreateApp -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: CreateApp
s@CreateApp' {} Maybe Platform
a -> CreateApp
s {$sel:platform:CreateApp' :: Maybe Platform
platform = Maybe Platform
a} :: CreateApp)

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

-- | The tag for an Amplify app.
createApp_tags :: Lens.Lens' CreateApp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApp_tags :: Lens' CreateApp (Maybe (HashMap Text Text))
createApp_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateApp
s@CreateApp' {} Maybe (HashMap Text Text)
a -> CreateApp
s {$sel:tags:CreateApp' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateApp) 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 name for an Amplify app.
createApp_name :: Lens.Lens' CreateApp Prelude.Text
createApp_name :: Lens' CreateApp Text
createApp_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Text
name :: Text
$sel:name:CreateApp' :: CreateApp -> Text
name} -> Text
name) (\s :: CreateApp
s@CreateApp' {} Text
a -> CreateApp
s {$sel:name:CreateApp' :: Text
name = Text
a} :: CreateApp)

instance Core.AWSRequest CreateApp where
  type AWSResponse CreateApp = CreateAppResponse
  request :: (Service -> Service) -> CreateApp -> Request CreateApp
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 CreateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApp)))
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 -> CreateAppResponse
CreateAppResponse'
            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 CreateApp where
  hashWithSalt :: Int -> CreateApp -> Int
hashWithSalt Int
_salt CreateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
name :: Text
tags :: Maybe (HashMap Text Text)
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive 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:name:CreateApp' :: CreateApp -> Text
$sel:tags:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
$sel:repository:CreateApp' :: CreateApp -> Maybe Text
$sel:platform:CreateApp' :: CreateApp -> Maybe Platform
$sel:oauthToken:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:iamServiceRoleArn:CreateApp' :: CreateApp -> Maybe Text
$sel:environmentVariables:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableBranchAutoBuild:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableBasicAuth:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableAutoBranchCreation:CreateApp' :: CreateApp -> Maybe Bool
$sel:description:CreateApp' :: CreateApp -> Maybe Text
$sel:customRules:CreateApp' :: CreateApp -> Maybe [CustomRule]
$sel:customHeaders:CreateApp' :: CreateApp -> Maybe Text
$sel:buildSpec:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:CreateApp' :: CreateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:CreateApp' :: CreateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:CreateApp' :: CreateApp -> 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 (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` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

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

instance Data.ToHeaders CreateApp where
  toHeaders :: CreateApp -> 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 CreateApp where
  toJSON :: CreateApp -> Value
toJSON CreateApp' {Maybe Bool
Maybe [Text]
Maybe [CustomRule]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Platform
Maybe AutoBranchCreationConfig
Text
name :: Text
tags :: Maybe (HashMap Text Text)
repository :: Maybe Text
platform :: Maybe Platform
oauthToken :: Maybe (Sensitive 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:name:CreateApp' :: CreateApp -> Text
$sel:tags:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
$sel:repository:CreateApp' :: CreateApp -> Maybe Text
$sel:platform:CreateApp' :: CreateApp -> Maybe Platform
$sel:oauthToken:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:iamServiceRoleArn:CreateApp' :: CreateApp -> Maybe Text
$sel:environmentVariables:CreateApp' :: CreateApp -> Maybe (HashMap Text Text)
$sel:enableBranchAutoDeletion:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableBranchAutoBuild:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableBasicAuth:CreateApp' :: CreateApp -> Maybe Bool
$sel:enableAutoBranchCreation:CreateApp' :: CreateApp -> Maybe Bool
$sel:description:CreateApp' :: CreateApp -> Maybe Text
$sel:customRules:CreateApp' :: CreateApp -> Maybe [CustomRule]
$sel:customHeaders:CreateApp' :: CreateApp -> Maybe Text
$sel:buildSpec:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:basicAuthCredentials:CreateApp' :: CreateApp -> Maybe (Sensitive Text)
$sel:autoBranchCreationPatterns:CreateApp' :: CreateApp -> Maybe [Text]
$sel:autoBranchCreationConfig:CreateApp' :: CreateApp -> Maybe AutoBranchCreationConfig
$sel:accessToken:CreateApp' :: CreateApp -> 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
"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,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath CreateApp where
  toPath :: CreateApp -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/apps"

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

-- | /See:/ 'newCreateAppResponse' smart constructor.
data CreateAppResponse = CreateAppResponse'
  { -- | The response's http status code.
    CreateAppResponse -> Int
httpStatus :: Prelude.Int,
    CreateAppResponse -> App
app :: App
  }
  deriving (CreateAppResponse -> CreateAppResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppResponse -> CreateAppResponse -> Bool
$c/= :: CreateAppResponse -> CreateAppResponse -> Bool
== :: CreateAppResponse -> CreateAppResponse -> Bool
$c== :: CreateAppResponse -> CreateAppResponse -> Bool
Prelude.Eq, Int -> CreateAppResponse -> ShowS
[CreateAppResponse] -> ShowS
CreateAppResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppResponse] -> ShowS
$cshowList :: [CreateAppResponse] -> ShowS
show :: CreateAppResponse -> String
$cshow :: CreateAppResponse -> String
showsPrec :: Int -> CreateAppResponse -> ShowS
$cshowsPrec :: Int -> CreateAppResponse -> ShowS
Prelude.Show, forall x. Rep CreateAppResponse x -> CreateAppResponse
forall x. CreateAppResponse -> Rep CreateAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppResponse x -> CreateAppResponse
$cfrom :: forall x. CreateAppResponse -> Rep CreateAppResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAppResponse' 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', 'createAppResponse_httpStatus' - The response's http status code.
--
-- 'app', 'createAppResponse_app' - Undocumented member.
newCreateAppResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'app'
  App ->
  CreateAppResponse
newCreateAppResponse :: Int -> App -> CreateAppResponse
newCreateAppResponse Int
pHttpStatus_ App
pApp_ =
  CreateAppResponse'
    { $sel:httpStatus:CreateAppResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:app:CreateAppResponse' :: App
app = App
pApp_
    }

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

-- | Undocumented member.
createAppResponse_app :: Lens.Lens' CreateAppResponse App
createAppResponse_app :: Lens' CreateAppResponse App
createAppResponse_app = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppResponse' {App
app :: App
$sel:app:CreateAppResponse' :: CreateAppResponse -> App
app} -> App
app) (\s :: CreateAppResponse
s@CreateAppResponse' {} App
a -> CreateAppResponse
s {$sel:app:CreateAppResponse' :: App
app = App
a} :: CreateAppResponse)

instance Prelude.NFData CreateAppResponse where
  rnf :: CreateAppResponse -> ()
rnf CreateAppResponse' {Int
App
app :: App
httpStatus :: Int
$sel:app:CreateAppResponse' :: CreateAppResponse -> App
$sel:httpStatus:CreateAppResponse' :: CreateAppResponse -> 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