{-# 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.MacieV2.ListClassificationJobs
-- 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)
--
-- Retrieves a subset of information about one or more classification jobs.
--
-- This operation returns paginated results.
module Amazonka.MacieV2.ListClassificationJobs
  ( -- * Creating a Request
    ListClassificationJobs (..),
    newListClassificationJobs,

    -- * Request Lenses
    listClassificationJobs_filterCriteria,
    listClassificationJobs_sortCriteria,
    listClassificationJobs_nextToken,
    listClassificationJobs_maxResults,

    -- * Destructuring the Response
    ListClassificationJobsResponse (..),
    newListClassificationJobsResponse,

    -- * Response Lenses
    listClassificationJobsResponse_items,
    listClassificationJobsResponse_nextToken,
    listClassificationJobsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListClassificationJobs' smart constructor.
data ListClassificationJobs = ListClassificationJobs'
  { -- | The criteria to use to filter the results.
    ListClassificationJobs -> Maybe ListJobsFilterCriteria
filterCriteria :: Prelude.Maybe ListJobsFilterCriteria,
    -- | The criteria to use to sort the results.
    ListClassificationJobs -> Maybe ListJobsSortCriteria
sortCriteria :: Prelude.Maybe ListJobsSortCriteria,
    -- | The nextToken string that specifies which page of results to return in a
    -- paginated response.
    ListClassificationJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to include in each page of the response.
    ListClassificationJobs -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListClassificationJobs -> ListClassificationJobs -> Bool
(ListClassificationJobs -> ListClassificationJobs -> Bool)
-> (ListClassificationJobs -> ListClassificationJobs -> Bool)
-> Eq ListClassificationJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClassificationJobs -> ListClassificationJobs -> Bool
$c/= :: ListClassificationJobs -> ListClassificationJobs -> Bool
== :: ListClassificationJobs -> ListClassificationJobs -> Bool
$c== :: ListClassificationJobs -> ListClassificationJobs -> Bool
Prelude.Eq, ReadPrec [ListClassificationJobs]
ReadPrec ListClassificationJobs
Int -> ReadS ListClassificationJobs
ReadS [ListClassificationJobs]
(Int -> ReadS ListClassificationJobs)
-> ReadS [ListClassificationJobs]
-> ReadPrec ListClassificationJobs
-> ReadPrec [ListClassificationJobs]
-> Read ListClassificationJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClassificationJobs]
$creadListPrec :: ReadPrec [ListClassificationJobs]
readPrec :: ReadPrec ListClassificationJobs
$creadPrec :: ReadPrec ListClassificationJobs
readList :: ReadS [ListClassificationJobs]
$creadList :: ReadS [ListClassificationJobs]
readsPrec :: Int -> ReadS ListClassificationJobs
$creadsPrec :: Int -> ReadS ListClassificationJobs
Prelude.Read, Int -> ListClassificationJobs -> ShowS
[ListClassificationJobs] -> ShowS
ListClassificationJobs -> String
(Int -> ListClassificationJobs -> ShowS)
-> (ListClassificationJobs -> String)
-> ([ListClassificationJobs] -> ShowS)
-> Show ListClassificationJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClassificationJobs] -> ShowS
$cshowList :: [ListClassificationJobs] -> ShowS
show :: ListClassificationJobs -> String
$cshow :: ListClassificationJobs -> String
showsPrec :: Int -> ListClassificationJobs -> ShowS
$cshowsPrec :: Int -> ListClassificationJobs -> ShowS
Prelude.Show, (forall x. ListClassificationJobs -> Rep ListClassificationJobs x)
-> (forall x.
    Rep ListClassificationJobs x -> ListClassificationJobs)
-> Generic ListClassificationJobs
forall x. Rep ListClassificationJobs x -> ListClassificationJobs
forall x. ListClassificationJobs -> Rep ListClassificationJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListClassificationJobs x -> ListClassificationJobs
$cfrom :: forall x. ListClassificationJobs -> Rep ListClassificationJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListClassificationJobs' 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:
--
-- 'filterCriteria', 'listClassificationJobs_filterCriteria' - The criteria to use to filter the results.
--
-- 'sortCriteria', 'listClassificationJobs_sortCriteria' - The criteria to use to sort the results.
--
-- 'nextToken', 'listClassificationJobs_nextToken' - The nextToken string that specifies which page of results to return in a
-- paginated response.
--
-- 'maxResults', 'listClassificationJobs_maxResults' - The maximum number of items to include in each page of the response.
newListClassificationJobs ::
  ListClassificationJobs
newListClassificationJobs :: ListClassificationJobs
newListClassificationJobs =
  ListClassificationJobs' :: Maybe ListJobsFilterCriteria
-> Maybe ListJobsSortCriteria
-> Maybe Text
-> Maybe Int
-> ListClassificationJobs
ListClassificationJobs'
    { $sel:filterCriteria:ListClassificationJobs' :: Maybe ListJobsFilterCriteria
filterCriteria =
        Maybe ListJobsFilterCriteria
forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:ListClassificationJobs' :: Maybe ListJobsSortCriteria
sortCriteria = Maybe ListJobsSortCriteria
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListClassificationJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListClassificationJobs' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The criteria to use to filter the results.
listClassificationJobs_filterCriteria :: Lens.Lens' ListClassificationJobs (Prelude.Maybe ListJobsFilterCriteria)
listClassificationJobs_filterCriteria :: (Maybe ListJobsFilterCriteria -> f (Maybe ListJobsFilterCriteria))
-> ListClassificationJobs -> f ListClassificationJobs
listClassificationJobs_filterCriteria = (ListClassificationJobs -> Maybe ListJobsFilterCriteria)
-> (ListClassificationJobs
    -> Maybe ListJobsFilterCriteria -> ListClassificationJobs)
-> Lens
     ListClassificationJobs
     ListClassificationJobs
     (Maybe ListJobsFilterCriteria)
     (Maybe ListJobsFilterCriteria)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobs' {Maybe ListJobsFilterCriteria
filterCriteria :: Maybe ListJobsFilterCriteria
$sel:filterCriteria:ListClassificationJobs' :: ListClassificationJobs -> Maybe ListJobsFilterCriteria
filterCriteria} -> Maybe ListJobsFilterCriteria
filterCriteria) (\s :: ListClassificationJobs
s@ListClassificationJobs' {} Maybe ListJobsFilterCriteria
a -> ListClassificationJobs
s {$sel:filterCriteria:ListClassificationJobs' :: Maybe ListJobsFilterCriteria
filterCriteria = Maybe ListJobsFilterCriteria
a} :: ListClassificationJobs)

-- | The criteria to use to sort the results.
listClassificationJobs_sortCriteria :: Lens.Lens' ListClassificationJobs (Prelude.Maybe ListJobsSortCriteria)
listClassificationJobs_sortCriteria :: (Maybe ListJobsSortCriteria -> f (Maybe ListJobsSortCriteria))
-> ListClassificationJobs -> f ListClassificationJobs
listClassificationJobs_sortCriteria = (ListClassificationJobs -> Maybe ListJobsSortCriteria)
-> (ListClassificationJobs
    -> Maybe ListJobsSortCriteria -> ListClassificationJobs)
-> Lens
     ListClassificationJobs
     ListClassificationJobs
     (Maybe ListJobsSortCriteria)
     (Maybe ListJobsSortCriteria)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobs' {Maybe ListJobsSortCriteria
sortCriteria :: Maybe ListJobsSortCriteria
$sel:sortCriteria:ListClassificationJobs' :: ListClassificationJobs -> Maybe ListJobsSortCriteria
sortCriteria} -> Maybe ListJobsSortCriteria
sortCriteria) (\s :: ListClassificationJobs
s@ListClassificationJobs' {} Maybe ListJobsSortCriteria
a -> ListClassificationJobs
s {$sel:sortCriteria:ListClassificationJobs' :: Maybe ListJobsSortCriteria
sortCriteria = Maybe ListJobsSortCriteria
a} :: ListClassificationJobs)

-- | The nextToken string that specifies which page of results to return in a
-- paginated response.
listClassificationJobs_nextToken :: Lens.Lens' ListClassificationJobs (Prelude.Maybe Prelude.Text)
listClassificationJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListClassificationJobs -> f ListClassificationJobs
listClassificationJobs_nextToken = (ListClassificationJobs -> Maybe Text)
-> (ListClassificationJobs -> Maybe Text -> ListClassificationJobs)
-> Lens
     ListClassificationJobs
     ListClassificationJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClassificationJobs' :: ListClassificationJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClassificationJobs
s@ListClassificationJobs' {} Maybe Text
a -> ListClassificationJobs
s {$sel:nextToken:ListClassificationJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListClassificationJobs)

