{-# 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.SSMIncidents.Types.TriggerDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TriggerDetails = TriggerDetails'
{
TriggerDetails -> Maybe Text
rawData :: Prelude.Maybe Prelude.Text,
TriggerDetails -> Maybe Text
triggerArn :: Prelude.Maybe Prelude.Text,
TriggerDetails -> Text
source :: Prelude.Text,
TriggerDetails -> POSIX
timestamp :: Core.POSIX
}
deriving (TriggerDetails -> TriggerDetails -> Bool
(TriggerDetails -> TriggerDetails -> Bool)
-> (TriggerDetails -> TriggerDetails -> Bool) -> Eq TriggerDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TriggerDetails -> TriggerDetails -> Bool
$c/= :: TriggerDetails -> TriggerDetails -> Bool
== :: TriggerDetails -> TriggerDetails -> Bool
$c== :: TriggerDetails -> TriggerDetails -> Bool
Prelude.Eq, ReadPrec [TriggerDetails]
ReadPrec TriggerDetails
Int -> ReadS TriggerDetails
ReadS [TriggerDetails]
(Int -> ReadS TriggerDetails)
-> ReadS [TriggerDetails]
-> ReadPrec TriggerDetails
-> ReadPrec [TriggerDetails]
-> Read TriggerDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TriggerDetails]
$creadListPrec :: ReadPrec [TriggerDetails]
readPrec :: ReadPrec TriggerDetails
$creadPrec :: ReadPrec TriggerDetails
readList :: ReadS [TriggerDetails]
$creadList :: ReadS [TriggerDetails]
readsPrec :: Int -> ReadS TriggerDetails
$creadsPrec :: Int -> ReadS TriggerDetails
Prelude.Read, Int -> TriggerDetails -> ShowS
[TriggerDetails] -> ShowS
TriggerDetails -> String
(Int -> TriggerDetails -> ShowS)
-> (TriggerDetails -> String)
-> ([TriggerDetails] -> ShowS)
-> Show TriggerDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TriggerDetails] -> ShowS
$cshowList :: [TriggerDetails] -> ShowS
show :: TriggerDetails -> String
$cshow :: TriggerDetails -> String
showsPrec :: Int -> TriggerDetails -> ShowS
$cshowsPrec :: Int -> TriggerDetails -> ShowS
Prelude.Show, (forall x. TriggerDetails -> Rep TriggerDetails x)
-> (forall x. Rep TriggerDetails x -> TriggerDetails)
-> Generic TriggerDetails
forall x. Rep TriggerDetails x -> TriggerDetails
forall x. TriggerDetails -> Rep TriggerDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TriggerDetails x -> TriggerDetails
$cfrom :: forall x. TriggerDetails -> Rep TriggerDetails x
Prelude.Generic)
newTriggerDetails ::
Prelude.Text ->
Prelude.UTCTime ->
TriggerDetails
newTriggerDetails :: Text -> UTCTime -> TriggerDetails
newTriggerDetails Text
pSource_ UTCTime
pTimestamp_ =
TriggerDetails' :: Maybe Text -> Maybe Text -> Text -> POSIX -> TriggerDetails
TriggerDetails'
{ $sel:rawData:TriggerDetails' :: Maybe Text
rawData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:triggerArn:TriggerDetails' :: Maybe Text
triggerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:source:TriggerDetails' :: Text
source = Text
pSource_,
$sel:timestamp:TriggerDetails' :: POSIX
timestamp = 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
pTimestamp_
}
triggerDetails_rawData :: Lens.Lens' TriggerDetails (Prelude.Maybe Prelude.Text)
triggerDetails_rawData :: (Maybe Text -> f (Maybe Text))
-> TriggerDetails -> f TriggerDetails
triggerDetails_rawData = (TriggerDetails -> Maybe Text)
-> (TriggerDetails -> Maybe Text -> TriggerDetails)
-> Lens TriggerDetails TriggerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerDetails' {Maybe Text
rawData :: Maybe Text
$sel:rawData:TriggerDetails' :: TriggerDetails -> Maybe Text
rawData} -> Maybe Text
rawData) (\s :: TriggerDetails
s@TriggerDetails' {} Maybe Text
a -> TriggerDetails
s {$sel:rawData:TriggerDetails' :: Maybe Text
rawData = Maybe Text
a} :: TriggerDetails)
triggerDetails_triggerArn :: Lens.Lens' TriggerDetails (Prelude.Maybe Prelude.Text)
triggerDetails_triggerArn :: (Maybe Text -> f (Maybe Text))
-> TriggerDetails -> f TriggerDetails
triggerDetails_triggerArn = (TriggerDetails -> Maybe Text)
-> (TriggerDetails -> Maybe Text -> TriggerDetails)
-> Lens TriggerDetails TriggerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerDetails' {Maybe Text
triggerArn :: Maybe Text
$sel:triggerArn:TriggerDetails' :: TriggerDetails -> Maybe Text
triggerArn} -> Maybe Text
triggerArn) (\s :: TriggerDetails
s@TriggerDetails' {} Maybe Text
a -> TriggerDetails
s {$sel:triggerArn:TriggerDetails' :: Maybe Text
triggerArn = Maybe Text
a} :: TriggerDetails)
triggerDetails_source :: Lens.Lens' TriggerDetails Prelude.Text
triggerDetails_source :: (Text -> f Text) -> TriggerDetails -> f TriggerDetails
triggerDetails_source = (TriggerDetails -> Text)
-> (TriggerDetails -> Text -> TriggerDetails)
-> Lens TriggerDetails TriggerDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerDetails' {Text
source :: Text
$sel:source:TriggerDetails' :: TriggerDetails -> Text
source} -> Text
source) (\s :: TriggerDetails
s@TriggerDetails' {} Text
a -> TriggerDetails
s {$sel:source:TriggerDetails' :: Text
source = Text
a} :: TriggerDetails)
triggerDetails_timestamp :: Lens.Lens' TriggerDetails Prelude.UTCTime
triggerDetails_timestamp :: (UTCTime -> f UTCTime) -> TriggerDetails -> f TriggerDetails
triggerDetails_timestamp = (TriggerDetails -> POSIX)
-> (TriggerDetails -> POSIX -> TriggerDetails)
-> Lens TriggerDetails TriggerDetails POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerDetails' {POSIX
timestamp :: POSIX
$sel:timestamp:TriggerDetails' :: TriggerDetails -> POSIX
timestamp} -> POSIX
timestamp) (\s :: TriggerDetails
s@TriggerDetails' {} POSIX
a -> TriggerDetails
s {$sel:timestamp:TriggerDetails' :: POSIX
timestamp = POSIX
a} :: TriggerDetails) ((POSIX -> f POSIX) -> TriggerDetails -> f TriggerDetails)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> TriggerDetails
-> f TriggerDetails
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
instance Prelude.Hashable TriggerDetails
instance Prelude.NFData TriggerDetails
instance Core.ToJSON TriggerDetails where
toJSON :: TriggerDetails -> Value
toJSON TriggerDetails' {Maybe Text
Text
POSIX
timestamp :: POSIX
source :: Text
triggerArn :: Maybe Text
rawData :: Maybe Text
$sel:timestamp:TriggerDetails' :: TriggerDetails -> POSIX
$sel:source:TriggerDetails' :: TriggerDetails -> Text
$sel:triggerArn:TriggerDetails' :: TriggerDetails -> Maybe Text
$sel:rawData:TriggerDetails' :: TriggerDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"rawData" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rawData,
(Text
"triggerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
triggerArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"source" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
source),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"timestamp" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
timestamp)
]
)