{-# 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.ListTrainingJobs
-- 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)
--
-- Lists training jobs.
--
-- When @StatusEquals@ and @MaxResults@ are set at the same time, the
-- @MaxResults@ number of training jobs are first retrieved ignoring the
-- @StatusEquals@ parameter and then they are filtered by the
-- @StatusEquals@ parameter, which is returned as a response.
--
-- For example, if @ListTrainingJobs@ is invoked with the following
-- parameters:
--
-- @{ ... MaxResults: 100, StatusEquals: InProgress ... }@
--
-- First, 100 trainings jobs with any status, including those other than
-- @InProgress@, are selected (sorted according to the creation time, from
-- the most current to the oldest). Next, those with a status of
-- @InProgress@ are returned.
--
-- You can quickly test the API using the following Amazon Web Services CLI
-- code.
--
-- @aws sagemaker list-training-jobs --max-results 100 --status-equals InProgress@
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListTrainingJobs
  ( -- * Creating a Request
    ListTrainingJobs (..),
    newListTrainingJobs,

    -- * Request Lenses
    listTrainingJobs_nameContains,
    listTrainingJobs_lastModifiedTimeBefore,
    listTrainingJobs_creationTimeAfter,
    listTrainingJobs_nextToken,
    listTrainingJobs_sortOrder,
    listTrainingJobs_lastModifiedTimeAfter,
    listTrainingJobs_creationTimeBefore,
    listTrainingJobs_statusEquals,
    listTrainingJobs_maxResults,
    listTrainingJobs_sortBy,

    -- * Destructuring the Response
    ListTrainingJobsResponse (..),
    newListTrainingJobsResponse,

    -- * Response Lenses
    listTrainingJobsResponse_nextToken,
    listTrainingJobsResponse_httpStatus,
    listTrainingJobsResponse_trainingJobSummaries,
  )
where

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
import Amazonka.SageMaker.Types

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

-- |
-- Create a value of 'ListTrainingJobs' 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:
--
-- 'nameContains', 'listTrainingJobs_nameContains' - A string in the training job name. This filter returns only training
-- jobs whose name contains the specified string.
--
-- 'lastModifiedTimeBefore', 'listTrainingJobs_lastModifiedTimeBefore' - A filter that returns only training jobs modified before the specified
-- time (timestamp).
--
-- 'creationTimeAfter', 'listTrainingJobs_creationTimeAfter' - A filter that returns only training jobs created after the specified
-- time (timestamp).
--
-- 'nextToken', 'listTrainingJobs_nextToken' - If the result of the previous @ListTrainingJobs@ request was truncated,
-- the response includes a @NextToken@. To retrieve the next set of
-- training jobs, use the token in the next request.
--
-- 'sortOrder', 'listTrainingJobs_sortOrder' - The sort order for results. The default is @Ascending@.
--
-- 'lastModifiedTimeAfter', 'listTrainingJobs_lastModifiedTimeAfter' - A filter that returns only training jobs modified after the specified
-- time (timestamp).
--
-- 'creationTimeBefore', 'listTrainingJobs_creationTimeBefore' - A filter that returns only training jobs created before the specified
-- time (timestamp).
--
-- 'statusEquals', 'listTrainingJobs_statusEquals' - A filter that retrieves only training jobs with a specific status.
--
-- 'maxResults', 'listTrainingJobs_maxResults' - The maximum number of training jobs to return in the response.
--
-- 'sortBy', 'listTrainingJobs_sortBy' - The field to sort results by. The default is @CreationTime@.
newListTrainingJobs ::
  ListTrainingJobs
newListTrainingJobs :: ListTrainingJobs
newListTrainingJobs =
  ListTrainingJobs' :: Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe SortOrder
-> Maybe POSIX
-> Maybe POSIX
-> Maybe TrainingJobStatus
-> Maybe Natural
-> Maybe SortBy
-> ListTrainingJobs
ListTrainingJobs'
    { $sel:nameContains:ListTrainingJobs' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeBefore:ListTrainingJobs' :: Maybe POSIX
lastModifiedTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeAfter:ListTrainingJobs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTrainingJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListTrainingJobs' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeAfter:ListTrainingJobs' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListTrainingJobs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusEquals:ListTrainingJobs' :: Maybe TrainingJobStatus
statusEquals = Maybe TrainingJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTrainingJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListTrainingJobs' :: Maybe SortBy
sortBy = Maybe SortBy
forall a. Maybe a
Prelude.Nothing
    }

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

