{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a build project.
module Amazonka.CodeBuild.CreateProject
  ( -- * Creating a Request
    CreateProject (..),
    newCreateProject,

    -- * Request Lenses
    createProject_secondaryArtifacts,
    createProject_concurrentBuildLimit,
    createProject_badgeEnabled,
    createProject_secondarySourceVersions,
    createProject_queuedTimeoutInMinutes,
    createProject_cache,
    createProject_secondarySources,
    createProject_sourceVersion,
    createProject_vpcConfig,
    createProject_logsConfig,
    createProject_fileSystemLocations,
    createProject_buildBatchConfig,
    createProject_encryptionKey,
    createProject_description,
    createProject_tags,
    createProject_timeoutInMinutes,
    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.Lens as Lens
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'
  { -- | An array of @ProjectArtifacts@ objects.
    CreateProject -> Maybe [ProjectArtifacts]
secondaryArtifacts :: Prelude.Maybe [ProjectArtifacts],
    -- | 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,
    -- | Set this to true to generate a publicly accessible URL for your
    -- project\'s build badge.
    CreateProject -> Maybe Bool
badgeEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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],
    -- | The number of minutes a build is allowed to be queued before it times
    -- out.
    CreateProject -> Maybe Natural
queuedTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | Stores recently used information so that it can be quickly accessed at a
    -- later time.
    CreateProject -> Maybe ProjectCache
cache :: Prelude.Maybe ProjectCache,
    -- | 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,
    -- | VpcConfig enables CodeBuild to access resources in an Amazon VPC.
    CreateProject -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | 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,
    -- | 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],
    -- | A ProjectBuildBatchConfig object that defines the batch build options
    -- for the project.
    CreateProject -> Maybe ProjectBuildBatchConfig
buildBatchConfig :: Prelude.Maybe ProjectBuildBatchConfig,
    -- | 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,
    -- | A description that makes the build project easy to identify.
    CreateProject -> Maybe Text
description :: 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,
    -- | 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
(CreateProject -> CreateProject -> Bool)
-> (CreateProject -> CreateProject -> Bool) -> Eq CreateProject
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]
(Int -> ReadS CreateProject)
-> ReadS [CreateProject]
-> ReadPrec CreateProject
-> ReadPrec [CreateProject]
-> Read 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
(Int -> CreateProject -> ShowS)
-> (CreateProject -> String)
-> ([CreateProject] -> ShowS)
-> Show CreateProject
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. CreateProject -> Rep CreateProject x)
-> (forall x. Rep CreateProject x -> CreateProject)
-> Generic CreateProject
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:
--
-- 'secondaryArtifacts', 'createProject_secondaryArtifacts' - An array of @ProjectArtifacts@ objects.
--
-- '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.
--
-- 'badgeEnabled', 'createProject_badgeEnabled' - Set this to true to generate a publicly accessible URL for your
-- project\'s build badge.
--
-- '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).
--
-- 'queuedTimeoutInMinutes', 'createProject_queuedTimeoutInMinutes' - The number of minutes a build is allowed to be queued before it times
-- out.
--
-- 'cache', 'createProject_cache' - Stores recently used information so that it can be quickly accessed at a
-- later time.
--
-- '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/.
--
-- 'vpcConfig', 'createProject_vpcConfig' - VpcConfig enables CodeBuild to access resources in an Amazon VPC.
--
-- '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.
--
-- '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.
--
-- 'buildBatchConfig', 'createProject_buildBatchConfig' - A ProjectBuildBatchConfig object that defines the batch build options
-- for the project.
--
-- '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>@).
--
-- 'description', 'createProject_description' - A description that makes the build project easy to identify.
--
-- '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.
--
-- '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' :: Maybe [ProjectArtifacts]
-> Maybe Int
-> Maybe Bool
-> Maybe [ProjectSourceVersion]
-> Maybe Natural
-> Maybe ProjectCache
-> Maybe [ProjectSource]
-> Maybe Text
-> Maybe VpcConfig
-> Maybe LogsConfig
-> Maybe [ProjectFileSystemLocation]
-> Maybe ProjectBuildBatchConfig
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Natural
-> Text
-> ProjectSource
-> ProjectArtifacts
-> ProjectEnvironment
-> Text
-> CreateProject
CreateProject'
      { $sel:secondaryArtifacts:CreateProject' :: Maybe [ProjectArtifacts]
secondaryArtifacts =
          Maybe [ProjectArtifacts]
forall a. Maybe a
Prelude.Nothing,
        $sel:concurrentBuildLimit:CreateProject' :: Maybe Int
concurrentBuildLimit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:badgeEnabled:CreateProject' :: Maybe Bool
badgeEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:secondarySourceVersions:CreateProject' :: Maybe [ProjectSourceVersion]
secondarySourceVersions = Maybe [ProjectSourceVersion]
forall a. Maybe a
Prelude.Nothing,
        $sel:queuedTimeoutInMinutes:CreateProject' :: Maybe Natural
queuedTimeoutInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:cache:CreateProject' :: Maybe ProjectCache
cache = Maybe ProjectCache
forall a. Maybe a
Prelude.Nothing,
        $sel:secondarySources:CreateProject' :: Maybe [ProjectSource]
secondarySources = Maybe [ProjectSource]
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceVersion:CreateProject' :: Maybe Text
sourceVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfig:CreateProject' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:logsConfig:CreateProject' :: Maybe LogsConfig
logsConfig = Maybe LogsConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:fileSystemLocations:CreateProject' :: Maybe [ProjectFileSystemLocation]
fileSystemLocations = Maybe [ProjectFileSystemLocation]
forall a. Maybe a
Prelude.Nothing,
        $sel:buildBatchConfig:CreateProject' :: Maybe ProjectBuildBatchConfig
buildBatchConfig = Maybe ProjectBuildBatchConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionKey:CreateProject' :: Maybe Text
encryptionKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateProject' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProject' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:timeoutInMinutes:CreateProject' :: Maybe Natural
timeoutInMinutes = Maybe Natural
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_
      }

-- | An array of @ProjectArtifacts@ objects.
createProject_secondaryArtifacts :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectArtifacts])
createProject_secondaryArtifacts :: (Maybe [ProjectArtifacts] -> f (Maybe [ProjectArtifacts]))
-> CreateProject -> f CreateProject
createProject_secondaryArtifacts = (CreateProject -> Maybe [ProjectArtifacts])
-> (CreateProject -> Maybe [ProjectArtifacts] -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe [ProjectArtifacts])
     (Maybe [ProjectArtifacts])
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) ((Maybe [ProjectArtifacts] -> f (Maybe [ProjectArtifacts]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [ProjectArtifacts] -> f (Maybe [ProjectArtifacts]))
    -> Maybe [ProjectArtifacts] -> f (Maybe [ProjectArtifacts]))
-> (Maybe [ProjectArtifacts] -> f (Maybe [ProjectArtifacts]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProjectArtifacts]
  [ProjectArtifacts]
  [ProjectArtifacts]
  [ProjectArtifacts]
-> Iso
     (Maybe [ProjectArtifacts])
     (Maybe [ProjectArtifacts])
     (Maybe [ProjectArtifacts])
     (Maybe [ProjectArtifacts])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ProjectArtifacts]
  [ProjectArtifacts]
  [ProjectArtifacts]
  [ProjectArtifacts]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Int -> f (Maybe Int)) -> CreateProject -> f CreateProject
createProject_concurrentBuildLimit = (CreateProject -> Maybe Int)
-> (CreateProject -> Maybe Int -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Int) (Maybe Int)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool)) -> CreateProject -> f CreateProject
createProject_badgeEnabled = (CreateProject -> Maybe Bool)
-> (CreateProject -> Maybe Bool -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe [ProjectSourceVersion] -> f (Maybe [ProjectSourceVersion]))
-> CreateProject -> f CreateProject
createProject_secondarySourceVersions = (CreateProject -> Maybe [ProjectSourceVersion])
-> (CreateProject -> Maybe [ProjectSourceVersion] -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe [ProjectSourceVersion])
     (Maybe [ProjectSourceVersion])
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) ((Maybe [ProjectSourceVersion] -> f (Maybe [ProjectSourceVersion]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [ProjectSourceVersion]
     -> f (Maybe [ProjectSourceVersion]))
    -> Maybe [ProjectSourceVersion]
    -> f (Maybe [ProjectSourceVersion]))
-> (Maybe [ProjectSourceVersion]
    -> f (Maybe [ProjectSourceVersion]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProjectSourceVersion]
  [ProjectSourceVersion]
  [ProjectSourceVersion]
  [ProjectSourceVersion]
-> Iso
     (Maybe [ProjectSourceVersion])
     (Maybe [ProjectSourceVersion])
     (Maybe [ProjectSourceVersion])
     (Maybe [ProjectSourceVersion])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ProjectSourceVersion]
  [ProjectSourceVersion]
  [ProjectSourceVersion]
  [ProjectSourceVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> CreateProject -> f CreateProject
createProject_queuedTimeoutInMinutes = (CreateProject -> Maybe Natural)
-> (CreateProject -> Maybe Natural -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Maybe ProjectCache -> f (Maybe ProjectCache))
-> CreateProject -> f CreateProject
createProject_cache = (CreateProject -> Maybe ProjectCache)
-> (CreateProject -> Maybe ProjectCache -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe ProjectCache)
     (Maybe ProjectCache)
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)

-- | An array of @ProjectSource@ objects.
createProject_secondarySources :: Lens.Lens' CreateProject (Prelude.Maybe [ProjectSource])
createProject_secondarySources :: (Maybe [ProjectSource] -> f (Maybe [ProjectSource]))
-> CreateProject -> f CreateProject
createProject_secondarySources = (CreateProject -> Maybe [ProjectSource])
-> (CreateProject -> Maybe [ProjectSource] -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe [ProjectSource])
     (Maybe [ProjectSource])
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) ((Maybe [ProjectSource] -> f (Maybe [ProjectSource]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [ProjectSource] -> f (Maybe [ProjectSource]))
    -> Maybe [ProjectSource] -> f (Maybe [ProjectSource]))
-> (Maybe [ProjectSource] -> f (Maybe [ProjectSource]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProjectSource] [ProjectSource] [ProjectSource] [ProjectSource]
-> Iso
     (Maybe [ProjectSource])
     (Maybe [ProjectSource])
     (Maybe [ProjectSource])
     (Maybe [ProjectSource])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ProjectSource] [ProjectSource] [ProjectSource] [ProjectSource]
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 :: (Maybe Text -> f (Maybe Text)) -> CreateProject -> f CreateProject
createProject_sourceVersion = (CreateProject -> Maybe Text)
-> (CreateProject -> Maybe Text -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Text) (Maybe Text)
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)

-- | VpcConfig enables CodeBuild to access resources in an Amazon VPC.
createProject_vpcConfig :: Lens.Lens' CreateProject (Prelude.Maybe VpcConfig)
createProject_vpcConfig :: (Maybe VpcConfig -> f (Maybe VpcConfig))
-> CreateProject -> f CreateProject
createProject_vpcConfig = (CreateProject -> Maybe VpcConfig)
-> (CreateProject -> Maybe VpcConfig -> CreateProject)
-> Lens
     CreateProject CreateProject (Maybe VpcConfig) (Maybe 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)

-- | 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 :: (Maybe LogsConfig -> f (Maybe LogsConfig))
-> CreateProject -> f CreateProject
createProject_logsConfig = (CreateProject -> Maybe LogsConfig)
-> (CreateProject -> Maybe LogsConfig -> CreateProject)
-> Lens
     CreateProject CreateProject (Maybe LogsConfig) (Maybe 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)

-- | 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 :: (Maybe [ProjectFileSystemLocation]
 -> f (Maybe [ProjectFileSystemLocation]))
