{-# 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.Comprehend.ListEventsDetectionJobs
(
ListEventsDetectionJobs (..),
newListEventsDetectionJobs,
listEventsDetectionJobs_filter,
listEventsDetectionJobs_maxResults,
listEventsDetectionJobs_nextToken,
ListEventsDetectionJobsResponse (..),
newListEventsDetectionJobsResponse,
listEventsDetectionJobsResponse_eventsDetectionJobPropertiesList,
listEventsDetectionJobsResponse_nextToken,
listEventsDetectionJobsResponse_httpStatus,
)
where
import Amazonka.Comprehend.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListEventsDetectionJobs = ListEventsDetectionJobs'
{
ListEventsDetectionJobs -> Maybe EventsDetectionJobFilter
filter' :: Prelude.Maybe EventsDetectionJobFilter,
ListEventsDetectionJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListEventsDetectionJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListEventsDetectionJobs -> ListEventsDetectionJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEventsDetectionJobs -> ListEventsDetectionJobs -> Bool
$c/= :: ListEventsDetectionJobs -> ListEventsDetectionJobs -> Bool
== :: ListEventsDetectionJobs -> ListEventsDetectionJobs -> Bool
$c== :: ListEventsDetectionJobs -> ListEventsDetectionJobs -> Bool
Prelude.Eq, ReadPrec [ListEventsDetectionJobs]
ReadPrec ListEventsDetectionJobs
Int -> ReadS ListEventsDetectionJobs
ReadS [ListEventsDetectionJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEventsDetectionJobs]
$creadListPrec :: ReadPrec [ListEventsDetectionJobs]
readPrec :: ReadPrec ListEventsDetectionJobs
$creadPrec :: ReadPrec ListEventsDetectionJobs
readList :: ReadS [ListEventsDetectionJobs]
$creadList :: ReadS [ListEventsDetectionJobs]
readsPrec :: Int -> ReadS ListEventsDetectionJobs
$creadsPrec :: Int -> ReadS ListEventsDetectionJobs
Prelude.Read, Int -> ListEventsDetectionJobs -> ShowS
[ListEventsDetectionJobs] -> ShowS
ListEventsDetectionJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEventsDetectionJobs] -> ShowS
$cshowList :: [ListEventsDetectionJobs] -> ShowS
show :: ListEventsDetectionJobs -> String
$cshow :: ListEventsDetectionJobs -> String
showsPrec :: Int -> ListEventsDetectionJobs -> ShowS
$cshowsPrec :: Int -> ListEventsDetectionJobs -> ShowS
Prelude.Show, forall x. Rep ListEventsDetectionJobs x -> ListEventsDetectionJobs
forall x. ListEventsDetectionJobs -> Rep ListEventsDetectionJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEventsDetectionJobs x -> ListEventsDetectionJobs
$cfrom :: forall x. ListEventsDetectionJobs -> Rep ListEventsDetectionJobs x
Prelude.Generic)
newListEventsDetectionJobs ::
ListEventsDetectionJobs
newListEventsDetectionJobs :: ListEventsDetectionJobs
newListEventsDetectionJobs =
ListEventsDetectionJobs'
{ $sel:filter':ListEventsDetectionJobs' :: Maybe EventsDetectionJobFilter
filter' = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListEventsDetectionJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListEventsDetectionJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listEventsDetectionJobs_filter :: Lens.Lens' ListEventsDetectionJobs (Prelude.Maybe EventsDetectionJobFilter)
listEventsDetectionJobs_filter :: Lens' ListEventsDetectionJobs (Maybe EventsDetectionJobFilter)
listEventsDetectionJobs_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobs' {Maybe EventsDetectionJobFilter
filter' :: Maybe EventsDetectionJobFilter
$sel:filter':ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe EventsDetectionJobFilter
filter'} -> Maybe EventsDetectionJobFilter
filter') (\s :: ListEventsDetectionJobs
s@ListEventsDetectionJobs' {} Maybe EventsDetectionJobFilter
a -> ListEventsDetectionJobs
s {$sel:filter':ListEventsDetectionJobs' :: Maybe EventsDetectionJobFilter
filter' = Maybe EventsDetectionJobFilter
a} :: ListEventsDetectionJobs)
listEventsDetectionJobs_maxResults :: Lens.Lens' ListEventsDetectionJobs (Prelude.Maybe Prelude.Natural)
listEventsDetectionJobs_maxResults :: Lens' ListEventsDetectionJobs (Maybe Natural)
listEventsDetectionJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEventsDetectionJobs
s@ListEventsDetectionJobs' {} Maybe Natural
a -> ListEventsDetectionJobs
s {$sel:maxResults:ListEventsDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEventsDetectionJobs)
listEventsDetectionJobs_nextToken :: Lens.Lens' ListEventsDetectionJobs (Prelude.Maybe Prelude.Text)
listEventsDetectionJobs_nextToken :: Lens' ListEventsDetectionJobs (Maybe Text)
listEventsDetectionJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEventsDetectionJobs
s@ListEventsDetectionJobs' {} Maybe Text
a -> ListEventsDetectionJobs
s {$sel:nextToken:ListEventsDetectionJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListEventsDetectionJobs)
instance Core.AWSRequest ListEventsDetectionJobs where
type
AWSResponse ListEventsDetectionJobs =
ListEventsDetectionJobsResponse
request :: (Service -> Service)
-> ListEventsDetectionJobs -> Request ListEventsDetectionJobs
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListEventsDetectionJobs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListEventsDetectionJobs)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [EventsDetectionJobProperties]
-> Maybe Text -> Int -> ListEventsDetectionJobsResponse
ListEventsDetectionJobsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventsDetectionJobPropertiesList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListEventsDetectionJobs where
hashWithSalt :: Int -> ListEventsDetectionJobs -> Int
hashWithSalt Int
_salt ListEventsDetectionJobs' {Maybe Natural
Maybe Text
Maybe EventsDetectionJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe EventsDetectionJobFilter
$sel:nextToken:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Text
$sel:maxResults:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Natural
$sel:filter':ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe EventsDetectionJobFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventsDetectionJobFilter
filter'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListEventsDetectionJobs where
rnf :: ListEventsDetectionJobs -> ()
rnf ListEventsDetectionJobs' {Maybe Natural
Maybe Text
Maybe EventsDetectionJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe EventsDetectionJobFilter
$sel:nextToken:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Text
$sel:maxResults:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Natural
$sel:filter':ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe EventsDetectionJobFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EventsDetectionJobFilter
filter'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListEventsDetectionJobs where
toHeaders :: ListEventsDetectionJobs -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Comprehend_20171127.ListEventsDetectionJobs" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListEventsDetectionJobs where
toJSON :: ListEventsDetectionJobs -> Value
toJSON ListEventsDetectionJobs' {Maybe Natural
Maybe Text
Maybe EventsDetectionJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe EventsDetectionJobFilter
$sel:nextToken:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Text
$sel:maxResults:ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe Natural
$sel:filter':ListEventsDetectionJobs' :: ListEventsDetectionJobs -> Maybe EventsDetectionJobFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventsDetectionJobFilter
filter',
(Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListEventsDetectionJobs where
toPath :: ListEventsDetectionJobs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListEventsDetectionJobs where
toQuery :: ListEventsDetectionJobs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListEventsDetectionJobsResponse = ListEventsDetectionJobsResponse'
{
ListEventsDetectionJobsResponse
-> Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList :: Prelude.Maybe [EventsDetectionJobProperties],
ListEventsDetectionJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEventsDetectionJobsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListEventsDetectionJobsResponse
-> ListEventsDetectionJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEventsDetectionJobsResponse
-> ListEventsDetectionJobsResponse -> Bool
$c/= :: ListEventsDetectionJobsResponse
-> ListEventsDetectionJobsResponse -> Bool
== :: ListEventsDetectionJobsResponse
-> ListEventsDetectionJobsResponse -> Bool
$c== :: ListEventsDetectionJobsResponse
-> ListEventsDetectionJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListEventsDetectionJobsResponse]
ReadPrec ListEventsDetectionJobsResponse
Int -> ReadS ListEventsDetectionJobsResponse
ReadS [ListEventsDetectionJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEventsDetectionJobsResponse]
$creadListPrec :: ReadPrec [ListEventsDetectionJobsResponse]
readPrec :: ReadPrec ListEventsDetectionJobsResponse
$creadPrec :: ReadPrec ListEventsDetectionJobsResponse
readList :: ReadS [ListEventsDetectionJobsResponse]
$creadList :: ReadS [ListEventsDetectionJobsResponse]
readsPrec :: Int -> ReadS ListEventsDetectionJobsResponse
$creadsPrec :: Int -> ReadS ListEventsDetectionJobsResponse
Prelude.Read, Int -> ListEventsDetectionJobsResponse -> ShowS
[ListEventsDetectionJobsResponse] -> ShowS
ListEventsDetectionJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEventsDetectionJobsResponse] -> ShowS
$cshowList :: [ListEventsDetectionJobsResponse] -> ShowS
show :: ListEventsDetectionJobsResponse -> String
$cshow :: ListEventsDetectionJobsResponse -> String
showsPrec :: Int -> ListEventsDetectionJobsResponse -> ShowS
$cshowsPrec :: Int -> ListEventsDetectionJobsResponse -> ShowS
Prelude.Show, forall x.
Rep ListEventsDetectionJobsResponse x
-> ListEventsDetectionJobsResponse
forall x.
ListEventsDetectionJobsResponse
-> Rep ListEventsDetectionJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEventsDetectionJobsResponse x
-> ListEventsDetectionJobsResponse
$cfrom :: forall x.
ListEventsDetectionJobsResponse
-> Rep ListEventsDetectionJobsResponse x
Prelude.Generic)
newListEventsDetectionJobsResponse ::
Prelude.Int ->
ListEventsDetectionJobsResponse
newListEventsDetectionJobsResponse :: Int -> ListEventsDetectionJobsResponse
newListEventsDetectionJobsResponse Int
pHttpStatus_ =
ListEventsDetectionJobsResponse'
{ $sel:eventsDetectionJobPropertiesList:ListEventsDetectionJobsResponse' :: Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListEventsDetectionJobsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListEventsDetectionJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listEventsDetectionJobsResponse_eventsDetectionJobPropertiesList :: Lens.Lens' ListEventsDetectionJobsResponse (Prelude.Maybe [EventsDetectionJobProperties])
listEventsDetectionJobsResponse_eventsDetectionJobPropertiesList :: Lens'
ListEventsDetectionJobsResponse
(Maybe [EventsDetectionJobProperties])
listEventsDetectionJobsResponse_eventsDetectionJobPropertiesList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobsResponse' {Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList :: Maybe [EventsDetectionJobProperties]
$sel:eventsDetectionJobPropertiesList:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse
-> Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList} -> Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList) (\s :: ListEventsDetectionJobsResponse
s@ListEventsDetectionJobsResponse' {} Maybe [EventsDetectionJobProperties]
a -> ListEventsDetectionJobsResponse
s {$sel:eventsDetectionJobPropertiesList:ListEventsDetectionJobsResponse' :: Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList = Maybe [EventsDetectionJobProperties]
a} :: ListEventsDetectionJobsResponse) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listEventsDetectionJobsResponse_nextToken :: Lens.Lens' ListEventsDetectionJobsResponse (Prelude.Maybe Prelude.Text)
listEventsDetectionJobsResponse_nextToken :: Lens' ListEventsDetectionJobsResponse (Maybe Text)
listEventsDetectionJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEventsDetectionJobsResponse
s@ListEventsDetectionJobsResponse' {} Maybe Text
a -> ListEventsDetectionJobsResponse
s {$sel:nextToken:ListEventsDetectionJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEventsDetectionJobsResponse)
listEventsDetectionJobsResponse_httpStatus :: Lens.Lens' ListEventsDetectionJobsResponse Prelude.Int
listEventsDetectionJobsResponse_httpStatus :: Lens' ListEventsDetectionJobsResponse Int
listEventsDetectionJobsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventsDetectionJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListEventsDetectionJobsResponse
s@ListEventsDetectionJobsResponse' {} Int
a -> ListEventsDetectionJobsResponse
s {$sel:httpStatus:ListEventsDetectionJobsResponse' :: Int
httpStatus = Int
a} :: ListEventsDetectionJobsResponse)
instance
Prelude.NFData
ListEventsDetectionJobsResponse
where
rnf :: ListEventsDetectionJobsResponse -> ()
rnf ListEventsDetectionJobsResponse' {Int
Maybe [EventsDetectionJobProperties]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
eventsDetectionJobPropertiesList :: Maybe [EventsDetectionJobProperties]
$sel:httpStatus:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse -> Int
$sel:nextToken:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse -> Maybe Text
$sel:eventsDetectionJobPropertiesList:ListEventsDetectionJobsResponse' :: ListEventsDetectionJobsResponse
-> Maybe [EventsDetectionJobProperties]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [EventsDetectionJobProperties]
eventsDetectionJobPropertiesList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus