{-# 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.AppConfig.Types.DeploymentEvent where
import Amazonka.AppConfig.Types.DeploymentEventType
import Amazonka.AppConfig.Types.TriggeredBy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeploymentEvent = DeploymentEvent'
{
DeploymentEvent -> Maybe TriggeredBy
triggeredBy :: Prelude.Maybe TriggeredBy,
DeploymentEvent -> Maybe POSIX
occurredAt :: Prelude.Maybe Core.POSIX,
DeploymentEvent -> Maybe DeploymentEventType
eventType :: Prelude.Maybe DeploymentEventType,
DeploymentEvent -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (DeploymentEvent -> DeploymentEvent -> Bool
(DeploymentEvent -> DeploymentEvent -> Bool)
-> (DeploymentEvent -> DeploymentEvent -> Bool)
-> Eq DeploymentEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentEvent -> DeploymentEvent -> Bool
$c/= :: DeploymentEvent -> DeploymentEvent -> Bool
== :: DeploymentEvent -> DeploymentEvent -> Bool
$c== :: DeploymentEvent -> DeploymentEvent -> Bool
Prelude.Eq, ReadPrec [DeploymentEvent]
ReadPrec DeploymentEvent
Int -> ReadS DeploymentEvent
ReadS [DeploymentEvent]
(Int -> ReadS DeploymentEvent)
-> ReadS [DeploymentEvent]
-> ReadPrec DeploymentEvent
-> ReadPrec [DeploymentEvent]
-> Read DeploymentEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentEvent]
$creadListPrec :: ReadPrec [DeploymentEvent]
readPrec :: ReadPrec DeploymentEvent
$creadPrec :: ReadPrec DeploymentEvent
readList :: ReadS [DeploymentEvent]
$creadList :: ReadS [DeploymentEvent]
readsPrec :: Int -> ReadS DeploymentEvent
$creadsPrec :: Int -> ReadS DeploymentEvent
Prelude.Read, Int -> DeploymentEvent -> ShowS
[DeploymentEvent] -> ShowS
DeploymentEvent -> String
(Int -> DeploymentEvent -> ShowS)
-> (DeploymentEvent -> String)
-> ([DeploymentEvent] -> ShowS)
-> Show DeploymentEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentEvent] -> ShowS
$cshowList :: [DeploymentEvent] -> ShowS
show :: DeploymentEvent -> String
$cshow :: DeploymentEvent -> String
showsPrec :: Int -> DeploymentEvent -> ShowS
$cshowsPrec :: Int -> DeploymentEvent -> ShowS
Prelude.Show, (forall x. DeploymentEvent -> Rep DeploymentEvent x)
-> (forall x. Rep DeploymentEvent x -> DeploymentEvent)
-> Generic DeploymentEvent
forall x. Rep DeploymentEvent x -> DeploymentEvent
forall x. DeploymentEvent -> Rep DeploymentEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentEvent x -> DeploymentEvent
$cfrom :: forall x. DeploymentEvent -> Rep DeploymentEvent x
Prelude.Generic)
newDeploymentEvent ::
DeploymentEvent
newDeploymentEvent :: DeploymentEvent
newDeploymentEvent =
DeploymentEvent' :: Maybe TriggeredBy
-> Maybe POSIX
-> Maybe DeploymentEventType
-> Maybe Text
-> DeploymentEvent
DeploymentEvent'
{ $sel:triggeredBy:DeploymentEvent' :: Maybe TriggeredBy
triggeredBy = Maybe TriggeredBy
forall a. Maybe a
Prelude.Nothing,
$sel:occurredAt:DeploymentEvent' :: Maybe POSIX
occurredAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:eventType:DeploymentEvent' :: Maybe DeploymentEventType
eventType = Maybe DeploymentEventType
forall a. Maybe a
Prelude.Nothing,
$sel:description:DeploymentEvent' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deploymentEvent_triggeredBy :: Lens.Lens' DeploymentEvent (Prelude.Maybe TriggeredBy)
deploymentEvent_triggeredBy :: (Maybe TriggeredBy -> f (Maybe TriggeredBy))
-> DeploymentEvent -> f DeploymentEvent
deploymentEvent_triggeredBy = (DeploymentEvent -> Maybe TriggeredBy)
-> (DeploymentEvent -> Maybe TriggeredBy -> DeploymentEvent)
-> Lens
DeploymentEvent
DeploymentEvent
(Maybe TriggeredBy)
(Maybe TriggeredBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentEvent' {Maybe TriggeredBy
triggeredBy :: Maybe TriggeredBy
$sel:triggeredBy:DeploymentEvent' :: DeploymentEvent -> Maybe TriggeredBy
triggeredBy} -> Maybe TriggeredBy
triggeredBy) (\s :: DeploymentEvent
s@DeploymentEvent' {} Maybe TriggeredBy
a -> DeploymentEvent
s {$sel:triggeredBy:DeploymentEvent' :: Maybe TriggeredBy
triggeredBy = Maybe TriggeredBy
a} :: DeploymentEvent)
deploymentEvent_occurredAt :: Lens.Lens' DeploymentEvent (Prelude.Maybe Prelude.UTCTime)
deploymentEvent_occurredAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeploymentEvent -> f DeploymentEvent
deploymentEvent_occurredAt = (DeploymentEvent -> Maybe POSIX)
-> (DeploymentEvent -> Maybe POSIX -> DeploymentEvent)
-> Lens DeploymentEvent DeploymentEvent (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentEvent' {Maybe POSIX
occurredAt :: Maybe POSIX
$sel:occurredAt:DeploymentEvent' :: DeploymentEvent -> Maybe POSIX
occurredAt} -> Maybe POSIX
occurredAt) (\s :: DeploymentEvent
s@DeploymentEvent' {} Maybe POSIX
a -> DeploymentEvent
s {$sel:occurredAt:DeploymentEvent' :: Maybe POSIX
occurredAt = Maybe POSIX
a} :: DeploymentEvent) ((Maybe POSIX -> f (Maybe POSIX))
-> DeploymentEvent -> f DeploymentEvent)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeploymentEvent
-> f DeploymentEvent
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
deploymentEvent_eventType :: Lens.Lens' DeploymentEvent (Prelude.Maybe DeploymentEventType)
deploymentEvent_eventType :: (Maybe DeploymentEventType -> f (Maybe DeploymentEventType))
-> DeploymentEvent -> f DeploymentEvent
deploymentEvent_eventType = (DeploymentEvent -> Maybe DeploymentEventType)
-> (DeploymentEvent
-> Maybe DeploymentEventType -> DeploymentEvent)
-> Lens
DeploymentEvent
DeploymentEvent
(Maybe DeploymentEventType)
(Maybe DeploymentEventType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentEvent' {Maybe DeploymentEventType
eventType :: Maybe DeploymentEventType
$sel:eventType:DeploymentEvent' :: DeploymentEvent -> Maybe DeploymentEventType
eventType} -> Maybe DeploymentEventType
eventType) (\s :: DeploymentEvent
s@DeploymentEvent' {} Maybe DeploymentEventType
a -> DeploymentEvent
s {$sel:eventType:DeploymentEvent' :: Maybe DeploymentEventType
eventType = Maybe DeploymentEventType
a} :: DeploymentEvent)
deploymentEvent_description :: Lens.Lens' DeploymentEvent (Prelude.Maybe Prelude.Text)
deploymentEvent_description :: (Maybe Text -> f (Maybe Text))
-> DeploymentEvent -> f DeploymentEvent
deploymentEvent_description = (DeploymentEvent -> Maybe Text)
-> (DeploymentEvent -> Maybe Text -> DeploymentEvent)
-> Lens DeploymentEvent DeploymentEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentEvent' {Maybe Text
description :: Maybe Text
$sel:description:DeploymentEvent' :: DeploymentEvent -> Maybe Text
description} -> Maybe Text
description) (\s :: DeploymentEvent
s@DeploymentEvent' {} Maybe Text
a -> DeploymentEvent
s {$sel:description:DeploymentEvent' :: Maybe Text
description = Maybe Text
a} :: DeploymentEvent)
instance Core.FromJSON DeploymentEvent where
parseJSON :: Value -> Parser DeploymentEvent
parseJSON =
String
-> (Object -> Parser DeploymentEvent)
-> Value
-> Parser DeploymentEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeploymentEvent"
( \Object
x ->
Maybe TriggeredBy
-> Maybe POSIX
-> Maybe DeploymentEventType
-> Maybe Text
-> DeploymentEvent
DeploymentEvent'
(Maybe TriggeredBy
-> Maybe POSIX
-> Maybe DeploymentEventType
-> Maybe Text
-> DeploymentEvent)
-> Parser (Maybe TriggeredBy)
-> Parser
(Maybe POSIX
-> Maybe DeploymentEventType -> Maybe Text -> DeploymentEvent)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TriggeredBy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TriggeredBy")
Parser
(Maybe POSIX
-> Maybe DeploymentEventType -> Maybe Text -> DeploymentEvent)
-> Parser (Maybe POSIX)
-> Parser
(Maybe DeploymentEventType -> Maybe Text -> DeploymentEvent)
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
"OccurredAt")
Parser (Maybe DeploymentEventType -> Maybe Text -> DeploymentEvent)
-> Parser (Maybe DeploymentEventType)
-> Parser (Maybe Text -> DeploymentEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeploymentEventType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventType")
Parser (Maybe Text -> DeploymentEvent)
-> Parser (Maybe Text) -> Parser DeploymentEvent
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")
)
instance Prelude.Hashable DeploymentEvent
instance Prelude.NFData DeploymentEvent