{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ProjectArtifacts
-- 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)
module Amazonka.CodeBuild.Types.ProjectArtifacts where

import Amazonka.CodeBuild.Types.ArtifactNamespace
import Amazonka.CodeBuild.Types.ArtifactPackaging
import Amazonka.CodeBuild.Types.ArtifactsType
import Amazonka.CodeBuild.Types.BucketOwnerAccess
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the build output artifacts for the build project.
--
-- /See:/ 'newProjectArtifacts' smart constructor.
data ProjectArtifacts = ProjectArtifacts'
  { -- | The type of build output artifact to create:
    --
    -- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
    --     if specified. This is because CodePipeline manages its build output
    --     artifacts instead of CodeBuild.
    --
    -- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
    --     specified, because no build output is produced.
    --
    -- -   If @type@ is set to @S3@, valid values include:
    --
    --     -   @NONE@: CodeBuild creates in the output bucket a folder that
    --         contains the build output. This is the default if @packaging@ is
    --         not specified.
    --
    --     -   @ZIP@: CodeBuild creates in the output bucket a ZIP file that
    --         contains the build output.
    ProjectArtifacts -> Maybe ArtifactPackaging
packaging :: Prelude.Maybe ArtifactPackaging,
    -- | Along with @namespaceType@ and @name@, the pattern that CodeBuild uses
    -- to name and store the output artifact:
    --
    -- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
    --     if specified. This is because CodePipeline manages its build output
    --     names instead of CodeBuild.
    --
    -- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
    --     specified, because no build output is produced.
    --
    -- -   If @type@ is set to @S3@, this is the path to the output artifact.
    --     If @path@ is not specified, @path@ is not used.
    --
    -- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
    -- to @NONE@, and @name@ is set to @MyArtifact.zip@, the output artifact is
    -- stored in the output bucket at @MyArtifacts\/MyArtifact.zip@.
    ProjectArtifacts -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | Information about the build output artifact location:
    --
    -- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
    --     if specified. This is because CodePipeline manages its build output
    --     locations instead of CodeBuild.
    --
    -- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
    --     specified, because no build output is produced.
    --
    -- -   If @type@ is set to @S3@, this is the name of the output bucket.
    ProjectArtifacts -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | Along with @path@ and @namespaceType@, the pattern that CodeBuild uses
    -- to name and store the output artifact:
    --
    -- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
    --     if specified. This is because CodePipeline manages its build output
    --     names instead of CodeBuild.
    --
    -- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
    --     specified, because no build output is produced.
    --
    -- -   If @type@ is set to @S3@, this is the name of the output artifact
    --     object. If you set the name to be a forward slash (\"\/\"), the
    --     artifact is stored in the root of the output bucket.
    --
    -- For example:
    --
    -- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
    --     @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, then the output
    --     artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
    --
    -- -   If @path@ is empty, @namespaceType@ is set to @NONE@, and @name@ is
    --     set to \"@\/@\", the output artifact is stored in the root of the
    --     output bucket.
    --
    -- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
    --     @BUILD_ID@, and @name@ is set to \"@\/@\", the output artifact is
    --     stored in @MyArtifacts\/\<build-ID>@.
    ProjectArtifacts -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Set to true if you do not want your output artifacts encrypted. This
    -- option is valid only if your artifacts type is Amazon S3. If this is set
    -- with another artifacts type, an invalidInputException is thrown.
    ProjectArtifacts -> Maybe Bool
encryptionDisabled :: Prelude.Maybe Prelude.Bool,
    -- | If this flag is set, a name specified in the buildspec file overrides
    -- the artifact name. The name specified in a buildspec file is calculated
    -- at build time and uses the Shell Command Language. For example, you can
    -- append a date and time to your artifact name so that it is always
    -- unique.
    ProjectArtifacts -> Maybe Bool
overrideArtifactName :: Prelude.Maybe Prelude.Bool,
    -- | An identifier for this artifact definition.
    ProjectArtifacts -> Maybe Text
artifactIdentifier :: Prelude.Maybe Prelude.Text,
    ProjectArtifacts -> Maybe BucketOwnerAccess
bucketOwnerAccess :: Prelude.Maybe BucketOwnerAccess,
    -- | Along with @path@ and @name@, the pattern that CodeBuild uses to
    -- determine the name and location to store the output artifact:
    --
    -- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
    --     if specified. This is because CodePipeline manages its build output
    --     names instead of CodeBuild.
    --
    -- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
    --     specified, because no build output is produced.
    --
    -- -   If @type@ is set to @S3@, valid values include:
    --
    --     -   @BUILD_ID@: Include the build ID in the location of the build
    --         output artifact.
    --
    --     -   @NONE@: Do not include the build ID. This is the default if
    --         @namespaceType@ is not specified.
    --
    -- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
    -- to @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, the output
    -- artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
    ProjectArtifacts -> Maybe ArtifactNamespace
namespaceType :: Prelude.Maybe ArtifactNamespace,
    -- | The type of build output artifact. Valid values include:
    --
    -- -   @CODEPIPELINE@: The build project has build output generated through
    --     CodePipeline.
    --
    --     The @CODEPIPELINE@ type is not supported for @secondaryArtifacts@.
    --
    -- -   @NO_ARTIFACTS@: The build project does not produce any build output.
    --
    -- -   @S3@: The build project stores build output in Amazon S3.
    ProjectArtifacts -> ArtifactsType
type' :: ArtifactsType
  }
  deriving (ProjectArtifacts -> ProjectArtifacts -> Bool
(ProjectArtifacts -> ProjectArtifacts -> Bool)
-> (ProjectArtifacts -> ProjectArtifacts -> Bool)
-> Eq ProjectArtifacts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectArtifacts -> ProjectArtifacts -> Bool
$c/= :: ProjectArtifacts -> ProjectArtifacts -> Bool
== :: ProjectArtifacts -> ProjectArtifacts -> Bool
$c== :: ProjectArtifacts -> ProjectArtifacts -> Bool
Prelude.Eq, ReadPrec [ProjectArtifacts]
ReadPrec ProjectArtifacts
Int -> ReadS ProjectArtifacts
ReadS [ProjectArtifacts]
(Int -> ReadS ProjectArtifacts)
-> ReadS [ProjectArtifacts]
-> ReadPrec ProjectArtifacts
-> ReadPrec [ProjectArtifacts]
-> Read ProjectArtifacts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectArtifacts]
$creadListPrec :: ReadPrec [ProjectArtifacts]
readPrec :: ReadPrec ProjectArtifacts
$creadPrec :: ReadPrec ProjectArtifacts
readList :: ReadS [ProjectArtifacts]
$creadList :: ReadS [ProjectArtifacts]
readsPrec :: Int -> ReadS ProjectArtifacts
$creadsPrec :: Int -> ReadS ProjectArtifacts
Prelude.Read, Int -> ProjectArtifacts -> ShowS
[ProjectArtifacts] -> ShowS
ProjectArtifacts -> String
(Int -> ProjectArtifacts -> ShowS)
-> (ProjectArtifacts -> String)
-> ([ProjectArtifacts] -> ShowS)
-> Show ProjectArtifacts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectArtifacts] -> ShowS
$cshowList :: [ProjectArtifacts] -> ShowS
show :: ProjectArtifacts -> String
$cshow :: ProjectArtifacts -> String
showsPrec :: Int -> ProjectArtifacts -> ShowS
$cshowsPrec :: Int -> ProjectArtifacts -> ShowS
Prelude.Show, (forall x. ProjectArtifacts -> Rep ProjectArtifacts x)
-> (forall x. Rep ProjectArtifacts x -> ProjectArtifacts)
-> Generic ProjectArtifacts
forall x. Rep ProjectArtifacts x -> ProjectArtifacts
forall x. ProjectArtifacts -> Rep ProjectArtifacts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectArtifacts x -> ProjectArtifacts
$cfrom :: forall x. ProjectArtifacts -> Rep ProjectArtifacts x
Prelude.Generic)

-- |
-- Create a value of 'ProjectArtifacts' 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:
--
-- 'packaging', 'projectArtifacts_packaging' - The type of build output artifact to create:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     artifacts instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, valid values include:
--
--     -   @NONE@: CodeBuild creates in the output bucket a folder that
--         contains the build output. This is the default if @packaging@ is
--         not specified.
--
--     -   @ZIP@: CodeBuild creates in the output bucket a ZIP file that
--         contains the build output.
--
-- 'path', 'projectArtifacts_path' - Along with @namespaceType@ and @name@, the pattern that CodeBuild uses
-- to name and store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the path to the output artifact.
--     If @path@ is not specified, @path@ is not used.
--
-- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
-- to @NONE@, and @name@ is set to @MyArtifact.zip@, the output artifact is
-- stored in the output bucket at @MyArtifacts\/MyArtifact.zip@.
--
-- 'location', 'projectArtifacts_location' - Information about the build output artifact location:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     locations instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the name of the output bucket.
--
-- 'name', 'projectArtifacts_name' - Along with @path@ and @namespaceType@, the pattern that CodeBuild uses
-- to name and store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the name of the output artifact
--     object. If you set the name to be a forward slash (\"\/\"), the
--     artifact is stored in the root of the output bucket.
--
-- For example:
--
-- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
--     @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, then the output
--     artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
--
-- -   If @path@ is empty, @namespaceType@ is set to @NONE@, and @name@ is
--     set to \"@\/@\", the output artifact is stored in the root of the
--     output bucket.
--
-- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
--     @BUILD_ID@, and @name@ is set to \"@\/@\", the output artifact is
--     stored in @MyArtifacts\/\<build-ID>@.
--
-- 'encryptionDisabled', 'projectArtifacts_encryptionDisabled' - Set to true if you do not want your output artifacts encrypted. This
-- option is valid only if your artifacts type is Amazon S3. If this is set
-- with another artifacts type, an invalidInputException is thrown.
--
-- 'overrideArtifactName', 'projectArtifacts_overrideArtifactName' - If this flag is set, a name specified in the buildspec file overrides
-- the artifact name. The name specified in a buildspec file is calculated
-- at build time and uses the Shell Command Language. For example, you can
-- append a date and time to your artifact name so that it is always
-- unique.
--
-- 'artifactIdentifier', 'projectArtifacts_artifactIdentifier' - An identifier for this artifact definition.
--
-- 'bucketOwnerAccess', 'projectArtifacts_bucketOwnerAccess' - Undocumented member.
--
-- 'namespaceType', 'projectArtifacts_namespaceType' - Along with @path@ and @name@, the pattern that CodeBuild uses to
-- determine the name and location to store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, valid values include:
--
--     -   @BUILD_ID@: Include the build ID in the location of the build
--         output artifact.
--
--     -   @NONE@: Do not include the build ID. This is the default if
--         @namespaceType@ is not specified.
--
-- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
-- to @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, the output
-- artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
--
-- 'type'', 'projectArtifacts_type' - The type of build output artifact. Valid values include:
--
-- -   @CODEPIPELINE@: The build project has build output generated through
--     CodePipeline.
--
--     The @CODEPIPELINE@ type is not supported for @secondaryArtifacts@.
--
-- -   @NO_ARTIFACTS@: The build project does not produce any build output.
--
-- -   @S3@: The build project stores build output in Amazon S3.
newProjectArtifacts ::
  -- | 'type''
  ArtifactsType ->
  ProjectArtifacts
newProjectArtifacts :: ArtifactsType -> ProjectArtifacts
newProjectArtifacts ArtifactsType
pType_ =
  ProjectArtifacts' :: Maybe ArtifactPackaging
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe BucketOwnerAccess
-> Maybe ArtifactNamespace
-> ArtifactsType
-> ProjectArtifacts
ProjectArtifacts'
    { $sel:packaging:ProjectArtifacts' :: Maybe ArtifactPackaging
packaging = Maybe ArtifactPackaging
forall a. Maybe a
Prelude.Nothing,
      $sel:path:ProjectArtifacts' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:ProjectArtifacts' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ProjectArtifacts' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionDisabled:ProjectArtifacts' :: Maybe Bool
encryptionDisabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:overrideArtifactName:ProjectArtifacts' :: Maybe Bool
overrideArtifactName = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:artifactIdentifier:ProjectArtifacts' :: Maybe Text
artifactIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketOwnerAccess:ProjectArtifacts' :: Maybe BucketOwnerAccess
bucketOwnerAccess = Maybe BucketOwnerAccess
forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceType:ProjectArtifacts' :: Maybe ArtifactNamespace
namespaceType = Maybe ArtifactNamespace
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ProjectArtifacts' :: ArtifactsType
type' = ArtifactsType
pType_
    }

-- | The type of build output artifact to create:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     artifacts instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, valid values include:
--
--     -   @NONE@: CodeBuild creates in the output bucket a folder that
--         contains the build output. This is the default if @packaging@ is
--         not specified.
--
--     -   @ZIP@: CodeBuild creates in the output bucket a ZIP file that
--         contains the build output.
projectArtifacts_packaging :: Lens.Lens' ProjectArtifacts (Prelude.Maybe ArtifactPackaging)
projectArtifacts_packaging :: (Maybe ArtifactPackaging -> f (Maybe ArtifactPackaging))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_packaging = (ProjectArtifacts -> Maybe ArtifactPackaging)
-> (ProjectArtifacts
    -> Maybe ArtifactPackaging -> ProjectArtifacts)
-> Lens
     ProjectArtifacts
     ProjectArtifacts
     (Maybe ArtifactPackaging)
     (Maybe ArtifactPackaging)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe ArtifactPackaging
packaging :: Maybe ArtifactPackaging
$sel:packaging:ProjectArtifacts' :: ProjectArtifacts -> Maybe ArtifactPackaging
packaging} -> Maybe ArtifactPackaging
packaging) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe ArtifactPackaging
a -> ProjectArtifacts
s {$sel:packaging:ProjectArtifacts' :: Maybe ArtifactPackaging
packaging = Maybe ArtifactPackaging
a} :: ProjectArtifacts)

