{-# 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.AuditManager.Types.Notification where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Notification = Notification'
{
Notification -> Maybe Text
controlSetName :: Prelude.Maybe Prelude.Text,
Notification -> Maybe Text
controlSetId :: Prelude.Maybe Prelude.Text,
Notification -> Maybe POSIX
eventTime :: Prelude.Maybe Core.POSIX,
Notification -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
Notification -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Notification -> Maybe Text
assessmentId :: Prelude.Maybe Prelude.Text,
Notification -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Notification -> Maybe Text
assessmentName :: Prelude.Maybe Prelude.Text
}
deriving (Notification -> Notification -> Bool
(Notification -> Notification -> Bool)
-> (Notification -> Notification -> Bool) -> Eq Notification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Notification -> Notification -> Bool
$c/= :: Notification -> Notification -> Bool
== :: Notification -> Notification -> Bool
$c== :: Notification -> Notification -> Bool
Prelude.Eq, ReadPrec [Notification]
ReadPrec Notification
Int -> ReadS Notification
ReadS [Notification]
(Int -> ReadS Notification)
-> ReadS [Notification]
-> ReadPrec Notification
-> ReadPrec [Notification]
-> Read Notification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Notification]
$creadListPrec :: ReadPrec [Notification]
readPrec :: ReadPrec Notification
$creadPrec :: ReadPrec Notification
readList :: ReadS [Notification]
$creadList :: ReadS [Notification]
readsPrec :: Int -> ReadS Notification
$creadsPrec :: Int -> ReadS Notification
Prelude.Read, Int -> Notification -> ShowS
[Notification] -> ShowS
Notification -> String
(Int -> Notification -> ShowS)
-> (Notification -> String)
-> ([Notification] -> ShowS)
-> Show Notification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Notification] -> ShowS
$cshowList :: [Notification] -> ShowS
show :: Notification -> String
$cshow :: Notification -> String
showsPrec :: Int -> Notification -> ShowS
$cshowsPrec :: Int -> Notification -> ShowS
Prelude.Show, (forall x. Notification -> Rep Notification x)
-> (forall x. Rep Notification x -> Notification)
-> Generic Notification
forall x. Rep Notification x -> Notification
forall x. Notification -> Rep Notification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Notification x -> Notification
$cfrom :: forall x. Notification -> Rep Notification x
Prelude.Generic)
newNotification ::
Notification
newNotification :: Notification
newNotification =
Notification' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification
Notification'
{ $sel:controlSetName:Notification' :: Maybe Text
controlSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:controlSetId:Notification' :: Maybe Text
controlSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventTime:Notification' :: Maybe POSIX
eventTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:source:Notification' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Notification' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assessmentId:Notification' :: Maybe Text
assessmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Notification' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assessmentName:Notification' :: Maybe Text
assessmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notification_controlSetName :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_controlSetName :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_controlSetName = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
controlSetName :: Maybe Text
$sel:controlSetName:Notification' :: Notification -> Maybe Text
controlSetName} -> Maybe Text
controlSetName) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:controlSetName:Notification' :: Maybe Text
controlSetName = Maybe Text
a} :: Notification)
notification_controlSetId :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_controlSetId :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_controlSetId = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
controlSetId :: Maybe Text
$sel:controlSetId:Notification' :: Notification -> Maybe Text
controlSetId} -> Maybe Text
controlSetId) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:controlSetId:Notification' :: Maybe Text
controlSetId = Maybe Text
a} :: Notification)
notification_eventTime :: Lens.Lens' Notification (Prelude.Maybe Prelude.UTCTime)
notification_eventTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Notification -> f Notification
notification_eventTime = (Notification -> Maybe POSIX)
-> (Notification -> Maybe POSIX -> Notification)
-> Lens Notification Notification (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe POSIX
eventTime :: Maybe POSIX
$sel:eventTime:Notification' :: Notification -> Maybe POSIX
eventTime} -> Maybe POSIX
eventTime) (\s :: Notification
s@Notification' {} Maybe POSIX
a -> Notification
s {$sel:eventTime:Notification' :: Maybe POSIX
eventTime = Maybe POSIX
a} :: Notification) ((Maybe POSIX -> f (Maybe POSIX))
-> Notification -> f Notification)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Notification
-> f Notification
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
notification_source :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_source :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_source = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
source :: Maybe Text
$sel:source:Notification' :: Notification -> Maybe Text
source} -> Maybe Text
source) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:source:Notification' :: Maybe Text
source = Maybe Text
a} :: Notification)
notification_id :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_id :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_id = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
id :: Maybe Text
$sel:id:Notification' :: Notification -> Maybe Text
id} -> Maybe Text
id) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:id:Notification' :: Maybe Text
id = Maybe Text
a} :: Notification)
notification_assessmentId :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_assessmentId :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_assessmentId = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
assessmentId :: Maybe Text
$sel:assessmentId:Notification' :: Notification -> Maybe Text
assessmentId} -> Maybe Text
assessmentId) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:assessmentId:Notification' :: Maybe Text
assessmentId = Maybe Text
a} :: Notification)
notification_description :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_description :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_description = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
description :: Maybe Text
$sel:description:Notification' :: Notification -> Maybe Text
description} -> Maybe Text
description) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:description:Notification' :: Maybe Text
description = Maybe Text
a} :: Notification)
notification_assessmentName :: Lens.Lens' Notification (Prelude.Maybe Prelude.Text)
notification_assessmentName :: (Maybe Text -> f (Maybe Text)) -> Notification -> f Notification
notification_assessmentName = (Notification -> Maybe Text)
-> (Notification -> Maybe Text -> Notification)
-> Lens Notification Notification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Notification' {Maybe Text
assessmentName :: Maybe Text
$sel:assessmentName:Notification' :: Notification -> Maybe Text
assessmentName} -> Maybe Text
assessmentName) (\s :: Notification
s@Notification' {} Maybe Text
a -> Notification
s {$sel:assessmentName:Notification' :: Maybe Text
assessmentName = Maybe Text
a} :: Notification)
instance Core.FromJSON Notification where
parseJSON :: Value -> Parser Notification
parseJSON =
String
-> (Object -> Parser Notification) -> Value -> Parser Notification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Notification"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification
Notification'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
forall (f :: * -> *) a b. Functor 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
"controlSetName")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
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
"controlSetId")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
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
"eventTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Notification)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Notification)
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
"source")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Notification)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Notification)
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
"id")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Notification)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Notification)
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
"assessmentId")
Parser (Maybe Text -> Maybe Text -> Notification)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Notification)
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
"description")
Parser (Maybe Text -> Notification)
-> Parser (Maybe Text) -> Parser Notification
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
"assessmentName")
)
instance Prelude.Hashable Notification
instance Prelude.NFData Notification