{-# 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 #-}
module Amazonka.CodePipeline.Types.ArtifactLocation where
import Amazonka.CodePipeline.Types.ArtifactLocationType
import Amazonka.CodePipeline.Types.S3ArtifactLocation
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
data ArtifactLocation = ArtifactLocation'
{
ArtifactLocation -> Maybe S3ArtifactLocation
s3Location :: Prelude.Maybe S3ArtifactLocation,
ArtifactLocation -> Maybe ArtifactLocationType
type' :: Prelude.Maybe ArtifactLocationType
}
deriving (ArtifactLocation -> ArtifactLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactLocation -> ArtifactLocation -> Bool
$c/= :: ArtifactLocation -> ArtifactLocation -> Bool
== :: ArtifactLocation -> ArtifactLocation -> Bool
$c== :: ArtifactLocation -> ArtifactLocation -> Bool
Prelude.Eq, ReadPrec [ArtifactLocation]
ReadPrec ArtifactLocation
Int -> ReadS ArtifactLocation
ReadS [ArtifactLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactLocation]
$creadListPrec :: ReadPrec [ArtifactLocation]
readPrec :: ReadPrec ArtifactLocation
$creadPrec :: ReadPrec ArtifactLocation
readList :: ReadS [ArtifactLocation]
$creadList :: ReadS [ArtifactLocation]
readsPrec :: Int -> ReadS ArtifactLocation
$creadsPrec :: Int -> ReadS ArtifactLocation
Prelude.Read, Int -> ArtifactLocation -> ShowS
[ArtifactLocation] -> ShowS
ArtifactLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactLocation] -> ShowS
$cshowList :: [ArtifactLocation] -> ShowS
show :: ArtifactLocation -> String
$cshow :: ArtifactLocation -> String
showsPrec :: Int -> ArtifactLocation -> ShowS
$cshowsPrec :: Int -> ArtifactLocation -> ShowS
Prelude.Show, forall x. Rep ArtifactLocation x -> ArtifactLocation
forall x. ArtifactLocation -> Rep ArtifactLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactLocation x -> ArtifactLocation
$cfrom :: forall x. ArtifactLocation -> Rep ArtifactLocation x
Prelude.Generic)
newArtifactLocation ::
ArtifactLocation
newArtifactLocation :: ArtifactLocation
newArtifactLocation =
ArtifactLocation'
{ $sel:s3Location:ArtifactLocation' :: Maybe S3ArtifactLocation
s3Location = forall a. Maybe a
Prelude.Nothing,
$sel:type':ArtifactLocation' :: Maybe ArtifactLocationType
type' = forall a. Maybe a
Prelude.Nothing
}
artifactLocation_s3Location :: Lens.Lens' ArtifactLocation (Prelude.Maybe S3ArtifactLocation)
artifactLocation_s3Location :: Lens' ArtifactLocation (Maybe S3ArtifactLocation)
artifactLocation_s3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactLocation' {Maybe S3ArtifactLocation
s3Location :: Maybe S3ArtifactLocation
$sel:s3Location:ArtifactLocation' :: ArtifactLocation -> Maybe S3ArtifactLocation
s3Location} -> Maybe S3ArtifactLocation
s3Location) (\s :: ArtifactLocation
s@ArtifactLocation' {} Maybe S3ArtifactLocation
a -> ArtifactLocation
s {$sel:s3Location:ArtifactLocation' :: Maybe S3ArtifactLocation
s3Location = Maybe S3ArtifactLocation
a} :: ArtifactLocation)
artifactLocation_type :: Lens.Lens' ArtifactLocation (Prelude.Maybe ArtifactLocationType)
artifactLocation_type :: Lens' ArtifactLocation (Maybe ArtifactLocationType)
artifactLocation_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactLocation' {Maybe ArtifactLocationType
type' :: Maybe ArtifactLocationType
$sel:type':ArtifactLocation' :: ArtifactLocation -> Maybe ArtifactLocationType
type'} -> Maybe ArtifactLocationType
type') (\s :: ArtifactLocation
s@ArtifactLocation' {} Maybe ArtifactLocationType
a -> ArtifactLocation
s {$sel:type':ArtifactLocation' :: Maybe ArtifactLocationType
type' = Maybe ArtifactLocationType
a} :: ArtifactLocation)
instance Data.FromJSON ArtifactLocation where
parseJSON :: Value -> Parser ArtifactLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ArtifactLocation"
( \Object
x ->
Maybe S3ArtifactLocation
-> Maybe ArtifactLocationType -> ArtifactLocation
ArtifactLocation'
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
"s3Location")
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
"type")
)
instance Prelude.Hashable ArtifactLocation where
hashWithSalt :: Int -> ArtifactLocation -> Int
hashWithSalt Int
_salt ArtifactLocation' {Maybe ArtifactLocationType
Maybe S3ArtifactLocation
type' :: Maybe ArtifactLocationType
s3Location :: Maybe S3ArtifactLocation
$sel:type':ArtifactLocation' :: ArtifactLocation -> Maybe ArtifactLocationType
$sel:s3Location:ArtifactLocation' :: ArtifactLocation -> Maybe S3ArtifactLocation
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3ArtifactLocation
s3Location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArtifactLocationType
type'
instance Prelude.NFData ArtifactLocation where
rnf :: ArtifactLocation -> ()
rnf ArtifactLocation' {Maybe ArtifactLocationType
Maybe S3ArtifactLocation
type' :: Maybe ArtifactLocationType
s3Location :: Maybe S3ArtifactLocation
$sel:type':ArtifactLocation' :: ArtifactLocation -> Maybe ArtifactLocationType
$sel:s3Location:ArtifactLocation' :: ArtifactLocation -> Maybe S3ArtifactLocation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe S3ArtifactLocation
s3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ArtifactLocationType
type'