{-# 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.AWSHealth.Types.EventDetails where
import Amazonka.AWSHealth.Types.Event
import Amazonka.AWSHealth.Types.EventDescription
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventDetails = EventDetails'
{
EventDetails -> Maybe Event
event :: Prelude.Maybe Event,
EventDetails -> Maybe EventDescription
eventDescription :: Prelude.Maybe EventDescription,
EventDetails -> Maybe (HashMap Text Text)
eventMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (EventDetails -> EventDetails -> Bool
(EventDetails -> EventDetails -> Bool)
-> (EventDetails -> EventDetails -> Bool) -> Eq EventDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventDetails -> EventDetails -> Bool
$c/= :: EventDetails -> EventDetails -> Bool
== :: EventDetails -> EventDetails -> Bool
$c== :: EventDetails -> EventDetails -> Bool
Prelude.Eq, ReadPrec [EventDetails]
ReadPrec EventDetails
Int -> ReadS EventDetails
ReadS [EventDetails]
(Int -> ReadS EventDetails)
-> ReadS [EventDetails]
-> ReadPrec EventDetails
-> ReadPrec [EventDetails]
-> Read EventDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventDetails]
$creadListPrec :: ReadPrec [EventDetails]
readPrec :: ReadPrec EventDetails
$creadPrec :: ReadPrec EventDetails
readList :: ReadS [EventDetails]
$creadList :: ReadS [EventDetails]
readsPrec :: Int -> ReadS EventDetails
$creadsPrec :: Int -> ReadS EventDetails
Prelude.Read, Int -> EventDetails -> ShowS
[EventDetails] -> ShowS
EventDetails -> String
(Int -> EventDetails -> ShowS)
-> (EventDetails -> String)
-> ([EventDetails] -> ShowS)
-> Show EventDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventDetails] -> ShowS
$cshowList :: [EventDetails] -> ShowS
show :: EventDetails -> String
$cshow :: EventDetails -> String
showsPrec :: Int -> EventDetails -> ShowS
$cshowsPrec :: Int -> EventDetails -> ShowS
Prelude.Show, (forall x. EventDetails -> Rep EventDetails x)
-> (forall x. Rep EventDetails x -> EventDetails)
-> Generic EventDetails
forall x. Rep EventDetails x -> EventDetails
forall x. EventDetails -> Rep EventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventDetails x -> EventDetails
$cfrom :: forall x. EventDetails -> Rep EventDetails x
Prelude.Generic)
newEventDetails ::
EventDetails
newEventDetails :: EventDetails
newEventDetails =
EventDetails' :: Maybe Event
-> Maybe EventDescription
-> Maybe (HashMap Text Text)
-> EventDetails
EventDetails'
{ $sel:event:EventDetails' :: Maybe Event
event = Maybe Event
forall a. Maybe a
Prelude.Nothing,
$sel:eventDescription:EventDetails' :: Maybe EventDescription
eventDescription = Maybe EventDescription
forall a. Maybe a
Prelude.Nothing,
$sel:eventMetadata:EventDetails' :: Maybe (HashMap Text Text)
eventMetadata = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
eventDetails_event :: Lens.Lens' EventDetails (Prelude.Maybe Event)
eventDetails_event :: (Maybe Event -> f (Maybe Event)) -> EventDetails -> f EventDetails
eventDetails_event = (EventDetails -> Maybe Event)
-> (EventDetails -> Maybe Event -> EventDetails)
-> Lens EventDetails EventDetails (Maybe Event) (Maybe Event)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDetails' {Maybe Event
event :: Maybe Event
$sel:event:EventDetails' :: EventDetails -> Maybe Event
event} -> Maybe Event
event) (\s :: EventDetails
s@EventDetails' {} Maybe Event
a -> EventDetails
s {$sel:event:EventDetails' :: Maybe Event
event = Maybe Event
a} :: EventDetails)
eventDetails_eventDescription :: Lens.Lens' EventDetails (Prelude.Maybe EventDescription)
eventDetails_eventDescription :: (Maybe EventDescription -> f (Maybe EventDescription))
-> EventDetails -> f EventDetails
eventDetails_eventDescription = (EventDetails -> Maybe EventDescription)
-> (EventDetails -> Maybe EventDescription -> EventDetails)
-> Lens
EventDetails
EventDetails
(Maybe EventDescription)
(Maybe EventDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDetails' {Maybe EventDescription
eventDescription :: Maybe EventDescription
$sel:eventDescription:EventDetails' :: EventDetails -> Maybe EventDescription
eventDescription} -> Maybe EventDescription
eventDescription) (\s :: EventDetails
s@EventDetails' {} Maybe EventDescription
a -> EventDetails
s {$sel:eventDescription:EventDetails' :: Maybe EventDescription
eventDescription = Maybe EventDescription
a} :: EventDetails)
eventDetails_eventMetadata :: Lens.Lens' EventDetails (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
eventDetails_eventMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EventDetails -> f EventDetails
eventDetails_eventMetadata = (EventDetails -> Maybe (HashMap Text Text))
-> (EventDetails -> Maybe (HashMap Text Text) -> EventDetails)
-> Lens
EventDetails
EventDetails
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDetails' {Maybe (HashMap Text Text)
eventMetadata :: Maybe (HashMap Text Text)
$sel:eventMetadata:EventDetails' :: EventDetails -> Maybe (HashMap Text Text)
eventMetadata} -> Maybe (HashMap Text Text)
eventMetadata) (\s :: EventDetails
s@EventDetails' {} Maybe (HashMap Text Text)
a -> EventDetails
s {$sel:eventMetadata:EventDetails' :: Maybe (HashMap Text Text)
eventMetadata = Maybe (HashMap Text Text)
a} :: EventDetails) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EventDetails -> f EventDetails)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EventDetails
-> f EventDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON EventDetails where
parseJSON :: Value -> Parser EventDetails
parseJSON =
String
-> (Object -> Parser EventDetails) -> Value -> Parser EventDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventDetails"
( \Object
x ->
Maybe Event
-> Maybe EventDescription
-> Maybe (HashMap Text Text)
-> EventDetails
EventDetails'
(Maybe Event
-> Maybe EventDescription
-> Maybe (HashMap Text Text)
-> EventDetails)
-> Parser (Maybe Event)
-> Parser
(Maybe EventDescription
-> Maybe (HashMap Text Text) -> EventDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Event)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"event")
Parser
(Maybe EventDescription
-> Maybe (HashMap Text Text) -> EventDetails)
-> Parser (Maybe EventDescription)
-> Parser (Maybe (HashMap Text Text) -> EventDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventDescription")
Parser (Maybe (HashMap Text Text) -> EventDetails)
-> Parser (Maybe (HashMap Text Text)) -> Parser EventDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventMetadata" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable EventDetails
instance Prelude.NFData EventDetails