{-# 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.ListEntitiesDetectionJobs
-- 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 entity detection jobs that you have submitted.
--
-- This operation returns paginated results.
module Amazonka.Comprehend.ListEntitiesDetectionJobs
  ( -- * Creating a Request
    ListEntitiesDetectionJobs (..),
    newListEntitiesDetectionJobs,

    -- * Request Lenses
    listEntitiesDetectionJobs_nextToken,
    listEntitiesDetectionJobs_filter,
    listEntitiesDetectionJobs_maxResults,

    -- * Destructuring the Response
    ListEntitiesDetectionJobsResponse (..),
    newListEntitiesDetectionJobsResponse,

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

-- |
-- Create a value of 'ListEntitiesDetectionJobs' 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', 'listEntitiesDetectionJobs_nextToken' - Identifies the next page of results to return.
--
-- 'filter'', 'listEntitiesDetectionJobs_filter' - Filters the jobs that are returned. You can filter jobs on their name,
-- status, or the date and time that they were submitted. You can only set
-- one filter at a time.
--
-- 'maxResults', 'listEntitiesDetectionJobs_maxResults' - The maximum number of results to return in each page. The default is
-- 100.
newListEntitiesDetectionJobs ::
  ListEntitiesDetectionJobs
newListEntitiesDetectionJobs :: ListEntitiesDetectionJobs
newListEntitiesDetectionJobs =
  ListEntitiesDetectionJobs' :: Maybe Text
-> Maybe EntitiesDetectionJobFilter
-> Maybe Natural
-> ListEntitiesDetectionJobs
ListEntitiesDetectionJobs'
    { $sel:nextToken:ListEntitiesDetectionJobs' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListEntitiesDetectionJobs' :: Maybe EntitiesDetectionJobFilter
filter' = Maybe EntitiesDetectionJobFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEntitiesDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance Core.AWSPager ListEntitiesDetectionJobs where
  page :: ListEntitiesDetectionJobs
-> AWSResponse ListEntitiesDetectionJobs
-> Maybe ListEntitiesDetectionJobs
page ListEntitiesDetectionJobs
rq AWSResponse ListEntitiesDetectionJobs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEntitiesDetectionJobs
ListEntitiesDetectionJobsResponse
rs
            ListEntitiesDetectionJobsResponse
-> Getting (First Text) ListEntitiesDetectionJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEntitiesDetectionJobsResponse
-> Const (First Text) ListEntitiesDetectionJobsResponse
Lens' ListEntitiesDetectionJobsResponse (Maybe Text)
listEntitiesDetectionJobsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEntitiesDetectionJobsResponse
 -> Const (First Text) ListEntitiesDetectionJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEntitiesDetectionJobsResponse 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 ListEntitiesDetectionJobs
forall a. Maybe a
Prelude.Nothing
    | Maybe [EntitiesDetectionJobProperties] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEntitiesDetectionJobs
ListEntitiesDetectionJobsResponse
rs
            ListEntitiesDetectionJobsResponse
-> Getting
     (First [EntitiesDetectionJobProperties])
     ListEntitiesDetectionJobsResponse
     [EntitiesDetectionJobProperties]
-> Maybe [EntitiesDetectionJobProperties]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [EntitiesDetectionJobProperties]
 -> Const
      (First [EntitiesDetectionJobProperties])
      (Maybe [EntitiesDetectionJobProperties]))
-> ListEntitiesDetectionJobsResponse
-> Const
     (First [EntitiesDetectionJobProperties])
     ListEntitiesDetectionJobsResponse
Lens'
  ListEntitiesDetectionJobsResponse
  (Maybe [EntitiesDetectionJobProperties])
listEntitiesDetectionJobsResponse_entitiesDetectionJobPropertiesList
              ((Maybe [EntitiesDetectionJobProperties]
  -> Const
       (First [EntitiesDetectionJobProperties])
       (Maybe [EntitiesDetectionJobProperties]))
 -> ListEntitiesDetectionJobsResponse
 -> Const
      (First [EntitiesDetectionJobProperties])
      ListEntitiesDetectionJobsResponse)
-> (([EntitiesDetectionJobProperties]
     -> Const
          (First [EntitiesDetectionJobProperties])
          [EntitiesDetectionJobProperties])
    -> Maybe [EntitiesDetectionJobProperties]
    -> Const
         (First [EntitiesDetectionJobProperties])
         (Maybe [EntitiesDetectionJobProperties]))
-> Getting
     (First [EntitiesDetectionJobProperties])
     ListEntitiesDetectionJobsResponse
     [EntitiesDetectionJobProperties]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EntitiesDetectionJobProperties]
 -> Const
      (First [EntitiesDetectionJobProperties])
      [EntitiesDetectionJobProperties])
-> Maybe [EntitiesDetectionJobProperties]
-> Const
     (First [EntitiesDetectionJobProperties])
     (Maybe [EntitiesDetectionJobProperties])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEntitiesDetectionJobs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListEntitiesDetectionJobs -> Maybe ListEntitiesDetectionJobs
forall a. a -> Maybe a
Prelude.Just (ListEntitiesDetectionJobs -> Maybe ListEntitiesDetectionJobs)
-> ListEntitiesDetectionJobs -> Maybe ListEntitiesDetectionJobs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListEntitiesDetectionJobs
rq
          ListEntitiesDetectionJobs
-> (ListEntitiesDetectionJobs -> ListEntitiesDetectionJobs)
-> ListEntitiesDetectionJobs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListEntitiesDetectionJobs -> Identity ListEntitiesDetectionJobs
Lens
  ListEntitiesDetectionJobs
  ListEntitiesDetectionJobs
  (Maybe Text)
  (Maybe Text)
listEntitiesDetectionJobs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListEntitiesDetectionJobs -> Identity ListEntitiesDetectionJobs)
-> Maybe Text
-> ListEntitiesDetectionJobs
-> ListEntitiesDetectionJobs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEntitiesDetectionJobs
ListEntitiesDetectionJobsResponse
rs
          ListEntitiesDetectionJobsResponse
-> Getting (First Text) ListEntitiesDetectionJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEntitiesDetectionJobsResponse
-> Const (First Text) ListEntitiesDetectionJobsResponse
Lens' ListEntitiesDetectionJobsResponse (Maybe Text)
listEntitiesDetectionJobsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEntitiesDetectionJobsResponse
 -> Const (First Text) ListEntitiesDetectionJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEntitiesDetectionJobsResponse 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 ListEntitiesDetectionJobs where
  type
    AWSResponse ListEntitiesDetectionJobs =
      ListEntitiesDetectionJobsResponse
  request :: ListEntitiesDetectionJobs -> Request ListEntitiesDetectionJobs
request = Service
-> ListEntitiesDetectionJobs -> Request ListEntitiesDetectionJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEntitiesDetectionJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEntitiesDetectionJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListEntitiesDetectionJobs))
-> Logger
-> Service
-> Proxy ListEntitiesDetectionJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEntitiesDetectionJobs)))
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 [EntitiesDetectionJobProperties]
-> Maybe Text -> Int -> ListEntitiesDetectionJobsResponse
ListEntitiesDetectionJobsResponse'
            (Maybe [EntitiesDetectionJobProperties]
 -> Maybe Text -> Int -> ListEntitiesDetectionJobsResponse)
-> Either String (Maybe [EntitiesDetectionJobProperties])
-> Either
     String (Maybe Text -> Int -> ListEntitiesDetectionJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [EntitiesDetectionJobProperties]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EntitiesDetectionJobPropertiesList"
                            Either String (Maybe (Maybe [EntitiesDetectionJobProperties]))
-> Maybe [EntitiesDetectionJobProperties]
-> Either String (Maybe [EntitiesDetectionJobProperties])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EntitiesDetectionJobProperties]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe Text -> Int -> ListEntitiesDetectionJobsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListEntitiesDetectionJobsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListEntitiesDetectionJobsResponse)
-> Either String Int
-> Either String ListEntitiesDetectionJobsResponse
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 ListEntitiesDetectionJobs

instance Prelude.NFData ListEntitiesDetectionJobs

instance Core.ToHeaders ListEntitiesDetectionJobs where
  toHeaders :: ListEntitiesDetectionJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEntitiesDetectionJobs -> 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.ListEntitiesDetectionJobs" ::
                          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 ListEntitiesDetectionJobs where
  toJSON :: ListEntitiesDetectionJobs -> Value
toJSON ListEntitiesDetectionJobs' {Maybe Natural
Maybe Text
Maybe EntitiesDetectionJobFilter
maxResults :: Maybe Natural
filter' :: Maybe EntitiesDetectionJobFilter
nextToken :: Maybe Text
$sel:maxResults:ListEntitiesDetectionJobs' :: ListEntitiesDetectionJobs -> Maybe Natural
$sel:filter':ListEntitiesDetectionJobs' :: ListEntitiesDetectionJobs -> Maybe EntitiesDetectionJobFilter
$sel:nextToken:ListEntitiesDetectionJobs' :: ListEntitiesDetectionJobs -> 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 -> EntitiesDetectionJobFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EntitiesDetectionJobFilter -> Pair)
-> Maybe EntitiesDetectionJobFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EntitiesDetectionJobFilter
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 ListEntitiesDetectionJobs where
  toPath :: ListEntitiesDetectionJobs -> ByteString
toPath = ByteString -> ListEntitiesDetectionJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ListEntitiesDetectionJobsResponse' 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:
--
-- 'entitiesDetectionJobPropertiesList', 'listEntitiesDetectionJobsResponse_entitiesDetectionJobPropertiesList' - A list containing the properties of each job that is returned.
--
-- 'nextToken', 'listEntitiesDetectionJobsResponse_nextToken' - Identifies the next page of results to return.
--
-- 'httpStatus', 'listEntitiesDetectionJobsResponse_httpStatus' - The response's http status code.
newListEntitiesDetectionJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEntitiesDetectionJobsResponse
newListEntitiesDetectionJobsResponse :: Int -> ListEntitiesDetectionJobsResponse
newListEntitiesDetectionJobsResponse Int
pHttpStatus_ =
  ListEntitiesDetectionJobsResponse' :: Maybe [EntitiesDetectionJobProperties]
-> Maybe Text -> Int -> ListEntitiesDetectionJobsResponse
ListEntitiesDetectionJobsResponse'
    { $sel:entitiesDetectionJobPropertiesList:ListEntitiesDetectionJobsResponse' :: Maybe [EntitiesDetectionJobProperties]
entitiesDetectionJobPropertiesList =
        Maybe [EntitiesDetectionJobProperties]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListEntitiesDetectionJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEntitiesDetectionJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

instance
  Prelude.NFData
    ListEntitiesDetectionJobsResponse