{-# 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.SageMaker.ListLabelingJobs
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list of labeling jobs.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListLabelingJobs
  ( -- * Creating a Request
    ListLabelingJobs (..),
    newListLabelingJobs,

    -- * Request Lenses
    listLabelingJobs_creationTimeAfter,
    listLabelingJobs_creationTimeBefore,
    listLabelingJobs_lastModifiedTimeAfter,
    listLabelingJobs_lastModifiedTimeBefore,
    listLabelingJobs_maxResults,
    listLabelingJobs_nameContains,
    listLabelingJobs_nextToken,
    listLabelingJobs_sortBy,
    listLabelingJobs_sortOrder,
    listLabelingJobs_statusEquals,

    -- * Destructuring the Response
    ListLabelingJobsResponse (..),
    newListLabelingJobsResponse,

    -- * Response Lenses
    listLabelingJobsResponse_labelingJobSummaryList,
    listLabelingJobsResponse_nextToken,
    listLabelingJobsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newListLabelingJobs' smart constructor.
data ListLabelingJobs = ListLabelingJobs'
  { -- | A filter that returns only labeling jobs created after the specified
    -- time (timestamp).
    ListLabelingJobs -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only labeling jobs created before the specified
    -- time (timestamp).
    ListLabelingJobs -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only labeling jobs modified after the specified
    -- time (timestamp).
    ListLabelingJobs -> Maybe POSIX
lastModifiedTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only labeling jobs modified before the specified
    -- time (timestamp).
    ListLabelingJobs -> Maybe POSIX
lastModifiedTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | The maximum number of labeling jobs to return in each page of the
    -- response.
    ListLabelingJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A string in the labeling job name. This filter returns only labeling
    -- jobs whose name contains the specified string.
    ListLabelingJobs -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the result of the previous @ListLabelingJobs@ request was truncated,
    -- the response includes a @NextToken@. To retrieve the next set of
    -- labeling jobs, use the token in the next request.
    ListLabelingJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The field to sort results by. The default is @CreationTime@.
    ListLabelingJobs -> Maybe SortBy
sortBy :: Prelude.Maybe SortBy,
    -- | The sort order for results. The default is @Ascending@.
    ListLabelingJobs -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | A filter that retrieves only labeling jobs with a specific status.
    ListLabelingJobs -> Maybe LabelingJobStatus
statusEquals :: Prelude.Maybe LabelingJobStatus
  }
  deriving (ListLabelingJobs -> ListLabelingJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabelingJobs -> ListLabelingJobs -> Bool
$c/= :: ListLabelingJobs -> ListLabelingJobs -> Bool
== :: ListLabelingJobs -> ListLabelingJobs -> Bool
$c== :: ListLabelingJobs -> ListLabelingJobs -> Bool
Prelude.Eq, ReadPrec [ListLabelingJobs]
ReadPrec ListLabelingJobs
Int -> ReadS ListLabelingJobs
ReadS [ListLabelingJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabelingJobs]
$creadListPrec :: ReadPrec [ListLabelingJobs]
readPrec :: ReadPrec ListLabelingJobs
$creadPrec :: ReadPrec ListLabelingJobs
readList :: ReadS [ListLabelingJobs]
$creadList :: ReadS [ListLabelingJobs]
readsPrec :: Int -> ReadS ListLabelingJobs
$creadsPrec :: Int -> ReadS ListLabelingJobs
Prelude.Read, Int -> ListLabelingJobs -> ShowS
[ListLabelingJobs] -> ShowS
ListLabelingJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabelingJobs] -> ShowS
$cshowList :: [ListLabelingJobs] -> ShowS
show :: ListLabelingJobs -> String
$cshow :: ListLabelingJobs -> String
showsPrec :: Int -> ListLabelingJobs -> ShowS
$cshowsPrec :: Int -> ListLabelingJobs -> ShowS
Prelude.Show, forall x. Rep ListLabelingJobs x -> ListLabelingJobs
forall x. ListLabelingJobs -> Rep ListLabelingJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLabelingJobs x -> ListLabelingJobs
$cfrom :: forall x. ListLabelingJobs -> Rep ListLabelingJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListLabelingJobs' 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:
--
-- 'creationTimeAfter', 'listLabelingJobs_creationTimeAfter' - A filter that returns only labeling jobs created after the specified
-- time (timestamp).
--
-- 'creationTimeBefore', 'listLabelingJobs_creationTimeBefore' - A filter that returns only labeling jobs created before the specified
-- time (timestamp).
--
-- 'lastModifiedTimeAfter', 'listLabelingJobs_lastModifiedTimeAfter' - A filter that returns only labeling jobs modified after the specified
-- time (timestamp).
--
-- 'lastModifiedTimeBefore', 'listLabelingJobs_lastModifiedTimeBefore' - A filter that returns only labeling jobs modified before the specified
-- time (timestamp).
--
-- 'maxResults', 'listLabelingJobs_maxResults' - The maximum number of labeling jobs to return in each page of the
-- response.
--
-- 'nameContains', 'listLabelingJobs_nameContains' - A string in the labeling job name. This filter returns only labeling
-- jobs whose name contains the specified string.
--
-- 'nextToken', 'listLabelingJobs_nextToken' - If the result of the previous @ListLabelingJobs@ request was truncated,
-- the response includes a @NextToken@. To retrieve the next set of
-- labeling jobs, use the token in the next request.
--
-- 'sortBy', 'listLabelingJobs_sortBy' - The field to sort results by. The default is @CreationTime@.
--
-- 'sortOrder', 'listLabelingJobs_sortOrder' - The sort order for results. The default is @Ascending@.
--
-- 'statusEquals', 'listLabelingJobs_statusEquals' - A filter that retrieves only labeling jobs with a specific status.
newListLabelingJobs ::
  ListLabelingJobs
newListLabelingJobs :: ListLabelingJobs
newListLabelingJobs =
  ListLabelingJobs'
    { $sel:creationTimeAfter:ListLabelingJobs' :: Maybe POSIX
creationTimeAfter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListLabelingJobs' :: Maybe POSIX
creationTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeAfter:ListLabelingJobs' :: Maybe POSIX
lastModifiedTimeAfter = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeBefore:ListLabelingJobs' :: Maybe POSIX
lastModifiedTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLabelingJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nameContains:ListLabelingJobs' :: Maybe Text
nameContains = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLabelingJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListLabelingJobs' :: Maybe SortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListLabelingJobs' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:statusEquals:ListLabelingJobs' :: Maybe LabelingJobStatus
statusEquals = forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that returns only labeling jobs created after the specified
-- time (timestamp).
listLabelingJobs_creationTimeAfter :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.UTCTime)
listLabelingJobs_creationTimeAfter :: Lens' ListLabelingJobs (Maybe UTCTime)
listLabelingJobs_creationTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe POSIX
a -> ListLabelingJobs
s {$sel:creationTimeAfter:ListLabelingJobs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListLabelingJobs) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only labeling jobs created before the specified
-- time (timestamp).
listLabelingJobs_creationTimeBefore :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.UTCTime)
listLabelingJobs_creationTimeBefore :: Lens' ListLabelingJobs (Maybe UTCTime)
listLabelingJobs_creationTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe POSIX
a -> ListLabelingJobs
s {$sel:creationTimeBefore:ListLabelingJobs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListLabelingJobs) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only labeling jobs modified after the specified
-- time (timestamp).
listLabelingJobs_lastModifiedTimeAfter :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.UTCTime)
listLabelingJobs_lastModifiedTimeAfter :: Lens' ListLabelingJobs (Maybe UTCTime)
listLabelingJobs_lastModifiedTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
$sel:lastModifiedTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
lastModifiedTimeAfter} -> Maybe POSIX
lastModifiedTimeAfter) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe POSIX
a -> ListLabelingJobs
s {$sel:lastModifiedTimeAfter:ListLabelingJobs' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
a} :: ListLabelingJobs) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only labeling jobs modified before the specified
-- time (timestamp).
listLabelingJobs_lastModifiedTimeBefore :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.UTCTime)
listLabelingJobs_lastModifiedTimeBefore :: Lens' ListLabelingJobs (Maybe UTCTime)
listLabelingJobs_lastModifiedTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
$sel:lastModifiedTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
lastModifiedTimeBefore} -> Maybe POSIX
lastModifiedTimeBefore) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe POSIX
a -> ListLabelingJobs
s {$sel:lastModifiedTimeBefore:ListLabelingJobs' :: Maybe POSIX
lastModifiedTimeBefore = Maybe POSIX
a} :: ListLabelingJobs) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The maximum number of labeling jobs to return in each page of the
-- response.
listLabelingJobs_maxResults :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.Natural)
listLabelingJobs_maxResults :: Lens' ListLabelingJobs (Maybe Natural)
listLabelingJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLabelingJobs' :: ListLabelingJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe Natural
a -> ListLabelingJobs
s {$sel:maxResults:ListLabelingJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLabelingJobs)

-- | A string in the labeling job name. This filter returns only labeling
-- jobs whose name contains the specified string.
listLabelingJobs_nameContains :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.Text)
listLabelingJobs_nameContains :: Lens' ListLabelingJobs (Maybe Text)
listLabelingJobs_nameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe Text
a -> ListLabelingJobs
s {$sel:nameContains:ListLabelingJobs' :: Maybe Text
nameContains = Maybe Text
a} :: ListLabelingJobs)

-- | If the result of the previous @ListLabelingJobs@ request was truncated,
-- the response includes a @NextToken@. To retrieve the next set of
-- labeling jobs, use the token in the next request.
listLabelingJobs_nextToken :: Lens.Lens' ListLabelingJobs (Prelude.Maybe Prelude.Text)
listLabelingJobs_nextToken :: Lens' ListLabelingJobs (Maybe Text)
listLabelingJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe Text
a -> ListLabelingJobs
s {$sel:nextToken:ListLabelingJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabelingJobs)

-- | The field to sort results by. The default is @CreationTime@.
listLabelingJobs_sortBy :: Lens.Lens' ListLabelingJobs (Prelude.Maybe SortBy)
listLabelingJobs_sortBy :: Lens' ListLabelingJobs (Maybe SortBy)
listLabelingJobs_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe SortBy
sortBy :: Maybe SortBy
$sel:sortBy:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortBy
sortBy} -> Maybe SortBy
sortBy) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe SortBy
a -> ListLabelingJobs
s {$sel:sortBy:ListLabelingJobs' :: Maybe SortBy
sortBy = Maybe SortBy
a} :: ListLabelingJobs)

-- | The sort order for results. The default is @Ascending@.
listLabelingJobs_sortOrder :: Lens.Lens' ListLabelingJobs (Prelude.Maybe SortOrder)
listLabelingJobs_sortOrder :: Lens' ListLabelingJobs (Maybe SortOrder)
listLabelingJobs_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe SortOrder
a -> ListLabelingJobs
s {$sel:sortOrder:ListLabelingJobs' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListLabelingJobs)

-- | A filter that retrieves only labeling jobs with a specific status.
listLabelingJobs_statusEquals :: Lens.Lens' ListLabelingJobs (Prelude.Maybe LabelingJobStatus)
listLabelingJobs_statusEquals :: Lens' ListLabelingJobs (Maybe LabelingJobStatus)
listLabelingJobs_statusEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobs' {Maybe LabelingJobStatus
statusEquals :: Maybe LabelingJobStatus
$sel:statusEquals:ListLabelingJobs' :: ListLabelingJobs -> Maybe LabelingJobStatus
statusEquals} -> Maybe LabelingJobStatus
statusEquals) (\s :: ListLabelingJobs
s@ListLabelingJobs' {} Maybe LabelingJobStatus
a -> ListLabelingJobs
s {$sel:statusEquals:ListLabelingJobs' :: Maybe LabelingJobStatus
statusEquals = Maybe LabelingJobStatus
a} :: ListLabelingJobs)

instance Core.AWSPager ListLabelingJobs where
  page :: ListLabelingJobs
-> AWSResponse ListLabelingJobs -> Maybe ListLabelingJobs
page ListLabelingJobs
rq AWSResponse ListLabelingJobs
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLabelingJobs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLabelingJobsResponse (Maybe Text)
listLabelingJobsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLabelingJobs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLabelingJobsResponse (Maybe [LabelingJobSummary])
listLabelingJobsResponse_labelingJobSummaryList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListLabelingJobs
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListLabelingJobs (Maybe Text)
listLabelingJobs_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLabelingJobs
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLabelingJobsResponse (Maybe Text)
listLabelingJobsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListLabelingJobs where
  type
    AWSResponse ListLabelingJobs =
      ListLabelingJobsResponse
  request :: (Service -> Service)
-> ListLabelingJobs -> Request ListLabelingJobs
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListLabelingJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLabelingJobs)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [LabelingJobSummary]
-> Maybe Text -> Int -> ListLabelingJobsResponse
ListLabelingJobsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LabelingJobSummaryList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListLabelingJobs where
  hashWithSalt :: Int -> ListLabelingJobs -> Int
hashWithSalt Int
_salt ListLabelingJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe LabelingJobStatus
Maybe SortBy
Maybe SortOrder
statusEquals :: Maybe LabelingJobStatus
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListLabelingJobs' :: ListLabelingJobs -> Maybe LabelingJobStatus
$sel:sortOrder:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortOrder
$sel:sortBy:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortBy
$sel:nextToken:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:nameContains:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:maxResults:ListLabelingJobs' :: ListLabelingJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeBefore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTimeAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTimeBefore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameContains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LabelingJobStatus
statusEquals

instance Prelude.NFData ListLabelingJobs where
  rnf :: ListLabelingJobs -> ()
rnf ListLabelingJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe LabelingJobStatus
Maybe SortBy
Maybe SortOrder
statusEquals :: Maybe LabelingJobStatus
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListLabelingJobs' :: ListLabelingJobs -> Maybe LabelingJobStatus
$sel:sortOrder:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortOrder
$sel:sortBy:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortBy
$sel:nextToken:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:nameContains:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:maxResults:ListLabelingJobs' :: ListLabelingJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeBefore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTimeAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTimeBefore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameContains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LabelingJobStatus
statusEquals

instance Data.ToHeaders ListLabelingJobs where
  toHeaders :: ListLabelingJobs -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"SageMaker.ListLabelingJobs" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListLabelingJobs where
  toJSON :: ListLabelingJobs -> Value
toJSON ListLabelingJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe LabelingJobStatus
Maybe SortBy
Maybe SortOrder
statusEquals :: Maybe LabelingJobStatus
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListLabelingJobs' :: ListLabelingJobs -> Maybe LabelingJobStatus
$sel:sortOrder:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortOrder
$sel:sortBy:ListLabelingJobs' :: ListLabelingJobs -> Maybe SortBy
$sel:nextToken:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:nameContains:ListLabelingJobs' :: ListLabelingJobs -> Maybe Text
$sel:maxResults:ListLabelingJobs' :: ListLabelingJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeBefore:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
$sel:creationTimeAfter:ListLabelingJobs' :: ListLabelingJobs -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CreationTimeAfter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeAfter,
            (Key
"CreationTimeBefore" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeBefore,
            (Key
"LastModifiedTimeAfter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastModifiedTimeAfter,
            (Key
"LastModifiedTimeBefore" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastModifiedTimeBefore,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NameContains" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nameContains,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"SortBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortBy
sortBy,
            (Key
"SortOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
            (Key
"StatusEquals" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LabelingJobStatus
statusEquals
          ]
      )

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

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

-- | /See:/ 'newListLabelingJobsResponse' smart constructor.
data ListLabelingJobsResponse = ListLabelingJobsResponse'
  { -- | An array of @LabelingJobSummary@ objects, each describing a labeling
    -- job.
    ListLabelingJobsResponse -> Maybe [LabelingJobSummary]
labelingJobSummaryList :: Prelude.Maybe [LabelingJobSummary],
    -- | If the response is truncated, SageMaker returns this token. To retrieve
    -- the next set of labeling jobs, use it in the subsequent request.
    ListLabelingJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListLabelingJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLabelingJobsResponse -> ListLabelingJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabelingJobsResponse -> ListLabelingJobsResponse -> Bool
$c/= :: ListLabelingJobsResponse -> ListLabelingJobsResponse -> Bool
== :: ListLabelingJobsResponse -> ListLabelingJobsResponse -> Bool
$c== :: ListLabelingJobsResponse -> ListLabelingJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListLabelingJobsResponse]
ReadPrec ListLabelingJobsResponse
Int -> ReadS ListLabelingJobsResponse
ReadS [ListLabelingJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabelingJobsResponse]
$creadListPrec :: ReadPrec [ListLabelingJobsResponse]
readPrec :: ReadPrec ListLabelingJobsResponse
$creadPrec :: ReadPrec ListLabelingJobsResponse
readList :: ReadS [ListLabelingJobsResponse]
$creadList :: ReadS [ListLabelingJobsResponse]
readsPrec :: Int -> ReadS ListLabelingJobsResponse
$creadsPrec :: Int -> ReadS ListLabelingJobsResponse
Prelude.Read, Int -> ListLabelingJobsResponse -> ShowS
[ListLabelingJobsResponse] -> ShowS
ListLabelingJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabelingJobsResponse] -> ShowS
$cshowList :: [ListLabelingJobsResponse] -> ShowS
show :: ListLabelingJobsResponse -> String
$cshow :: ListLabelingJobsResponse -> String
showsPrec :: Int -> ListLabelingJobsResponse -> ShowS
$cshowsPrec :: Int -> ListLabelingJobsResponse -> ShowS
Prelude.Show, forall x.
Rep ListLabelingJobsResponse x -> ListLabelingJobsResponse
forall x.
ListLabelingJobsResponse -> Rep ListLabelingJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLabelingJobsResponse x -> ListLabelingJobsResponse
$cfrom :: forall x.
ListLabelingJobsResponse -> Rep ListLabelingJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLabelingJobsResponse' 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:
--
-- 'labelingJobSummaryList', 'listLabelingJobsResponse_labelingJobSummaryList' - An array of @LabelingJobSummary@ objects, each describing a labeling
-- job.
--
-- 'nextToken', 'listLabelingJobsResponse_nextToken' - If the response is truncated, SageMaker returns this token. To retrieve
-- the next set of labeling jobs, use it in the subsequent request.
--
-- 'httpStatus', 'listLabelingJobsResponse_httpStatus' - The response's http status code.
newListLabelingJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLabelingJobsResponse
newListLabelingJobsResponse :: Int -> ListLabelingJobsResponse
newListLabelingJobsResponse Int
pHttpStatus_ =
  ListLabelingJobsResponse'
    { $sel:labelingJobSummaryList:ListLabelingJobsResponse' :: Maybe [LabelingJobSummary]
labelingJobSummaryList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLabelingJobsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLabelingJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @LabelingJobSummary@ objects, each describing a labeling
-- job.
listLabelingJobsResponse_labelingJobSummaryList :: Lens.Lens' ListLabelingJobsResponse (Prelude.Maybe [LabelingJobSummary])
listLabelingJobsResponse_labelingJobSummaryList :: Lens' ListLabelingJobsResponse (Maybe [LabelingJobSummary])
listLabelingJobsResponse_labelingJobSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobsResponse' {Maybe [LabelingJobSummary]
labelingJobSummaryList :: Maybe [LabelingJobSummary]
$sel:labelingJobSummaryList:ListLabelingJobsResponse' :: ListLabelingJobsResponse -> Maybe [LabelingJobSummary]
labelingJobSummaryList} -> Maybe [LabelingJobSummary]
labelingJobSummaryList) (\s :: ListLabelingJobsResponse
s@ListLabelingJobsResponse' {} Maybe [LabelingJobSummary]
a -> ListLabelingJobsResponse
s {$sel:labelingJobSummaryList:ListLabelingJobsResponse' :: Maybe [LabelingJobSummary]
labelingJobSummaryList = Maybe [LabelingJobSummary]
a} :: ListLabelingJobsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, SageMaker returns this token. To retrieve
-- the next set of labeling jobs, use it in the subsequent request.
listLabelingJobsResponse_nextToken :: Lens.Lens' ListLabelingJobsResponse (Prelude.Maybe Prelude.Text)
listLabelingJobsResponse_nextToken :: Lens' ListLabelingJobsResponse (Maybe Text)
listLabelingJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelingJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabelingJobsResponse' :: ListLabelingJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabelingJobsResponse
s@ListLabelingJobsResponse' {} Maybe Text
a -> ListLabelingJobsResponse
s {$sel:nextToken:ListLabelingJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabelingJobsResponse)

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

instance Prelude.NFData ListLabelingJobsResponse where
  rnf :: ListLabelingJobsResponse -> ()
rnf ListLabelingJobsResponse' {Int
Maybe [LabelingJobSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
labelingJobSummaryList :: Maybe [LabelingJobSummary]
$sel:httpStatus:ListLabelingJobsResponse' :: ListLabelingJobsResponse -> Int
$sel:nextToken:ListLabelingJobsResponse' :: ListLabelingJobsResponse -> Maybe Text
$sel:labelingJobSummaryList:ListLabelingJobsResponse' :: ListLabelingJobsResponse -> Maybe [LabelingJobSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [LabelingJobSummary]
labelingJobSummaryList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus