{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DMS.DescribeEventCategories
(
DescribeEventCategories (..),
newDescribeEventCategories,
describeEventCategories_sourceType,
describeEventCategories_filters,
DescribeEventCategoriesResponse (..),
newDescribeEventCategoriesResponse,
describeEventCategoriesResponse_eventCategoryGroupList,
describeEventCategoriesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeEventCategories = DescribeEventCategories'
{
DescribeEventCategories -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
DescribeEventCategories -> Maybe [Filter]
filters :: Prelude.Maybe [Filter]
}
deriving (DescribeEventCategories -> DescribeEventCategories -> Bool
(DescribeEventCategories -> DescribeEventCategories -> Bool)
-> (DescribeEventCategories -> DescribeEventCategories -> Bool)
-> Eq DescribeEventCategories
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventCategories -> DescribeEventCategories -> Bool
$c/= :: DescribeEventCategories -> DescribeEventCategories -> Bool
== :: DescribeEventCategories -> DescribeEventCategories -> Bool
$c== :: DescribeEventCategories -> DescribeEventCategories -> Bool
Prelude.Eq, ReadPrec [DescribeEventCategories]
ReadPrec DescribeEventCategories
Int -> ReadS DescribeEventCategories
ReadS [DescribeEventCategories]
(Int -> ReadS DescribeEventCategories)
-> ReadS [DescribeEventCategories]
-> ReadPrec DescribeEventCategories
-> ReadPrec [DescribeEventCategories]
-> Read DescribeEventCategories
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventCategories]
$creadListPrec :: ReadPrec [DescribeEventCategories]
readPrec :: ReadPrec DescribeEventCategories
$creadPrec :: ReadPrec DescribeEventCategories
readList :: ReadS [DescribeEventCategories]
$creadList :: ReadS [DescribeEventCategories]
readsPrec :: Int -> ReadS DescribeEventCategories
$creadsPrec :: Int -> ReadS DescribeEventCategories
Prelude.Read, Int -> DescribeEventCategories -> ShowS
[DescribeEventCategories] -> ShowS
DescribeEventCategories -> String
(Int -> DescribeEventCategories -> ShowS)
-> (DescribeEventCategories -> String)
-> ([DescribeEventCategories] -> ShowS)
-> Show DescribeEventCategories
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventCategories] -> ShowS
$cshowList :: [DescribeEventCategories] -> ShowS
show :: DescribeEventCategories -> String
$cshow :: DescribeEventCategories -> String
showsPrec :: Int -> DescribeEventCategories -> ShowS
$cshowsPrec :: Int -> DescribeEventCategories -> ShowS
Prelude.Show, (forall x.
DescribeEventCategories -> Rep DescribeEventCategories x)
-> (forall x.
Rep DescribeEventCategories x -> DescribeEventCategories)
-> Generic DescribeEventCategories
forall x. Rep DescribeEventCategories x -> DescribeEventCategories
forall x. DescribeEventCategories -> Rep DescribeEventCategories x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeEventCategories x -> DescribeEventCategories
$cfrom :: forall x. DescribeEventCategories -> Rep DescribeEventCategories x
Prelude.Generic)
newDescribeEventCategories ::
DescribeEventCategories
newDescribeEventCategories :: DescribeEventCategories
newDescribeEventCategories =
DescribeEventCategories' :: Maybe Text -> Maybe [Filter] -> DescribeEventCategories
DescribeEventCategories'
{ $sel:sourceType:DescribeEventCategories' :: Maybe Text
sourceType =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filters:DescribeEventCategories' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing
}
describeEventCategories_sourceType :: Lens.Lens' DescribeEventCategories (Prelude.Maybe Prelude.Text)
describeEventCategories_sourceType :: (Maybe Text -> f (Maybe Text))
-> DescribeEventCategories -> f DescribeEventCategories
describeEventCategories_sourceType = (DescribeEventCategories -> Maybe Text)
-> (DescribeEventCategories
-> Maybe Text -> DescribeEventCategories)
-> Lens
DescribeEventCategories
DescribeEventCategories
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventCategories' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:DescribeEventCategories' :: DescribeEventCategories -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: DescribeEventCategories
s@DescribeEventCategories' {} Maybe Text
a -> DescribeEventCategories
s {$sel:sourceType:DescribeEventCategories' :: Maybe Text
sourceType = Maybe Text
a} :: DescribeEventCategories)
describeEventCategories_filters :: Lens.Lens' DescribeEventCategories (Prelude.Maybe [Filter])
describeEventCategories_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeEventCategories -> f DescribeEventCategories
describeEventCategories_filters = (DescribeEventCategories -> Maybe [Filter])
-> (DescribeEventCategories
-> Maybe [Filter] -> DescribeEventCategories)
-> Lens
DescribeEventCategories
DescribeEventCategories
(Maybe [Filter])
(Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventCategories' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeEventCategories' :: DescribeEventCategories -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeEventCategories
s@DescribeEventCategories' {} Maybe [Filter]
a -> DescribeEventCategories
s {$sel:filters:DescribeEventCategories' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeEventCategories) ((Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeEventCategories -> f DescribeEventCategories)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
-> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeEventCategories
-> f DescribeEventCategories
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
(Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DescribeEventCategories where
type
AWSResponse DescribeEventCategories =
DescribeEventCategoriesResponse
request :: DescribeEventCategories -> Request DescribeEventCategories
request = Service
-> DescribeEventCategories -> Request DescribeEventCategories
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeEventCategories
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEventCategories)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeEventCategories))
-> Logger
-> Service
-> Proxy DescribeEventCategories
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEventCategories)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [EventCategoryGroup]
-> Int -> DescribeEventCategoriesResponse
DescribeEventCategoriesResponse'
(Maybe [EventCategoryGroup]
-> Int -> DescribeEventCategoriesResponse)
-> Either String (Maybe [EventCategoryGroup])
-> Either String (Int -> DescribeEventCategoriesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [EventCategoryGroup]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EventCategoryGroupList"
Either String (Maybe (Maybe [EventCategoryGroup]))
-> Maybe [EventCategoryGroup]
-> Either String (Maybe [EventCategoryGroup])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EventCategoryGroup]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeEventCategoriesResponse)
-> Either String Int
-> Either String DescribeEventCategoriesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeEventCategories
instance Prelude.NFData DescribeEventCategories
instance Core.ToHeaders DescribeEventCategories where
toHeaders :: DescribeEventCategories -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeEventCategories -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.DescribeEventCategories" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeEventCategories where
toJSON :: DescribeEventCategories -> Value
toJSON DescribeEventCategories' {Maybe [Filter]
Maybe Text
filters :: Maybe [Filter]
sourceType :: Maybe Text
$sel:filters:DescribeEventCategories' :: DescribeEventCategories -> Maybe [Filter]
$sel:sourceType:DescribeEventCategories' :: DescribeEventCategories -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceType,
(Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters
]
)
instance Core.ToPath DescribeEventCategories where
toPath :: DescribeEventCategories -> ByteString
toPath = ByteString -> DescribeEventCategories -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeEventCategories where
toQuery :: DescribeEventCategories -> QueryString
toQuery = QueryString -> DescribeEventCategories -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeEventCategoriesResponse = DescribeEventCategoriesResponse'
{
DescribeEventCategoriesResponse -> Maybe [EventCategoryGroup]
eventCategoryGroupList :: Prelude.Maybe [EventCategoryGroup],
DescribeEventCategoriesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool
(DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool)
-> (DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool)
-> Eq DescribeEventCategoriesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool
$c/= :: DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool
== :: DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool
$c== :: DescribeEventCategoriesResponse
-> DescribeEventCategoriesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEventCategoriesResponse]
ReadPrec DescribeEventCategoriesResponse
Int -> ReadS DescribeEventCategoriesResponse
ReadS [DescribeEventCategoriesResponse]
(Int -> ReadS DescribeEventCategoriesResponse)
-> ReadS [DescribeEventCategoriesResponse]
-> ReadPrec DescribeEventCategoriesResponse
-> ReadPrec [DescribeEventCategoriesResponse]
-> Read DescribeEventCategoriesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventCategoriesResponse]
$creadListPrec :: ReadPrec [DescribeEventCategoriesResponse]
readPrec :: ReadPrec DescribeEventCategoriesResponse
$creadPrec :: ReadPrec DescribeEventCategoriesResponse
readList :: ReadS [DescribeEventCategoriesResponse]
$creadList :: ReadS [DescribeEventCategoriesResponse]
readsPrec :: Int -> ReadS DescribeEventCategoriesResponse
$creadsPrec :: Int -> ReadS DescribeEventCategoriesResponse
Prelude.Read, Int -> DescribeEventCategoriesResponse -> ShowS
[DescribeEventCategoriesResponse] -> ShowS
DescribeEventCategoriesResponse -> String
(Int -> DescribeEventCategoriesResponse -> ShowS)
-> (DescribeEventCategoriesResponse -> String)
-> ([DescribeEventCategoriesResponse] -> ShowS)
-> Show DescribeEventCategoriesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventCategoriesResponse] -> ShowS
$cshowList :: [DescribeEventCategoriesResponse] -> ShowS
show :: DescribeEventCategoriesResponse -> String
$cshow :: DescribeEventCategoriesResponse -> String
showsPrec :: Int -> DescribeEventCategoriesResponse -> ShowS
$cshowsPrec :: Int -> DescribeEventCategoriesResponse -> ShowS
Prelude.Show, (forall x.
DescribeEventCategoriesResponse
-> Rep DescribeEventCategoriesResponse x)
-> (forall x.
Rep DescribeEventCategoriesResponse x
-> DescribeEventCategoriesResponse)
-> Generic DescribeEventCategoriesResponse
forall x.
Rep DescribeEventCategoriesResponse x
-> DescribeEventCategoriesResponse
forall x.
DescribeEventCategoriesResponse
-> Rep DescribeEventCategoriesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventCategoriesResponse x
-> DescribeEventCategoriesResponse
$cfrom :: forall x.
DescribeEventCategoriesResponse
-> Rep DescribeEventCategoriesResponse x
Prelude.Generic)
newDescribeEventCategoriesResponse ::
Prelude.Int ->
DescribeEventCategoriesResponse
newDescribeEventCategoriesResponse :: Int -> DescribeEventCategoriesResponse
newDescribeEventCategoriesResponse Int
pHttpStatus_ =
DescribeEventCategoriesResponse' :: Maybe [EventCategoryGroup]
-> Int -> DescribeEventCategoriesResponse
DescribeEventCategoriesResponse'
{ $sel:eventCategoryGroupList:DescribeEventCategoriesResponse' :: Maybe [EventCategoryGroup]
eventCategoryGroupList =
Maybe [EventCategoryGroup]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeEventCategoriesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeEventCategoriesResponse_eventCategoryGroupList :: Lens.Lens' DescribeEventCategoriesResponse (Prelude.Maybe [EventCategoryGroup])
describeEventCategoriesResponse_eventCategoryGroupList :: (Maybe [EventCategoryGroup] -> f (Maybe [EventCategoryGroup]))
-> DescribeEventCategoriesResponse
-> f DescribeEventCategoriesResponse
describeEventCategoriesResponse_eventCategoryGroupList = (DescribeEventCategoriesResponse -> Maybe [EventCategoryGroup])
-> (DescribeEventCategoriesResponse
-> Maybe [EventCategoryGroup] -> DescribeEventCategoriesResponse)
-> Lens
DescribeEventCategoriesResponse
DescribeEventCategoriesResponse
(Maybe [EventCategoryGroup])
(Maybe [EventCategoryGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventCategoriesResponse' {Maybe [EventCategoryGroup]
eventCategoryGroupList :: Maybe [EventCategoryGroup]
$sel:eventCategoryGroupList:DescribeEventCategoriesResponse' :: DescribeEventCategoriesResponse -> Maybe [EventCategoryGroup]
eventCategoryGroupList} -> Maybe [EventCategoryGroup]
eventCategoryGroupList) (\s :: DescribeEventCategoriesResponse
s@DescribeEventCategoriesResponse' {} Maybe [EventCategoryGroup]
a -> DescribeEventCategoriesResponse
s {$sel:eventCategoryGroupList:DescribeEventCategoriesResponse' :: Maybe [EventCategoryGroup]
eventCategoryGroupList = Maybe [EventCategoryGroup]
a} :: DescribeEventCategoriesResponse) ((Maybe [EventCategoryGroup] -> f (Maybe [EventCategoryGroup]))
-> DescribeEventCategoriesResponse
-> f DescribeEventCategoriesResponse)
-> ((Maybe [EventCategoryGroup] -> f (Maybe [EventCategoryGroup]))
-> Maybe [EventCategoryGroup] -> f (Maybe [EventCategoryGroup]))
-> (Maybe [EventCategoryGroup] -> f (Maybe [EventCategoryGroup]))
-> DescribeEventCategoriesResponse
-> f DescribeEventCategoriesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EventCategoryGroup]
[EventCategoryGroup]
[EventCategoryGroup]
[EventCategoryGroup]
-> Iso
(Maybe [EventCategoryGroup])
(Maybe [EventCategoryGroup])
(Maybe [EventCategoryGroup])
(Maybe [EventCategoryGroup])
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
[EventCategoryGroup]
[EventCategoryGroup]
[EventCategoryGroup]
[EventCategoryGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeEventCategoriesResponse_httpStatus :: Lens.Lens' DescribeEventCategoriesResponse Prelude.Int
describeEventCategoriesResponse_httpStatus :: (Int -> f Int)
-> DescribeEventCategoriesResponse
-> f DescribeEventCategoriesResponse
describeEventCategoriesResponse_httpStatus = (DescribeEventCategoriesResponse -> Int)
-> (DescribeEventCategoriesResponse
-> Int -> DescribeEventCategoriesResponse)
-> Lens
DescribeEventCategoriesResponse
DescribeEventCategoriesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventCategoriesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEventCategoriesResponse' :: DescribeEventCategoriesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEventCategoriesResponse
s@DescribeEventCategoriesResponse' {} Int
a -> DescribeEventCategoriesResponse
s {$sel:httpStatus:DescribeEventCategoriesResponse' :: Int
httpStatus = Int
a} :: DescribeEventCategoriesResponse)
instance
Prelude.NFData
DescribeEventCategoriesResponse