-- | The maximum number of items to include in each page of the response.
listClassificationJobs_maxResults :: Lens.Lens' ListClassificationJobs (Prelude.Maybe Prelude.Int)
listClassificationJobs_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListClassificationJobs -> f ListClassificationJobs
listClassificationJobs_maxResults = (ListClassificationJobs -> Maybe Int)
-> (ListClassificationJobs -> Maybe Int -> ListClassificationJobs)
-> Lens
     ListClassificationJobs
     ListClassificationJobs
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobs' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListClassificationJobs' :: ListClassificationJobs -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListClassificationJobs
s@ListClassificationJobs' {} Maybe Int
a -> ListClassificationJobs
s {$sel:maxResults:ListClassificationJobs' :: Maybe Int
maxResults = Maybe Int
a} :: ListClassificationJobs)

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

instance Prelude.NFData ListClassificationJobs

instance Core.ToHeaders ListClassificationJobs where
  toHeaders :: ListClassificationJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListClassificationJobs -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 ListClassificationJobs where
  toJSON :: ListClassificationJobs -> Value
toJSON ListClassificationJobs' {Maybe Int
Maybe Text
Maybe ListJobsFilterCriteria
Maybe ListJobsSortCriteria
maxResults :: Maybe Int
nextToken :: Maybe Text
sortCriteria :: Maybe ListJobsSortCriteria
filterCriteria :: Maybe ListJobsFilterCriteria
$sel:maxResults:ListClassificationJobs' :: ListClassificationJobs -> Maybe Int
$sel:nextToken:ListClassificationJobs' :: ListClassificationJobs -> Maybe Text
$sel:sortCriteria:ListClassificationJobs' :: ListClassificationJobs -> Maybe ListJobsSortCriteria
$sel:filterCriteria:ListClassificationJobs' :: ListClassificationJobs -> Maybe ListJobsFilterCriteria
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filterCriteria" Text -> ListJobsFilterCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ListJobsFilterCriteria -> Pair)
-> Maybe ListJobsFilterCriteria -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ListJobsFilterCriteria
filterCriteria,
            (Text
"sortCriteria" Text -> ListJobsSortCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ListJobsSortCriteria -> Pair)
-> Maybe ListJobsSortCriteria -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ListJobsSortCriteria
sortCriteria,
            (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
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newListClassificationJobsResponse' smart constructor.
data ListClassificationJobsResponse = ListClassificationJobsResponse'
  { -- | An array of objects, one for each job that meets the filter criteria
    -- specified in the request.
    ListClassificationJobsResponse -> Maybe [JobSummary]
items :: Prelude.Maybe [JobSummary],
    -- | The string to use in a subsequent request to get the next page of
    -- results in a paginated response. This value is null if there are no
    -- additional pages.
    ListClassificationJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListClassificationJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListClassificationJobsResponse
-> ListClassificationJobsResponse -> Bool
(ListClassificationJobsResponse
 -> ListClassificationJobsResponse -> Bool)
-> (ListClassificationJobsResponse
    -> ListClassificationJobsResponse -> Bool)
-> Eq ListClassificationJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClassificationJobsResponse
-> ListClassificationJobsResponse -> Bool
$c/= :: ListClassificationJobsResponse
-> ListClassificationJobsResponse -> Bool
== :: ListClassificationJobsResponse
-> ListClassificationJobsResponse -> Bool
$c== :: ListClassificationJobsResponse
-> ListClassificationJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListClassificationJobsResponse]
ReadPrec ListClassificationJobsResponse
Int -> ReadS ListClassificationJobsResponse
ReadS [ListClassificationJobsResponse]
(Int -> ReadS ListClassificationJobsResponse)
-> ReadS [ListClassificationJobsResponse]
-> ReadPrec ListClassificationJobsResponse
-> ReadPrec [ListClassificationJobsResponse]
-> Read ListClassificationJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClassificationJobsResponse]
$creadListPrec :: ReadPrec [ListClassificationJobsResponse]
readPrec :: ReadPrec ListClassificationJobsResponse
$creadPrec :: ReadPrec ListClassificationJobsResponse
readList :: ReadS [ListClassificationJobsResponse]
$creadList :: ReadS [ListClassificationJobsResponse]
readsPrec :: Int -> ReadS ListClassificationJobsResponse
$creadsPrec :: Int -> ReadS ListClassificationJobsResponse
Prelude.Read, Int -> ListClassificationJobsResponse -> ShowS
[ListClassificationJobsResponse] -> ShowS
ListClassificationJobsResponse -> String
(Int -> ListClassificationJobsResponse -> ShowS)
-> (ListClassificationJobsResponse -> String)
-> ([ListClassificationJobsResponse] -> ShowS)
-> Show ListClassificationJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClassificationJobsResponse] -> ShowS
$cshowList :: [ListClassificationJobsResponse] -> ShowS
show :: ListClassificationJobsResponse -> String
$cshow :: ListClassificationJobsResponse -> String
showsPrec :: Int -> ListClassificationJobsResponse -> ShowS
$cshowsPrec :: Int -> ListClassificationJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListClassificationJobsResponse
 -> Rep ListClassificationJobsResponse x)
-> (forall x.
    Rep ListClassificationJobsResponse x
    -> ListClassificationJobsResponse)
-> Generic ListClassificationJobsResponse
forall x.
Rep ListClassificationJobsResponse x
-> ListClassificationJobsResponse
forall x.
ListClassificationJobsResponse
-> Rep ListClassificationJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListClassificationJobsResponse x
-> ListClassificationJobsResponse
$cfrom :: forall x.
ListClassificationJobsResponse
-> Rep ListClassificationJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListClassificationJobsResponse' 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:
--
-- 'items', 'listClassificationJobsResponse_items' - An array of objects, one for each job that meets the filter criteria
-- specified in the request.
--
-- 'nextToken', 'listClassificationJobsResponse_nextToken' - The string to use in a subsequent request to get the next page of
-- results in a paginated response. This value is null if there are no
-- additional pages.
--
-- 'httpStatus', 'listClassificationJobsResponse_httpStatus' - The response's http status code.
newListClassificationJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListClassificationJobsResponse
newListClassificationJobsResponse :: Int -> ListClassificationJobsResponse
newListClassificationJobsResponse Int
pHttpStatus_ =
  ListClassificationJobsResponse' :: Maybe [JobSummary]
-> Maybe Text -> Int -> ListClassificationJobsResponse
ListClassificationJobsResponse'
    { $sel:items:ListClassificationJobsResponse' :: Maybe [JobSummary]
items =
        Maybe [JobSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListClassificationJobsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListClassificationJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects, one for each job that meets the filter criteria
-- specified in the request.
listClassificationJobsResponse_items :: Lens.Lens' ListClassificationJobsResponse (Prelude.Maybe [JobSummary])
listClassificationJobsResponse_items :: (Maybe [JobSummary] -> f (Maybe [JobSummary]))
-> ListClassificationJobsResponse
-> f ListClassificationJobsResponse
listClassificationJobsResponse_items = (ListClassificationJobsResponse -> Maybe [JobSummary])
-> (ListClassificationJobsResponse
    -> Maybe [JobSummary] -> ListClassificationJobsResponse)
-> Lens' ListClassificationJobsResponse (Maybe [JobSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobsResponse' {Maybe [JobSummary]
items :: Maybe [JobSummary]
$sel:items:ListClassificationJobsResponse' :: ListClassificationJobsResponse -> Maybe [JobSummary]
items} -> Maybe [JobSummary]
items) (\s :: ListClassificationJobsResponse
s@ListClassificationJobsResponse' {} Maybe [JobSummary]
a -> ListClassificationJobsResponse
s {$sel:items:ListClassificationJobsResponse' :: Maybe [JobSummary]
items = Maybe [JobSummary]
a} :: ListClassificationJobsResponse) ((Maybe [JobSummary] -> f (Maybe [JobSummary]))
 -> ListClassificationJobsResponse
 -> f ListClassificationJobsResponse)
-> ((Maybe [JobSummary] -> f (Maybe [JobSummary]))
    -> Maybe [JobSummary] -> f (Maybe [JobSummary]))
-> (Maybe [JobSummary] -> f (Maybe [JobSummary]))
-> ListClassificationJobsResponse
-> f ListClassificationJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobSummary] [JobSummary] [JobSummary] [JobSummary]
-> Iso
     (Maybe [JobSummary])
     (Maybe [JobSummary])
     (Maybe [JobSummary])
     (Maybe [JobSummary])
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 [JobSummary] [JobSummary] [JobSummary] [JobSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The string to use in a subsequent request to get the next page of
-- results in a paginated response. This value is null if there are no
-- additional pages.
listClassificationJobsResponse_nextToken :: Lens.Lens' ListClassificationJobsResponse (Prelude.Maybe Prelude.Text)
listClassificationJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListClassificationJobsResponse
-> f ListClassificationJobsResponse
listClassificationJobsResponse_nextToken = (ListClassificationJobsResponse -> Maybe Text)
-> (ListClassificationJobsResponse
    -> Maybe Text -> ListClassificationJobsResponse)
-> Lens' ListClassificationJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClassificationJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClassificationJobsResponse' :: ListClassificationJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClassificationJobsResponse
s@ListClassificationJobsResponse' {} Maybe Text
a -> ListClassificationJobsResponse
s {$sel:nextToken:ListClassificationJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListClassificationJobsResponse)

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

instance
  Prelude.NFData
    ListClassificationJobsResponse