{-# 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-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.BuildArtifacts where

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 build output artifacts.
--
-- /See:/ 'newBuildArtifacts' smart constructor.
data BuildArtifacts = BuildArtifacts'
  { -- | 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,
    -- | Information that tells you if encryption for build artifacts is
    -- disabled.
    BuildArtifacts -> 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.
    BuildArtifacts -> Maybe Bool
overrideArtifactName :: Prelude.Maybe Prelude.Bool,
    -- | An identifier for this artifact definition.
    BuildArtifacts -> Maybe Text
artifactIdentifier :: Prelude.Maybe Prelude.Text,
    -- | 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,
    BuildArtifacts -> Maybe BucketOwnerAccess
bucketOwnerAccess :: Prelude.Maybe BucketOwnerAccess
  }
  deriving (BuildArtifacts -> BuildArtifacts -> Bool
(BuildArtifacts -> BuildArtifacts -> Bool)
-> (BuildArtifacts -> BuildArtifacts -> Bool) -> Eq BuildArtifacts
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]
(Int -> ReadS BuildArtifacts)
-> ReadS [BuildArtifacts]
-> ReadPrec BuildArtifacts
-> ReadPrec [BuildArtifacts]
-> Read 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
(Int -> BuildArtifacts -> ShowS)
-> (BuildArtifacts -> String)
-> ([BuildArtifacts] -> ShowS)
-> Show BuildArtifacts
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. BuildArtifacts -> Rep BuildArtifacts x)
-> (forall x. Rep BuildArtifacts x -> BuildArtifacts)
-> Generic BuildArtifacts
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:
--
-- '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@.
--
-- 'encryptionDisabled', 'buildArtifacts_encryptionDisabled' - Information that tells you if encryption for build artifacts is
-- disabled.
--
-- '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.
--
-- 'artifactIdentifier', 'buildArtifacts_artifactIdentifier' - An identifier for this artifact definition.
--
-- '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@.
--
-- 'bucketOwnerAccess', 'buildArtifacts_bucketOwnerAccess' - Undocumented member.
newBuildArtifacts ::
  BuildArtifacts
newBuildArtifacts :: BuildArtifacts
newBuildArtifacts =
  BuildArtifacts' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe BucketOwnerAccess
-> BuildArtifacts
BuildArtifacts'
    { $sel:location:BuildArtifacts' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:md5sum:BuildArtifacts' :: Maybe Text
md5sum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionDisabled:BuildArtifacts' :: Maybe Bool
encryptionDisabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:overrideArtifactName:BuildArtifacts' :: Maybe Bool
overrideArtifactName = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:artifactIdentifier:BuildArtifacts' :: Maybe Text
artifactIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sha256sum:BuildArtifacts' :: Maybe Text
sha256sum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketOwnerAccess:BuildArtifacts' :: Maybe BucketOwnerAccess
bucketOwnerAccess = Maybe BucketOwnerAccess
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the location of the build artifacts.
buildArtifacts_location :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Text)
buildArtifacts_location :: (Maybe Text -> f (Maybe Text))
-> BuildArtifacts -> f BuildArtifacts
buildArtifacts_location = (BuildArtifacts -> Maybe Text)
-> (BuildArtifacts -> Maybe Text -> BuildArtifacts)
-> Lens BuildArtifacts BuildArtifacts (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> BuildArtifacts -> f BuildArtifacts
buildArtifacts_md5sum = (BuildArtifacts -> Maybe Text)
-> (BuildArtifacts -> Maybe Text -> BuildArtifacts)
-> Lens BuildArtifacts BuildArtifacts (Maybe Text) (Maybe Text)
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)

-- | Information that tells you if encryption for build artifacts is
-- disabled.
buildArtifacts_encryptionDisabled :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Bool)
buildArtifacts_encryptionDisabled :: (Maybe Bool -> f (Maybe Bool))
-> BuildArtifacts -> f BuildArtifacts
buildArtifacts_encryptionDisabled = (BuildArtifacts -> Maybe Bool)
-> (BuildArtifacts -> Maybe Bool -> BuildArtifacts)
-> Lens BuildArtifacts BuildArtifacts (Maybe Bool) (Maybe Bool)
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)

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

-- | An identifier for this artifact definition.
buildArtifacts_artifactIdentifier :: Lens.Lens' BuildArtifacts (Prelude.Maybe Prelude.Text)
buildArtifacts_artifactIdentifier :: (Maybe Text -> f (Maybe Text))
-> BuildArtifacts -> f BuildArtifacts
buildArtifacts_artifactIdentifier = (BuildArtifacts -> Maybe Text)
-> (BuildArtifacts -> Maybe Text -> BuildArtifacts)
-> Lens BuildArtifacts BuildArtifacts (Maybe Text) (Maybe Text)
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)

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

-- | Undocumented member.
buildArtifacts_bucketOwnerAccess :: Lens.Lens' BuildArtifacts (Prelude.Maybe BucketOwnerAccess)
buildArtifacts_bucketOwnerAccess :: (Maybe BucketOwnerAccess -> f (Maybe BucketOwnerAccess))
-> BuildArtifacts -> f BuildArtifacts
buildArtifacts_bucketOwnerAccess = (BuildArtifacts -> Maybe BucketOwnerAccess)
-> (BuildArtifacts -> Maybe BucketOwnerAccess -> BuildArtifacts)
-> Lens
     BuildArtifacts
     BuildArtifacts
     (Maybe BucketOwnerAccess)
     (Maybe 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)

instance Core.FromJSON BuildArtifacts where
  parseJSON :: Value -> Parser BuildArtifacts
parseJSON =
    String
-> (Object -> Parser BuildArtifacts)
-> Value
-> Parser BuildArtifacts
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BuildArtifacts"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe BucketOwnerAccess
-> BuildArtifacts
BuildArtifacts'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe BucketOwnerAccess
 -> BuildArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> BuildArtifacts)
forall (f :: * -> *) a b. Functor 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 Text
   -> Maybe BucketOwnerAccess
   -> BuildArtifacts)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> BuildArtifacts)
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
"md5sum")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe BucketOwnerAccess
   -> BuildArtifacts)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe BucketOwnerAccess
      -> BuildArtifacts)
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 Text
   -> Maybe BucketOwnerAccess
   -> BuildArtifacts)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe BucketOwnerAccess -> BuildArtifacts)
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 Text -> Maybe BucketOwnerAccess -> BuildArtifacts)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe BucketOwnerAccess -> BuildArtifacts)
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 Text -> Maybe BucketOwnerAccess -> BuildArtifacts)
-> Parser (Maybe Text)
-> Parser (Maybe BucketOwnerAccess -> BuildArtifacts)
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
"sha256sum")
            Parser (Maybe BucketOwnerAccess -> BuildArtifacts)
-> Parser (Maybe BucketOwnerAccess) -> Parser BuildArtifacts
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")
      )

instance Prelude.Hashable BuildArtifacts

instance Prelude.NFData BuildArtifacts