{-# 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.Inspector.Types.AssessmentRunNotification where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.AssessmentRunNotificationSnsStatusCode
import Amazonka.Inspector.Types.InspectorEvent
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssessmentRunNotification = AssessmentRunNotification'
{
AssessmentRunNotification -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
AssessmentRunNotification
-> Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode :: Prelude.Maybe AssessmentRunNotificationSnsStatusCode,
AssessmentRunNotification -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
AssessmentRunNotification -> POSIX
date :: Core.POSIX,
AssessmentRunNotification -> InspectorEvent
event :: InspectorEvent,
AssessmentRunNotification -> Bool
error :: Prelude.Bool
}
deriving (AssessmentRunNotification -> AssessmentRunNotification -> Bool
(AssessmentRunNotification -> AssessmentRunNotification -> Bool)
-> (AssessmentRunNotification -> AssessmentRunNotification -> Bool)
-> Eq AssessmentRunNotification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentRunNotification -> AssessmentRunNotification -> Bool
$c/= :: AssessmentRunNotification -> AssessmentRunNotification -> Bool
== :: AssessmentRunNotification -> AssessmentRunNotification -> Bool
$c== :: AssessmentRunNotification -> AssessmentRunNotification -> Bool
Prelude.Eq, ReadPrec [AssessmentRunNotification]
ReadPrec AssessmentRunNotification
Int -> ReadS AssessmentRunNotification
ReadS [AssessmentRunNotification]
(Int -> ReadS AssessmentRunNotification)
-> ReadS [AssessmentRunNotification]
-> ReadPrec AssessmentRunNotification
-> ReadPrec [AssessmentRunNotification]
-> Read AssessmentRunNotification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentRunNotification]
$creadListPrec :: ReadPrec [AssessmentRunNotification]
readPrec :: ReadPrec AssessmentRunNotification
$creadPrec :: ReadPrec AssessmentRunNotification
readList :: ReadS [AssessmentRunNotification]
$creadList :: ReadS [AssessmentRunNotification]
readsPrec :: Int -> ReadS AssessmentRunNotification
$creadsPrec :: Int -> ReadS AssessmentRunNotification
Prelude.Read, Int -> AssessmentRunNotification -> ShowS
[AssessmentRunNotification] -> ShowS
AssessmentRunNotification -> String
(Int -> AssessmentRunNotification -> ShowS)
-> (AssessmentRunNotification -> String)
-> ([AssessmentRunNotification] -> ShowS)
-> Show AssessmentRunNotification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentRunNotification] -> ShowS
$cshowList :: [AssessmentRunNotification] -> ShowS
show :: AssessmentRunNotification -> String
$cshow :: AssessmentRunNotification -> String
showsPrec :: Int -> AssessmentRunNotification -> ShowS
$cshowsPrec :: Int -> AssessmentRunNotification -> ShowS
Prelude.Show, (forall x.
AssessmentRunNotification -> Rep AssessmentRunNotification x)
-> (forall x.
Rep AssessmentRunNotification x -> AssessmentRunNotification)
-> Generic AssessmentRunNotification
forall x.
Rep AssessmentRunNotification x -> AssessmentRunNotification
forall x.
AssessmentRunNotification -> Rep AssessmentRunNotification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssessmentRunNotification x -> AssessmentRunNotification
$cfrom :: forall x.
AssessmentRunNotification -> Rep AssessmentRunNotification x
Prelude.Generic)
newAssessmentRunNotification ::
Prelude.UTCTime ->
InspectorEvent ->
Prelude.Bool ->
AssessmentRunNotification
newAssessmentRunNotification :: UTCTime -> InspectorEvent -> Bool -> AssessmentRunNotification
newAssessmentRunNotification UTCTime
pDate_ InspectorEvent
pEvent_ Bool
pError_ =
AssessmentRunNotification' :: Maybe Text
-> Maybe AssessmentRunNotificationSnsStatusCode
-> Maybe Text
-> POSIX
-> InspectorEvent
-> Bool
-> AssessmentRunNotification
AssessmentRunNotification'
{ $sel:snsTopicArn:AssessmentRunNotification' :: Maybe Text
snsTopicArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snsPublishStatusCode:AssessmentRunNotification' :: Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode = Maybe AssessmentRunNotificationSnsStatusCode
forall a. Maybe a
Prelude.Nothing,
$sel:message:AssessmentRunNotification' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:date:AssessmentRunNotification' :: POSIX
date = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pDate_,
$sel:event:AssessmentRunNotification' :: InspectorEvent
event = InspectorEvent
pEvent_,
$sel:error:AssessmentRunNotification' :: Bool
error = Bool
pError_
}
assessmentRunNotification_snsTopicArn :: Lens.Lens' AssessmentRunNotification (Prelude.Maybe Prelude.Text)
assessmentRunNotification_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_snsTopicArn = (AssessmentRunNotification -> Maybe Text)
-> (AssessmentRunNotification
-> Maybe Text -> AssessmentRunNotification)
-> Lens
AssessmentRunNotification
AssessmentRunNotification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:AssessmentRunNotification' :: AssessmentRunNotification -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} Maybe Text
a -> AssessmentRunNotification
s {$sel:snsTopicArn:AssessmentRunNotification' :: Maybe Text
snsTopicArn = Maybe Text
a} :: AssessmentRunNotification)
assessmentRunNotification_snsPublishStatusCode :: Lens.Lens' AssessmentRunNotification (Prelude.Maybe AssessmentRunNotificationSnsStatusCode)
assessmentRunNotification_snsPublishStatusCode :: (Maybe AssessmentRunNotificationSnsStatusCode
-> f (Maybe AssessmentRunNotificationSnsStatusCode))
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_snsPublishStatusCode = (AssessmentRunNotification
-> Maybe AssessmentRunNotificationSnsStatusCode)
-> (AssessmentRunNotification
-> Maybe AssessmentRunNotificationSnsStatusCode
-> AssessmentRunNotification)
-> Lens
AssessmentRunNotification
AssessmentRunNotification
(Maybe AssessmentRunNotificationSnsStatusCode)
(Maybe AssessmentRunNotificationSnsStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode :: Maybe AssessmentRunNotificationSnsStatusCode
$sel:snsPublishStatusCode:AssessmentRunNotification' :: AssessmentRunNotification
-> Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode} -> Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} Maybe AssessmentRunNotificationSnsStatusCode
a -> AssessmentRunNotification
s {$sel:snsPublishStatusCode:AssessmentRunNotification' :: Maybe AssessmentRunNotificationSnsStatusCode
snsPublishStatusCode = Maybe AssessmentRunNotificationSnsStatusCode
a} :: AssessmentRunNotification)
assessmentRunNotification_message :: Lens.Lens' AssessmentRunNotification (Prelude.Maybe Prelude.Text)
assessmentRunNotification_message :: (Maybe Text -> f (Maybe Text))
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_message = (AssessmentRunNotification -> Maybe Text)
-> (AssessmentRunNotification
-> Maybe Text -> AssessmentRunNotification)
-> Lens
AssessmentRunNotification
AssessmentRunNotification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {Maybe Text
message :: Maybe Text
$sel:message:AssessmentRunNotification' :: AssessmentRunNotification -> Maybe Text
message} -> Maybe Text
message) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} Maybe Text
a -> AssessmentRunNotification
s {$sel:message:AssessmentRunNotification' :: Maybe Text
message = Maybe Text
a} :: AssessmentRunNotification)
assessmentRunNotification_date :: Lens.Lens' AssessmentRunNotification Prelude.UTCTime
assessmentRunNotification_date :: (UTCTime -> f UTCTime)
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_date = (AssessmentRunNotification -> POSIX)
-> (AssessmentRunNotification
-> POSIX -> AssessmentRunNotification)
-> Lens
AssessmentRunNotification AssessmentRunNotification POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {POSIX
date :: POSIX
$sel:date:AssessmentRunNotification' :: AssessmentRunNotification -> POSIX
date} -> POSIX
date) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} POSIX
a -> AssessmentRunNotification
s {$sel:date:AssessmentRunNotification' :: POSIX
date = POSIX
a} :: AssessmentRunNotification) ((POSIX -> f POSIX)
-> AssessmentRunNotification -> f AssessmentRunNotification)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentRunNotification
-> f AssessmentRunNotification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentRunNotification_event :: Lens.Lens' AssessmentRunNotification InspectorEvent
assessmentRunNotification_event :: (InspectorEvent -> f InspectorEvent)
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_event = (AssessmentRunNotification -> InspectorEvent)
-> (AssessmentRunNotification
-> InspectorEvent -> AssessmentRunNotification)
-> Lens
AssessmentRunNotification
AssessmentRunNotification
InspectorEvent
InspectorEvent
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {InspectorEvent
event :: InspectorEvent
$sel:event:AssessmentRunNotification' :: AssessmentRunNotification -> InspectorEvent
event} -> InspectorEvent
event) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} InspectorEvent
a -> AssessmentRunNotification
s {$sel:event:AssessmentRunNotification' :: InspectorEvent
event = InspectorEvent
a} :: AssessmentRunNotification)
assessmentRunNotification_error :: Lens.Lens' AssessmentRunNotification Prelude.Bool
assessmentRunNotification_error :: (Bool -> f Bool)
-> AssessmentRunNotification -> f AssessmentRunNotification
assessmentRunNotification_error = (AssessmentRunNotification -> Bool)
-> (AssessmentRunNotification -> Bool -> AssessmentRunNotification)
-> Lens
AssessmentRunNotification AssessmentRunNotification Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunNotification' {Bool
error :: Bool
$sel:error:AssessmentRunNotification' :: AssessmentRunNotification -> Bool
error} -> Bool
error) (\s :: AssessmentRunNotification
s@AssessmentRunNotification' {} Bool
a -> AssessmentRunNotification
s {$sel:error:AssessmentRunNotification' :: Bool
error = Bool
a} :: AssessmentRunNotification)
instance Core.FromJSON AssessmentRunNotification where
parseJSON :: Value -> Parser AssessmentRunNotification
parseJSON =
String
-> (Object -> Parser AssessmentRunNotification)
-> Value
-> Parser AssessmentRunNotification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssessmentRunNotification"
( \Object
x ->
Maybe Text
-> Maybe AssessmentRunNotificationSnsStatusCode
-> Maybe Text
-> POSIX
-> InspectorEvent
-> Bool
-> AssessmentRunNotification
AssessmentRunNotification'
(Maybe Text
-> Maybe AssessmentRunNotificationSnsStatusCode
-> Maybe Text
-> POSIX
-> InspectorEvent
-> Bool
-> AssessmentRunNotification)
-> Parser (Maybe Text)
-> Parser
(Maybe AssessmentRunNotificationSnsStatusCode
-> Maybe Text
-> POSIX
-> InspectorEvent
-> Bool
-> AssessmentRunNotification)
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
"snsTopicArn")
Parser
(Maybe AssessmentRunNotificationSnsStatusCode
-> Maybe Text
-> POSIX
-> InspectorEvent
-> Bool
-> AssessmentRunNotification)
-> Parser (Maybe AssessmentRunNotificationSnsStatusCode)
-> Parser
(Maybe Text
-> POSIX -> InspectorEvent -> Bool -> AssessmentRunNotification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe AssessmentRunNotificationSnsStatusCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"snsPublishStatusCode")
Parser
(Maybe Text
-> POSIX -> InspectorEvent -> Bool -> AssessmentRunNotification)
-> Parser (Maybe Text)
-> Parser
(POSIX -> InspectorEvent -> Bool -> AssessmentRunNotification)
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
"message")
Parser
(POSIX -> InspectorEvent -> Bool -> AssessmentRunNotification)
-> Parser POSIX
-> Parser (InspectorEvent -> Bool -> AssessmentRunNotification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"date")
Parser (InspectorEvent -> Bool -> AssessmentRunNotification)
-> Parser InspectorEvent
-> Parser (Bool -> AssessmentRunNotification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser InspectorEvent
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"event")
Parser (Bool -> AssessmentRunNotification)
-> Parser Bool -> Parser AssessmentRunNotification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"error")
)
instance Prelude.Hashable AssessmentRunNotification
instance Prelude.NFData AssessmentRunNotification