-- | Along with @namespaceType@ and @name@, the pattern that CodeBuild uses
-- to name and store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the path to the output artifact.
--     If @path@ is not specified, @path@ is not used.
--
-- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
-- to @NONE@, and @name@ is set to @MyArtifact.zip@, the output artifact is
-- stored in the output bucket at @MyArtifacts\/MyArtifact.zip@.
projectArtifacts_path :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Text)
projectArtifacts_path :: (Maybe Text -> f (Maybe Text))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_path = (ProjectArtifacts -> Maybe Text)
-> (ProjectArtifacts -> Maybe Text -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Text
path :: Maybe Text
$sel:path:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
path} -> Maybe Text
path) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Text
a -> ProjectArtifacts
s {$sel:path:ProjectArtifacts' :: Maybe Text
path = Maybe Text
a} :: ProjectArtifacts)

-- | Information about the build output artifact location:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     locations instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the name of the output bucket.
projectArtifacts_location :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Text)
projectArtifacts_location :: (Maybe Text -> f (Maybe Text))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_location = (ProjectArtifacts -> Maybe Text)
-> (ProjectArtifacts -> Maybe Text -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Text
location :: Maybe Text
$sel:location:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
location} -> Maybe Text
location) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Text
a -> ProjectArtifacts
s {$sel:location:ProjectArtifacts' :: Maybe Text
location = Maybe Text
a} :: ProjectArtifacts)

-- | Along with @path@ and @namespaceType@, the pattern that CodeBuild uses
-- to name and store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, this is the name of the output artifact
--     object. If you set the name to be a forward slash (\"\/\"), the
--     artifact is stored in the root of the output bucket.
--
-- For example:
--
-- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
--     @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, then the output
--     artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
--
-- -   If @path@ is empty, @namespaceType@ is set to @NONE@, and @name@ is
--     set to \"@\/@\", the output artifact is stored in the root of the
--     output bucket.
--
-- -   If @path@ is set to @MyArtifacts@, @namespaceType@ is set to
--     @BUILD_ID@, and @name@ is set to \"@\/@\", the output artifact is
--     stored in @MyArtifacts\/\<build-ID>@.
projectArtifacts_name :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Text)
projectArtifacts_name :: (Maybe Text -> f (Maybe Text))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_name = (ProjectArtifacts -> Maybe Text)
-> (ProjectArtifacts -> Maybe Text -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Text
name :: Maybe Text
$sel:name:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
name} -> Maybe Text
name) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Text
a -> ProjectArtifacts
s {$sel:name:ProjectArtifacts' :: Maybe Text
name = Maybe Text
a} :: ProjectArtifacts)

-- | Set to true if you do not want your output artifacts encrypted. This
-- option is valid only if your artifacts type is Amazon S3. If this is set
-- with another artifacts type, an invalidInputException is thrown.
projectArtifacts_encryptionDisabled :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Bool)
projectArtifacts_encryptionDisabled :: (Maybe Bool -> f (Maybe Bool))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_encryptionDisabled = (ProjectArtifacts -> Maybe Bool)
-> (ProjectArtifacts -> Maybe Bool -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Bool
encryptionDisabled :: Maybe Bool
$sel:encryptionDisabled:ProjectArtifacts' :: ProjectArtifacts -> Maybe Bool
encryptionDisabled} -> Maybe Bool
encryptionDisabled) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Bool
a -> ProjectArtifacts
s {$sel:encryptionDisabled:ProjectArtifacts' :: Maybe Bool
encryptionDisabled = Maybe Bool
a} :: ProjectArtifacts)

-- | If this flag is set, a name specified in the buildspec file overrides
-- the artifact name. The name specified in a buildspec file is calculated
-- at build time and uses the Shell Command Language. For example, you can
-- append a date and time to your artifact name so that it is always
-- unique.
projectArtifacts_overrideArtifactName :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Bool)
projectArtifacts_overrideArtifactName :: (Maybe Bool -> f (Maybe Bool))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_overrideArtifactName = (ProjectArtifacts -> Maybe Bool)
-> (ProjectArtifacts -> Maybe Bool -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Bool
overrideArtifactName :: Maybe Bool
$sel:overrideArtifactName:ProjectArtifacts' :: ProjectArtifacts -> Maybe Bool
overrideArtifactName} -> Maybe Bool
overrideArtifactName) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Bool
a -> ProjectArtifacts
s {$sel:overrideArtifactName:ProjectArtifacts' :: Maybe Bool
overrideArtifactName = Maybe Bool
a} :: ProjectArtifacts)

-- | An identifier for this artifact definition.
projectArtifacts_artifactIdentifier :: Lens.Lens' ProjectArtifacts (Prelude.Maybe Prelude.Text)
projectArtifacts_artifactIdentifier :: (Maybe Text -> f (Maybe Text))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_artifactIdentifier = (ProjectArtifacts -> Maybe Text)
-> (ProjectArtifacts -> Maybe Text -> ProjectArtifacts)
-> Lens ProjectArtifacts ProjectArtifacts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe Text
artifactIdentifier :: Maybe Text
$sel:artifactIdentifier:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
artifactIdentifier} -> Maybe Text
artifactIdentifier) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe Text
a -> ProjectArtifacts
s {$sel:artifactIdentifier:ProjectArtifacts' :: Maybe Text
artifactIdentifier = Maybe Text
a} :: ProjectArtifacts)

-- | Undocumented member.
projectArtifacts_bucketOwnerAccess :: Lens.Lens' ProjectArtifacts (Prelude.Maybe BucketOwnerAccess)
projectArtifacts_bucketOwnerAccess :: (Maybe BucketOwnerAccess -> f (Maybe BucketOwnerAccess))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_bucketOwnerAccess = (ProjectArtifacts -> Maybe BucketOwnerAccess)
-> (ProjectArtifacts
    -> Maybe BucketOwnerAccess -> ProjectArtifacts)
-> Lens
     ProjectArtifacts
     ProjectArtifacts
     (Maybe BucketOwnerAccess)
     (Maybe BucketOwnerAccess)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe BucketOwnerAccess
bucketOwnerAccess :: Maybe BucketOwnerAccess
$sel:bucketOwnerAccess:ProjectArtifacts' :: ProjectArtifacts -> Maybe BucketOwnerAccess
bucketOwnerAccess} -> Maybe BucketOwnerAccess
bucketOwnerAccess) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe BucketOwnerAccess
a -> ProjectArtifacts
s {$sel:bucketOwnerAccess:ProjectArtifacts' :: Maybe BucketOwnerAccess
bucketOwnerAccess = Maybe BucketOwnerAccess
a} :: ProjectArtifacts)

