{-# 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.CodeBuild.CreateProject
-- 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 build project.
module Amazonka.CodeBuild.CreateProject
  ( -- * Creating a Request
    CreateProject (..),
    newCreateProject,

    -- * Request Lenses
    createProject_badgeEnabled,
    createProject_buildBatchConfig,
    createProject_cache,
    createProject_concurrentBuildLimit,
    createProject_description,
    createProject_encryptionKey,
    createProject_fileSystemLocations,
    createProject_logsConfig,
    createProject_queuedTimeoutInMinutes,
    createProject_secondaryArtifacts,
    createProject_secondarySourceVersions,
    createProject_secondarySources,
    createProject_sourceVersion,
    createProject_tags,
    createProject_timeoutInMinutes,
    createProject_vpcConfig,
    createProject_name,
    createProject_source,
    createProject_artifacts,
    createProject_environment,
    createProject_serviceRole,

    -- * Destructuring the Response
    CreateProjectResponse (..),
    newCreateProjectResponse,

    -- * Response Lenses
    createProjectResponse_project,
    createProjectResponse_httpStatus,
  )
where

import Amazonka.CodeBuild.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

-- | /See:/ 'newCreateProject' smart constructor.
data CreateProject = CreateProject'
  { -- | Set this to true to generate a publicly accessible URL for your
    -- project\'s build badge.
    CreateProject -> Maybe Bool
badgeEnabled :: Prelude.Maybe Prelude.Bool,
    -- | A ProjectBuildBatchConfig object that defines the batch build options
    -- for the project.
    CreateProject -> Maybe ProjectBuildBatchConfig
buildBatchConfig :: Prelude.Maybe ProjectBuildBatchConfig,
    -- | Stores recently used information so that it can be quickly accessed at a
    -- later time.
    CreateProject -> Maybe ProjectCache
cache :: Prelude.Maybe ProjectCache,
    -- | The maximum number of concurrent builds that are allowed for this
    -- project.
    --
    -- New builds are only started if the current number of builds is less than
    -- or equal to this limit. If the current build count meets this limit, new
    -- builds are throttled and are not run.
    CreateProject -> Maybe Int
concurrentBuildLimit :: Prelude.Maybe Prelude.Int,
    -- | A description that makes the build project easy to identify.
    CreateProject -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Key Management Service customer master key (CMK) to be used for
    -- encrypting the build output artifacts.
    --
    -- You can use a cross-account KMS key to encrypt the build output
    -- artifacts if your service role has permission to that key.
    --
    -- You can specify either the Amazon Resource Name (ARN) of the CMK or, if
    -- available, the CMK\'s alias (using the format @alias\/\<alias-name>@).
    CreateProject -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
    -- | An array of @ProjectFileSystemLocation@ objects for a CodeBuild build
    -- project. A @ProjectFileSystemLocation@ object specifies the
    -- @identifier@, @location@, @mountOptions@, @mountPoint@, and @type@ of a
    -- file system created using Amazon Elastic File System.
    CreateProject -> Maybe [ProjectFileSystemLocation]
fileSystemLocations :: Prelude.Maybe [ProjectFileSystemLocation],
    -- | Information about logs for the build project. These can be logs in
    -- CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.
    CreateProject -> Maybe LogsConfig
logsConfig :: Prelude.Maybe LogsConfig,
    -- | The number of minutes a build is allowed to be queued before it times
    -- out.
    CreateProject -> Maybe Natural
queuedTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | An array of @ProjectArtifacts@ objects.
    CreateProject -> Maybe [ProjectArtifacts]
secondaryArtifacts :: Prelude.Maybe [ProjectArtifacts],
    -- | An array of @ProjectSourceVersion@ objects. If @secondarySourceVersions@
    -- is specified at the build level, then they take precedence over these
    -- @secondarySourceVersions@ (at the project level).
    CreateProject -> Maybe [ProjectSourceVersion]
secondarySourceVersions :: Prelude.Maybe [ProjectSourceVersion],
    -- | An array of @ProjectSource@ objects.
    CreateProject -> Maybe [ProjectSource]
secondarySources :: Prelude.Maybe [ProjectSource],
    -- | A version of the build input to be built for this project. If not
    -- specified, the latest version is used. If specified, it must be one of:
    --
    -- -   For CodeCommit: the commit ID, branch, or Git tag to use.
    --
    -- -   For GitHub: the commit ID, pull request ID, branch name, or tag name
    --     that corresponds to the version of the source code you want to
    --     build. If a pull request ID is specified, it must use the format
    --     @pr\/pull-request-ID@ (for example @pr\/25@). If a branch name is
    --     specified, the branch\'s HEAD commit ID is used. If not specified,
    --     the default branch\'s HEAD commit ID is used.
    --
    -- -   For Bitbucket: the commit ID, branch name, or tag name that
    --     corresponds to the version of the source code you want to build. If
    --     a branch name is specified, the branch\'s HEAD commit ID is used. If
    --     not specified, the default branch\'s HEAD commit ID is used.
    --
    -- -   For Amazon S3: the version ID of the object that represents the
    --     build input ZIP file to use.
    --
    -- If @sourceVersion@ is specified at the build level, then that version
    -- takes precedence over this @sourceVersion@ (at the project level).
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html Source Version Sample with CodeBuild>
    -- in the /CodeBuild User Guide/.
    CreateProject -> Maybe Text
sourceVersion :: Prelude.Maybe Prelude.Text,
    -- | A list of tag key and value pairs associated with this build project.
    --
    -- These tags are available for use by Amazon Web Services services that
    -- support CodeBuild build project tags.
    CreateProject -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait
    -- before it times out any build that has not been marked as completed. The
    -- default is 60 minutes.
    CreateProject -> Maybe Natural
timeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | VpcConfig enables CodeBuild to access resources in an Amazon VPC.
    CreateProject -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | The name of the build project.
    CreateProject -> Text
name :: Prelude.Text,
    -- | Information about the build input source code for the build project.
    CreateProject -> ProjectSource
source :: ProjectSource,
    -- | Information about the build output artifacts for the build project.
    CreateProject -> ProjectArtifacts
artifacts :: ProjectArtifacts,
    -- | Information about the build environment for the build project.
    CreateProject -> ProjectEnvironment
environment :: ProjectEnvironment,
    -- | The ARN of the IAM role that enables CodeBuild to interact with
    -- dependent Amazon Web Services services on behalf of the Amazon Web
    -- Services account.
    CreateProject -> Text
serviceRole :: Prelude.Text
  }
  deriving (CreateProject -> CreateProject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProject -> CreateProject -> Bool
$c/= :: CreateProject -> CreateProject -> Bool
== :: CreateProject -> CreateProject -> Bool
$c== :: CreateProject -> CreateProject -> Bool
Prelude.Eq, ReadPrec [CreateProject]
ReadPrec CreateProject
Int -> ReadS CreateProject
ReadS [CreateProject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProject]
$creadListPrec :: ReadPrec [CreateProject]
readPrec :: ReadPrec CreateProject
$creadPrec :: ReadPrec CreateProject
readList :: ReadS [CreateProject]
$creadList :: ReadS [CreateProject]
readsPrec :: Int -> ReadS CreateProject
$creadsPrec :: Int -> ReadS CreateProject
Prelude.Read, Int -> CreateProject -> ShowS
[CreateProject] -> ShowS
CreateProject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProject] -> ShowS
$cshowList :: [CreateProject] -> ShowS
show :: CreateProject -> String
$cshow :: CreateProject -> String
showsPrec :: Int -> CreateProject -> ShowS
$cshowsPrec :: Int -> CreateProject -> ShowS
Prelude.Show, forall x. Rep CreateProject x -> CreateProject
forall x. CreateProject -> Rep CreateProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProject x -> CreateProject
$cfrom :: forall x. CreateProject -> Rep CreateProject x
Prelude.Generic)