-- | A filter that returns only training jobs modified before the specified
-- time (timestamp).
listTrainingJobs_lastModifiedTimeBefore :: Lens.Lens' ListTrainingJobs (Prelude.Maybe Prelude.UTCTime)
listTrainingJobs_lastModifiedTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs -> f ListTrainingJobs
listTrainingJobs_lastModifiedTimeBefore = (ListTrainingJobs -> Maybe POSIX)
-> (ListTrainingJobs -> Maybe POSIX -> ListTrainingJobs)
-> Lens
     ListTrainingJobs ListTrainingJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobs' {Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
$sel:lastModifiedTimeBefore:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
lastModifiedTimeBefore} -> Maybe POSIX
lastModifiedTimeBefore) (\s :: ListTrainingJobs
s@ListTrainingJobs' {} Maybe POSIX
a -> ListTrainingJobs
s {$sel:lastModifiedTimeBefore:ListTrainingJobs' :: Maybe POSIX
lastModifiedTimeBefore = Maybe POSIX
a} :: ListTrainingJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListTrainingJobs -> f ListTrainingJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs
-> f ListTrainingJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A filter that returns only training jobs created after the specified
-- time (timestamp).
listTrainingJobs_creationTimeAfter :: Lens.Lens' ListTrainingJobs (Prelude.Maybe Prelude.UTCTime)
listTrainingJobs_creationTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs -> f ListTrainingJobs
listTrainingJobs_creationTimeAfter = (ListTrainingJobs -> Maybe POSIX)
-> (ListTrainingJobs -> Maybe POSIX -> ListTrainingJobs)
-> Lens
     ListTrainingJobs ListTrainingJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobs' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListTrainingJobs
s@ListTrainingJobs' {} Maybe POSIX
a -> ListTrainingJobs
s {$sel:creationTimeAfter:ListTrainingJobs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListTrainingJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListTrainingJobs -> f ListTrainingJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs
-> f ListTrainingJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

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

-- | A filter that returns only training jobs modified after the specified
-- time (timestamp).
listTrainingJobs_lastModifiedTimeAfter :: Lens.Lens' ListTrainingJobs (Prelude.Maybe Prelude.UTCTime)
listTrainingJobs_lastModifiedTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs -> f ListTrainingJobs
listTrainingJobs_lastModifiedTimeAfter = (ListTrainingJobs -> Maybe POSIX)
-> (ListTrainingJobs -> Maybe POSIX -> ListTrainingJobs)
-> Lens
     ListTrainingJobs ListTrainingJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobs' {Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
$sel:lastModifiedTimeAfter:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
lastModifiedTimeAfter} -> Maybe POSIX
lastModifiedTimeAfter) (\s :: ListTrainingJobs
s@ListTrainingJobs' {} Maybe POSIX
a -> ListTrainingJobs
s {$sel:lastModifiedTimeAfter:ListTrainingJobs' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
a} :: ListTrainingJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListTrainingJobs -> f ListTrainingJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs
-> f ListTrainingJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A filter that returns only training jobs created before the specified
-- time (timestamp).
listTrainingJobs_creationTimeBefore :: Lens.Lens' ListTrainingJobs (Prelude.Maybe Prelude.UTCTime)
listTrainingJobs_creationTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs -> f ListTrainingJobs
listTrainingJobs_creationTimeBefore = (ListTrainingJobs -> Maybe POSIX)
-> (ListTrainingJobs -> Maybe POSIX -> ListTrainingJobs)
-> Lens
     ListTrainingJobs ListTrainingJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobs' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListTrainingJobs
s@ListTrainingJobs' {} Maybe POSIX
a -> ListTrainingJobs
s {$sel:creationTimeBefore:ListTrainingJobs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListTrainingJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListTrainingJobs -> f ListTrainingJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListTrainingJobs
-> f ListTrainingJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A filter that retrieves only training jobs with a specific status.
listTrainingJobs_statusEquals :: Lens.Lens' ListTrainingJobs (Prelude.Maybe TrainingJobStatus)
listTrainingJobs_statusEquals :: (Maybe TrainingJobStatus -> f (Maybe TrainingJobStatus))
-> ListTrainingJobs -> f ListTrainingJobs
listTrainingJobs_statusEquals = (ListTrainingJobs -> Maybe TrainingJobStatus)
-> (ListTrainingJobs
    -> Maybe TrainingJobStatus -> ListTrainingJobs)
-> Lens
     ListTrainingJobs
     ListTrainingJobs
     (Maybe TrainingJobStatus)
     (Maybe TrainingJobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobs' {Maybe TrainingJobStatus
statusEquals :: Maybe TrainingJobStatus
$sel:statusEquals:ListTrainingJobs' :: ListTrainingJobs -> Maybe TrainingJobStatus
statusEquals} -> Maybe TrainingJobStatus
statusEquals) (\s :: ListTrainingJobs
s@ListTrainingJobs' {} Maybe TrainingJobStatus
a -> ListTrainingJobs
s {$sel:statusEquals:ListTrainingJobs' :: Maybe TrainingJobStatus
statusEquals = Maybe TrainingJobStatus
a} :: ListTrainingJobs)

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

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

instance Core.AWSPager ListTrainingJobs where
  page :: ListTrainingJobs
-> AWSResponse ListTrainingJobs -> Maybe ListTrainingJobs
page ListTrainingJobs
rq AWSResponse ListTrainingJobs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTrainingJobs
ListTrainingJobsResponse
rs
            ListTrainingJobsResponse
-> Getting (First Text) ListTrainingJobsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTrainingJobsResponse
-> Const (First Text) ListTrainingJobsResponse
Lens' ListTrainingJobsResponse (Maybe Text)
listTrainingJobsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTrainingJobsResponse
 -> Const (First Text) ListTrainingJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTrainingJobsResponse 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 ListTrainingJobs
forall a. Maybe a
Prelude.Nothing
    | [TrainingJobSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTrainingJobs
ListTrainingJobsResponse
rs
            ListTrainingJobsResponse
-> Getting
     [TrainingJobSummary] ListTrainingJobsResponse [TrainingJobSummary]
-> [TrainingJobSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [TrainingJobSummary] ListTrainingJobsResponse [TrainingJobSummary]
Lens' ListTrainingJobsResponse [TrainingJobSummary]
listTrainingJobsResponse_trainingJobSummaries
        ) =
      Maybe ListTrainingJobs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTrainingJobs -> Maybe ListTrainingJobs
forall a. a -> Maybe a
Prelude.Just (ListTrainingJobs -> Maybe ListTrainingJobs)
-> ListTrainingJobs -> Maybe ListTrainingJobs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTrainingJobs
rq
          ListTrainingJobs
-> (ListTrainingJobs -> ListTrainingJobs) -> ListTrainingJobs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTrainingJobs -> Identity ListTrainingJobs
Lens ListTrainingJobs ListTrainingJobs (Maybe Text) (Maybe Text)
listTrainingJobs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTrainingJobs -> Identity ListTrainingJobs)
-> Maybe Text -> ListTrainingJobs -> ListTrainingJobs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTrainingJobs
ListTrainingJobsResponse
rs
          ListTrainingJobsResponse
-> Getting (First Text) ListTrainingJobsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTrainingJobsResponse
-> Const (First Text) ListTrainingJobsResponse
Lens' ListTrainingJobsResponse (Maybe Text)
listTrainingJobsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTrainingJobsResponse
 -> Const (First Text) ListTrainingJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTrainingJobsResponse 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 ListTrainingJobs where
  type
    AWSResponse ListTrainingJobs =
      ListTrainingJobsResponse
  request :: ListTrainingJobs -> Request ListTrainingJobs
request = Service -> ListTrainingJobs -> Request ListTrainingJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTrainingJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTrainingJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTrainingJobs))
-> Logger
-> Service
-> Proxy ListTrainingJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTrainingJobs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int -> [TrainingJobSummary] -> ListTrainingJobsResponse
ListTrainingJobsResponse'
            (Maybe Text
 -> Int -> [TrainingJobSummary] -> ListTrainingJobsResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [TrainingJobSummary] -> ListTrainingJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Int -> [TrainingJobSummary] -> ListTrainingJobsResponse)
