{-# 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.Lens as Lens
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
(ArtifactLocation -> ArtifactLocation -> Bool)
-> (ArtifactLocation -> ArtifactLocation -> Bool)
-> Eq ArtifactLocation
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]
(Int -> ReadS ArtifactLocation)
-> ReadS [ArtifactLocation]
-> ReadPrec ArtifactLocation
-> ReadPrec [ArtifactLocation]
-> Read 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
(Int -> ArtifactLocation -> ShowS)
-> (ArtifactLocation -> String)
-> ([ArtifactLocation] -> ShowS)
-> Show ArtifactLocation
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. ArtifactLocation -> Rep ArtifactLocation x)
-> (forall x. Rep ArtifactLocation x -> ArtifactLocation)
-> Generic ArtifactLocation
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' :: Maybe S3ArtifactLocation
-> Maybe ArtifactLocationType -> ArtifactLocation
ArtifactLocation'
{ $sel:s3Location:ArtifactLocation' :: Maybe S3ArtifactLocation
s3Location = Maybe S3ArtifactLocation
forall a. Maybe a
Prelude.Nothing,
$sel:type':ArtifactLocation' :: Maybe ArtifactLocationType
type' = Maybe ArtifactLocationType
forall a. Maybe a
Prelude.Nothing
}
artifactLocation_s3Location :: Lens.Lens' ArtifactLocation (Prelude.Maybe S3ArtifactLocation)
artifactLocation_s3Location :: (Maybe S3ArtifactLocation -> f (Maybe S3ArtifactLocation))
-> ArtifactLocation -> f ArtifactLocation
artifactLocation_s3Location = (ArtifactLocation -> Maybe S3ArtifactLocation)
-> (ArtifactLocation
-> Maybe S3ArtifactLocation -> ArtifactLocation)
-> Lens
ArtifactLocation
ArtifactLocation
(Maybe S3ArtifactLocation)
(Maybe S3ArtifactLocation)
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 :: (Maybe ArtifactLocationType -> f (Maybe ArtifactLocationType))
-> ArtifactLocation -> f ArtifactLocation
artifactLocation_type = (ArtifactLocation -> Maybe ArtifactLocationType)
-> (ArtifactLocation
-> Maybe ArtifactLocationType -> ArtifactLocation)
-> Lens
ArtifactLocation
ArtifactLocation
(Maybe ArtifactLocationType)
(Maybe ArtifactLocationType)
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 Core.FromJSON ArtifactLocation where
parseJSON :: Value -> Parser ArtifactLocation
parseJSON =
String
-> (Object -> Parser ArtifactLocation)
-> Value
-> Parser ArtifactLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ArtifactLocation"
( \Object
x ->
Maybe S3ArtifactLocation
-> Maybe ArtifactLocationType -> ArtifactLocation
ArtifactLocation'
(Maybe S3ArtifactLocation
-> Maybe ArtifactLocationType -> ArtifactLocation)
-> Parser (Maybe S3ArtifactLocation)
-> Parser (Maybe ArtifactLocationType -> ArtifactLocation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3ArtifactLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3Location")
Parser (Maybe ArtifactLocationType -> ArtifactLocation)
-> Parser (Maybe ArtifactLocationType) -> Parser ArtifactLocation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ArtifactLocationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
)
instance Prelude.Hashable ArtifactLocation
instance Prelude.NFData ArtifactLocation