{-# 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.Glue.Types.MetadataKeyValuePair where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetadataKeyValuePair = MetadataKeyValuePair'
{
MetadataKeyValuePair -> Maybe Text
metadataKey :: Prelude.Maybe Prelude.Text,
MetadataKeyValuePair -> Maybe Text
metadataValue :: Prelude.Maybe Prelude.Text
}
deriving (MetadataKeyValuePair -> MetadataKeyValuePair -> Bool
(MetadataKeyValuePair -> MetadataKeyValuePair -> Bool)
-> (MetadataKeyValuePair -> MetadataKeyValuePair -> Bool)
-> Eq MetadataKeyValuePair
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetadataKeyValuePair -> MetadataKeyValuePair -> Bool
$c/= :: MetadataKeyValuePair -> MetadataKeyValuePair -> Bool
== :: MetadataKeyValuePair -> MetadataKeyValuePair -> Bool
$c== :: MetadataKeyValuePair -> MetadataKeyValuePair -> Bool
Prelude.Eq, ReadPrec [MetadataKeyValuePair]
ReadPrec MetadataKeyValuePair
Int -> ReadS MetadataKeyValuePair
ReadS [MetadataKeyValuePair]
(Int -> ReadS MetadataKeyValuePair)
-> ReadS [MetadataKeyValuePair]
-> ReadPrec MetadataKeyValuePair
-> ReadPrec [MetadataKeyValuePair]
-> Read MetadataKeyValuePair
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetadataKeyValuePair]
$creadListPrec :: ReadPrec [MetadataKeyValuePair]
readPrec :: ReadPrec MetadataKeyValuePair
$creadPrec :: ReadPrec MetadataKeyValuePair
readList :: ReadS [MetadataKeyValuePair]
$creadList :: ReadS [MetadataKeyValuePair]
readsPrec :: Int -> ReadS MetadataKeyValuePair
$creadsPrec :: Int -> ReadS MetadataKeyValuePair
Prelude.Read, Int -> MetadataKeyValuePair -> ShowS
[MetadataKeyValuePair] -> ShowS
MetadataKeyValuePair -> String
(Int -> MetadataKeyValuePair -> ShowS)
-> (MetadataKeyValuePair -> String)
-> ([MetadataKeyValuePair] -> ShowS)
-> Show MetadataKeyValuePair
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetadataKeyValuePair] -> ShowS
$cshowList :: [MetadataKeyValuePair] -> ShowS
show :: MetadataKeyValuePair -> String
$cshow :: MetadataKeyValuePair -> String
showsPrec :: Int -> MetadataKeyValuePair -> ShowS
$cshowsPrec :: Int -> MetadataKeyValuePair -> ShowS
Prelude.Show, (forall x. MetadataKeyValuePair -> Rep MetadataKeyValuePair x)
-> (forall x. Rep MetadataKeyValuePair x -> MetadataKeyValuePair)
-> Generic MetadataKeyValuePair
forall x. Rep MetadataKeyValuePair x -> MetadataKeyValuePair
forall x. MetadataKeyValuePair -> Rep MetadataKeyValuePair x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetadataKeyValuePair x -> MetadataKeyValuePair
$cfrom :: forall x. MetadataKeyValuePair -> Rep MetadataKeyValuePair x
Prelude.Generic)
newMetadataKeyValuePair ::
MetadataKeyValuePair
newMetadataKeyValuePair :: MetadataKeyValuePair
newMetadataKeyValuePair =
MetadataKeyValuePair' :: Maybe Text -> Maybe Text -> MetadataKeyValuePair
MetadataKeyValuePair'
{ $sel:metadataKey:MetadataKeyValuePair' :: Maybe Text
metadataKey =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metadataValue:MetadataKeyValuePair' :: Maybe Text
metadataValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
metadataKeyValuePair_metadataKey :: Lens.Lens' MetadataKeyValuePair (Prelude.Maybe Prelude.Text)
metadataKeyValuePair_metadataKey :: (Maybe Text -> f (Maybe Text))
-> MetadataKeyValuePair -> f MetadataKeyValuePair
metadataKeyValuePair_metadataKey = (MetadataKeyValuePair -> Maybe Text)
-> (MetadataKeyValuePair -> Maybe Text -> MetadataKeyValuePair)
-> Lens
MetadataKeyValuePair MetadataKeyValuePair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataKeyValuePair' {Maybe Text
metadataKey :: Maybe Text
$sel:metadataKey:MetadataKeyValuePair' :: MetadataKeyValuePair -> Maybe Text
metadataKey} -> Maybe Text
metadataKey) (\s :: MetadataKeyValuePair
s@MetadataKeyValuePair' {} Maybe Text
a -> MetadataKeyValuePair
s {$sel:metadataKey:MetadataKeyValuePair' :: Maybe Text
metadataKey = Maybe Text
a} :: MetadataKeyValuePair)
metadataKeyValuePair_metadataValue :: Lens.Lens' MetadataKeyValuePair (Prelude.Maybe Prelude.Text)
metadataKeyValuePair_metadataValue :: (Maybe Text -> f (Maybe Text))
-> MetadataKeyValuePair -> f MetadataKeyValuePair
metadataKeyValuePair_metadataValue = (MetadataKeyValuePair -> Maybe Text)
-> (MetadataKeyValuePair -> Maybe Text -> MetadataKeyValuePair)
-> Lens
MetadataKeyValuePair MetadataKeyValuePair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataKeyValuePair' {Maybe Text
metadataValue :: Maybe Text
$sel:metadataValue:MetadataKeyValuePair' :: MetadataKeyValuePair -> Maybe Text
metadataValue} -> Maybe Text
metadataValue) (\s :: MetadataKeyValuePair
s@MetadataKeyValuePair' {} Maybe Text
a -> MetadataKeyValuePair
s {$sel:metadataValue:MetadataKeyValuePair' :: Maybe Text
metadataValue = Maybe Text
a} :: MetadataKeyValuePair)
instance Prelude.Hashable MetadataKeyValuePair
instance Prelude.NFData MetadataKeyValuePair
instance Core.ToJSON MetadataKeyValuePair where
toJSON :: MetadataKeyValuePair -> Value
toJSON MetadataKeyValuePair' {Maybe Text
metadataValue :: Maybe Text
metadataKey :: Maybe Text
$sel:metadataValue:MetadataKeyValuePair' :: MetadataKeyValuePair -> Maybe Text
$sel:metadataKey:MetadataKeyValuePair' :: MetadataKeyValuePair -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MetadataKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
metadataKey,
(Text
"MetadataValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
metadataValue
]
)