{-# 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.CodePipeline.Types.ArtifactDetail
-- 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.CodePipeline.Types.ArtifactDetail where

import Amazonka.CodePipeline.Types.S3Location
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

-- | Artifact details for the action execution, such as the artifact
-- location.
--
-- /See:/ 'newArtifactDetail' smart constructor.
data ArtifactDetail = ArtifactDetail'
  { -- | The artifact object name for the action execution.
    ArtifactDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 artifact location for the action execution.
    ArtifactDetail -> Maybe S3Location
s3location :: Prelude.Maybe S3Location
  }
  deriving (ArtifactDetail -> ArtifactDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactDetail -> ArtifactDetail -> Bool
$c/= :: ArtifactDetail -> ArtifactDetail -> Bool
== :: ArtifactDetail -> ArtifactDetail -> Bool
$c== :: ArtifactDetail -> ArtifactDetail -> Bool
Prelude.Eq, ReadPrec [ArtifactDetail]
ReadPrec ArtifactDetail
Int -> ReadS ArtifactDetail
ReadS [ArtifactDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactDetail]
$creadListPrec :: ReadPrec [ArtifactDetail]
readPrec :: ReadPrec ArtifactDetail
$creadPrec :: ReadPrec ArtifactDetail
readList :: ReadS [ArtifactDetail]
$creadList :: ReadS [ArtifactDetail]
readsPrec :: Int -> ReadS ArtifactDetail
$creadsPrec :: Int -> ReadS ArtifactDetail
Prelude.Read, Int -> ArtifactDetail -> ShowS
[ArtifactDetail] -> ShowS
ArtifactDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactDetail] -> ShowS
$cshowList :: [ArtifactDetail] -> ShowS
show :: ArtifactDetail -> String
$cshow :: ArtifactDetail -> String
showsPrec :: Int -> ArtifactDetail -> ShowS
$cshowsPrec :: Int -> ArtifactDetail -> ShowS
Prelude.Show, forall x. Rep ArtifactDetail x -> ArtifactDetail
forall x. ArtifactDetail -> Rep ArtifactDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactDetail x -> ArtifactDetail
$cfrom :: forall x. ArtifactDetail -> Rep ArtifactDetail x
Prelude.Generic)

-- |
-- Create a value of 'ArtifactDetail' 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:
--
-- 'name', 'artifactDetail_name' - The artifact object name for the action execution.
--
-- 's3location', 'artifactDetail_s3location' - The Amazon S3 artifact location for the action execution.
newArtifactDetail ::
  ArtifactDetail
newArtifactDetail :: ArtifactDetail
newArtifactDetail =
  ArtifactDetail'
    { $sel:name:ArtifactDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:s3location:ArtifactDetail' :: Maybe S3Location
s3location = forall a. Maybe a
Prelude.Nothing
    }

-- | The artifact object name for the action execution.
artifactDetail_name :: Lens.Lens' ArtifactDetail (Prelude.Maybe Prelude.Text)
artifactDetail_name :: Lens' ArtifactDetail (Maybe Text)
artifactDetail_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactDetail' {Maybe Text
name :: Maybe Text
$sel:name:ArtifactDetail' :: ArtifactDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: ArtifactDetail
s@ArtifactDetail' {} Maybe Text
a -> ArtifactDetail
s {$sel:name:ArtifactDetail' :: Maybe Text
name = Maybe Text
a} :: ArtifactDetail)

-- | The Amazon S3 artifact location for the action execution.
artifactDetail_s3location :: Lens.Lens' ArtifactDetail (Prelude.Maybe S3Location)
artifactDetail_s3location :: Lens' ArtifactDetail (Maybe S3Location)
artifactDetail_s3location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactDetail' {Maybe S3Location
s3location :: Maybe S3Location
$sel:s3location:ArtifactDetail' :: ArtifactDetail -> Maybe S3Location
s3location} -> Maybe S3Location
s3location) (\s :: ArtifactDetail
s@ArtifactDetail' {} Maybe S3Location
a -> ArtifactDetail
s {$sel:s3location:ArtifactDetail' :: Maybe S3Location
s3location = Maybe S3Location
a} :: ArtifactDetail)

instance Data.FromJSON ArtifactDetail where
  parseJSON :: Value -> Parser ArtifactDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ArtifactDetail"
      ( \Object
x ->
          Maybe Text -> Maybe S3Location -> ArtifactDetail
ArtifactDetail'
            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
"name")
            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
"s3location")
      )

instance Prelude.Hashable ArtifactDetail where
  hashWithSalt :: Int -> ArtifactDetail -> Int
hashWithSalt Int
_salt ArtifactDetail' {Maybe Text
Maybe S3Location
s3location :: Maybe S3Location
name :: Maybe Text
$sel:s3location:ArtifactDetail' :: ArtifactDetail -> Maybe S3Location
$sel:name:ArtifactDetail' :: ArtifactDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
s3location

instance Prelude.NFData ArtifactDetail where
  rnf :: ArtifactDetail -> ()
rnf ArtifactDetail' {Maybe Text
Maybe S3Location
s3location :: Maybe S3Location
name :: Maybe Text
$sel:s3location:ArtifactDetail' :: ArtifactDetail -> Maybe S3Location
$sel:name:ArtifactDetail' :: ArtifactDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
s3location