{-# 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.SES.Types.ReceiptRuleSetMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReceiptRuleSetMetadata = ReceiptRuleSetMetadata'
{
ReceiptRuleSetMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ReceiptRuleSetMetadata -> Maybe ISO8601
createdTimestamp :: Prelude.Maybe Core.ISO8601
}
deriving (ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool
(ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool)
-> (ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool)
-> Eq ReceiptRuleSetMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool
$c/= :: ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool
== :: ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool
$c== :: ReceiptRuleSetMetadata -> ReceiptRuleSetMetadata -> Bool
Prelude.Eq, ReadPrec [ReceiptRuleSetMetadata]
ReadPrec ReceiptRuleSetMetadata
Int -> ReadS ReceiptRuleSetMetadata
ReadS [ReceiptRuleSetMetadata]
(Int -> ReadS ReceiptRuleSetMetadata)
-> ReadS [ReceiptRuleSetMetadata]
-> ReadPrec ReceiptRuleSetMetadata
-> ReadPrec [ReceiptRuleSetMetadata]
-> Read ReceiptRuleSetMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReceiptRuleSetMetadata]
$creadListPrec :: ReadPrec [ReceiptRuleSetMetadata]
readPrec :: ReadPrec ReceiptRuleSetMetadata
$creadPrec :: ReadPrec ReceiptRuleSetMetadata
readList :: ReadS [ReceiptRuleSetMetadata]
$creadList :: ReadS [ReceiptRuleSetMetadata]
readsPrec :: Int -> ReadS ReceiptRuleSetMetadata
$creadsPrec :: Int -> ReadS ReceiptRuleSetMetadata
Prelude.Read, Int -> ReceiptRuleSetMetadata -> ShowS
[ReceiptRuleSetMetadata] -> ShowS
ReceiptRuleSetMetadata -> String
(Int -> ReceiptRuleSetMetadata -> ShowS)
-> (ReceiptRuleSetMetadata -> String)
-> ([ReceiptRuleSetMetadata] -> ShowS)
-> Show ReceiptRuleSetMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReceiptRuleSetMetadata] -> ShowS
$cshowList :: [ReceiptRuleSetMetadata] -> ShowS
show :: ReceiptRuleSetMetadata -> String
$cshow :: ReceiptRuleSetMetadata -> String
showsPrec :: Int -> ReceiptRuleSetMetadata -> ShowS
$cshowsPrec :: Int -> ReceiptRuleSetMetadata -> ShowS
Prelude.Show, (forall x. ReceiptRuleSetMetadata -> Rep ReceiptRuleSetMetadata x)
-> (forall x.
Rep ReceiptRuleSetMetadata x -> ReceiptRuleSetMetadata)
-> Generic ReceiptRuleSetMetadata
forall x. Rep ReceiptRuleSetMetadata x -> ReceiptRuleSetMetadata
forall x. ReceiptRuleSetMetadata -> Rep ReceiptRuleSetMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReceiptRuleSetMetadata x -> ReceiptRuleSetMetadata
$cfrom :: forall x. ReceiptRuleSetMetadata -> Rep ReceiptRuleSetMetadata x
Prelude.Generic)
newReceiptRuleSetMetadata ::
ReceiptRuleSetMetadata
newReceiptRuleSetMetadata :: ReceiptRuleSetMetadata
newReceiptRuleSetMetadata =
ReceiptRuleSetMetadata' :: Maybe Text -> Maybe ISO8601 -> ReceiptRuleSetMetadata
ReceiptRuleSetMetadata'
{ $sel:name:ReceiptRuleSetMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:ReceiptRuleSetMetadata' :: Maybe ISO8601
createdTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
}
receiptRuleSetMetadata_name :: Lens.Lens' ReceiptRuleSetMetadata (Prelude.Maybe Prelude.Text)
receiptRuleSetMetadata_name :: (Maybe Text -> f (Maybe Text))
-> ReceiptRuleSetMetadata -> f ReceiptRuleSetMetadata
receiptRuleSetMetadata_name = (ReceiptRuleSetMetadata -> Maybe Text)
-> (ReceiptRuleSetMetadata -> Maybe Text -> ReceiptRuleSetMetadata)
-> Lens
ReceiptRuleSetMetadata
ReceiptRuleSetMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRuleSetMetadata' {Maybe Text
name :: Maybe Text
$sel:name:ReceiptRuleSetMetadata' :: ReceiptRuleSetMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: ReceiptRuleSetMetadata
s@ReceiptRuleSetMetadata' {} Maybe Text
a -> ReceiptRuleSetMetadata
s {$sel:name:ReceiptRuleSetMetadata' :: Maybe Text
name = Maybe Text
a} :: ReceiptRuleSetMetadata)
receiptRuleSetMetadata_createdTimestamp :: Lens.Lens' ReceiptRuleSetMetadata (Prelude.Maybe Prelude.UTCTime)
receiptRuleSetMetadata_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReceiptRuleSetMetadata -> f ReceiptRuleSetMetadata
receiptRuleSetMetadata_createdTimestamp = (ReceiptRuleSetMetadata -> Maybe ISO8601)
-> (ReceiptRuleSetMetadata
-> Maybe ISO8601 -> ReceiptRuleSetMetadata)
-> Lens
ReceiptRuleSetMetadata
ReceiptRuleSetMetadata
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRuleSetMetadata' {Maybe ISO8601
createdTimestamp :: Maybe ISO8601
$sel:createdTimestamp:ReceiptRuleSetMetadata' :: ReceiptRuleSetMetadata -> Maybe ISO8601
createdTimestamp} -> Maybe ISO8601
createdTimestamp) (\s :: ReceiptRuleSetMetadata
s@ReceiptRuleSetMetadata' {} Maybe ISO8601
a -> ReceiptRuleSetMetadata
s {$sel:createdTimestamp:ReceiptRuleSetMetadata' :: Maybe ISO8601
createdTimestamp = Maybe ISO8601
a} :: ReceiptRuleSetMetadata) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ReceiptRuleSetMetadata -> f ReceiptRuleSetMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReceiptRuleSetMetadata
-> f ReceiptRuleSetMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromXML ReceiptRuleSetMetadata where
parseXML :: [Node] -> Either String ReceiptRuleSetMetadata
parseXML [Node]
x =
Maybe Text -> Maybe ISO8601 -> ReceiptRuleSetMetadata
ReceiptRuleSetMetadata'
(Maybe Text -> Maybe ISO8601 -> ReceiptRuleSetMetadata)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> ReceiptRuleSetMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Name")
Either String (Maybe ISO8601 -> ReceiptRuleSetMetadata)
-> Either String (Maybe ISO8601)
-> Either String ReceiptRuleSetMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CreatedTimestamp")
instance Prelude.Hashable ReceiptRuleSetMetadata
instance Prelude.NFData ReceiptRuleSetMetadata