{-# 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.SSMContacts.Types.Page where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Page = Page'
{
Page -> Maybe POSIX
readTime :: Prelude.Maybe Core.POSIX,
Page -> Maybe POSIX
deliveryTime :: Prelude.Maybe Core.POSIX,
Page -> Maybe Text
incidentId :: Prelude.Maybe Prelude.Text,
Page -> Maybe POSIX
sentTime :: Prelude.Maybe Core.POSIX,
Page -> Text
pageArn :: Prelude.Text,
Page -> Text
engagementArn :: Prelude.Text,
Page -> Text
contactArn :: Prelude.Text,
Page -> Text
sender :: Prelude.Text
}
deriving (Page -> Page -> Bool
(Page -> Page -> Bool) -> (Page -> Page -> Bool) -> Eq Page
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Page -> Page -> Bool
$c/= :: Page -> Page -> Bool
== :: Page -> Page -> Bool
$c== :: Page -> Page -> Bool
Prelude.Eq, ReadPrec [Page]
ReadPrec Page
Int -> ReadS Page
ReadS [Page]
(Int -> ReadS Page)
-> ReadS [Page] -> ReadPrec Page -> ReadPrec [Page] -> Read Page
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Page]
$creadListPrec :: ReadPrec [Page]
readPrec :: ReadPrec Page
$creadPrec :: ReadPrec Page
readList :: ReadS [Page]
$creadList :: ReadS [Page]
readsPrec :: Int -> ReadS Page
$creadsPrec :: Int -> ReadS Page
Prelude.Read, Int -> Page -> ShowS
[Page] -> ShowS
Page -> String
(Int -> Page -> ShowS)
-> (Page -> String) -> ([Page] -> ShowS) -> Show Page
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Page] -> ShowS
$cshowList :: [Page] -> ShowS
show :: Page -> String
$cshow :: Page -> String
showsPrec :: Int -> Page -> ShowS
$cshowsPrec :: Int -> Page -> ShowS
Prelude.Show, (forall x. Page -> Rep Page x)
-> (forall x. Rep Page x -> Page) -> Generic Page
forall x. Rep Page x -> Page
forall x. Page -> Rep Page x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Page x -> Page
$cfrom :: forall x. Page -> Rep Page x
Prelude.Generic)
newPage ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Page
newPage :: Text -> Text -> Text -> Text -> Page
newPage
Text
pPageArn_
Text
pEngagementArn_
Text
pContactArn_
Text
pSender_ =
Page' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> Page
Page'
{ $sel:readTime:Page' :: Maybe POSIX
readTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryTime:Page' :: Maybe POSIX
deliveryTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:incidentId:Page' :: Maybe Text
incidentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sentTime:Page' :: Maybe POSIX
sentTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:pageArn:Page' :: Text
pageArn = Text
pPageArn_,
$sel:engagementArn:Page' :: Text
engagementArn = Text
pEngagementArn_,
$sel:contactArn:Page' :: Text
contactArn = Text
pContactArn_,
$sel:sender:Page' :: Text
sender = Text
pSender_
}
page_readTime :: Lens.Lens' Page (Prelude.Maybe Prelude.UTCTime)
page_readTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Page -> f Page
page_readTime = (Page -> Maybe POSIX)
-> (Page -> Maybe POSIX -> Page)
-> Lens Page Page (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Maybe POSIX
readTime :: Maybe POSIX
$sel:readTime:Page' :: Page -> Maybe POSIX
readTime} -> Maybe POSIX
readTime) (\s :: Page
s@Page' {} Maybe POSIX
a -> Page
s {$sel:readTime:Page' :: Maybe POSIX
readTime = Maybe POSIX
a} :: Page) ((Maybe POSIX -> f (Maybe POSIX)) -> Page -> f Page)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Page
-> f Page
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
page_deliveryTime :: Lens.Lens' Page (Prelude.Maybe Prelude.UTCTime)
page_deliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Page -> f Page
page_deliveryTime = (Page -> Maybe POSIX)
-> (Page -> Maybe POSIX -> Page)
-> Lens Page Page (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Maybe POSIX
deliveryTime :: Maybe POSIX
$sel:deliveryTime:Page' :: Page -> Maybe POSIX
deliveryTime} -> Maybe POSIX
deliveryTime) (\s :: Page
s@Page' {} Maybe POSIX
a -> Page
s {$sel:deliveryTime:Page' :: Maybe POSIX
deliveryTime = Maybe POSIX
a} :: Page) ((Maybe POSIX -> f (Maybe POSIX)) -> Page -> f Page)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Page
-> f Page
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
page_incidentId :: Lens.Lens' Page (Prelude.Maybe Prelude.Text)
page_incidentId :: (Maybe Text -> f (Maybe Text)) -> Page -> f Page
page_incidentId = (Page -> Maybe Text)
-> (Page -> Maybe Text -> Page)
-> Lens Page Page (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Maybe Text
incidentId :: Maybe Text
$sel:incidentId:Page' :: Page -> Maybe Text
incidentId} -> Maybe Text
incidentId) (\s :: Page
s@Page' {} Maybe Text
a -> Page
s {$sel:incidentId:Page' :: Maybe Text
incidentId = Maybe Text
a} :: Page)
page_sentTime :: Lens.Lens' Page (Prelude.Maybe Prelude.UTCTime)
page_sentTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Page -> f Page
page_sentTime = (Page -> Maybe POSIX)
-> (Page -> Maybe POSIX -> Page)
-> Lens Page Page (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Maybe POSIX
sentTime :: Maybe POSIX
$sel:sentTime:Page' :: Page -> Maybe POSIX
sentTime} -> Maybe POSIX
sentTime) (\s :: Page
s@Page' {} Maybe POSIX
a -> Page
s {$sel:sentTime:Page' :: Maybe POSIX
sentTime = Maybe POSIX
a} :: Page) ((Maybe POSIX -> f (Maybe POSIX)) -> Page -> f Page)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Page
-> f Page
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
page_pageArn :: Lens.Lens' Page Prelude.Text
page_pageArn :: (Text -> f Text) -> Page -> f Page
page_pageArn = (Page -> Text)
-> (Page -> Text -> Page) -> Lens Page Page Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Text
pageArn :: Text
$sel:pageArn:Page' :: Page -> Text
pageArn} -> Text
pageArn) (\s :: Page
s@Page' {} Text
a -> Page
s {$sel:pageArn:Page' :: Text
pageArn = Text
a} :: Page)
page_engagementArn :: Lens.Lens' Page Prelude.Text
page_engagementArn :: (Text -> f Text) -> Page -> f Page
page_engagementArn = (Page -> Text)
-> (Page -> Text -> Page) -> Lens Page Page Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Text
engagementArn :: Text
$sel:engagementArn:Page' :: Page -> Text
engagementArn} -> Text
engagementArn) (\s :: Page
s@Page' {} Text
a -> Page
s {$sel:engagementArn:Page' :: Text
engagementArn = Text
a} :: Page)
page_contactArn :: Lens.Lens' Page Prelude.Text
page_contactArn :: (Text -> f Text) -> Page -> f Page
page_contactArn = (Page -> Text)
-> (Page -> Text -> Page) -> Lens Page Page Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Text
contactArn :: Text
$sel:contactArn:Page' :: Page -> Text
contactArn} -> Text
contactArn) (\s :: Page
s@Page' {} Text
a -> Page
s {$sel:contactArn:Page' :: Text
contactArn = Text
a} :: Page)
page_sender :: Lens.Lens' Page Prelude.Text
page_sender :: (Text -> f Text) -> Page -> f Page
page_sender = (Page -> Text)
-> (Page -> Text -> Page) -> Lens Page Page Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Page' {Text
sender :: Text
$sel:sender:Page' :: Page -> Text
sender} -> Text
sender) (\s :: Page
s@Page' {} Text
a -> Page
s {$sel:sender:Page' :: Text
sender = Text
a} :: Page)
instance Core.FromJSON Page where
parseJSON :: Value -> Parser Page
parseJSON =
String -> (Object -> Parser Page) -> Value -> Parser Page
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Page"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> Page
Page'
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> Page)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> Page)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReadTime")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> Page)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe POSIX -> Text -> Text -> Text -> Text -> Page)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeliveryTime")
Parser
(Maybe Text -> Maybe POSIX -> Text -> Text -> Text -> Text -> Page)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Text -> Text -> Text -> Text -> Page)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncidentId")
Parser (Maybe POSIX -> Text -> Text -> Text -> Text -> Page)
-> Parser (Maybe POSIX)
-> Parser (Text -> Text -> Text -> Text -> Page)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SentTime")
Parser (Text -> Text -> Text -> Text -> Page)
-> Parser Text -> Parser (Text -> Text -> Text -> Page)
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
"PageArn")
Parser (Text -> Text -> Text -> Page)
-> Parser Text -> Parser (Text -> Text -> Page)
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
"EngagementArn")
Parser (Text -> Text -> Page)
-> Parser Text -> Parser (Text -> Page)
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
"ContactArn")
Parser (Text -> Page) -> Parser Text -> Parser Page
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
"Sender")
)
instance Prelude.Hashable Page
instance Prelude.NFData Page