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

    -- * Request Lenses
    listAutoMLJobs_creationTimeAfter,
    listAutoMLJobs_creationTimeBefore,
    listAutoMLJobs_lastModifiedTimeAfter,
    listAutoMLJobs_lastModifiedTimeBefore,
    listAutoMLJobs_maxResults,
    listAutoMLJobs_nameContains,
    listAutoMLJobs_nextToken,
    listAutoMLJobs_sortBy,
    listAutoMLJobs_sortOrder,
    listAutoMLJobs_statusEquals,

    -- * Destructuring the Response
    ListAutoMLJobsResponse (..),
    newListAutoMLJobsResponse,

    -- * Response Lenses
    listAutoMLJobsResponse_nextToken,
    listAutoMLJobsResponse_httpStatus,
    listAutoMLJobsResponse_autoMLJobSummaries,
  )
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:/ 'newListAutoMLJobs' smart constructor.
data ListAutoMLJobs = ListAutoMLJobs'
  { -- | Request a list of jobs, using a filter for time.
    ListAutoMLJobs -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | Request a list of jobs, using a filter for time.
    ListAutoMLJobs -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | Request a list of jobs, using a filter for time.
    ListAutoMLJobs -> Maybe POSIX
lastModifiedTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | Request a list of jobs, using a filter for time.
    ListAutoMLJobs -> Maybe POSIX
lastModifiedTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | Request a list of jobs up to a specified limit.
    ListAutoMLJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Request a list of jobs, using a search filter for name.
    ListAutoMLJobs -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the previous response was truncated, you receive this token. Use it
    -- in your next request to receive the next set of results.
    ListAutoMLJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The parameter by which to sort the results. The default is @Name@.
    ListAutoMLJobs -> Maybe AutoMLSortBy
sortBy :: Prelude.Maybe AutoMLSortBy,
    -- | The sort order for the results. The default is @Descending@.
    ListAutoMLJobs -> Maybe AutoMLSortOrder
sortOrder :: Prelude.Maybe AutoMLSortOrder,
    -- | Request a list of jobs, using a filter for status.
    ListAutoMLJobs -> Maybe AutoMLJobStatus
statusEquals :: Prelude.Maybe AutoMLJobStatus
  }
  deriving (ListAutoMLJobs -> ListAutoMLJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAutoMLJobs -> ListAutoMLJobs -> Bool
$c/= :: ListAutoMLJobs -> ListAutoMLJobs -> Bool
== :: ListAutoMLJobs -> ListAutoMLJobs -> Bool
$c== :: ListAutoMLJobs -> ListAutoMLJobs -> Bool
Prelude.Eq, ReadPrec [ListAutoMLJobs]
ReadPrec ListAutoMLJobs
Int -> ReadS ListAutoMLJobs
ReadS [ListAutoMLJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAutoMLJobs]
$creadListPrec :: ReadPrec [ListAutoMLJobs]
readPrec :: ReadPrec ListAutoMLJobs
$creadPrec :: ReadPrec ListAutoMLJobs
readList :: ReadS [ListAutoMLJobs]
$creadList :: ReadS [ListAutoMLJobs]
readsPrec :: Int -> ReadS ListAutoMLJobs
$creadsPrec :: Int -> ReadS ListAutoMLJobs
Prelude.Read, Int -> ListAutoMLJobs -> ShowS
[ListAutoMLJobs] -> ShowS
ListAutoMLJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAutoMLJobs] -> ShowS
$cshowList :: [ListAutoMLJobs] -> ShowS
show :: ListAutoMLJobs -> String
$cshow :: ListAutoMLJobs -> String
showsPrec :: Int -> ListAutoMLJobs -> ShowS
$cshowsPrec :: Int -> ListAutoMLJobs -> ShowS
Prelude.Show, forall x. Rep ListAutoMLJobs x -> ListAutoMLJobs
forall x. ListAutoMLJobs -> Rep ListAutoMLJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAutoMLJobs x -> ListAutoMLJobs
$cfrom :: forall x. ListAutoMLJobs -> Rep ListAutoMLJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListAutoMLJobs' 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', 'listAutoMLJobs_creationTimeAfter' - Request a list of jobs, using a filter for time.
--
-- 'creationTimeBefore', 'listAutoMLJobs_creationTimeBefore' - Request a list of jobs, using a filter for time.
--
-- 'lastModifiedTimeAfter', 'listAutoMLJobs_lastModifiedTimeAfter' - Request a list of jobs, using a filter for time.
--
-- 'lastModifiedTimeBefore', 'listAutoMLJobs_lastModifiedTimeBefore' - Request a list of jobs, using a filter for time.
--
-- 'maxResults', 'listAutoMLJobs_maxResults' - Request a list of jobs up to a specified limit.
--
-- 'nameContains', 'listAutoMLJobs_nameContains' - Request a list of jobs, using a search filter for name.
--
-- 'nextToken', 'listAutoMLJobs_nextToken' - If the previous response was truncated, you receive this token. Use it
-- in your next request to receive the next set of results.
--
-- 'sortBy', 'listAutoMLJobs_sortBy' - The parameter by which to sort the results. The default is @Name@.
--
-- 'sortOrder', 'listAutoMLJobs_sortOrder' - The sort order for the results. The default is @Descending@.
--
-- 'statusEquals', 'listAutoMLJobs_statusEquals' - Request a list of jobs, using a filter for status.
newListAutoMLJobs ::
  ListAutoMLJobs
newListAutoMLJobs :: ListAutoMLJobs
newListAutoMLJobs =
  ListAutoMLJobs'
    { $sel:creationTimeAfter:ListAutoMLJobs' :: Maybe POSIX
creationTimeAfter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListAutoMLJobs' :: Maybe POSIX
creationTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeAfter:ListAutoMLJobs' :: Maybe POSIX
lastModifiedTimeAfter = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTimeBefore:ListAutoMLJobs' :: Maybe POSIX
lastModifiedTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAutoMLJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nameContains:ListAutoMLJobs' :: Maybe Text
nameContains = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAutoMLJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListAutoMLJobs' :: Maybe AutoMLSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListAutoMLJobs' :: Maybe AutoMLSortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:statusEquals:ListAutoMLJobs' :: Maybe AutoMLJobStatus
statusEquals = forall a. Maybe a
Prelude.Nothing
    }

-- | Request a list of jobs, using a filter for time.
listAutoMLJobs_creationTimeAfter :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.UTCTime)
listAutoMLJobs_creationTimeAfter :: Lens' ListAutoMLJobs (Maybe UTCTime)
listAutoMLJobs_creationTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe POSIX
a -> ListAutoMLJobs
s {$sel:creationTimeAfter:ListAutoMLJobs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListAutoMLJobs) 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

-- | Request a list of jobs, using a filter for time.
listAutoMLJobs_creationTimeBefore :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.UTCTime)
listAutoMLJobs_creationTimeBefore :: Lens' ListAutoMLJobs (Maybe UTCTime)
listAutoMLJobs_creationTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe POSIX
a -> ListAutoMLJobs
s {$sel:creationTimeBefore:ListAutoMLJobs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListAutoMLJobs) 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

-- | Request a list of jobs, using a filter for time.
listAutoMLJobs_lastModifiedTimeAfter :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.UTCTime)
listAutoMLJobs_lastModifiedTimeAfter :: Lens' ListAutoMLJobs (Maybe UTCTime)
listAutoMLJobs_lastModifiedTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
$sel:lastModifiedTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
lastModifiedTimeAfter} -> Maybe POSIX
lastModifiedTimeAfter) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe POSIX
a -> ListAutoMLJobs
s {$sel:lastModifiedTimeAfter:ListAutoMLJobs' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
a} :: ListAutoMLJobs) 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

-- | Request a list of jobs, using a filter for time.
listAutoMLJobs_lastModifiedTimeBefore :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.UTCTime)
listAutoMLJobs_lastModifiedTimeBefore :: Lens' ListAutoMLJobs (Maybe UTCTime)
listAutoMLJobs_lastModifiedTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
$sel:lastModifiedTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
lastModifiedTimeBefore} -> Maybe POSIX
lastModifiedTimeBefore) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe POSIX
a -> ListAutoMLJobs
s {$sel:lastModifiedTimeBefore:ListAutoMLJobs' :: Maybe POSIX
lastModifiedTimeBefore = Maybe POSIX
a} :: ListAutoMLJobs) 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

-- | Request a list of jobs up to a specified limit.
listAutoMLJobs_maxResults :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.Natural)
listAutoMLJobs_maxResults :: Lens' ListAutoMLJobs (Maybe Natural)
listAutoMLJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe Natural
a -> ListAutoMLJobs
s {$sel:maxResults:ListAutoMLJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAutoMLJobs)

-- | Request a list of jobs, using a search filter for name.
listAutoMLJobs_nameContains :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.Text)
listAutoMLJobs_nameContains :: Lens' ListAutoMLJobs (Maybe Text)
listAutoMLJobs_nameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe Text
a -> ListAutoMLJobs
s {$sel:nameContains:ListAutoMLJobs' :: Maybe Text
nameContains = Maybe Text
a} :: ListAutoMLJobs)

-- | If the previous response was truncated, you receive this token. Use it
-- in your next request to receive the next set of results.
listAutoMLJobs_nextToken :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe Prelude.Text)
listAutoMLJobs_nextToken :: Lens' ListAutoMLJobs (Maybe Text)
listAutoMLJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe Text
a -> ListAutoMLJobs
s {$sel:nextToken:ListAutoMLJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListAutoMLJobs)

-- | The parameter by which to sort the results. The default is @Name@.
listAutoMLJobs_sortBy :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe AutoMLSortBy)
listAutoMLJobs_sortBy :: Lens' ListAutoMLJobs (Maybe AutoMLSortBy)
listAutoMLJobs_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe AutoMLSortBy
sortBy :: Maybe AutoMLSortBy
$sel:sortBy:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortBy
sortBy} -> Maybe AutoMLSortBy
sortBy) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe AutoMLSortBy
a -> ListAutoMLJobs
s {$sel:sortBy:ListAutoMLJobs' :: Maybe AutoMLSortBy
sortBy = Maybe AutoMLSortBy
a} :: ListAutoMLJobs)

-- | The sort order for the results. The default is @Descending@.
listAutoMLJobs_sortOrder :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe AutoMLSortOrder)
listAutoMLJobs_sortOrder :: Lens' ListAutoMLJobs (Maybe AutoMLSortOrder)
listAutoMLJobs_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe AutoMLSortOrder
sortOrder :: Maybe AutoMLSortOrder
$sel:sortOrder:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortOrder
sortOrder} -> Maybe AutoMLSortOrder
sortOrder) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe AutoMLSortOrder
a -> ListAutoMLJobs
s {$sel:sortOrder:ListAutoMLJobs' :: Maybe AutoMLSortOrder
sortOrder = Maybe AutoMLSortOrder
a} :: ListAutoMLJobs)

-- | Request a list of jobs, using a filter for status.
listAutoMLJobs_statusEquals :: Lens.Lens' ListAutoMLJobs (Prelude.Maybe AutoMLJobStatus)
listAutoMLJobs_statusEquals :: Lens' ListAutoMLJobs (Maybe AutoMLJobStatus)
listAutoMLJobs_statusEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobs' {Maybe AutoMLJobStatus
statusEquals :: Maybe AutoMLJobStatus
$sel:statusEquals:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLJobStatus
statusEquals} -> Maybe AutoMLJobStatus
statusEquals) (\s :: ListAutoMLJobs
s@ListAutoMLJobs' {} Maybe AutoMLJobStatus
a -> ListAutoMLJobs
s {$sel:statusEquals:ListAutoMLJobs' :: Maybe AutoMLJobStatus
statusEquals = Maybe AutoMLJobStatus
a} :: ListAutoMLJobs)

instance Core.AWSPager ListAutoMLJobs where
  page :: ListAutoMLJobs
-> AWSResponse ListAutoMLJobs -> Maybe ListAutoMLJobs
page ListAutoMLJobs
rq AWSResponse ListAutoMLJobs
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAutoMLJobs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAutoMLJobsResponse (Maybe Text)
listAutoMLJobsResponse_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 ListAutoMLJobs
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListAutoMLJobsResponse [AutoMLJobSummary]
listAutoMLJobsResponse_autoMLJobSummaries
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListAutoMLJobs
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAutoMLJobs (Maybe Text)
listAutoMLJobs_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAutoMLJobs
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAutoMLJobsResponse (Maybe Text)
listAutoMLJobsResponse_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 ListAutoMLJobs where
  type
    AWSResponse ListAutoMLJobs =
      ListAutoMLJobsResponse
  request :: (Service -> Service) -> ListAutoMLJobs -> Request ListAutoMLJobs
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 ListAutoMLJobs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAutoMLJobs)))
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 Text -> Int -> [AutoMLJobSummary] -> ListAutoMLJobsResponse
ListAutoMLJobsResponse'
            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
"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))
            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
"AutoMLJobSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListAutoMLJobs where
  hashWithSalt :: Int -> ListAutoMLJobs -> Int
hashWithSalt Int
_salt ListAutoMLJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AutoMLJobStatus
Maybe AutoMLSortBy
Maybe AutoMLSortOrder
statusEquals :: Maybe AutoMLJobStatus
sortOrder :: Maybe AutoMLSortOrder
sortBy :: Maybe AutoMLSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLJobStatus
$sel:sortOrder:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortOrder
$sel:sortBy:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortBy
$sel:nextToken:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:nameContains:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:maxResults:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> 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 AutoMLSortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMLSortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMLJobStatus
statusEquals

instance Prelude.NFData ListAutoMLJobs where
  rnf :: ListAutoMLJobs -> ()
rnf ListAutoMLJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AutoMLJobStatus
Maybe AutoMLSortBy
Maybe AutoMLSortOrder
statusEquals :: Maybe AutoMLJobStatus
sortOrder :: Maybe AutoMLSortOrder
sortBy :: Maybe AutoMLSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLJobStatus
$sel:sortOrder:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortOrder
$sel:sortBy:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortBy
$sel:nextToken:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:nameContains:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:maxResults:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> 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 AutoMLSortBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMLSortOrder
sortOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMLJobStatus
statusEquals

instance Data.ToHeaders ListAutoMLJobs where
  toHeaders :: ListAutoMLJobs -> 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.ListAutoMLJobs" :: 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 ListAutoMLJobs where
  toJSON :: ListAutoMLJobs -> Value
toJSON ListAutoMLJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AutoMLJobStatus
Maybe AutoMLSortBy
Maybe AutoMLSortOrder
statusEquals :: Maybe AutoMLJobStatus
sortOrder :: Maybe AutoMLSortOrder
sortBy :: Maybe AutoMLSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
lastModifiedTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:statusEquals:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLJobStatus
$sel:sortOrder:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortOrder
$sel:sortBy:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe AutoMLSortBy
$sel:nextToken:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:nameContains:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Text
$sel:maxResults:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe Natural
$sel:lastModifiedTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeBefore:ListAutoMLJobs' :: ListAutoMLJobs -> Maybe POSIX
$sel:creationTimeAfter:ListAutoMLJobs' :: ListAutoMLJobs -> 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 AutoMLSortBy
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 AutoMLSortOrder
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 AutoMLJobStatus
statusEquals
          ]
      )

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

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

-- | /See:/ 'newListAutoMLJobsResponse' smart constructor.
data ListAutoMLJobsResponse = ListAutoMLJobsResponse'
  { -- | If the previous response was truncated, you receive this token. Use it
    -- in your next request to receive the next set of results.
    ListAutoMLJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAutoMLJobsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Returns a summary list of jobs.
    ListAutoMLJobsResponse -> [AutoMLJobSummary]
autoMLJobSummaries :: [AutoMLJobSummary]
  }
  deriving (ListAutoMLJobsResponse -> ListAutoMLJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAutoMLJobsResponse -> ListAutoMLJobsResponse -> Bool
$c/= :: ListAutoMLJobsResponse -> ListAutoMLJobsResponse -> Bool
== :: ListAutoMLJobsResponse -> ListAutoMLJobsResponse -> Bool
$c== :: ListAutoMLJobsResponse -> ListAutoMLJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListAutoMLJobsResponse]
ReadPrec ListAutoMLJobsResponse
Int -> ReadS ListAutoMLJobsResponse
ReadS [ListAutoMLJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAutoMLJobsResponse]
$creadListPrec :: ReadPrec [ListAutoMLJobsResponse]
readPrec :: ReadPrec ListAutoMLJobsResponse
$creadPrec :: ReadPrec ListAutoMLJobsResponse
readList :: ReadS [ListAutoMLJobsResponse]
$creadList :: ReadS [ListAutoMLJobsResponse]
readsPrec :: Int -> ReadS ListAutoMLJobsResponse
$creadsPrec :: Int -> ReadS ListAutoMLJobsResponse
Prelude.Read, Int -> ListAutoMLJobsResponse -> ShowS
[ListAutoMLJobsResponse] -> ShowS
ListAutoMLJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAutoMLJobsResponse] -> ShowS
$cshowList :: [ListAutoMLJobsResponse] -> ShowS
show :: ListAutoMLJobsResponse -> String
$cshow :: ListAutoMLJobsResponse -> String
showsPrec :: Int -> ListAutoMLJobsResponse -> ShowS
$cshowsPrec :: Int -> ListAutoMLJobsResponse -> ShowS
Prelude.Show, forall x. Rep ListAutoMLJobsResponse x -> ListAutoMLJobsResponse
forall x. ListAutoMLJobsResponse -> Rep ListAutoMLJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAutoMLJobsResponse x -> ListAutoMLJobsResponse
$cfrom :: forall x. ListAutoMLJobsResponse -> Rep ListAutoMLJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAutoMLJobsResponse' 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', 'listAutoMLJobsResponse_nextToken' - If the previous response was truncated, you receive this token. Use it
-- in your next request to receive the next set of results.
--
-- 'httpStatus', 'listAutoMLJobsResponse_httpStatus' - The response's http status code.
--
-- 'autoMLJobSummaries', 'listAutoMLJobsResponse_autoMLJobSummaries' - Returns a summary list of jobs.
newListAutoMLJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAutoMLJobsResponse
newListAutoMLJobsResponse :: Int -> ListAutoMLJobsResponse
newListAutoMLJobsResponse Int
pHttpStatus_ =
  ListAutoMLJobsResponse'
    { $sel:nextToken:ListAutoMLJobsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAutoMLJobsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:autoMLJobSummaries:ListAutoMLJobsResponse' :: [AutoMLJobSummary]
autoMLJobSummaries = forall a. Monoid a => a
Prelude.mempty
    }

-- | If the previous response was truncated, you receive this token. Use it
-- in your next request to receive the next set of results.
listAutoMLJobsResponse_nextToken :: Lens.Lens' ListAutoMLJobsResponse (Prelude.Maybe Prelude.Text)
listAutoMLJobsResponse_nextToken :: Lens' ListAutoMLJobsResponse (Maybe Text)
listAutoMLJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAutoMLJobsResponse' :: ListAutoMLJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAutoMLJobsResponse
s@ListAutoMLJobsResponse' {} Maybe Text
a -> ListAutoMLJobsResponse
s {$sel:nextToken:ListAutoMLJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAutoMLJobsResponse)

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

-- | Returns a summary list of jobs.
listAutoMLJobsResponse_autoMLJobSummaries :: Lens.Lens' ListAutoMLJobsResponse [AutoMLJobSummary]
listAutoMLJobsResponse_autoMLJobSummaries :: Lens' ListAutoMLJobsResponse [AutoMLJobSummary]
listAutoMLJobsResponse_autoMLJobSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAutoMLJobsResponse' {[AutoMLJobSummary]
autoMLJobSummaries :: [AutoMLJobSummary]
$sel:autoMLJobSummaries:ListAutoMLJobsResponse' :: ListAutoMLJobsResponse -> [AutoMLJobSummary]
autoMLJobSummaries} -> [AutoMLJobSummary]
autoMLJobSummaries) (\s :: ListAutoMLJobsResponse
s@ListAutoMLJobsResponse' {} [AutoMLJobSummary]
a -> ListAutoMLJobsResponse
s {$sel:autoMLJobSummaries:ListAutoMLJobsResponse' :: [AutoMLJobSummary]
autoMLJobSummaries = [AutoMLJobSummary]
a} :: ListAutoMLJobsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAutoMLJobsResponse where
  rnf :: ListAutoMLJobsResponse -> ()
rnf ListAutoMLJobsResponse' {Int
[AutoMLJobSummary]
Maybe Text
autoMLJobSummaries :: [AutoMLJobSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:autoMLJobSummaries:ListAutoMLJobsResponse' :: ListAutoMLJobsResponse -> [AutoMLJobSummary]
$sel:httpStatus:ListAutoMLJobsResponse' :: ListAutoMLJobsResponse -> Int
$sel:nextToken:ListAutoMLJobsResponse' :: ListAutoMLJobsResponse -> Maybe Text
..} =
    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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AutoMLJobSummary]
autoMLJobSummaries