{-# 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.ArtifactStore where
import Amazonka.CodePipeline.Types.ArtifactStoreType
import Amazonka.CodePipeline.Types.EncryptionKey
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ArtifactStore = ArtifactStore'
{
ArtifactStore -> Maybe EncryptionKey
encryptionKey :: Prelude.Maybe EncryptionKey,
ArtifactStore -> ArtifactStoreType
type' :: ArtifactStoreType,
ArtifactStore -> Text
location :: Prelude.Text
}
deriving (ArtifactStore -> ArtifactStore -> Bool
(ArtifactStore -> ArtifactStore -> Bool)
-> (ArtifactStore -> ArtifactStore -> Bool) -> Eq ArtifactStore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactStore -> ArtifactStore -> Bool
$c/= :: ArtifactStore -> ArtifactStore -> Bool
== :: ArtifactStore -> ArtifactStore -> Bool
$c== :: ArtifactStore -> ArtifactStore -> Bool
Prelude.Eq, ReadPrec [ArtifactStore]
ReadPrec ArtifactStore
Int -> ReadS ArtifactStore
ReadS [ArtifactStore]
(Int -> ReadS ArtifactStore)
-> ReadS [ArtifactStore]
-> ReadPrec ArtifactStore
-> ReadPrec [ArtifactStore]
-> Read ArtifactStore
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactStore]
$creadListPrec :: ReadPrec [ArtifactStore]
readPrec :: ReadPrec ArtifactStore
$creadPrec :: ReadPrec ArtifactStore
readList :: ReadS [ArtifactStore]
$creadList :: ReadS [ArtifactStore]
readsPrec :: Int -> ReadS ArtifactStore
$creadsPrec :: Int -> ReadS ArtifactStore
Prelude.Read, Int -> ArtifactStore -> ShowS
[ArtifactStore] -> ShowS
ArtifactStore -> String
(Int -> ArtifactStore -> ShowS)
-> (ArtifactStore -> String)
-> ([ArtifactStore] -> ShowS)
-> Show ArtifactStore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactStore] -> ShowS
$cshowList :: [ArtifactStore] -> ShowS
show :: ArtifactStore -> String
$cshow :: ArtifactStore -> String
showsPrec :: Int -> ArtifactStore -> ShowS
$cshowsPrec :: Int -> ArtifactStore -> ShowS
Prelude.Show, (forall x. ArtifactStore -> Rep ArtifactStore x)
-> (forall x. Rep ArtifactStore x -> ArtifactStore)
-> Generic ArtifactStore
forall x. Rep ArtifactStore x -> ArtifactStore
forall x. ArtifactStore -> Rep ArtifactStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactStore x -> ArtifactStore
$cfrom :: forall x. ArtifactStore -> Rep ArtifactStore x
Prelude.Generic)
newArtifactStore ::
ArtifactStoreType ->
Prelude.Text ->
ArtifactStore
newArtifactStore :: ArtifactStoreType -> Text -> ArtifactStore
newArtifactStore ArtifactStoreType
pType_ Text
pLocation_ =
ArtifactStore' :: Maybe EncryptionKey -> ArtifactStoreType -> Text -> ArtifactStore
ArtifactStore'
{ $sel:encryptionKey:ArtifactStore' :: Maybe EncryptionKey
encryptionKey = Maybe EncryptionKey
forall a. Maybe a
Prelude.Nothing,
$sel:type':ArtifactStore' :: ArtifactStoreType
type' = ArtifactStoreType
pType_,
$sel:location:ArtifactStore' :: Text
location = Text
pLocation_
}
artifactStore_encryptionKey :: Lens.Lens' ArtifactStore (Prelude.Maybe EncryptionKey)
artifactStore_encryptionKey :: (Maybe EncryptionKey -> f (Maybe EncryptionKey))
-> ArtifactStore -> f ArtifactStore
artifactStore_encryptionKey = (ArtifactStore -> Maybe EncryptionKey)
-> (ArtifactStore -> Maybe EncryptionKey -> ArtifactStore)
-> Lens
ArtifactStore
ArtifactStore
(Maybe EncryptionKey)
(Maybe EncryptionKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactStore' {Maybe EncryptionKey
encryptionKey :: Maybe EncryptionKey
$sel:encryptionKey:ArtifactStore' :: ArtifactStore -> Maybe EncryptionKey
encryptionKey} -> Maybe EncryptionKey
encryptionKey) (\s :: ArtifactStore
s@ArtifactStore' {} Maybe EncryptionKey
a -> ArtifactStore
s {$sel:encryptionKey:ArtifactStore' :: Maybe EncryptionKey
encryptionKey = Maybe EncryptionKey
a} :: ArtifactStore)
artifactStore_type :: Lens.Lens' ArtifactStore ArtifactStoreType
artifactStore_type :: (ArtifactStoreType -> f ArtifactStoreType)
-> ArtifactStore -> f ArtifactStore
artifactStore_type = (ArtifactStore -> ArtifactStoreType)
-> (ArtifactStore -> ArtifactStoreType -> ArtifactStore)
-> Lens
ArtifactStore ArtifactStore ArtifactStoreType ArtifactStoreType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactStore' {ArtifactStoreType
type' :: ArtifactStoreType
$sel:type':ArtifactStore' :: ArtifactStore -> ArtifactStoreType
type'} -> ArtifactStoreType
type') (\s :: ArtifactStore
s@ArtifactStore' {} ArtifactStoreType
a -> ArtifactStore
s {$sel:type':ArtifactStore' :: ArtifactStoreType
type' = ArtifactStoreType
a} :: ArtifactStore)
artifactStore_location :: Lens.Lens' ArtifactStore Prelude.Text
artifactStore_location :: (Text -> f Text) -> ArtifactStore -> f ArtifactStore
artifactStore_location = (ArtifactStore -> Text)
-> (ArtifactStore -> Text -> ArtifactStore)
-> Lens ArtifactStore ArtifactStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactStore' {Text
location :: Text
$sel:location:ArtifactStore' :: ArtifactStore -> Text
location} -> Text
location) (\s :: ArtifactStore
s@ArtifactStore' {} Text
a -> ArtifactStore
s {$sel:location:ArtifactStore' :: Text
location = Text
a} :: ArtifactStore)
instance Core.FromJSON ArtifactStore where
parseJSON :: Value -> Parser ArtifactStore
parseJSON =
String
-> (Object -> Parser ArtifactStore)
-> Value
-> Parser ArtifactStore
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ArtifactStore"
( \Object
x ->
Maybe EncryptionKey -> ArtifactStoreType -> Text -> ArtifactStore
ArtifactStore'
(Maybe EncryptionKey -> ArtifactStoreType -> Text -> ArtifactStore)
-> Parser (Maybe EncryptionKey)
-> Parser (ArtifactStoreType -> Text -> ArtifactStore)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionKey)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryptionKey")
Parser (ArtifactStoreType -> Text -> ArtifactStore)
-> Parser ArtifactStoreType -> Parser (Text -> ArtifactStore)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ArtifactStoreType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
Parser (Text -> ArtifactStore)
-> Parser Text -> Parser ArtifactStore
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"location")
)
instance Prelude.Hashable ArtifactStore
instance Prelude.NFData ArtifactStore
instance Core.ToJSON ArtifactStore where
toJSON :: ArtifactStore -> Value
toJSON ArtifactStore' {Maybe EncryptionKey
Text
ArtifactStoreType
location :: Text
type' :: ArtifactStoreType
encryptionKey :: Maybe EncryptionKey
$sel:location:ArtifactStore' :: ArtifactStore -> Text
$sel:type':ArtifactStore' :: ArtifactStore -> ArtifactStoreType
$sel:encryptionKey:ArtifactStore' :: ArtifactStore -> Maybe EncryptionKey
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"encryptionKey" Text -> EncryptionKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EncryptionKey -> Pair) -> Maybe EncryptionKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionKey
encryptionKey,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> ArtifactStoreType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ArtifactStoreType
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
location)
]
)