{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Comprehend.ListTopicsDetectionJobs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list of the topic detection jobs that you have submitted.
--
-- This operation returns paginated results.
module Amazonka.Comprehend.ListTopicsDetectionJobs
  ( -- * Creating a Request
    ListTopicsDetectionJobs (..),
    newListTopicsDetectionJobs,

    -- * Request Lenses
    listTopicsDetectionJobs_nextToken,
    listTopicsDetectionJobs_filter,
    listTopicsDetectionJobs_maxResults,

    -- * Destructuring the Response
    ListTopicsDetectionJobsResponse (..),
    newListTopicsDetectionJobsResponse,

    -- * Response Lenses
    listTopicsDetectionJobsResponse_nextToken,
    listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList,
    listTopicsDetectionJobsResponse_httpStatus,
  )
where

import Amazonka.Comprehend.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListTopicsDetectionJobs' smart constructor.
data ListTopicsDetectionJobs = ListTopicsDetectionJobs'
  { -- | Identifies the next page of results to return.
    ListTopicsDetectionJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters the jobs that are returned. Jobs can be filtered on their name,
    -- status, or the date and time that they were submitted. You can set only
    -- one filter at a time.
    ListTopicsDetectionJobs -> Maybe TopicsDetectionJobFilter
filter' :: Prelude.Maybe TopicsDetectionJobFilter,
    -- | The maximum number of results to return in each page. The default is
    -- 100.
    ListTopicsDetectionJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool
(ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool)
-> (ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool)
-> Eq ListTopicsDetectionJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool
$c/= :: ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool
== :: ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool
$c== :: ListTopicsDetectionJobs -> ListTopicsDetectionJobs -> Bool
Prelude.Eq, ReadPrec [ListTopicsDetectionJobs]
ReadPrec ListTopicsDetectionJobs
Int -> ReadS ListTopicsDetectionJobs
ReadS [ListTopicsDetectionJobs]
(Int -> ReadS ListTopicsDetectionJobs)
-> ReadS [ListTopicsDetectionJobs]
-> ReadPrec ListTopicsDetectionJobs
-> ReadPrec [ListTopicsDetectionJobs]
-> Read ListTopicsDetectionJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTopicsDetectionJobs]
$creadListPrec :: ReadPrec [ListTopicsDetectionJobs]
readPrec :: ReadPrec ListTopicsDetectionJobs
$creadPrec :: ReadPrec ListTopicsDetectionJobs
readList :: ReadS [ListTopicsDetectionJobs]
$creadList :: ReadS [ListTopicsDetectionJobs]
readsPrec :: Int -> ReadS ListTopicsDetectionJobs
$creadsPrec :: Int -> ReadS ListTopicsDetectionJobs
Prelude.Read, Int -> ListTopicsDetectionJobs -> ShowS
[ListTopicsDetectionJobs] -> ShowS
ListTopicsDetectionJobs -> String
(Int -> ListTopicsDetectionJobs -> ShowS)
-> (ListTopicsDetectionJobs -> String)
-> ([ListTopicsDetectionJobs] -> ShowS)
-> Show ListTopicsDetectionJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTopicsDetectionJobs] -> ShowS
$cshowList :: [ListTopicsDetectionJobs] -> ShowS
show :: ListTopicsDetectionJobs -> String
$cshow :: ListTopicsDetectionJobs -> String
showsPrec :: Int -> ListTopicsDetectionJobs -> ShowS
$cshowsPrec :: Int -> ListTopicsDetectionJobs -> ShowS
Prelude.Show, (forall x.
 ListTopicsDetectionJobs -> Rep ListTopicsDetectionJobs x)
-> (forall x.
    Rep ListTopicsDetectionJobs x -> ListTopicsDetectionJobs)
-> Generic ListTopicsDetectionJobs
forall x. Rep ListTopicsDetectionJobs x -> ListTopicsDetectionJobs
forall x. ListTopicsDetectionJobs -> Rep ListTopicsDetectionJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTopicsDetectionJobs x -> ListTopicsDetectionJobs
$cfrom :: forall x. ListTopicsDetectionJobs -> Rep ListTopicsDetectionJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListTopicsDetectionJobs' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listTopicsDetectionJobs_nextToken' - Identifies the next page of results to return.
--
-- 'filter'', 'listTopicsDetectionJobs_filter' - Filters the jobs that are returned. Jobs can be filtered on their name,
-- status, or the date and time that they were submitted. You can set only
-- one filter at a time.
--
-- 'maxResults', 'listTopicsDetectionJobs_maxResults' - The maximum number of results to return in each page. The default is
-- 100.
newListTopicsDetectionJobs ::
  ListTopicsDetectionJobs
newListTopicsDetectionJobs :: ListTopicsDetectionJobs
newListTopicsDetectionJobs =
  ListTopicsDetectionJobs' :: Maybe Text
-> Maybe TopicsDetectionJobFilter
-> Maybe Natural
-> ListTopicsDetectionJobs
ListTopicsDetectionJobs'
    { $sel:nextToken:ListTopicsDetectionJobs' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListTopicsDetectionJobs' :: Maybe TopicsDetectionJobFilter
filter' = Maybe TopicsDetectionJobFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTopicsDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Identifies the next page of results to return.
listTopicsDetectionJobs_nextToken :: Lens.Lens' ListTopicsDetectionJobs (Prelude.Maybe Prelude.Text)
listTopicsDetectionJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTopicsDetectionJobs -> f ListTopicsDetectionJobs
listTopicsDetectionJobs_nextToken = (ListTopicsDetectionJobs -> Maybe Text)
-> (ListTopicsDetectionJobs
    -> Maybe Text -> ListTopicsDetectionJobs)
-> Lens
     ListTopicsDetectionJobs
     ListTopicsDetectionJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTopicsDetectionJobs
s@ListTopicsDetectionJobs' {} Maybe Text
a -> ListTopicsDetectionJobs
s {$sel:nextToken:ListTopicsDetectionJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListTopicsDetectionJobs)

-- | Filters the jobs that are returned. Jobs can be filtered on their name,
-- status, or the date and time that they were submitted. You can set only
-- one filter at a time.
listTopicsDetectionJobs_filter :: Lens.Lens' ListTopicsDetectionJobs (Prelude.Maybe TopicsDetectionJobFilter)
listTopicsDetectionJobs_filter :: (Maybe TopicsDetectionJobFilter
 -> f (Maybe TopicsDetectionJobFilter))
-> ListTopicsDetectionJobs -> f ListTopicsDetectionJobs
listTopicsDetectionJobs_filter = (ListTopicsDetectionJobs -> Maybe TopicsDetectionJobFilter)
-> (ListTopicsDetectionJobs
    -> Maybe TopicsDetectionJobFilter -> ListTopicsDetectionJobs)
-> Lens
     ListTopicsDetectionJobs
     ListTopicsDetectionJobs
     (Maybe TopicsDetectionJobFilter)
     (Maybe TopicsDetectionJobFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobs' {Maybe TopicsDetectionJobFilter
filter' :: Maybe TopicsDetectionJobFilter
$sel:filter':ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe TopicsDetectionJobFilter
filter'} -> Maybe TopicsDetectionJobFilter
filter') (\s :: ListTopicsDetectionJobs
s@ListTopicsDetectionJobs' {} Maybe TopicsDetectionJobFilter
a -> ListTopicsDetectionJobs
s {$sel:filter':ListTopicsDetectionJobs' :: Maybe TopicsDetectionJobFilter
filter' = Maybe TopicsDetectionJobFilter
a} :: ListTopicsDetectionJobs)

-- | The maximum number of results to return in each page. The default is
-- 100.
listTopicsDetectionJobs_maxResults :: Lens.Lens' ListTopicsDetectionJobs (Prelude.Maybe Prelude.Natural)
listTopicsDetectionJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListTopicsDetectionJobs -> f ListTopicsDetectionJobs
listTopicsDetectionJobs_maxResults = (ListTopicsDetectionJobs -> Maybe Natural)
-> (ListTopicsDetectionJobs
    -> Maybe Natural -> ListTopicsDetectionJobs)
-> Lens
     ListTopicsDetectionJobs
     ListTopicsDetectionJobs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTopicsDetectionJobs
s@ListTopicsDetectionJobs' {} Maybe Natural
a -> ListTopicsDetectionJobs
s {$sel:maxResults:ListTopicsDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTopicsDetectionJobs)

instance Core.AWSPager ListTopicsDetectionJobs where
  page :: ListTopicsDetectionJobs
-> AWSResponse ListTopicsDetectionJobs
-> Maybe ListTopicsDetectionJobs
page ListTopicsDetectionJobs
rq AWSResponse ListTopicsDetectionJobs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTopicsDetectionJobs
ListTopicsDetectionJobsResponse
rs
            ListTopicsDetectionJobsResponse
-> Getting (First Text) ListTopicsDetectionJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTopicsDetectionJobsResponse
-> Const (First Text) ListTopicsDetectionJobsResponse
Lens' ListTopicsDetectionJobsResponse (Maybe Text)
listTopicsDetectionJobsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTopicsDetectionJobsResponse
 -> Const (First Text) ListTopicsDetectionJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTopicsDetectionJobsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTopicsDetectionJobs
forall a. Maybe a
Prelude.Nothing
    | Maybe [TopicsDetectionJobProperties] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTopicsDetectionJobs
ListTopicsDetectionJobsResponse
rs
            ListTopicsDetectionJobsResponse
-> Getting
     (First [TopicsDetectionJobProperties])
     ListTopicsDetectionJobsResponse
     [TopicsDetectionJobProperties]
-> Maybe [TopicsDetectionJobProperties]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TopicsDetectionJobProperties]
 -> Const
      (First [TopicsDetectionJobProperties])
      (Maybe [TopicsDetectionJobProperties]))
-> ListTopicsDetectionJobsResponse
-> Const
     (First [TopicsDetectionJobProperties])
     ListTopicsDetectionJobsResponse
Lens'
  ListTopicsDetectionJobsResponse
  (Maybe [TopicsDetectionJobProperties])
listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList
              ((Maybe [TopicsDetectionJobProperties]
  -> Const
       (First [TopicsDetectionJobProperties])
       (Maybe [TopicsDetectionJobProperties]))
 -> ListTopicsDetectionJobsResponse
 -> Const
      (First [TopicsDetectionJobProperties])
      ListTopicsDetectionJobsResponse)
-> (([TopicsDetectionJobProperties]
     -> Const
          (First [TopicsDetectionJobProperties])
          [TopicsDetectionJobProperties])
    -> Maybe [TopicsDetectionJobProperties]
    -> Const
         (First [TopicsDetectionJobProperties])
         (Maybe [TopicsDetectionJobProperties]))
-> Getting
     (First [TopicsDetectionJobProperties])
     ListTopicsDetectionJobsResponse
     [TopicsDetectionJobProperties]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TopicsDetectionJobProperties]
 -> Const
      (First [TopicsDetectionJobProperties])
      [TopicsDetectionJobProperties])
-> Maybe [TopicsDetectionJobProperties]
-> Const
     (First [TopicsDetectionJobProperties])
     (Maybe [TopicsDetectionJobProperties])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTopicsDetectionJobs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTopicsDetectionJobs -> Maybe ListTopicsDetectionJobs
forall a. a -> Maybe a
Prelude.Just (ListTopicsDetectionJobs -> Maybe ListTopicsDetectionJobs)
-> ListTopicsDetectionJobs -> Maybe ListTopicsDetectionJobs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTopicsDetectionJobs
rq
          ListTopicsDetectionJobs
-> (ListTopicsDetectionJobs -> ListTopicsDetectionJobs)
-> ListTopicsDetectionJobs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTopicsDetectionJobs -> Identity ListTopicsDetectionJobs
Lens
  ListTopicsDetectionJobs
  ListTopicsDetectionJobs
  (Maybe Text)
  (Maybe Text)
listTopicsDetectionJobs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTopicsDetectionJobs -> Identity ListTopicsDetectionJobs)
-> Maybe Text -> ListTopicsDetectionJobs -> ListTopicsDetectionJobs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTopicsDetectionJobs
ListTopicsDetectionJobsResponse
rs
          ListTopicsDetectionJobsResponse