-- |
-- Create a value of 'CreateProject' 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:
--
-- 'badgeEnabled', 'createProject_badgeEnabled' - Set this to true to generate a publicly accessible URL for your
-- project\'s build badge.
--
-- 'buildBatchConfig', 'createProject_buildBatchConfig' - A ProjectBuildBatchConfig object that defines the batch build options
-- for the project.
--
-- 'cache', 'createProject_cache' - Stores recently used information so that it can be quickly accessed at a
-- later time.
--
-- 'concurrentBuildLimit', 'createProject_concurrentBuildLimit' - The maximum number of concurrent builds that are allowed for this
-- project.
--
-- New builds are only started if the current number of builds is less than
-- or equal to this limit. If the current build count meets this limit, new
-- builds are throttled and are not run.
--
-- 'description', 'createProject_description' - A description that makes the build project easy to identify.
--
-- 'encryptionKey', 'createProject_encryptionKey' - The Key Management Service customer master key (CMK) to be used for
-- encrypting the build output artifacts.
--
-- You can use a cross-account KMS key to encrypt the build output
-- artifacts if your service role has permission to that key.
--
-- You can specify either the Amazon Resource Name (ARN) of the CMK or, if
-- available, the CMK\'s alias (using the format @alias\/\<alias-name>@).
--
-- 'fileSystemLocations', 'createProject_fileSystemLocations' - An array of @ProjectFileSystemLocation@ objects for a CodeBuild build
-- project. A @ProjectFileSystemLocation@ object specifies the
-- @identifier@, @location@, @mountOptions@, @mountPoint@, and @type@ of a
-- file system created using Amazon Elastic File System.
--
-- 'logsConfig', 'createProject_logsConfig' - Information about logs for the build project. These can be logs in
-- CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.
--
-- 'queuedTimeoutInMinutes', 'createProject_queuedTimeoutInMinutes' - The number of minutes a build is allowed to be queued before it times
-- out.
--
-- 'secondaryArtifacts', 'createProject_secondaryArtifacts' - An array of @ProjectArtifacts@ objects.
--
-- 'secondarySourceVersions', 'createProject_secondarySourceVersions' - An array of @ProjectSourceVersion@ objects. If @secondarySourceVersions@
-- is specified at the build level, then they take precedence over these
-- @secondarySourceVersions@ (at the project level).
--
-- 'secondarySources', 'createProject_secondarySources' - An array of @ProjectSource@ objects.
--
-- 'sourceVersion', 'createProject_sourceVersion' - A version of the build input to be built for this project. If not
-- specified, the latest version is used. If specified, it must be one of:
--
-- -   For CodeCommit: the commit ID, branch, or Git tag to use.
--
-- -   For GitHub: the commit ID, pull request ID, branch name, or tag name
--     that corresponds to the version of the source code you want to
--     build. If a pull request ID is specified, it must use the format
--     @pr\/pull-request-ID@ (for example @pr\/25@). If a branch name is
--     specified, the branch\'s HEAD commit ID is used. If not specified,
--     the default branch\'s HEAD commit ID is used.
--
-- -   For Bitbucket: the commit ID, branch name, or tag name that
--     corresponds to the version of the source code you want to build. If
--     a branch name is specified, the branch\'s HEAD commit ID is used. If
--     not specified, the default branch\'s HEAD commit ID is used.
--
-- -   For Amazon S3: the version ID of the object that represents the
--     build input ZIP file to use.
--
-- If @sourceVersion@ is specified at the build level, then that version
-- takes precedence over this @sourceVersion@ (at the project level).
--
-- For more information, see
-- <https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html Source Version Sample with CodeBuild>
-- in the /CodeBuild User Guide/.
--
-- 'tags', 'createProject_tags' - A list of tag key and value pairs associated with this build project.
--
-- These tags are available for use by Amazon Web Services services that
-- support CodeBuild build project tags.
--
-- 'timeoutInMinutes', 'createProject_timeoutInMinutes' - How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait
-- before it times out any build that has not been marked as completed. The
-- default is 60 minutes.
--
-- 'vpcConfig', 'createProject_vpcConfig' - VpcConfig enables CodeBuild to access resources in an Amazon VPC.
--
-- 'name', 'createProject_name' - The name of the build project.
--
-- 'source', 'createProject_source' - Information about the build input source code for the build project.
--
-- 'artifacts', 'createProject_artifacts' - Information about the build output artifacts for the build project.
--
-- 'environment', 'createProject_environment' - Information about the build environment for the build project.
--
-- 'serviceRole', 'createProject_serviceRole' - The ARN of the IAM role that enables CodeBuild to interact with
-- dependent Amazon Web Services services on behalf of the Amazon Web
-- Services account.
newCreateProject ::
  -- | 'name'
  Prelude.Text ->
  -- | 'source'
  ProjectSource ->
  -- | 'artifacts'
  ProjectArtifacts ->
  -- | 'environment'
  ProjectEnvironment ->
  -- | 'serviceRole'
  Prelude.Text ->
  CreateProject
newCreateProject :: Text
-> ProjectSource
-> ProjectArtifacts
-> ProjectEnvironment
-> Text
-> CreateProject
newCreateProject
  Text
pName_
  ProjectSource
pSource_
  ProjectArtifacts
pArtifacts_
  ProjectEnvironment
pEnvironment_
  Text
pServiceRole_ =
    CreateProject'
      { $sel:badgeEnabled:CreateProject' :: Maybe Bool
badgeEnabled = forall a. Maybe a
Prelude.Nothing,
        $sel:buildBatchConfig:CreateProject' :: Maybe ProjectBuildBatchConfig
buildBatchConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:cache:CreateProject' :: Maybe ProjectCache
cache = forall a. Maybe a
Prelude.Nothing,
        $sel:concurrentBuildLimit:CreateProject' :: Maybe Int
concurrentBuildLimit = forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateProject' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionKey:CreateProject' :: Maybe Text
encryptionKey = forall a. Maybe a
Prelude.Nothing,
        $sel:fileSystemLocations:CreateProject' :: Maybe [ProjectFileSystemLocation]
fileSystemLocations = forall a. Maybe a
Prelude.Nothing,
        $sel:logsConfig:CreateProject' :: Maybe LogsConfig
logsConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:queuedTimeoutInMinutes:CreateProject' :: Maybe Natural
queuedTimeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
        $sel:secondaryArtifacts:CreateProject' :: Maybe [ProjectArtifacts]
secondaryArtifacts = forall a. Maybe a
Prelude.Nothing,
        $sel:secondarySourceVersions:CreateProject' :: Maybe [ProjectSourceVersion]
secondarySourceVersions = forall a. Maybe a
Prelude.Nothing,
        $sel:secondarySources:CreateProject' :: Maybe [ProjectSource]
secondarySources = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceVersion:CreateProject' :: Maybe Text
sourceVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProject' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:timeoutInMinutes:CreateProject' :: Maybe Natural
timeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfig:CreateProject' :: Maybe VpcConfig
vpcConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateProject' :: Text
name = Text
pName_,
        $sel:source:CreateProject' :: ProjectSource
source = ProjectSource
pSource_,
        $sel:artifacts:CreateProject' :: ProjectArtifacts
artifacts = ProjectArtifacts
pArtifacts_,
        $sel:environment:CreateProject' :: ProjectEnvironment
environment = ProjectEnvironment
pEnvironment_,
        $sel:serviceRole:CreateProject' :: Text
serviceRole = Text
pServiceRole_
      }

-- | Set this to true to generate a publicly accessible URL for your
-- project\'s build badge.
createProject_badgeEnabled :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Bool)
createProject_badgeEnabled :: Lens' CreateProject (Maybe Bool)
createProject_badgeEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Bool
badgeEnabled :: Maybe Bool
$sel:badgeEnabled:CreateProject' :: CreateProject -> Maybe Bool
badgeEnabled} -> Maybe Bool
badgeEnabled) (\s :: CreateProject
s@CreateProject' {} Maybe Bool
a -> CreateProject
s {$sel:badgeEnabled:CreateProject' :: Maybe Bool
badgeEnabled = Maybe Bool
a} :: CreateProject)

-- | A ProjectBuildBatchConfig object that defines the batch build options
-- for the project.
createProject_buildBatchConfig :: Lens.Lens' CreateProject (Prelude.Maybe ProjectBuildBatchConfig)
createProject_buildBatchConfig :: Lens' CreateProject (Maybe ProjectBuildBatchConfig)
createProject_buildBatchConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe ProjectBuildBatchConfig
buildBatchConfig :: Maybe ProjectBuildBatchConfig
$sel:buildBatchConfig:CreateProject' :: CreateProject -> Maybe ProjectBuildBatchConfig
buildBatchConfig} -> Maybe ProjectBuildBatchConfig
buildBatchConfig) (\s :: CreateProject
s@CreateProject' {} Maybe ProjectBuildBatchConfig
a -> CreateProject
s {$sel:buildBatchConfig:CreateProject' :: Maybe ProjectBuildBatchConfig
buildBatchConfig = Maybe ProjectBuildBatchConfig
a} :: CreateProject)

-- | Stores recently used information so that it can be quickly accessed at a
-- later time.
createProject_cache :: Lens.Lens' CreateProject (Prelude.Maybe ProjectCache)
createProject_cache :: Lens' CreateProject (Maybe ProjectCache)
createProject_cache = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe ProjectCache
cache :: Maybe ProjectCache
$sel:cache:CreateProject' :: CreateProject -> Maybe ProjectCache
cache} -> Maybe ProjectCache
cache) (\s :: CreateProject
s@CreateProject' {} Maybe ProjectCache
a -> CreateProject
s {$sel:cache:CreateProject' :: Maybe ProjectCache
cache = Maybe ProjectCache
a} :: CreateProject)

-- | The maximum number of concurrent builds that are allowed for this
-- project.
--
-- New builds are only started if the current number of builds is less than
-- or equal to this limit. If the current build count meets this limit, new
-- builds are throttled and are not run.
createProject_concurrentBuildLimit :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Int)
createProject_concurrentBuildLimit :: Lens' CreateProject (Maybe Int)
createProject_concurrentBuildLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Int
concurrentBuildLimit :: Maybe Int
$sel:concurrentBuildLimit:CreateProject' :: CreateProject -> Maybe Int
concurrentBuildLimit} -> Maybe Int
concurrentBuildLimit) (\s :: CreateProject
s@CreateProject' {} Maybe Int
a -> CreateProject
s {$sel:concurrentBuildLimit:CreateProject' :: Maybe Int
concurrentBuildLimit = Maybe Int
a} :: CreateProject)

-- | A description that makes the build project easy to identify.
createProject_description :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_description :: Lens' CreateProject (Maybe Text)
createProject_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Text
description :: Maybe Text
$sel:description:CreateProject' :: CreateProject -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateProject
s@CreateProject' {} Maybe Text
a -> CreateProject
s {$sel:description:CreateProject' :: Maybe Text
description = Maybe Text
a} :: CreateProject)

-- | The Key Management Service customer master key (CMK) to be used for
-- encrypting the build output artifacts.
--
-- You can use a cross-account KMS key to encrypt the build output
-- artifacts if your service role has permission to that key.
--
-- You can specify either the Amazon Resource Name (ARN) of the CMK or, if
-- available, the CMK\'s alias (using the format @alias\/\<alias-name>@).
createProject_encryptionKey :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_encryptionKey :: Lens' CreateProject (Maybe Text)
createProject_encryptionKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Text
encryptionKey :: Maybe Text
$sel:encryptionKey:CreateProject' :: CreateProject -> Maybe Text
encryptionKey} -> Maybe Text
encryptionKey) (\s :: CreateProject
s@CreateProject' {} Maybe Text
a -> CreateProject
s {$sel:encryptionKey:CreateProject' :: Maybe Text
encryptionKey = Maybe Text
a} :: CreateProject)

-- | An array of @ProjectFileSystemLocation@ objects for a CodeBuild build
-- project. A @ProjectFileSystemLocation@ object specifies the
-- @identifier@, @location@, @mountOptions@, @mountPoint@, and @type@ of a
-- file system created using Amazon Elastic File System.
createProject_fileSystemLocations :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectFileSystemLocation])
createProject_fileSystemLocations :: Lens' CreateProject (Maybe [ProjectFileSystemLocation])
createProject_fileSystemLocations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [ProjectFileSystemLocation]
fileSystemLocations :: Maybe [ProjectFileSystemLocation]
$sel:fileSystemLocations:CreateProject' :: CreateProject -> Maybe [ProjectFileSystemLocation]
fileSystemLocations} -> Maybe [ProjectFileSystemLocation]
fileSystemLocations) (\s :: CreateProject
s@CreateProject' {} Maybe [ProjectFileSystemLocation]
a -> CreateProject
s {$sel:fileSystemLocations:CreateProject' :: Maybe [ProjectFileSystemLocation]
fileSystemLocations = Maybe [ProjectFileSystemLocation]
a} :: CreateProject) 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

-- | Information about logs for the build project. These can be logs in
-- CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.
createProject_logsConfig :: Lens.Lens' CreateProject (Prelude.Maybe LogsConfig)
createProject_logsConfig :: Lens' CreateProject (Maybe LogsConfig)
createProject_logsConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe LogsConfig
logsConfig :: Maybe LogsConfig
$sel:logsConfig:CreateProject' :: CreateProject -> Maybe LogsConfig
logsConfig} -> Maybe LogsConfig
logsConfig) (\s :: CreateProject
s@CreateProject' {} Maybe LogsConfig
a -> CreateProject
s {$sel:logsConfig:CreateProject' :: Maybe LogsConfig
logsConfig = Maybe LogsConfig
a} :: CreateProject)

-- | The number of minutes a build is allowed to be queued before it times
-- out.
createProject_queuedTimeoutInMinutes :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Natural)
createProject_queuedTimeoutInMinutes :: Lens' CreateProject (Maybe Natural)
createProject_queuedTimeoutInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Natural
queuedTimeoutInMinutes :: Maybe Natural
$sel:queuedTimeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
queuedTimeoutInMinutes} -> Maybe Natural
queuedTimeoutInMinutes) (\s :: CreateProject
s@CreateProject' {} Maybe Natural
a -> CreateProject
s {$sel:queuedTimeoutInMinutes:CreateProject' :: Maybe Natural
queuedTimeoutInMinutes = Maybe Natural
a} :: CreateProject)

-- | An array of @ProjectArtifacts@ objects.
createProject_secondaryArtifacts :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectArtifacts])
createProject_secondaryArtifacts :: Lens' CreateProject (Maybe [ProjectArtifacts])
createProject_secondaryArtifacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [ProjectArtifacts]
secondaryArtifacts :: Maybe [ProjectArtifacts]
$sel:secondaryArtifacts:CreateProject' :: CreateProject -> Maybe [ProjectArtifacts]
secondaryArtifacts} -> Maybe [ProjectArtifacts]
secondaryArtifacts) (\s :: CreateProject
s@CreateProject' {} Maybe [ProjectArtifacts]
a -> CreateProject
s {$sel:secondaryArtifacts:CreateProject' :: Maybe [ProjectArtifacts]
secondaryArtifacts = Maybe [ProjectArtifacts]
a} :: CreateProject) 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

-- | An array of @ProjectSourceVersion@ objects. If @secondarySourceVersions@
-- is specified at the build level, then they take precedence over these
-- @secondarySourceVersions@ (at the project level).
createProject_secondarySourceVersions :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectSourceVersion])
createProject_secondarySourceVersions :: Lens' CreateProject (Maybe [ProjectSourceVersion])
createProject_secondarySourceVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [ProjectSourceVersion]
secondarySourceVersions :: Maybe [ProjectSourceVersion]
$sel:secondarySourceVersions:CreateProject' :: CreateProject -> Maybe [ProjectSourceVersion]
secondarySourceVersions} -> Maybe [ProjectSourceVersion]
secondarySourceVersions) (\s :: CreateProject
s@CreateProject' {} Maybe [ProjectSourceVersion]
a -> CreateProject
s {$sel:secondarySourceVersions:CreateProject' :: Maybe [ProjectSourceVersion]
secondarySourceVersions = Maybe [ProjectSourceVersion]
a} :: CreateProject) 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

-- | An array of @ProjectSource@ objects.
createProject_secondarySources :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectSource])
createProject_secondarySources :: Lens' CreateProject (Maybe [ProjectSource])
createProject_secondarySources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [ProjectSource]
secondarySources :: Maybe [ProjectSource]
$sel:secondarySources:CreateProject' :: CreateProject -> Maybe [ProjectSource]
secondarySources} -> Maybe [ProjectSource]
secondarySources) (\s :: CreateProject
s@CreateProject' {} Maybe [ProjectSource]
a -> CreateProject
s {$sel:secondarySources:CreateProject' :: Maybe [ProjectSource]
secondarySources = Maybe [ProjectSource]
a} :: CreateProject) 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

-- | A version of the build input to be built for this project. If not
-- specified, the latest version is used. If specified, it must be one of:
--
-- -   For CodeCommit: the commit ID, branch, or Git tag to use.
--
-- -   For GitHub: the commit ID, pull request ID, branch name, or tag name
--     that corresponds to the version of the source code you want to
--     build. If a pull request ID is specified, it must use the format
--     @pr\/pull-request-ID@ (for example @pr\/25@). If a branch name is
--     specified, the branch\'s HEAD commit ID is used. If not specified,
--     the default branch\'s HEAD commit ID is used.
--
-- -   For Bitbucket: the commit ID, branch name, or tag name that
--     corresponds to the version of the source code you want to build. If
--     a branch name is specified, the branch\'s HEAD commit ID is used. If
--     not specified, the default branch\'s HEAD commit ID is used.
--
-- -   For Amazon S3: the version ID of the object that represents the
--     build input ZIP file to use.
--
-- If @sourceVersion@ is specified at the build level, then that version
-- takes precedence over this @sourceVersion@ (at the project level).
--
-- For more information, see
-- <https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html Source Version Sample with CodeBuild>
-- in the /CodeBuild User Guide/.
createProject_sourceVersion :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_sourceVersion :: Lens' CreateProject (Maybe Text)
createProject_sourceVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Text
sourceVersion :: Maybe Text
$sel:sourceVersion:CreateProject' :: CreateProject -> Maybe Text
sourceVersion} -> Maybe Text
sourceVersion) (\s :: CreateProject
s@CreateProject' {} Maybe Text
a -> CreateProject
s {$sel:sourceVersion:CreateProject' :: Maybe Text
sourceVersion = Maybe Text
a} :: CreateProject)

-- | A list of tag key and value pairs associated with this build project.
--
-- These tags are available for use by Amazon Web Services services that
-- support CodeBuild build project tags.
createProject_tags :: Lens.Lens' CreateProject (Prelude.Maybe [Tag])
createProject_tags :: Lens' CreateProject (Maybe [Tag])
createProject_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateProject' :: CreateProject -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateProject
s@CreateProject' {} Maybe [Tag]
a -> CreateProject
s {$sel:tags:CreateProject' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateProject) 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

-- | How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait
-- before it times out any build that has not been marked as completed. The
-- default is 60 minutes.
createProject_timeoutInMinutes :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Natural)
createProject_timeoutInMinutes :: Lens' CreateProject (Maybe Natural)
createProject_timeoutInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Natural
timeoutInMinutes :: Maybe Natural
$sel:timeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
timeoutInMinutes} -> Maybe Natural
timeoutInMinutes) (\s :: CreateProject
s@CreateProject' {} Maybe Natural
a -> CreateProject
s {$sel:timeoutInMinutes:CreateProject' :: Maybe Natural
timeoutInMinutes = Maybe Natural
a} :: CreateProject)

-- | VpcConfig enables CodeBuild to access resources in an Amazon VPC.
createProject_vpcConfig :: Lens.Lens' CreateProject (Prelude.Maybe VpcConfig)
createProject_vpcConfig :: Lens' CreateProject (Maybe VpcConfig)
createProject_vpcConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe VpcConfig
vpcConfig :: Maybe VpcConfig
$sel:vpcConfig:CreateProject' :: CreateProject -> Maybe VpcConfig
vpcConfig} -> Maybe VpcConfig
vpcConfig) (\s :: CreateProject
s@CreateProject' {} Maybe VpcConfig
a -> CreateProject
s {$sel:vpcConfig:CreateProject' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
a} :: CreateProject)

-- | The name of the build project.
createProject_name :: Lens.Lens' CreateProject Prelude.Text
createProject_name :: Lens' CreateProject Text
createProject_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Text
name :: Text
$sel:name:CreateProject' :: CreateProject -> Text
name} -> Text
name) (\s :: CreateProject
s@CreateProject' {} Text
a -> CreateProject
s {$sel:name:CreateProject' :: Text
name = Text
a} :: CreateProject)

-- | Information about the build input source code for the build project.
createProject_source :: Lens.Lens' CreateProject ProjectSource
createProject_source :: Lens' CreateProject ProjectSource
createProject_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {ProjectSource
source :: ProjectSource
$sel:source:CreateProject' :: CreateProject -> ProjectSource
source} -> ProjectSource
source) (\s :: CreateProject
s@CreateProject' {} ProjectSource
a -> CreateProject
s {$sel:source:CreateProject' :: ProjectSource
source = ProjectSource
a} :: CreateProject)

-- | Information about the build output artifacts for the build project.
createProject_artifacts :: Lens.Lens' CreateProject ProjectArtifacts
createProject_artifacts :: Lens' CreateProject ProjectArtifacts
createProject_artifacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {ProjectArtifacts
artifacts :: ProjectArtifacts
$sel:artifacts:CreateProject' :: CreateProject -> ProjectArtifacts
artifacts} -> ProjectArtifacts
artifacts) (\s :: CreateProject
s@CreateProject' {} ProjectArtifacts
a -> CreateProject
s {$sel:artifacts:CreateProject' :: ProjectArtifacts
artifacts = ProjectArtifacts
a} :: CreateProject)

-- | Information about the build environment for the build project.
createProject_environment :: Lens.Lens' CreateProject ProjectEnvironment
createProject_environment :: Lens' CreateProject ProjectEnvironment
createProject_environment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {ProjectEnvironment
environment :: ProjectEnvironment
$sel:environment:CreateProject' :: CreateProject -> ProjectEnvironment
environment} -> ProjectEnvironment
environment) (\s :: CreateProject
s@CreateProject' {} ProjectEnvironment
a -> CreateProject
s {$sel:environment:CreateProject' :: ProjectEnvironment
environment = ProjectEnvironment
a} :: CreateProject)

-- | The ARN of the IAM role that enables CodeBuild to interact with
-- dependent Amazon Web Services services on behalf of the Amazon Web
-- Services account.
createProject_serviceRole :: Lens.Lens' CreateProject Prelude.Text
createProject_serviceRole :: Lens' CreateProject Text
createProject_serviceRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Text
serviceRole :: Text
$sel:serviceRole:CreateProject' :: CreateProject -> Text
serviceRole} -> Text
serviceRole) (\s :: CreateProject
s@CreateProject' {} Text
a -> CreateProject
s {$sel:serviceRole:CreateProject' :: Text
serviceRole = Text
a} :: CreateProject)

instance Core.AWSRequest CreateProject where
  type
    AWSResponse CreateProject =
      CreateProjectResponse
  request :: (Service -> Service) -> CreateProject -> Request CreateProject
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 CreateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProject)))
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 ->
          Maybe Project -> Int -> CreateProjectResponse
CreateProjectResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"project")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreateProject where
  hashWithSalt :: Int -> CreateProject -> Int
hashWithSalt Int
_salt CreateProject' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [ProjectArtifacts]
Maybe [ProjectFileSystemLocation]
Maybe [ProjectSourceVersion]
Maybe [ProjectSource]
Maybe [Tag]
Maybe Text
Maybe ProjectBuildBatchConfig
Maybe ProjectCache
Maybe LogsConfig
Maybe VpcConfig
Text
ProjectArtifacts
ProjectEnvironment
ProjectSource
serviceRole :: Text
environment :: ProjectEnvironment
artifacts :: ProjectArtifacts
source :: ProjectSource
name :: Text
vpcConfig :: Maybe VpcConfig
timeoutInMinutes :: Maybe Natural
tags :: Maybe [Tag]
sourceVersion :: Maybe Text
secondarySources :: Maybe [ProjectSource]
secondarySourceVersions :: Maybe [ProjectSourceVersion]
secondaryArtifacts :: Maybe [ProjectArtifacts]
queuedTimeoutInMinutes :: Maybe Natural
logsConfig :: Maybe LogsConfig
fileSystemLocations :: Maybe [ProjectFileSystemLocation]
encryptionKey :: Maybe Text
description :: Maybe Text
concurrentBuildLimit :: Maybe Int
cache :: Maybe ProjectCache
buildBatchConfig :: Maybe ProjectBuildBatchConfig
badgeEnabled :: Maybe Bool
$sel:serviceRole:CreateProject' :: CreateProject -> Text
$sel:environment:CreateProject' :: CreateProject -> ProjectEnvironment
$sel:artifacts:CreateProject' :: CreateProject -> ProjectArtifacts
$sel:source:CreateProject' :: CreateProject -> ProjectSource
$sel:name:CreateProject' :: CreateProject -> Text
$sel:vpcConfig:CreateProject' :: CreateProject -> Maybe VpcConfig
$sel:timeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:tags:CreateProject' :: CreateProject -> Maybe [Tag]
$sel:sourceVersion:CreateProject' :: CreateProject -> Maybe Text
$sel:secondarySources:CreateProject' :: CreateProject -> Maybe [ProjectSource]
$sel:secondarySourceVersions:CreateProject' :: CreateProject -> Maybe [ProjectSourceVersion]
$sel:secondaryArtifacts:CreateProject' :: CreateProject -> Maybe [ProjectArtifacts]
$sel:queuedTimeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:logsConfig:CreateProject' :: CreateProject -> Maybe LogsConfig
$sel:fileSystemLocations:CreateProject' :: CreateProject -> Maybe [ProjectFileSystemLocation]
$sel:encryptionKey:CreateProject' :: CreateProject -> Maybe Text
$sel:description:CreateProject' :: CreateProject -> Maybe Text
$sel:concurrentBuildLimit:CreateProject' :: CreateProject -> Maybe Int
$sel:cache:CreateProject' :: CreateProject -> Maybe ProjectCache
$sel:buildBatchConfig:CreateProject' :: CreateProject -> Maybe ProjectBuildBatchConfig
$sel:badgeEnabled:CreateProject' :: CreateProject -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
badgeEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProjectBuildBatchConfig
buildBatchConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProjectCache
cache
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
concurrentBuildLimit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProjectFileSystemLocation]
fileSystemLocations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LogsConfig
logsConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
queuedTimeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProjectArtifacts]
secondaryArtifacts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProjectSourceVersion]
secondarySourceVersions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProjectSource]
secondarySources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcConfig
vpcConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProjectSource
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProjectArtifacts
artifacts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProjectEnvironment
environment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceRole

instance Prelude.NFData CreateProject where
  rnf :: CreateProject -> ()
rnf CreateProject' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [ProjectArtifacts]
Maybe [ProjectFileSystemLocation]
Maybe [ProjectSourceVersion]
Maybe [ProjectSource]
Maybe [Tag]
Maybe Text
Maybe ProjectBuildBatchConfig
Maybe ProjectCache
Maybe LogsConfig
Maybe VpcConfig
Text
ProjectArtifacts
ProjectEnvironment
ProjectSource
serviceRole :: Text
environment :: ProjectEnvironment
artifacts :: ProjectArtifacts
source :: ProjectSource
name :: Text
vpcConfig :: Maybe VpcConfig
timeoutInMinutes :: Maybe Natural
tags :: Maybe [Tag]
sourceVersion :: Maybe Text
secondarySources :: Maybe [ProjectSource]
secondarySourceVersions :: Maybe [ProjectSourceVersion]
secondaryArtifacts :: Maybe [ProjectArtifacts]
queuedTimeoutInMinutes :: Maybe Natural
logsConfig :: Maybe LogsConfig
fileSystemLocations :: Maybe [ProjectFileSystemLocation]
encryptionKey :: Maybe Text
description :: Maybe Text
concurrentBuildLimit :: Maybe Int
cache :: Maybe ProjectCache
buildBatchConfig :: Maybe ProjectBuildBatchConfig
badgeEnabled :: Maybe Bool
$sel:serviceRole:CreateProject' :: CreateProject -> Text
$sel:environment:CreateProject' :: CreateProject -> ProjectEnvironment
$sel:artifacts:CreateProject' :: CreateProject -> ProjectArtifacts
$sel:source:CreateProject' :: CreateProject -> ProjectSource
$sel:name:CreateProject' :: CreateProject -> Text
$sel:vpcConfig:CreateProject' :: CreateProject -> Maybe VpcConfig
$sel:timeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:tags:CreateProject' :: CreateProject -> Maybe [Tag]
$sel:sourceVersion:CreateProject' :: CreateProject -> Maybe Text
$sel:secondarySources:CreateProject' :: CreateProject -> Maybe [ProjectSource]
$sel:secondarySourceVersions:CreateProject' :: CreateProject -> Maybe [ProjectSourceVersion]
$sel:secondaryArtifacts:CreateProject' :: CreateProject -> Maybe [ProjectArtifacts]
$sel:queuedTimeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:logsConfig:CreateProject' :: CreateProject -> Maybe LogsConfig
$sel:fileSystemLocations:CreateProject' :: CreateProject -> Maybe [ProjectFileSystemLocation]
$sel:encryptionKey:CreateProject' :: CreateProject -> Maybe Text
$sel:description:CreateProject' :: CreateProject -> Maybe Text
$sel:concurrentBuildLimit:CreateProject' :: CreateProject -> Maybe Int
$sel:cache:CreateProject' :: CreateProject -> Maybe ProjectCache
$sel:buildBatchConfig:CreateProject' :: CreateProject -> Maybe ProjectBuildBatchConfig
$sel:badgeEnabled:CreateProject' :: CreateProject -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
badgeEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProjectBuildBatchConfig
buildBatchConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProjectCache
cache
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
concurrentBuildLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProjectFileSystemLocation]
fileSystemLocations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LogsConfig
logsConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
queuedTimeoutInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProjectArtifacts]
secondaryArtifacts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProjectSourceVersion]
secondarySourceVersions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProjectSource]
secondarySources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeoutInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcConfig
vpcConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProjectSource
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProjectArtifacts
artifacts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProjectEnvironment
environment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceRole

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

instance Data.ToJSON CreateProject where
  toJSON :: CreateProject -> Value
toJSON CreateProject' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [ProjectArtifacts]
Maybe [ProjectFileSystemLocation]
Maybe [ProjectSourceVersion]
Maybe [ProjectSource]
Maybe [Tag]
Maybe Text
Maybe ProjectBuildBatchConfig
Maybe ProjectCache
Maybe LogsConfig
Maybe VpcConfig
Text
ProjectArtifacts
ProjectEnvironment
ProjectSource
serviceRole :: Text
environment :: ProjectEnvironment
artifacts :: ProjectArtifacts
source :: ProjectSource
name :: Text
vpcConfig :: Maybe VpcConfig
timeoutInMinutes :: Maybe Natural
tags :: Maybe [Tag]
sourceVersion :: Maybe Text
secondarySources :: Maybe [ProjectSource]
secondarySourceVersions :: Maybe [ProjectSourceVersion]
secondaryArtifacts :: Maybe [ProjectArtifacts]
queuedTimeoutInMinutes :: Maybe Natural
logsConfig :: Maybe LogsConfig
fileSystemLocations :: Maybe [ProjectFileSystemLocation]
encryptionKey :: Maybe Text
description :: Maybe Text
concurrentBuildLimit :: Maybe Int
cache :: Maybe ProjectCache
buildBatchConfig :: Maybe ProjectBuildBatchConfig
badgeEnabled :: Maybe Bool
$sel:serviceRole:CreateProject' :: CreateProject -> Text
$sel:environment:CreateProject' :: CreateProject -> ProjectEnvironment
$sel:artifacts:CreateProject' :: CreateProject -> ProjectArtifacts
$sel:source:CreateProject' :: CreateProject -> ProjectSource
$sel:name:CreateProject' :: CreateProject -> Text
$sel:vpcConfig:CreateProject' :: CreateProject -> Maybe VpcConfig
$sel:timeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:tags:CreateProject' :: CreateProject -> Maybe [Tag]
$sel:sourceVersion:CreateProject' :: CreateProject -> Maybe Text
$sel:secondarySources:CreateProject' :: CreateProject -> Maybe [ProjectSource]
$sel:secondarySourceVersions:CreateProject' :: CreateProject -> Maybe [ProjectSourceVersion]
$sel:secondaryArtifacts:CreateProject' :: CreateProject -> Maybe [ProjectArtifacts]
$sel:queuedTimeoutInMinutes:CreateProject' :: CreateProject -> Maybe Natural
$sel:logsConfig:CreateProject' :: CreateProject -> Maybe LogsConfig
$sel:fileSystemLocations:CreateProject' :: CreateProject -> Maybe [ProjectFileSystemLocation]
$sel:encryptionKey:CreateProject' :: CreateProject -> Maybe Text
$sel:description:CreateProject' :: CreateProject -> Maybe Text
$sel:concurrentBuildLimit:CreateProject' :: CreateProject -> Maybe Int
$sel:cache:CreateProject' :: CreateProject -> Maybe ProjectCache
$sel:buildBatchConfig:CreateProject' :: CreateProject -> Maybe ProjectBuildBatchConfig
$sel:badgeEnabled:CreateProject' :: CreateProject -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"badgeEnabled" 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
badgeEnabled,
            (Key
"buildBatchConfig" 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 ProjectBuildBatchConfig
buildBatchConfig,
            (Key
"cache" 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 ProjectCache
cache,
            (Key
"concurrentBuildLimit" 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 Int
concurrentBuildLimit,
            (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
"encryptionKey" 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
encryptionKey,
            (Key
"fileSystemLocations" 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 [ProjectFileSystemLocation]
fileSystemLocations,
            (Key
"logsConfig" 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 LogsConfig
logsConfig,
            (Key
"queuedTimeoutInMinutes" 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 Natural
queuedTimeoutInMinutes,
            (Key
"secondaryArtifacts" 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 [ProjectArtifacts]
secondaryArtifacts,
            (Key
"secondarySourceVersions" 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 [ProjectSourceVersion]
secondarySourceVersions,
            (Key
"secondarySources" 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 [ProjectSource]
secondarySources,
            (Key
"sourceVersion" 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
sourceVersion,
            (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 [Tag]
tags,
            (Key
"timeoutInMinutes" 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 Natural
timeoutInMinutes,
            (Key
"vpcConfig" 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 VpcConfig
vpcConfig,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"source" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProjectSource
source),
            forall a. a -> Maybe a
Prelude.Just (Key
"artifacts" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProjectArtifacts
artifacts),
            forall a. a -> Maybe a
Prelude.Just (Key
"environment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProjectEnvironment
environment),
            forall a. a -> Maybe a
Prelude.Just (Key
"serviceRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceRole)
          ]
      )

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

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

-- | /See:/ 'newCreateProjectResponse' smart constructor.
data CreateProjectResponse = CreateProjectResponse'
  { -- | Information about the build project that was created.
    CreateProjectResponse -> Maybe Project
project :: Prelude.Maybe Project,
    -- | The response's http status code.
    CreateProjectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateProjectResponse -> CreateProjectResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProjectResponse -> CreateProjectResponse -> Bool
$c/= :: CreateProjectResponse -> CreateProjectResponse -> Bool
== :: CreateProjectResponse -> CreateProjectResponse -> Bool
$c== :: CreateProjectResponse -> CreateProjectResponse -> Bool
Prelude.Eq, ReadPrec [CreateProjectResponse]
ReadPrec CreateProjectResponse
Int -> ReadS CreateProjectResponse
ReadS [CreateProjectResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProjectResponse]
$creadListPrec :: ReadPrec [CreateProjectResponse]
readPrec :: ReadPrec CreateProjectResponse
$creadPrec :: ReadPrec CreateProjectResponse
readList :: ReadS [CreateProjectResponse]
$creadList :: ReadS [CreateProjectResponse]
readsPrec :: Int -> ReadS CreateProjectResponse
$creadsPrec :: Int -> ReadS CreateProjectResponse
Prelude.Read, Int -> CreateProjectResponse -> ShowS
[CreateProjectResponse] -> ShowS
CreateProjectResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProjectResponse] -> ShowS
$cshowList :: [CreateProjectResponse] -> ShowS
show :: CreateProjectResponse -> String
$cshow :: CreateProjectResponse -> String
showsPrec :: Int -> CreateProjectResponse -> ShowS
$cshowsPrec :: Int -> CreateProjectResponse -> ShowS
Prelude.Show, forall x. Rep CreateProjectResponse x -> CreateProjectResponse
forall x. CreateProjectResponse -> Rep CreateProjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProjectResponse x -> CreateProjectResponse
$cfrom :: forall x. CreateProjectResponse -> Rep CreateProjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateProjectResponse' 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:
--
-- 'project', 'createProjectResponse_project' - Information about the build project that was created.
--
-- 'httpStatus', 'createProjectResponse_httpStatus' - The response's http status code.
newCreateProjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateProjectResponse
newCreateProjectResponse :: Int -> CreateProjectResponse
newCreateProjectResponse Int
pHttpStatus_ =
  CreateProjectResponse'
    { $sel:project:CreateProjectResponse' :: Maybe Project
project = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateProjectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the build project that was created.
createProjectResponse_project :: Lens.Lens' CreateProjectResponse (Prelude.Maybe Project)
createProjectResponse_project :: Lens' CreateProjectResponse (Maybe Project)
createProjectResponse_project = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProjectResponse' {Maybe Project
project :: Maybe Project
$sel:project:CreateProjectResponse' :: CreateProjectResponse -> Maybe Project
project} -> Maybe Project
project) (\s :: CreateProjectResponse
s@CreateProjectResponse' {} Maybe Project
a -> CreateProjectResponse
s {$sel:project:CreateProjectResponse' :: Maybe Project
project = Maybe Project
a} :: CreateProjectResponse)

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

instance Prelude.NFData CreateProjectResponse where
  rnf :: CreateProjectResponse -> ()
rnf CreateProjectResponse' {Int
Maybe Project
httpStatus :: Int
project :: Maybe Project
$sel:httpStatus:CreateProjectResponse' :: CreateProjectResponse -> Int
$sel:project:CreateProjectResponse' :: CreateProjectResponse -> Maybe Project
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Project
project
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus