{-# 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.ECS.Types.ServiceEvent where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ServiceEvent = ServiceEvent'
{
ServiceEvent -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
ServiceEvent -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
ServiceEvent -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (ServiceEvent -> ServiceEvent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceEvent -> ServiceEvent -> Bool
$c/= :: ServiceEvent -> ServiceEvent -> Bool
== :: ServiceEvent -> ServiceEvent -> Bool
$c== :: ServiceEvent -> ServiceEvent -> Bool
Prelude.Eq, ReadPrec [ServiceEvent]
ReadPrec ServiceEvent
Int -> ReadS ServiceEvent
ReadS [ServiceEvent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceEvent]
$creadListPrec :: ReadPrec [ServiceEvent]
readPrec :: ReadPrec ServiceEvent
$creadPrec :: ReadPrec ServiceEvent
readList :: ReadS [ServiceEvent]
$creadList :: ReadS [ServiceEvent]
readsPrec :: Int -> ReadS ServiceEvent
$creadsPrec :: Int -> ReadS ServiceEvent
Prelude.Read, Int -> ServiceEvent -> ShowS
[ServiceEvent] -> ShowS
ServiceEvent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceEvent] -> ShowS
$cshowList :: [ServiceEvent] -> ShowS
show :: ServiceEvent -> String
$cshow :: ServiceEvent -> String
showsPrec :: Int -> ServiceEvent -> ShowS
$cshowsPrec :: Int -> ServiceEvent -> ShowS
Prelude.Show, forall x. Rep ServiceEvent x -> ServiceEvent
forall x. ServiceEvent -> Rep ServiceEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceEvent x -> ServiceEvent
$cfrom :: forall x. ServiceEvent -> Rep ServiceEvent x
Prelude.Generic)
newServiceEvent ::
ServiceEvent
newServiceEvent :: ServiceEvent
newServiceEvent =
ServiceEvent'
{ $sel:createdAt:ServiceEvent' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:id:ServiceEvent' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:message:ServiceEvent' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
}
serviceEvent_createdAt :: Lens.Lens' ServiceEvent (Prelude.Maybe Prelude.UTCTime)
serviceEvent_createdAt :: Lens' ServiceEvent (Maybe UTCTime)
serviceEvent_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceEvent' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ServiceEvent' :: ServiceEvent -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ServiceEvent
s@ServiceEvent' {} Maybe POSIX
a -> ServiceEvent
s {$sel:createdAt:ServiceEvent' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ServiceEvent) 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
serviceEvent_id :: Lens.Lens' ServiceEvent (Prelude.Maybe Prelude.Text)
serviceEvent_id :: Lens' ServiceEvent (Maybe Text)
serviceEvent_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceEvent' {Maybe Text
id :: Maybe Text
$sel:id:ServiceEvent' :: ServiceEvent -> Maybe Text
id} -> Maybe Text
id) (\s :: ServiceEvent
s@ServiceEvent' {} Maybe Text
a -> ServiceEvent
s {$sel:id:ServiceEvent' :: Maybe Text
id = Maybe Text
a} :: ServiceEvent)
serviceEvent_message :: Lens.Lens' ServiceEvent (Prelude.Maybe Prelude.Text)
serviceEvent_message :: Lens' ServiceEvent (Maybe Text)
serviceEvent_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceEvent' {Maybe Text
message :: Maybe Text
$sel:message:ServiceEvent' :: ServiceEvent -> Maybe Text
message} -> Maybe Text
message) (\s :: ServiceEvent
s@ServiceEvent' {} Maybe Text
a -> ServiceEvent
s {$sel:message:ServiceEvent' :: Maybe Text
message = Maybe Text
a} :: ServiceEvent)
instance Data.FromJSON ServiceEvent where
parseJSON :: Value -> Parser ServiceEvent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceEvent"
( \Object
x ->
Maybe POSIX -> Maybe Text -> Maybe Text -> ServiceEvent
ServiceEvent'
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
"createdAt")
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
"id")
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
"message")
)
instance Prelude.Hashable ServiceEvent where
hashWithSalt :: Int -> ServiceEvent -> Int
hashWithSalt Int
_salt ServiceEvent' {Maybe Text
Maybe POSIX
message :: Maybe Text
id :: Maybe Text
createdAt :: Maybe POSIX
$sel:message:ServiceEvent' :: ServiceEvent -> Maybe Text
$sel:id:ServiceEvent' :: ServiceEvent -> Maybe Text
$sel:createdAt:ServiceEvent' :: ServiceEvent -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
instance Prelude.NFData ServiceEvent where
rnf :: ServiceEvent -> ()
rnf ServiceEvent' {Maybe Text
Maybe POSIX
message :: Maybe Text
id :: Maybe Text
createdAt :: Maybe POSIX
$sel:message:ServiceEvent' :: ServiceEvent -> Maybe Text
$sel:id:ServiceEvent' :: ServiceEvent -> Maybe Text
$sel:createdAt:ServiceEvent' :: ServiceEvent -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message