-> CreateProject -> f CreateProject
createProject_fileSystemLocations = (CreateProject -> Maybe [ProjectFileSystemLocation])
-> (CreateProject
    -> Maybe [ProjectFileSystemLocation] -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe [ProjectFileSystemLocation])
     (Maybe [ProjectFileSystemLocation])
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) ((Maybe [ProjectFileSystemLocation]
  -> f (Maybe [ProjectFileSystemLocation]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [ProjectFileSystemLocation]
     -> f (Maybe [ProjectFileSystemLocation]))
    -> Maybe [ProjectFileSystemLocation]
    -> f (Maybe [ProjectFileSystemLocation]))
-> (Maybe [ProjectFileSystemLocation]
    -> f (Maybe [ProjectFileSystemLocation]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
-> Iso
     (Maybe [ProjectFileSystemLocation])
     (Maybe [ProjectFileSystemLocation])
     (Maybe [ProjectFileSystemLocation])
     (Maybe [ProjectFileSystemLocation])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
  [ProjectFileSystemLocation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A ProjectBuildBatchConfig object that defines the batch build options
-- for the project.
createProject_buildBatchConfig :: Lens.Lens' CreateProject (Prelude.Maybe ProjectBuildBatchConfig)
createProject_buildBatchConfig :: (Maybe ProjectBuildBatchConfig
 -> f (Maybe ProjectBuildBatchConfig))
-> CreateProject -> f CreateProject
createProject_buildBatchConfig = (CreateProject -> Maybe ProjectBuildBatchConfig)
-> (CreateProject
    -> Maybe ProjectBuildBatchConfig -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe ProjectBuildBatchConfig)
     (Maybe ProjectBuildBatchConfig)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CreateProject -> f CreateProject
createProject_encryptionKey = (CreateProject -> Maybe Text)
-> (CreateProject -> Maybe Text -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Text) (Maybe Text)
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)

-- | A description that makes the build project easy to identify.
createProject_description :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_description :: (Maybe Text -> f (Maybe Text)) -> CreateProject -> f CreateProject
createProject_description = (CreateProject -> Maybe Text)
-> (CreateProject -> Maybe Text -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProject -> f CreateProject
createProject_tags = (CreateProject -> Maybe [Tag])
-> (CreateProject -> Maybe [Tag] -> CreateProject)
-> Lens CreateProject CreateProject (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
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 :: (Maybe Natural -> f (Maybe Natural))
-> CreateProject -> f CreateProject
createProject_timeoutInMinutes = (CreateProject -> Maybe Natural)
-> (CreateProject -> Maybe Natural -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Natural) (Maybe Natural)
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)

-- | The name of the build project.
createProject_name :: Lens.Lens' CreateProject Prelude.Text
createProject_name :: (Text -> f Text) -> CreateProject -> f CreateProject
createProject_name = (CreateProject -> Text)
-> (CreateProject -> Text -> CreateProject)
-> Lens CreateProject CreateProject Text Text
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 :: (ProjectSource -> f ProjectSource)
-> CreateProject -> f CreateProject
createProject_source = (CreateProject -> ProjectSource)
-> (CreateProject -> ProjectSource -> CreateProject)
-> Lens CreateProject CreateProject ProjectSource ProjectSource
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 :: (ProjectArtifacts -> f ProjectArtifacts)
-> CreateProject -> f CreateProject
createProject_artifacts = (CreateProject -> ProjectArtifacts)
-> (CreateProject -> ProjectArtifacts -> CreateProject)
-> Lens
     CreateProject CreateProject ProjectArtifacts ProjectArtifacts
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 :: (ProjectEnvironment -> f ProjectEnvironment)
-> CreateProject -> f CreateProject
createProject_environment = (CreateProject -> ProjectEnvironment)
-> (CreateProject -> ProjectEnvironment -> CreateProject)
-> Lens
     CreateProject CreateProject ProjectEnvironment ProjectEnvironment
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 :: (Text -> f Text) -> CreateProject -> f CreateProject
createProject_serviceRole = (CreateProject -> Text)
-> (CreateProject -> Text -> CreateProject)
-> Lens CreateProject CreateProject Text Text
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 :: CreateProject -> Request CreateProject
request = Service -> CreateProject -> Request CreateProject
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProject)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProject))
-> Logger
-> Service
-> Proxy CreateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Project -> Int -> CreateProjectResponse
CreateProjectResponse'
            (Maybe Project -> Int -> CreateProjectResponse)
-> Either String (Maybe Project)
-> Either String (Int -> CreateProjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Project)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"project")
            Either String (Int -> CreateProjectResponse)
-> Either String Int -> Either String CreateProjectResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateProject

instance Prelude.NFData CreateProject

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

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

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

instance Core.ToQuery CreateProject where
  toQuery :: CreateProject -> QueryString
toQuery = QueryString -> CreateProject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateProjectResponse -> CreateProjectResponse -> Bool)
-> (CreateProjectResponse -> CreateProjectResponse -> Bool)
-> Eq CreateProjectResponse
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]
(Int -> ReadS CreateProjectResponse)
-> ReadS [CreateProjectResponse]
-> ReadPrec CreateProjectResponse
-> ReadPrec [CreateProjectResponse]
-> Read 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
(Int -> CreateProjectResponse -> ShowS)
-> (CreateProjectResponse -> String)
-> ([CreateProjectResponse] -> ShowS)
-> Show CreateProjectResponse
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. CreateProjectResponse -> Rep CreateProjectResponse x)
-> (forall x. Rep CreateProjectResponse x -> CreateProjectResponse)
-> Generic CreateProjectResponse
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' :: Maybe Project -> Int -> CreateProjectResponse
CreateProjectResponse'
    { $sel:project:CreateProjectResponse' :: Maybe Project
project = Maybe 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 :: (Maybe Project -> f (Maybe Project))
-> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_project = (CreateProjectResponse -> Maybe Project)
-> (CreateProjectResponse
    -> Maybe Project -> CreateProjectResponse)
-> Lens
     CreateProjectResponse
     CreateProjectResponse
     (Maybe Project)
     (Maybe 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 :: (Int -> f Int) -> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_httpStatus = (CreateProjectResponse -> Int)
-> (CreateProjectResponse -> Int -> CreateProjectResponse)
-> Lens CreateProjectResponse CreateProjectResponse Int Int
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