-- | Along with @path@ and @name@, the pattern that CodeBuild uses to
-- determine the name and location to store the output artifact:
--
-- -   If @type@ is set to @CODEPIPELINE@, CodePipeline ignores this value
--     if specified. This is because CodePipeline manages its build output
--     names instead of CodeBuild.
--
-- -   If @type@ is set to @NO_ARTIFACTS@, this value is ignored if
--     specified, because no build output is produced.
--
-- -   If @type@ is set to @S3@, valid values include:
--
--     -   @BUILD_ID@: Include the build ID in the location of the build
--         output artifact.
--
--     -   @NONE@: Do not include the build ID. This is the default if
--         @namespaceType@ is not specified.
--
-- For example, if @path@ is set to @MyArtifacts@, @namespaceType@ is set
-- to @BUILD_ID@, and @name@ is set to @MyArtifact.zip@, the output
-- artifact is stored in @MyArtifacts\/\<build-ID>\/MyArtifact.zip@.
projectArtifacts_namespaceType :: Lens.Lens' ProjectArtifacts (Prelude.Maybe ArtifactNamespace)
projectArtifacts_namespaceType :: (Maybe ArtifactNamespace -> f (Maybe ArtifactNamespace))
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_namespaceType = (ProjectArtifacts -> Maybe ArtifactNamespace)
-> (ProjectArtifacts
    -> Maybe ArtifactNamespace -> ProjectArtifacts)
-> Lens
     ProjectArtifacts
     ProjectArtifacts
     (Maybe ArtifactNamespace)
     (Maybe ArtifactNamespace)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {Maybe ArtifactNamespace
namespaceType :: Maybe ArtifactNamespace
$sel:namespaceType:ProjectArtifacts' :: ProjectArtifacts -> Maybe ArtifactNamespace
namespaceType} -> Maybe ArtifactNamespace
namespaceType) (\s :: ProjectArtifacts
s@ProjectArtifacts' {} Maybe ArtifactNamespace
a -> ProjectArtifacts
s {$sel:namespaceType:ProjectArtifacts' :: Maybe ArtifactNamespace
namespaceType = Maybe ArtifactNamespace
a} :: ProjectArtifacts)

-- | The type of build output artifact. Valid values include:
--
-- -   @CODEPIPELINE@: The build project has build output generated through
--     CodePipeline.
--
--     The @CODEPIPELINE@ type is not supported for @secondaryArtifacts@.
--
-- -   @NO_ARTIFACTS@: The build project does not produce any build output.
--
-- -   @S3@: The build project stores build output in Amazon S3.
projectArtifacts_type :: Lens.Lens' ProjectArtifacts ArtifactsType
projectArtifacts_type :: (ArtifactsType -> f ArtifactsType)
-> ProjectArtifacts -> f ProjectArtifacts
projectArtifacts_type = (ProjectArtifacts -> ArtifactsType)
-> (ProjectArtifacts -> ArtifactsType -> ProjectArtifacts)
-> Lens
     ProjectArtifacts ProjectArtifacts ArtifactsType ArtifactsType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectArtifacts' {ArtifactsType
type' :: ArtifactsType
$sel:type':ProjectArtifacts' :: ProjectArtifacts -> ArtifactsType
type'} -> ArtifactsType
type') (\s :: ProjectArtifacts
s@ProjectArtifacts' {} ArtifactsType
a -> ProjectArtifacts
s {$sel:type':ProjectArtifacts' :: ArtifactsType
type' = ArtifactsType
a} :: ProjectArtifacts)

instance Core.FromJSON ProjectArtifacts where
  parseJSON :: Value -> Parser ProjectArtifacts
parseJSON =
    String
-> (Object -> Parser ProjectArtifacts)
-> Value
-> Parser ProjectArtifacts
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProjectArtifacts"
      ( \Object
x ->
          Maybe ArtifactPackaging
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe BucketOwnerAccess
-> Maybe ArtifactNamespace
-> ArtifactsType
-> ProjectArtifacts
ProjectArtifacts'
            (Maybe ArtifactPackaging
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe BucketOwnerAccess
 -> Maybe ArtifactNamespace
 -> ArtifactsType
 -> ProjectArtifacts)
-> Parser (Maybe ArtifactPackaging)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ArtifactPackaging)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"packaging")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"path")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryptionDisabled")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace
      -> ArtifactsType
      -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"overrideArtifactName")
            Parser
  (Maybe Text
   -> Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace
   -> ArtifactsType
   -> ProjectArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe BucketOwnerAccess
      -> Maybe ArtifactNamespace -> ArtifactsType -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"artifactIdentifier")
            Parser
  (Maybe BucketOwnerAccess
   -> Maybe ArtifactNamespace -> ArtifactsType -> ProjectArtifacts)
-> Parser (Maybe BucketOwnerAccess)
-> Parser
     (Maybe ArtifactNamespace -> ArtifactsType -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BucketOwnerAccess)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketOwnerAccess")
            Parser
  (Maybe ArtifactNamespace -> ArtifactsType -> ProjectArtifacts)
-> Parser (Maybe ArtifactNamespace)
-> Parser (ArtifactsType -> ProjectArtifacts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ArtifactNamespace)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"namespaceType")
            Parser (ArtifactsType -> ProjectArtifacts)
-> Parser ArtifactsType -> Parser ProjectArtifacts
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ArtifactsType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
      )

instance Prelude.Hashable ProjectArtifacts

instance Prelude.NFData ProjectArtifacts

instance Core.ToJSON ProjectArtifacts where
  toJSON :: ProjectArtifacts -> Value
toJSON ProjectArtifacts' {Maybe Bool
Maybe Text
Maybe ArtifactNamespace
Maybe ArtifactPackaging
Maybe BucketOwnerAccess
ArtifactsType
type' :: ArtifactsType
namespaceType :: Maybe ArtifactNamespace
bucketOwnerAccess :: Maybe BucketOwnerAccess
artifactIdentifier :: Maybe Text
overrideArtifactName :: Maybe Bool
encryptionDisabled :: Maybe Bool
name :: Maybe Text
location :: Maybe Text
path :: Maybe Text
packaging :: Maybe ArtifactPackaging
$sel:type':ProjectArtifacts' :: ProjectArtifacts -> ArtifactsType
$sel:namespaceType:ProjectArtifacts' :: ProjectArtifacts -> Maybe ArtifactNamespace
$sel:bucketOwnerAccess:ProjectArtifacts' :: ProjectArtifacts -> Maybe BucketOwnerAccess
$sel:artifactIdentifier:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
$sel:overrideArtifactName:ProjectArtifacts' :: ProjectArtifacts -> Maybe Bool
$sel:encryptionDisabled:ProjectArtifacts' :: ProjectArtifacts -> Maybe Bool
$sel:name:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
$sel:location:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
$sel:path:ProjectArtifacts' :: ProjectArtifacts -> Maybe Text
$sel:packaging:ProjectArtifacts' :: ProjectArtifacts -> Maybe ArtifactPackaging
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"packaging" Text -> ArtifactPackaging -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ArtifactPackaging -> Pair)
-> Maybe ArtifactPackaging -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactPackaging
packaging,
            (Text
"path" 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
path,
            (Text
"location" 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
location,
            (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"encryptionDisabled" 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
encryptionDisabled,
            (Text
"overrideArtifactName" 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
overrideArtifactName,
            (Text
"artifactIdentifier" 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
artifactIdentifier,
            (Text
"bucketOwnerAccess" Text -> BucketOwnerAccess -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BucketOwnerAccess -> Pair)
-> Maybe BucketOwnerAccess -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BucketOwnerAccess
bucketOwnerAccess,
            (Text
"namespaceType" Text -> ArtifactNamespace -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ArtifactNamespace -> Pair)
-> Maybe ArtifactNamespace -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactNamespace
namespaceType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> ArtifactsType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ArtifactsType
type')
          ]
      )