-> Either String Int
-> Either String ([TrainingJobSummary] -> ListTrainingJobsResponse)
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))
            Either String ([TrainingJobSummary] -> ListTrainingJobsResponse)
-> Either String [TrainingJobSummary]
-> Either String ListTrainingJobsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [TrainingJobSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TrainingJobSummaries"
                            Either String (Maybe [TrainingJobSummary])
-> [TrainingJobSummary] -> Either String [TrainingJobSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [TrainingJobSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListTrainingJobs

instance Prelude.NFData ListTrainingJobs

instance Core.ToHeaders ListTrainingJobs where
  toHeaders :: ListTrainingJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTrainingJobs -> 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
"SageMaker.ListTrainingJobs" :: 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 ListTrainingJobs where
  toJSON :: ListTrainingJobs -> Value
toJSON ListTrainingJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortBy
Maybe SortOrder
Maybe TrainingJobStatus
sortBy :: Maybe SortBy
maxResults :: Maybe Natural
statusEquals :: Maybe TrainingJobStatus
creationTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
creationTimeAfter :: Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
nameContains :: Maybe Text
$sel:sortBy:ListTrainingJobs' :: ListTrainingJobs -> Maybe SortBy
$sel:maxResults:ListTrainingJobs' :: ListTrainingJobs -> Maybe Natural
$sel:statusEquals:ListTrainingJobs' :: ListTrainingJobs -> Maybe TrainingJobStatus
$sel:creationTimeBefore:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
$sel:sortOrder:ListTrainingJobs' :: ListTrainingJobs -> Maybe SortOrder
$sel:nextToken:ListTrainingJobs' :: ListTrainingJobs -> Maybe Text
$sel:creationTimeAfter:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
$sel:lastModifiedTimeBefore:ListTrainingJobs' :: ListTrainingJobs -> Maybe POSIX
$sel:nameContains:ListTrainingJobs' :: ListTrainingJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NameContains" 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
nameContains,
            (Text
"LastModifiedTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastModifiedTimeBefore,
            (Text
"CreationTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeAfter,
            (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
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
            (Text
"LastModifiedTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastModifiedTimeAfter,
            (Text
"CreationTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeBefore,
            (Text
"StatusEquals" Text -> TrainingJobStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TrainingJobStatus -> Pair)
-> Maybe TrainingJobStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TrainingJobStatus
statusEquals,
            (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,
            (Text
"SortBy" Text -> SortBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortBy -> Pair) -> Maybe SortBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortBy
sortBy
          ]
      )

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

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

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

-- |
-- Create a value of 'ListTrainingJobsResponse' 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', 'listTrainingJobsResponse_nextToken' - If the response is truncated, Amazon SageMaker returns this token. To
-- retrieve the next set of training jobs, use it in the subsequent
-- request.
--
-- 'httpStatus', 'listTrainingJobsResponse_httpStatus' - The response's http status code.
--
-- 'trainingJobSummaries', 'listTrainingJobsResponse_trainingJobSummaries' - An array of @TrainingJobSummary@ objects, each listing a training job.
newListTrainingJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTrainingJobsResponse
newListTrainingJobsResponse :: Int -> ListTrainingJobsResponse
newListTrainingJobsResponse Int
pHttpStatus_ =
  ListTrainingJobsResponse' :: Maybe Text
-> Int -> [TrainingJobSummary] -> ListTrainingJobsResponse
ListTrainingJobsResponse'
    { $sel:nextToken:ListTrainingJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTrainingJobsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:trainingJobSummaries:ListTrainingJobsResponse' :: [TrainingJobSummary]
trainingJobSummaries = [TrainingJobSummary]
forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | An array of @TrainingJobSummary@ objects, each listing a training job.
listTrainingJobsResponse_trainingJobSummaries :: Lens.Lens' ListTrainingJobsResponse [TrainingJobSummary]
listTrainingJobsResponse_trainingJobSummaries :: ([TrainingJobSummary] -> f [TrainingJobSummary])
-> ListTrainingJobsResponse -> f ListTrainingJobsResponse
listTrainingJobsResponse_trainingJobSummaries = (ListTrainingJobsResponse -> [TrainingJobSummary])
-> (ListTrainingJobsResponse
    -> [TrainingJobSummary] -> ListTrainingJobsResponse)
-> Lens' ListTrainingJobsResponse [TrainingJobSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrainingJobsResponse' {[TrainingJobSummary]
trainingJobSummaries :: [TrainingJobSummary]
$sel:trainingJobSummaries:ListTrainingJobsResponse' :: ListTrainingJobsResponse -> [TrainingJobSummary]
trainingJobSummaries} -> [TrainingJobSummary]
trainingJobSummaries) (\s :: ListTrainingJobsResponse
s@ListTrainingJobsResponse' {} [TrainingJobSummary]
a -> ListTrainingJobsResponse
s {$sel:trainingJobSummaries:ListTrainingJobsResponse' :: [TrainingJobSummary]
trainingJobSummaries = [TrainingJobSummary]
a} :: ListTrainingJobsResponse) (([TrainingJobSummary] -> f [TrainingJobSummary])
 -> ListTrainingJobsResponse -> f ListTrainingJobsResponse)
-> (([TrainingJobSummary] -> f [TrainingJobSummary])
    -> [TrainingJobSummary] -> f [TrainingJobSummary])
-> ([TrainingJobSummary] -> f [TrainingJobSummary])
-> ListTrainingJobsResponse
-> f ListTrainingJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TrainingJobSummary] -> f [TrainingJobSummary])
-> [TrainingJobSummary] -> f [TrainingJobSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListTrainingJobsResponse