{-# 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.S3.Types.MetadataEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data MetadataEntry = MetadataEntry'
{
MetadataEntry -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
MetadataEntry -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (MetadataEntry -> MetadataEntry -> Bool
(MetadataEntry -> MetadataEntry -> Bool)
-> (MetadataEntry -> MetadataEntry -> Bool) -> Eq MetadataEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetadataEntry -> MetadataEntry -> Bool
$c/= :: MetadataEntry -> MetadataEntry -> Bool
== :: MetadataEntry -> MetadataEntry -> Bool
$c== :: MetadataEntry -> MetadataEntry -> Bool
Prelude.Eq, ReadPrec [MetadataEntry]
ReadPrec MetadataEntry
Int -> ReadS MetadataEntry
ReadS [MetadataEntry]
(Int -> ReadS MetadataEntry)
-> ReadS [MetadataEntry]
-> ReadPrec MetadataEntry
-> ReadPrec [MetadataEntry]
-> Read MetadataEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetadataEntry]
$creadListPrec :: ReadPrec [MetadataEntry]
readPrec :: ReadPrec MetadataEntry
$creadPrec :: ReadPrec MetadataEntry
readList :: ReadS [MetadataEntry]
$creadList :: ReadS [MetadataEntry]
readsPrec :: Int -> ReadS MetadataEntry
$creadsPrec :: Int -> ReadS MetadataEntry
Prelude.Read, Int -> MetadataEntry -> ShowS
[MetadataEntry] -> ShowS
MetadataEntry -> String
(Int -> MetadataEntry -> ShowS)
-> (MetadataEntry -> String)
-> ([MetadataEntry] -> ShowS)
-> Show MetadataEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetadataEntry] -> ShowS
$cshowList :: [MetadataEntry] -> ShowS
show :: MetadataEntry -> String
$cshow :: MetadataEntry -> String
showsPrec :: Int -> MetadataEntry -> ShowS
$cshowsPrec :: Int -> MetadataEntry -> ShowS
Prelude.Show, (forall x. MetadataEntry -> Rep MetadataEntry x)
-> (forall x. Rep MetadataEntry x -> MetadataEntry)
-> Generic MetadataEntry
forall x. Rep MetadataEntry x -> MetadataEntry
forall x. MetadataEntry -> Rep MetadataEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetadataEntry x -> MetadataEntry
$cfrom :: forall x. MetadataEntry -> Rep MetadataEntry x
Prelude.Generic)
newMetadataEntry ::
MetadataEntry
newMetadataEntry :: MetadataEntry
newMetadataEntry =
MetadataEntry' :: Maybe Text -> Maybe Text -> MetadataEntry
MetadataEntry'
{ $sel:value:MetadataEntry' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:MetadataEntry' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
metadataEntry_value :: Lens.Lens' MetadataEntry (Prelude.Maybe Prelude.Text)
metadataEntry_value :: (Maybe Text -> f (Maybe Text)) -> MetadataEntry -> f MetadataEntry
metadataEntry_value = (MetadataEntry -> Maybe Text)
-> (MetadataEntry -> Maybe Text -> MetadataEntry)
-> Lens MetadataEntry MetadataEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataEntry' {Maybe Text
value :: Maybe Text
$sel:value:MetadataEntry' :: MetadataEntry -> Maybe Text
value} -> Maybe Text
value) (\s :: MetadataEntry
s@MetadataEntry' {} Maybe Text
a -> MetadataEntry
s {$sel:value:MetadataEntry' :: Maybe Text
value = Maybe Text
a} :: MetadataEntry)
metadataEntry_name :: Lens.Lens' MetadataEntry (Prelude.Maybe Prelude.Text)
metadataEntry_name :: (Maybe Text -> f (Maybe Text)) -> MetadataEntry -> f MetadataEntry
metadataEntry_name = (MetadataEntry -> Maybe Text)
-> (MetadataEntry -> Maybe Text -> MetadataEntry)
-> Lens MetadataEntry MetadataEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataEntry' {Maybe Text
name :: Maybe Text
$sel:name:MetadataEntry' :: MetadataEntry -> Maybe Text
name} -> Maybe Text
name) (\s :: MetadataEntry
s@MetadataEntry' {} Maybe Text
a -> MetadataEntry
s {$sel:name:MetadataEntry' :: Maybe Text
name = Maybe Text
a} :: MetadataEntry)
instance Prelude.Hashable MetadataEntry
instance Prelude.NFData MetadataEntry
instance Core.ToXML MetadataEntry where
toXML :: MetadataEntry -> XML
toXML MetadataEntry' {Maybe Text
name :: Maybe Text
value :: Maybe Text
$sel:name:MetadataEntry' :: MetadataEntry -> Maybe Text
$sel:value:MetadataEntry' :: MetadataEntry -> Maybe Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"Value" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
value, Name
"Name" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
name]