{-# 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.BuildArtifacts
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeBuild.Types.BuildArtifacts where

import Amazonka.CodeBuild.Types.BucketOwnerAccess
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Information about build output artifacts.
--
-- /See:/ 'newBuildArtifacts' smart constructor.
data BuildArtifacts = BuildArtifacts'
  { -- | An identifier for this artifact definition.
    BuildArtifacts -> Maybe Text
artifactIdentifier :: Prelude.Maybe Prelude.Text,
    BuildArtifacts -> Maybe BucketOwnerAccess
bucketOwnerAccess :: Prelude.Maybe BucketOwnerAccess,
    -- | Information that tells you if encryption for build artifacts is
    -- disabled.
    BuildArtifacts -> Maybe Bool
encryptionDisabled :: Prelude.Maybe Prelude.Bool,
    -- | Information about the location of the build artifacts.
    BuildArtifacts -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The MD5 hash of the build artifact.
    --
    -- You can use this hash along with a checksum tool to confirm file
    -- integrity and authenticity.
    --
    -- This value is available only if the build project\'s @packaging@ value
    -- is set to @ZIP@.
    BuildArtifacts -> Maybe Text
md5sum :: Prelude.Maybe Prelude.Text,
    -- | 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.
    BuildArtifacts -> Maybe Bool
overrideArtifactName :: Prelude.Maybe Prelude.Bool,
    -- | The SHA-256 hash of the build artifact.
    --
    -- You can use this hash along with a checksum tool to confirm file
    -- integrity and authenticity.
    --
    -- This value is available only if the build project\'s @packaging@ value
    -- is set to @ZIP@.
    BuildArtifacts -> Maybe Text
sha256sum :: Prelude.Maybe Prelude.Text
  }
  deriving (BuildArtifacts -> BuildArtifacts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildArtifacts -> BuildArtifacts -> Bool
$c/= :: BuildArtifacts -> BuildArtifacts -> Bool
== :: BuildArtifacts -> BuildArtifacts -> Bool
$c== :: BuildArtifacts -> BuildArtifacts -> Bool
Prelude.Eq, ReadPrec [BuildArtifacts]
ReadPrec BuildArtifacts
Int -> ReadS BuildArtifacts
ReadS [BuildArtifacts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuildArtifacts]
$creadListPrec :: ReadPrec [BuildArtifacts]
readPrec :: ReadPrec BuildArtifacts
$creadPrec :: ReadPrec BuildArtifacts
readList :: ReadS [BuildArtifacts]
$creadList :: ReadS [BuildArtifacts]
readsPrec :: Int -> ReadS BuildArtifacts
$creadsPrec :: Int -> ReadS BuildArtifacts
Prelude.Read, Int -> BuildArtifacts -> ShowS
[BuildArtifacts] -> ShowS
BuildArtifacts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuildArtifacts] -> ShowS
$cshowList :: [BuildArtifacts] -> ShowS
show :: BuildArtifacts -> String
$cshow :: BuildArtifacts -> String
showsPrec :: Int -> BuildArtifacts -> ShowS
$cshowsPrec :: Int -> BuildArtifacts -> ShowS
Prelude.Show, forall x. Rep BuildArtifacts x -> BuildArtifacts
forall x. BuildArtifacts -> Rep BuildArtifacts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuildArtifacts x -> BuildArtifacts
$cfrom :: forall x. BuildArtifacts -> Rep BuildArtifacts x
Prelude.Generic)

-- |
-- Create a value of 'BuildArtifacts' 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:
--
-- 'artifactIdentifier', 'buildArtifacts_artifactIdentifier' - An identifier for this artifact definition.
--
-- 'bucketOwnerAccess', 'buildArtifacts_bucketOwnerAccess' - Undocumented member.
--
-- 'encryptionDisabled', 'buildArtifacts_encryptionDisabled' - Information that tells you if encryption for build artifacts is
-- disabled.
--
-- 'location', 'buildArtifacts_location' - Information about the location of the build artifacts.
--
-- 'md5sum', 'buildArtifacts_md5sum' - The MD5 hash of the build artifact.
--
-- You can use this hash along with a checksum tool to confirm file
-- integrity and authenticity.
--
-- This value is available only if the build project\'s @packaging@ value
-- is set to @ZIP@.
--
-- 'overrideArtifactName', 'buildArtifacts_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.
--
-- 'sha256sum', 'buildArtifacts_sha256sum' - The SHA-256 hash of the build artifact.
--
-- You can use this hash along with a checksum tool to confirm file
-- integrity and authenticity.
--
-- This value is available only if the build project\'s @packaging@ value
-- is set to @ZIP@.
newBuildArtifacts ::
  BuildArtifacts
newBuildArtifacts :: BuildArtifacts
newBuildArtifacts =
  BuildArtifacts'
    { $sel:artifactIdentifier:BuildArtifacts' :: Maybe Text
artifactIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:bucketOwnerAccess:BuildArtifacts' :: Maybe BucketOwnerAccess
bucketOwnerAccess = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionDisabled:BuildArtifacts' :: Maybe Bool
encryptionDisabled = forall a. Maybe a
Prelude.Nothing,
      $sel:location:BuildArtifacts' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
      $sel:md5sum:BuildArtifacts' :: Maybe Text
md5sum = forall a. Maybe a
Prelude.Nothing,
      $sel:overrideArtifactName:BuildArtifacts' :: Maybe Bool
overrideArtifactName = forall a. Maybe a
Prelude.Nothing,
      $sel:sha256sum:BuildArtifacts' :: Maybe Text
sha256sum = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | Information that tells you if encryption for build artifacts is
-- disabled.
buildArtifacts_encryptionDisabled :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Bool)
buildArtifacts_encryptionDisabled :: Lens' BuildArtifacts (Maybe Bool)
buildArtifacts_encryptionDisabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildArtifacts' {Maybe Bool
encryptionDisabled :: Maybe Bool
$sel:encryptionDisabled:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
encryptionDisabled} -> Maybe Bool
encryptionDisabled) (\s :: BuildArtifacts
s@BuildArtifacts' {} Maybe Bool
a -> BuildArtifacts
s {$sel:encryptionDisabled:BuildArtifacts' :: Maybe Bool
encryptionDisabled = Maybe Bool
a} :: BuildArtifacts)

-- | Information about the location of the build artifacts.
buildArtifacts_location :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Text)
buildArtifacts_location :: Lens' BuildArtifacts (Maybe Text)
buildArtifacts_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildArtifacts' {Maybe Text
location :: Maybe Text
$sel:location:BuildArtifacts' :: BuildArtifacts -> Maybe Text
location} -> Maybe Text
location) (\s :: BuildArtifacts
s@BuildArtifacts' {} Maybe Text
a -> BuildArtifacts
s {$sel:location:BuildArtifacts' :: Maybe Text
location = Maybe Text
a} :: BuildArtifacts)

-- | The MD5 hash of the build artifact.
--
-- You can use this hash along with a checksum tool to confirm file
-- integrity and authenticity.
--
-- This value is available only if the build project\'s @packaging@ value
-- is set to @ZIP@.
buildArtifacts_md5sum :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Text)
buildArtifacts_md5sum :: Lens' BuildArtifacts (Maybe Text)
buildArtifacts_md5sum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildArtifacts' {Maybe Text
md5sum :: Maybe Text
$sel:md5sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
md5sum} -> Maybe Text
md5sum) (\s :: BuildArtifacts
s@BuildArtifacts' {} Maybe Text
a -> BuildArtifacts
s {$sel:md5sum:BuildArtifacts' :: Maybe Text
md5sum = Maybe Text
a} :: BuildArtifacts)

-- | 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.
buildArtifacts_overrideArtifactName :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Bool)
buildArtifacts_overrideArtifactName :: Lens' BuildArtifacts (Maybe Bool)
buildArtifacts_overrideArtifactName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildArtifacts' {Maybe Bool
overrideArtifactName :: Maybe Bool
$sel:overrideArtifactName:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
overrideArtifactName} -> Maybe Bool
overrideArtifactName) (\s :: BuildArtifacts
s@BuildArtifacts' {} Maybe Bool
a -> BuildArtifacts
s {$sel:overrideArtifactName:BuildArtifacts' :: Maybe Bool
overrideArtifactName = Maybe Bool
a} :: BuildArtifacts)

-- | The SHA-256 hash of the build artifact.
--
-- You can use this hash along with a checksum tool to confirm file
-- integrity and authenticity.
--
-- This value is available only if the build project\'s @packaging@ value
-- is set to @ZIP@.
buildArtifacts_sha256sum :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Text)
buildArtifacts_sha256sum :: Lens' BuildArtifacts (Maybe Text)
buildArtifacts_sha256sum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildArtifacts' {Maybe Text
sha256sum :: Maybe Text
$sel:sha256sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
sha256sum} -> Maybe Text
sha256sum) (\s :: BuildArtifacts
s@BuildArtifacts' {} Maybe Text
a -> BuildArtifacts
s {$sel:sha256sum:BuildArtifacts' :: Maybe Text
sha256sum = Maybe Text
a} :: BuildArtifacts)

instance Data.FromJSON BuildArtifacts where
  parseJSON :: Value -> Parser BuildArtifacts
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BuildArtifacts"
      ( \Object
x ->
          Maybe Text
-> Maybe BucketOwnerAccess
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> BuildArtifacts
BuildArtifacts'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"artifactIdentifier")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bucketOwnerAccess")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionDisabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"location")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"md5sum")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"overrideArtifactName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sha256sum")
      )

instance Prelude.Hashable BuildArtifacts where
  hashWithSalt :: Int -> BuildArtifacts -> Int
hashWithSalt Int
_salt BuildArtifacts' {Maybe Bool
Maybe Text
Maybe BucketOwnerAccess
sha256sum :: Maybe Text
overrideArtifactName :: Maybe Bool
md5sum :: Maybe Text
location :: Maybe Text
encryptionDisabled :: Maybe Bool
bucketOwnerAccess :: Maybe BucketOwnerAccess
artifactIdentifier :: Maybe Text
$sel:sha256sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:overrideArtifactName:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
$sel:md5sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:location:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:encryptionDisabled:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
$sel:bucketOwnerAccess:BuildArtifacts' :: BuildArtifacts -> Maybe BucketOwnerAccess
$sel:artifactIdentifier:BuildArtifacts' :: BuildArtifacts -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
artifactIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BucketOwnerAccess
bucketOwnerAccess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encryptionDisabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
md5sum
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
overrideArtifactName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sha256sum

instance Prelude.NFData BuildArtifacts where
  rnf :: BuildArtifacts -> ()
rnf BuildArtifacts' {Maybe Bool
Maybe Text
Maybe BucketOwnerAccess
sha256sum :: Maybe Text
overrideArtifactName :: Maybe Bool
md5sum :: Maybe Text
location :: Maybe Text
encryptionDisabled :: Maybe Bool
bucketOwnerAccess :: Maybe BucketOwnerAccess
artifactIdentifier :: Maybe Text
$sel:sha256sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:overrideArtifactName:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
$sel:md5sum:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:location:BuildArtifacts' :: BuildArtifacts -> Maybe Text
$sel:encryptionDisabled:BuildArtifacts' :: BuildArtifacts -> Maybe Bool
$sel:bucketOwnerAccess:BuildArtifacts' :: BuildArtifacts -> Maybe BucketOwnerAccess
$sel:artifactIdentifier:BuildArtifacts' :: BuildArtifacts -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
artifactIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BucketOwnerAccess
bucketOwnerAccess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encryptionDisabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
md5sum
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
overrideArtifactName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sha256sum