-> Getting (First Text) ListTopicsDetectionJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTopicsDetectionJobsResponse
-> Const (First Text) ListTopicsDetectionJobsResponse
Lens' ListTopicsDetectionJobsResponse (Maybe Text)
listTopicsDetectionJobsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTopicsDetectionJobsResponse
 -> Const (First Text) ListTopicsDetectionJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTopicsDetectionJobsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListTopicsDetectionJobs where
  type
    AWSResponse ListTopicsDetectionJobs =
      ListTopicsDetectionJobsResponse
  request :: ListTopicsDetectionJobs -> Request ListTopicsDetectionJobs
request = Service
-> ListTopicsDetectionJobs -> Request ListTopicsDetectionJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTopicsDetectionJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTopicsDetectionJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTopicsDetectionJobs))
-> Logger
-> Service
-> Proxy ListTopicsDetectionJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTopicsDetectionJobs)))
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 Text
-> Maybe [TopicsDetectionJobProperties]
-> Int
-> ListTopicsDetectionJobsResponse
ListTopicsDetectionJobsResponse'
            (Maybe Text
 -> Maybe [TopicsDetectionJobProperties]
 -> Int
 -> ListTopicsDetectionJobsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [TopicsDetectionJobProperties]
      -> Int -> ListTopicsDetectionJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [TopicsDetectionJobProperties]
   -> Int -> ListTopicsDetectionJobsResponse)
-> Either String (Maybe [TopicsDetectionJobProperties])
-> Either String (Int -> ListTopicsDetectionJobsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [TopicsDetectionJobProperties]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TopicsDetectionJobPropertiesList"
                            Either String (Maybe (Maybe [TopicsDetectionJobProperties]))
-> Maybe [TopicsDetectionJobProperties]
-> Either String (Maybe [TopicsDetectionJobProperties])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TopicsDetectionJobProperties]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListTopicsDetectionJobsResponse)
-> Either String Int
-> Either String ListTopicsDetectionJobsResponse
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 ListTopicsDetectionJobs

instance Prelude.NFData ListTopicsDetectionJobs

instance Core.ToHeaders ListTopicsDetectionJobs where
  toHeaders :: ListTopicsDetectionJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTopicsDetectionJobs -> 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
"Comprehend_20171127.ListTopicsDetectionJobs" ::
                          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 ListTopicsDetectionJobs where
  toJSON :: ListTopicsDetectionJobs -> Value
toJSON ListTopicsDetectionJobs' {Maybe Natural
Maybe Text
Maybe TopicsDetectionJobFilter
maxResults :: Maybe Natural
filter' :: Maybe TopicsDetectionJobFilter
nextToken :: Maybe Text
$sel:maxResults:ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe Natural
$sel:filter':ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe TopicsDetectionJobFilter
$sel:nextToken:ListTopicsDetectionJobs' :: ListTopicsDetectionJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"Filter" Text -> TopicsDetectionJobFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TopicsDetectionJobFilter -> Pair)
-> Maybe TopicsDetectionJobFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TopicsDetectionJobFilter
filter',
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListTopicsDetectionJobs where
  toPath :: ListTopicsDetectionJobs -> ByteString
toPath = ByteString -> ListTopicsDetectionJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListTopicsDetectionJobs where
  toQuery :: ListTopicsDetectionJobs -> QueryString
toQuery = QueryString -> ListTopicsDetectionJobs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListTopicsDetectionJobsResponse' smart constructor.
data ListTopicsDetectionJobsResponse = ListTopicsDetectionJobsResponse'
  { -- | Identifies the next page of results to return.
    ListTopicsDetectionJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list containing the properties of each job that is returned.
    ListTopicsDetectionJobsResponse
-> Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList :: Prelude.Maybe [TopicsDetectionJobProperties],
    -- | The response's http status code.
    ListTopicsDetectionJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTopicsDetectionJobsResponse
-> ListTopicsDetectionJobsResponse -> Bool
(ListTopicsDetectionJobsResponse
 -> ListTopicsDetectionJobsResponse -> Bool)
-> (ListTopicsDetectionJobsResponse
    -> ListTopicsDetectionJobsResponse -> Bool)
-> Eq ListTopicsDetectionJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTopicsDetectionJobsResponse
-> ListTopicsDetectionJobsResponse -> Bool
$c/= :: ListTopicsDetectionJobsResponse
-> ListTopicsDetectionJobsResponse -> Bool
== :: ListTopicsDetectionJobsResponse
-> ListTopicsDetectionJobsResponse -> Bool
$c== :: ListTopicsDetectionJobsResponse
-> ListTopicsDetectionJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListTopicsDetectionJobsResponse]
ReadPrec ListTopicsDetectionJobsResponse
Int -> ReadS ListTopicsDetectionJobsResponse
ReadS [ListTopicsDetectionJobsResponse]
(Int -> ReadS ListTopicsDetectionJobsResponse)
-> ReadS [ListTopicsDetectionJobsResponse]
-> ReadPrec ListTopicsDetectionJobsResponse
-> ReadPrec [ListTopicsDetectionJobsResponse]
-> Read ListTopicsDetectionJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTopicsDetectionJobsResponse]
$creadListPrec :: ReadPrec [ListTopicsDetectionJobsResponse]
readPrec :: ReadPrec ListTopicsDetectionJobsResponse
$creadPrec :: ReadPrec ListTopicsDetectionJobsResponse
readList :: ReadS [ListTopicsDetectionJobsResponse]
$creadList :: ReadS [ListTopicsDetectionJobsResponse]
readsPrec :: Int -> ReadS ListTopicsDetectionJobsResponse
$creadsPrec :: Int -> ReadS ListTopicsDetectionJobsResponse
Prelude.Read, Int -> ListTopicsDetectionJobsResponse -> ShowS
[ListTopicsDetectionJobsResponse] -> ShowS
ListTopicsDetectionJobsResponse -> String
(Int -> ListTopicsDetectionJobsResponse -> ShowS)
-> (ListTopicsDetectionJobsResponse -> String)
-> ([ListTopicsDetectionJobsResponse] -> ShowS)
-> Show ListTopicsDetectionJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTopicsDetectionJobsResponse] -> ShowS
$cshowList :: [ListTopicsDetectionJobsResponse] -> ShowS
show :: ListTopicsDetectionJobsResponse -> String
$cshow :: ListTopicsDetectionJobsResponse -> String
showsPrec :: Int -> ListTopicsDetectionJobsResponse -> ShowS
$cshowsPrec :: Int -> ListTopicsDetectionJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListTopicsDetectionJobsResponse
 -> Rep ListTopicsDetectionJobsResponse x)
-> (forall x.
    Rep ListTopicsDetectionJobsResponse x
    -> ListTopicsDetectionJobsResponse)
-> Generic ListTopicsDetectionJobsResponse
forall x.
Rep ListTopicsDetectionJobsResponse x
-> ListTopicsDetectionJobsResponse
forall x.
ListTopicsDetectionJobsResponse
-> Rep ListTopicsDetectionJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTopicsDetectionJobsResponse x
-> ListTopicsDetectionJobsResponse
$cfrom :: forall x.
ListTopicsDetectionJobsResponse
-> Rep ListTopicsDetectionJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTopicsDetectionJobsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listTopicsDetectionJobsResponse_nextToken' - Identifies the next page of results to return.
--
-- 'topicsDetectionJobPropertiesList', 'listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList' - A list containing the properties of each job that is returned.
--
-- 'httpStatus', 'listTopicsDetectionJobsResponse_httpStatus' - The response's http status code.
newListTopicsDetectionJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTopicsDetectionJobsResponse
newListTopicsDetectionJobsResponse :: Int -> ListTopicsDetectionJobsResponse
newListTopicsDetectionJobsResponse Int
pHttpStatus_ =
  ListTopicsDetectionJobsResponse' :: Maybe Text
-> Maybe [TopicsDetectionJobProperties]
-> Int
-> ListTopicsDetectionJobsResponse
ListTopicsDetectionJobsResponse'
    { $sel:nextToken:ListTopicsDetectionJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:topicsDetectionJobPropertiesList:ListTopicsDetectionJobsResponse' :: Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList =
        Maybe [TopicsDetectionJobProperties]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTopicsDetectionJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Identifies the next page of results to return.
listTopicsDetectionJobsResponse_nextToken :: Lens.Lens' ListTopicsDetectionJobsResponse (Prelude.Maybe Prelude.Text)
listTopicsDetectionJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTopicsDetectionJobsResponse
-> f ListTopicsDetectionJobsResponse
listTopicsDetectionJobsResponse_nextToken = (ListTopicsDetectionJobsResponse -> Maybe Text)
-> (ListTopicsDetectionJobsResponse
    -> Maybe Text -> ListTopicsDetectionJobsResponse)
-> Lens' ListTopicsDetectionJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTopicsDetectionJobsResponse' :: ListTopicsDetectionJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTopicsDetectionJobsResponse
s@ListTopicsDetectionJobsResponse' {} Maybe Text
a -> ListTopicsDetectionJobsResponse
s {$sel:nextToken:ListTopicsDetectionJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTopicsDetectionJobsResponse)

-- | A list containing the properties of each job that is returned.
listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList :: Lens.Lens' ListTopicsDetectionJobsResponse (Prelude.Maybe [TopicsDetectionJobProperties])
listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList :: (Maybe [TopicsDetectionJobProperties]
 -> f (Maybe [TopicsDetectionJobProperties]))
-> ListTopicsDetectionJobsResponse
-> f ListTopicsDetectionJobsResponse
listTopicsDetectionJobsResponse_topicsDetectionJobPropertiesList = (ListTopicsDetectionJobsResponse
 -> Maybe [TopicsDetectionJobProperties])
-> (ListTopicsDetectionJobsResponse
    -> Maybe [TopicsDetectionJobProperties]
    -> ListTopicsDetectionJobsResponse)
-> Lens'
     ListTopicsDetectionJobsResponse
     (Maybe [TopicsDetectionJobProperties])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobsResponse' {Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList :: Maybe [TopicsDetectionJobProperties]
$sel:topicsDetectionJobPropertiesList:ListTopicsDetectionJobsResponse' :: ListTopicsDetectionJobsResponse
-> Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList} -> Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList) (\s :: ListTopicsDetectionJobsResponse
s@ListTopicsDetectionJobsResponse' {} Maybe [TopicsDetectionJobProperties]
a -> ListTopicsDetectionJobsResponse
s {$sel:topicsDetectionJobPropertiesList:ListTopicsDetectionJobsResponse' :: Maybe [TopicsDetectionJobProperties]
topicsDetectionJobPropertiesList = Maybe [TopicsDetectionJobProperties]
a} :: ListTopicsDetectionJobsResponse) ((Maybe [TopicsDetectionJobProperties]
  -> f (Maybe [TopicsDetectionJobProperties]))
 -> ListTopicsDetectionJobsResponse
 -> f ListTopicsDetectionJobsResponse)
-> ((Maybe [TopicsDetectionJobProperties]
     -> f (Maybe [TopicsDetectionJobProperties]))
    -> Maybe [TopicsDetectionJobProperties]
    -> f (Maybe [TopicsDetectionJobProperties]))
-> (Maybe [TopicsDetectionJobProperties]
    -> f (Maybe [TopicsDetectionJobProperties]))
-> ListTopicsDetectionJobsResponse
-> f ListTopicsDetectionJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
-> Iso
     (Maybe [TopicsDetectionJobProperties])
     (Maybe [TopicsDetectionJobProperties])
     (Maybe [TopicsDetectionJobProperties])
     (Maybe [TopicsDetectionJobProperties])
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
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
  [TopicsDetectionJobProperties]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listTopicsDetectionJobsResponse_httpStatus :: Lens.Lens' ListTopicsDetectionJobsResponse Prelude.Int
listTopicsDetectionJobsResponse_httpStatus :: (Int -> f Int)
-> ListTopicsDetectionJobsResponse
-> f ListTopicsDetectionJobsResponse
listTopicsDetectionJobsResponse_httpStatus = (ListTopicsDetectionJobsResponse -> Int)
-> (ListTopicsDetectionJobsResponse
    -> Int -> ListTopicsDetectionJobsResponse)
-> Lens
     ListTopicsDetectionJobsResponse
     ListTopicsDetectionJobsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTopicsDetectionJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTopicsDetectionJobsResponse' :: ListTopicsDetectionJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTopicsDetectionJobsResponse
s@ListTopicsDetectionJobsResponse' {} Int
a -> ListTopicsDetectionJobsResponse
s {$sel:httpStatus:ListTopicsDetectionJobsResponse' :: Int
httpStatus = Int
a} :: ListTopicsDetectionJobsResponse)

instance
  Prelude.NFData
    ListTopicsDetectionJobsResponse