{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:encryptionKey:ArtifactStore' :: Maybe EncryptionKey
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 :: Lens' ArtifactStore (Maybe EncryptionKey)
artifactStore_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 :: Lens' ArtifactStore ArtifactStoreType
artifactStore_type = 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 :: Lens' ArtifactStore Text
artifactStore_location = 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 Data.FromJSON ArtifactStore where
parseJSON :: Value -> Parser ArtifactStore
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ArtifactStore"
( \Object
x ->
Maybe EncryptionKey -> ArtifactStoreType -> Text -> ArtifactStore
ArtifactStore'
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
"encryptionKey")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"location")
)
instance Prelude.Hashable ArtifactStore where
hashWithSalt :: Int -> ArtifactStore -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionKey
encryptionKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ArtifactStoreType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
location
instance Prelude.NFData ArtifactStore where
rnf :: ArtifactStore -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionKey
encryptionKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ArtifactStoreType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
location
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"encryptionKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionKey
encryptionKey,
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ArtifactStoreType
type'),
forall a. a -> Maybe a
Prelude.Just (Key
"location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
location)
]
)