{-# 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.DirectoryService.Types.EventTopic where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types.TopicStatus
import qualified Amazonka.Prelude as Prelude
data EventTopic = EventTopic'
{
EventTopic -> Maybe POSIX
createdDateTime :: Prelude.Maybe Data.POSIX,
EventTopic -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
EventTopic -> Maybe TopicStatus
status :: Prelude.Maybe TopicStatus,
EventTopic -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
EventTopic -> Maybe Text
topicName :: Prelude.Maybe Prelude.Text
}
deriving (EventTopic -> EventTopic -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventTopic -> EventTopic -> Bool
$c/= :: EventTopic -> EventTopic -> Bool
== :: EventTopic -> EventTopic -> Bool
$c== :: EventTopic -> EventTopic -> Bool
Prelude.Eq, ReadPrec [EventTopic]
ReadPrec EventTopic
Int -> ReadS EventTopic
ReadS [EventTopic]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventTopic]
$creadListPrec :: ReadPrec [EventTopic]
readPrec :: ReadPrec EventTopic
$creadPrec :: ReadPrec EventTopic
readList :: ReadS [EventTopic]
$creadList :: ReadS [EventTopic]
readsPrec :: Int -> ReadS EventTopic
$creadsPrec :: Int -> ReadS EventTopic
Prelude.Read, Int -> EventTopic -> ShowS
[EventTopic] -> ShowS
EventTopic -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventTopic] -> ShowS
$cshowList :: [EventTopic] -> ShowS
show :: EventTopic -> String
$cshow :: EventTopic -> String
showsPrec :: Int -> EventTopic -> ShowS
$cshowsPrec :: Int -> EventTopic -> ShowS
Prelude.Show, forall x. Rep EventTopic x -> EventTopic
forall x. EventTopic -> Rep EventTopic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventTopic x -> EventTopic
$cfrom :: forall x. EventTopic -> Rep EventTopic x
Prelude.Generic)
newEventTopic ::
EventTopic
newEventTopic :: EventTopic
newEventTopic =
EventTopic'
{ $sel:createdDateTime:EventTopic' :: Maybe POSIX
createdDateTime = forall a. Maybe a
Prelude.Nothing,
$sel:directoryId:EventTopic' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
$sel:status:EventTopic' :: Maybe TopicStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:topicArn:EventTopic' :: Maybe Text
topicArn = forall a. Maybe a
Prelude.Nothing,
$sel:topicName:EventTopic' :: Maybe Text
topicName = forall a. Maybe a
Prelude.Nothing
}
eventTopic_createdDateTime :: Lens.Lens' EventTopic (Prelude.Maybe Prelude.UTCTime)
eventTopic_createdDateTime :: Lens' EventTopic (Maybe UTCTime)
eventTopic_createdDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTopic' {Maybe POSIX
createdDateTime :: Maybe POSIX
$sel:createdDateTime:EventTopic' :: EventTopic -> Maybe POSIX
createdDateTime} -> Maybe POSIX
createdDateTime) (\s :: EventTopic
s@EventTopic' {} Maybe POSIX
a -> EventTopic
s {$sel:createdDateTime:EventTopic' :: Maybe POSIX
createdDateTime = Maybe POSIX
a} :: EventTopic) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
eventTopic_directoryId :: Lens.Lens' EventTopic (Prelude.Maybe Prelude.Text)
eventTopic_directoryId :: Lens' EventTopic (Maybe Text)
eventTopic_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTopic' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:EventTopic' :: EventTopic -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: EventTopic
s@EventTopic' {} Maybe Text
a -> EventTopic
s {$sel:directoryId:EventTopic' :: Maybe Text
directoryId = Maybe Text
a} :: EventTopic)
eventTopic_status :: Lens.Lens' EventTopic (Prelude.Maybe TopicStatus)
eventTopic_status :: Lens' EventTopic (Maybe TopicStatus)
eventTopic_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTopic' {Maybe TopicStatus
status :: Maybe TopicStatus
$sel:status:EventTopic' :: EventTopic -> Maybe TopicStatus
status} -> Maybe TopicStatus
status) (\s :: EventTopic
s@EventTopic' {} Maybe TopicStatus
a -> EventTopic
s {$sel:status:EventTopic' :: Maybe TopicStatus
status = Maybe TopicStatus
a} :: EventTopic)
eventTopic_topicArn :: Lens.Lens' EventTopic (Prelude.Maybe Prelude.Text)
eventTopic_topicArn :: Lens' EventTopic (Maybe Text)
eventTopic_topicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTopic' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:EventTopic' :: EventTopic -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: EventTopic
s@EventTopic' {} Maybe Text
a -> EventTopic
s {$sel:topicArn:EventTopic' :: Maybe Text
topicArn = Maybe Text
a} :: EventTopic)
eventTopic_topicName :: Lens.Lens' EventTopic (Prelude.Maybe Prelude.Text)
eventTopic_topicName :: Lens' EventTopic (Maybe Text)
eventTopic_topicName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTopic' {Maybe Text
topicName :: Maybe Text
$sel:topicName:EventTopic' :: EventTopic -> Maybe Text
topicName} -> Maybe Text
topicName) (\s :: EventTopic
s@EventTopic' {} Maybe Text
a -> EventTopic
s {$sel:topicName:EventTopic' :: Maybe Text
topicName = Maybe Text
a} :: EventTopic)
instance Data.FromJSON EventTopic where
parseJSON :: Value -> Parser EventTopic
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EventTopic"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe TopicStatus
-> Maybe Text
-> Maybe Text
-> EventTopic
EventTopic'
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
"CreatedDateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DirectoryId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TopicName")
)
instance Prelude.Hashable EventTopic where
hashWithSalt :: Int -> EventTopic -> Int
hashWithSalt Int
_salt EventTopic' {Maybe Text
Maybe POSIX
Maybe TopicStatus
topicName :: Maybe Text
topicArn :: Maybe Text
status :: Maybe TopicStatus
directoryId :: Maybe Text
createdDateTime :: Maybe POSIX
$sel:topicName:EventTopic' :: EventTopic -> Maybe Text
$sel:topicArn:EventTopic' :: EventTopic -> Maybe Text
$sel:status:EventTopic' :: EventTopic -> Maybe TopicStatus
$sel:directoryId:EventTopic' :: EventTopic -> Maybe Text
$sel:createdDateTime:EventTopic' :: EventTopic -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TopicStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicName
instance Prelude.NFData EventTopic where
rnf :: EventTopic -> ()
rnf EventTopic' {Maybe Text
Maybe POSIX
Maybe TopicStatus
topicName :: Maybe Text
topicArn :: Maybe Text
status :: Maybe TopicStatus
directoryId :: Maybe Text
createdDateTime :: Maybe POSIX
$sel:topicName:EventTopic' :: EventTopic -> Maybe Text
$sel:topicArn:EventTopic' :: EventTopic -> Maybe Text
$sel:status:EventTopic' :: EventTopic -> Maybe TopicStatus
$sel:directoryId:EventTopic' :: EventTopic -> Maybe Text
$sel:createdDateTime:EventTopic' :: EventTopic -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TopicStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicName