{-# 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.EventType where
import Amazonka.AWSHealth.Types.EventTypeCategory
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventType = EventType'
{
EventType -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
EventType -> Maybe EventTypeCategory
category :: Prelude.Maybe EventTypeCategory,
EventType -> Maybe Text
code :: Prelude.Maybe Prelude.Text
}
deriving (EventType -> EventType -> Bool
(EventType -> EventType -> Bool)
-> (EventType -> EventType -> Bool) -> Eq EventType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventType -> EventType -> Bool
$c/= :: EventType -> EventType -> Bool
== :: EventType -> EventType -> Bool
$c== :: EventType -> EventType -> Bool
Prelude.Eq, ReadPrec [EventType]
ReadPrec EventType
Int -> ReadS EventType
ReadS [EventType]
(Int -> ReadS EventType)
-> ReadS [EventType]
-> ReadPrec EventType
-> ReadPrec [EventType]
-> Read EventType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventType]
$creadListPrec :: ReadPrec [EventType]
readPrec :: ReadPrec EventType
$creadPrec :: ReadPrec EventType
readList :: ReadS [EventType]
$creadList :: ReadS [EventType]
readsPrec :: Int -> ReadS EventType
$creadsPrec :: Int -> ReadS EventType
Prelude.Read, Int -> EventType -> ShowS
[EventType] -> ShowS
EventType -> String
(Int -> EventType -> ShowS)
-> (EventType -> String)
-> ([EventType] -> ShowS)
-> Show EventType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventType] -> ShowS
$cshowList :: [EventType] -> ShowS
show :: EventType -> String
$cshow :: EventType -> String
showsPrec :: Int -> EventType -> ShowS
$cshowsPrec :: Int -> EventType -> ShowS
Prelude.Show, (forall x. EventType -> Rep EventType x)
-> (forall x. Rep EventType x -> EventType) -> Generic EventType
forall x. Rep EventType x -> EventType
forall x. EventType -> Rep EventType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventType x -> EventType
$cfrom :: forall x. EventType -> Rep EventType x
Prelude.Generic)
newEventType ::
EventType
newEventType :: EventType
newEventType =
EventType' :: Maybe Text -> Maybe EventTypeCategory -> Maybe Text -> EventType
EventType'
{ $sel:service:EventType' :: Maybe Text
service = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:category:EventType' :: Maybe EventTypeCategory
category = Maybe EventTypeCategory
forall a. Maybe a
Prelude.Nothing,
$sel:code:EventType' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eventType_service :: Lens.Lens' EventType (Prelude.Maybe Prelude.Text)
eventType_service :: (Maybe Text -> f (Maybe Text)) -> EventType -> f EventType
eventType_service = (EventType -> Maybe Text)
-> (EventType -> Maybe Text -> EventType)
-> Lens EventType EventType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventType' {Maybe Text
service :: Maybe Text
$sel:service:EventType' :: EventType -> Maybe Text
service} -> Maybe Text
service) (\s :: EventType
s@EventType' {} Maybe Text
a -> EventType
s {$sel:service:EventType' :: Maybe Text
service = Maybe Text
a} :: EventType)
eventType_category :: Lens.Lens' EventType (Prelude.Maybe EventTypeCategory)
eventType_category :: (Maybe EventTypeCategory -> f (Maybe EventTypeCategory))
-> EventType -> f EventType
eventType_category = (EventType -> Maybe EventTypeCategory)
-> (EventType -> Maybe EventTypeCategory -> EventType)
-> Lens
EventType
EventType
(Maybe EventTypeCategory)
(Maybe EventTypeCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventType' {Maybe EventTypeCategory
category :: Maybe EventTypeCategory
$sel:category:EventType' :: EventType -> Maybe EventTypeCategory
category} -> Maybe EventTypeCategory
category) (\s :: EventType
s@EventType' {} Maybe EventTypeCategory
a -> EventType
s {$sel:category:EventType' :: Maybe EventTypeCategory
category = Maybe EventTypeCategory
a} :: EventType)
eventType_code :: Lens.Lens' EventType (Prelude.Maybe Prelude.Text)
eventType_code :: (Maybe Text -> f (Maybe Text)) -> EventType -> f EventType
eventType_code = (EventType -> Maybe Text)
-> (EventType -> Maybe Text -> EventType)
-> Lens EventType EventType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventType' {Maybe Text
code :: Maybe Text
$sel:code:EventType' :: EventType -> Maybe Text
code} -> Maybe Text
code) (\s :: EventType
s@EventType' {} Maybe Text
a -> EventType
s {$sel:code:EventType' :: Maybe Text
code = Maybe Text
a} :: EventType)
instance Core.FromJSON EventType where
parseJSON :: Value -> Parser EventType
parseJSON =
String -> (Object -> Parser EventType) -> Value -> Parser EventType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventType"
( \Object
x ->
Maybe Text -> Maybe EventTypeCategory -> Maybe Text -> EventType
EventType'
(Maybe Text -> Maybe EventTypeCategory -> Maybe Text -> EventType)
-> Parser (Maybe Text)
-> Parser (Maybe EventTypeCategory -> Maybe Text -> EventType)
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
"service")
Parser (Maybe EventTypeCategory -> Maybe Text -> EventType)
-> Parser (Maybe EventTypeCategory)
-> Parser (Maybe Text -> EventType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventTypeCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"category")
Parser (Maybe Text -> EventType)
-> Parser (Maybe Text) -> Parser EventType
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
"code")
)
instance Prelude.Hashable EventType
instance Prelude.NFData EventType