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