{-# 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.Glue.GetMLTaskRuns
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list of runs for a machine learning transform. Machine learning
-- task runs are asynchronous tasks that Glue runs on your behalf as part
-- of various machine learning workflows. You can get a sortable,
-- filterable list of machine learning task runs by calling @GetMLTaskRuns@
-- with their parent transform\'s @TransformID@ and other optional
-- parameters as documented in this section.
--
-- This operation returns a list of historic runs and must be paginated.
module Amazonka.Glue.GetMLTaskRuns
  ( -- * Creating a Request
    GetMLTaskRuns (..),
    newGetMLTaskRuns,

    -- * Request Lenses
    getMLTaskRuns_nextToken,
    getMLTaskRuns_sort,
    getMLTaskRuns_filter,
    getMLTaskRuns_maxResults,
    getMLTaskRuns_transformId,

    -- * Destructuring the Response
    GetMLTaskRunsResponse (..),
    newGetMLTaskRunsResponse,

    -- * Response Lenses
    getMLTaskRunsResponse_nextToken,
    getMLTaskRunsResponse_taskRuns,
    getMLTaskRunsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetMLTaskRuns' smart constructor.
data GetMLTaskRuns = GetMLTaskRuns'
  { -- | A token for pagination of the results. The default is empty.
    GetMLTaskRuns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sorting criteria, in the @TaskRunSortCriteria@ structure, for the
    -- task run.
    GetMLTaskRuns -> Maybe TaskRunSortCriteria
sort :: Prelude.Maybe TaskRunSortCriteria,
    -- | The filter criteria, in the @TaskRunFilterCriteria@ structure, for the
    -- task run.
    GetMLTaskRuns -> Maybe TaskRunFilterCriteria
filter' :: Prelude.Maybe TaskRunFilterCriteria,
    -- | The maximum number of results to return.
    GetMLTaskRuns -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique identifier of the machine learning transform.
    GetMLTaskRuns -> Text
transformId :: Prelude.Text
  }
  deriving (GetMLTaskRuns -> GetMLTaskRuns -> Bool
(GetMLTaskRuns -> GetMLTaskRuns -> Bool)
-> (GetMLTaskRuns -> GetMLTaskRuns -> Bool) -> Eq GetMLTaskRuns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMLTaskRuns -> GetMLTaskRuns -> Bool
$c/= :: GetMLTaskRuns -> GetMLTaskRuns -> Bool
== :: GetMLTaskRuns -> GetMLTaskRuns -> Bool
$c== :: GetMLTaskRuns -> GetMLTaskRuns -> Bool
Prelude.Eq, ReadPrec [GetMLTaskRuns]
ReadPrec GetMLTaskRuns
Int -> ReadS GetMLTaskRuns
ReadS [GetMLTaskRuns]
(Int -> ReadS GetMLTaskRuns)
-> ReadS [GetMLTaskRuns]
-> ReadPrec GetMLTaskRuns
-> ReadPrec [GetMLTaskRuns]
-> Read GetMLTaskRuns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMLTaskRuns]
$creadListPrec :: ReadPrec [GetMLTaskRuns]
readPrec :: ReadPrec GetMLTaskRuns
$creadPrec :: ReadPrec GetMLTaskRuns
readList :: ReadS [GetMLTaskRuns]
$creadList :: ReadS [GetMLTaskRuns]
readsPrec :: Int -> ReadS GetMLTaskRuns
$creadsPrec :: Int -> ReadS GetMLTaskRuns
Prelude.Read, Int -> GetMLTaskRuns -> ShowS
[GetMLTaskRuns] -> ShowS
GetMLTaskRuns -> String
(Int -> GetMLTaskRuns -> ShowS)
-> (GetMLTaskRuns -> String)
-> ([GetMLTaskRuns] -> ShowS)
-> Show GetMLTaskRuns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMLTaskRuns] -> ShowS
$cshowList :: [GetMLTaskRuns] -> ShowS
show :: GetMLTaskRuns -> String
$cshow :: GetMLTaskRuns -> String
showsPrec :: Int -> GetMLTaskRuns -> ShowS
$cshowsPrec :: Int -> GetMLTaskRuns -> ShowS
Prelude.Show, (forall x. GetMLTaskRuns -> Rep GetMLTaskRuns x)
-> (forall x. Rep GetMLTaskRuns x -> GetMLTaskRuns)
-> Generic GetMLTaskRuns
forall x. Rep GetMLTaskRuns x -> GetMLTaskRuns
forall x. GetMLTaskRuns -> Rep GetMLTaskRuns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMLTaskRuns x -> GetMLTaskRuns
$cfrom :: forall x. GetMLTaskRuns -> Rep GetMLTaskRuns x
Prelude.Generic)

-- |
-- Create a value of 'GetMLTaskRuns' 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', 'getMLTaskRuns_nextToken' - A token for pagination of the results. The default is empty.
--
-- 'sort', 'getMLTaskRuns_sort' - The sorting criteria, in the @TaskRunSortCriteria@ structure, for the
-- task run.
--
-- 'filter'', 'getMLTaskRuns_filter' - The filter criteria, in the @TaskRunFilterCriteria@ structure, for the
-- task run.
--
-- 'maxResults', 'getMLTaskRuns_maxResults' - The maximum number of results to return.
--
-- 'transformId', 'getMLTaskRuns_transformId' - The unique identifier of the machine learning transform.
newGetMLTaskRuns ::
  -- | 'transformId'
  Prelude.Text ->
  GetMLTaskRuns
newGetMLTaskRuns :: Text -> GetMLTaskRuns
newGetMLTaskRuns Text
pTransformId_ =
  GetMLTaskRuns' :: Maybe Text
-> Maybe TaskRunSortCriteria
-> Maybe TaskRunFilterCriteria
-> Maybe Natural
-> Text
-> GetMLTaskRuns
GetMLTaskRuns'
    { $sel:nextToken:GetMLTaskRuns' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sort:GetMLTaskRuns' :: Maybe TaskRunSortCriteria
sort = Maybe TaskRunSortCriteria
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetMLTaskRuns' :: Maybe TaskRunFilterCriteria
filter' = Maybe TaskRunFilterCriteria
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetMLTaskRuns' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:transformId:GetMLTaskRuns' :: Text
transformId = Text
pTransformId_
    }

-- | A token for pagination of the results. The default is empty.
getMLTaskRuns_nextToken :: Lens.Lens' GetMLTaskRuns (Prelude.Maybe Prelude.Text)
getMLTaskRuns_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetMLTaskRuns -> f GetMLTaskRuns
getMLTaskRuns_nextToken = (GetMLTaskRuns -> Maybe Text)
-> (GetMLTaskRuns -> Maybe Text -> GetMLTaskRuns)
-> Lens GetMLTaskRuns GetMLTaskRuns (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRuns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMLTaskRuns
s@GetMLTaskRuns' {} Maybe Text
a -> GetMLTaskRuns
s {$sel:nextToken:GetMLTaskRuns' :: Maybe Text
nextToken = Maybe Text
a} :: GetMLTaskRuns)

-- | The sorting criteria, in the @TaskRunSortCriteria@ structure, for the
-- task run.
getMLTaskRuns_sort :: Lens.Lens' GetMLTaskRuns (Prelude.Maybe TaskRunSortCriteria)
getMLTaskRuns_sort :: (Maybe TaskRunSortCriteria -> f (Maybe TaskRunSortCriteria))
-> GetMLTaskRuns -> f GetMLTaskRuns
getMLTaskRuns_sort = (GetMLTaskRuns -> Maybe TaskRunSortCriteria)
-> (GetMLTaskRuns -> Maybe TaskRunSortCriteria -> GetMLTaskRuns)
-> Lens
     GetMLTaskRuns
     GetMLTaskRuns
     (Maybe TaskRunSortCriteria)
     (Maybe TaskRunSortCriteria)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRuns' {Maybe TaskRunSortCriteria
sort :: Maybe TaskRunSortCriteria
$sel:sort:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe TaskRunSortCriteria
sort} -> Maybe TaskRunSortCriteria
sort) (\s :: GetMLTaskRuns
s@GetMLTaskRuns' {} Maybe TaskRunSortCriteria
a -> GetMLTaskRuns
s {$sel:sort:GetMLTaskRuns' :: Maybe TaskRunSortCriteria
sort = Maybe TaskRunSortCriteria
a} :: GetMLTaskRuns)

-- | The filter criteria, in the @TaskRunFilterCriteria@ structure, for the
-- task run.
getMLTaskRuns_filter :: Lens.Lens' GetMLTaskRuns (Prelude.Maybe TaskRunFilterCriteria)
getMLTaskRuns_filter :: (Maybe TaskRunFilterCriteria -> f (Maybe TaskRunFilterCriteria))
-> GetMLTaskRuns -> f GetMLTaskRuns
getMLTaskRuns_filter = (GetMLTaskRuns -> Maybe TaskRunFilterCriteria)
-> (GetMLTaskRuns -> Maybe TaskRunFilterCriteria -> GetMLTaskRuns)
-> Lens
     GetMLTaskRuns
     GetMLTaskRuns
     (Maybe TaskRunFilterCriteria)
     (Maybe TaskRunFilterCriteria)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRuns' {Maybe TaskRunFilterCriteria
filter' :: Maybe TaskRunFilterCriteria
$sel:filter':GetMLTaskRuns' :: GetMLTaskRuns -> Maybe TaskRunFilterCriteria
filter'} -> Maybe TaskRunFilterCriteria
filter') (\s :: GetMLTaskRuns
s@GetMLTaskRuns' {} Maybe TaskRunFilterCriteria
a -> GetMLTaskRuns
s {$sel:filter':GetMLTaskRuns' :: Maybe TaskRunFilterCriteria
filter' = Maybe TaskRunFilterCriteria
a} :: GetMLTaskRuns)

-- | The maximum number of results to return.
getMLTaskRuns_maxResults :: Lens.Lens' GetMLTaskRuns (Prelude.Maybe Prelude.Natural)
getMLTaskRuns_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetMLTaskRuns -> f GetMLTaskRuns
getMLTaskRuns_maxResults = (GetMLTaskRuns -> Maybe Natural)
-> (GetMLTaskRuns -> Maybe Natural -> GetMLTaskRuns)
-> Lens GetMLTaskRuns GetMLTaskRuns (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRuns' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetMLTaskRuns
s@GetMLTaskRuns' {} Maybe Natural
a -> GetMLTaskRuns
s {$sel:maxResults:GetMLTaskRuns' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetMLTaskRuns)

-- | The unique identifier of the machine learning transform.
getMLTaskRuns_transformId :: Lens.Lens' GetMLTaskRuns Prelude.Text
getMLTaskRuns_transformId :: (Text -> f Text) -> GetMLTaskRuns -> f GetMLTaskRuns
getMLTaskRuns_transformId = (GetMLTaskRuns -> Text)
-> (GetMLTaskRuns -> Text -> GetMLTaskRuns)
-> Lens GetMLTaskRuns GetMLTaskRuns Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRuns' {Text
transformId :: Text
$sel:transformId:GetMLTaskRuns' :: GetMLTaskRuns -> Text
transformId} -> Text
transformId) (\s :: GetMLTaskRuns
s@GetMLTaskRuns' {} Text
a -> GetMLTaskRuns
s {$sel:transformId:GetMLTaskRuns' :: Text
transformId = Text
a} :: GetMLTaskRuns)

instance Core.AWSRequest GetMLTaskRuns where
  type
    AWSResponse GetMLTaskRuns =
      GetMLTaskRunsResponse
  request :: GetMLTaskRuns -> Request GetMLTaskRuns
request = Service -> GetMLTaskRuns -> Request GetMLTaskRuns
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMLTaskRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMLTaskRuns)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMLTaskRuns))
-> Logger
-> Service
-> Proxy GetMLTaskRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMLTaskRuns)))
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 -> Maybe [TaskRun] -> Int -> GetMLTaskRunsResponse
GetMLTaskRunsResponse'
            (Maybe Text -> Maybe [TaskRun] -> Int -> GetMLTaskRunsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [TaskRun] -> Int -> GetMLTaskRunsResponse)
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 (Maybe [TaskRun] -> Int -> GetMLTaskRunsResponse)
-> Either String (Maybe [TaskRun])
-> Either String (Int -> GetMLTaskRunsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [TaskRun]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TaskRuns" Either String (Maybe (Maybe [TaskRun]))
-> Maybe [TaskRun] -> Either String (Maybe [TaskRun])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TaskRun]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetMLTaskRunsResponse)
-> Either String Int -> Either String GetMLTaskRunsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetMLTaskRuns

instance Prelude.NFData GetMLTaskRuns

instance Core.ToHeaders GetMLTaskRuns where
  toHeaders :: GetMLTaskRuns -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMLTaskRuns -> 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
"AWSGlue.GetMLTaskRuns" :: 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 GetMLTaskRuns where
  toJSON :: GetMLTaskRuns -> Value
toJSON GetMLTaskRuns' {Maybe Natural
Maybe Text
Maybe TaskRunSortCriteria
Maybe TaskRunFilterCriteria
Text
transformId :: Text
maxResults :: Maybe Natural
filter' :: Maybe TaskRunFilterCriteria
sort :: Maybe TaskRunSortCriteria
nextToken :: Maybe Text
$sel:transformId:GetMLTaskRuns' :: GetMLTaskRuns -> Text
$sel:maxResults:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe Natural
$sel:filter':GetMLTaskRuns' :: GetMLTaskRuns -> Maybe TaskRunFilterCriteria
$sel:sort:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe TaskRunSortCriteria
$sel:nextToken:GetMLTaskRuns' :: GetMLTaskRuns -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Sort" Text -> TaskRunSortCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskRunSortCriteria -> Pair)
-> Maybe TaskRunSortCriteria -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskRunSortCriteria
sort,
            (Text
"Filter" Text -> TaskRunFilterCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskRunFilterCriteria -> Pair)
-> Maybe TaskRunFilterCriteria -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskRunFilterCriteria
filter',
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TransformId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transformId)
          ]
      )

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

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

-- | /See:/ 'newGetMLTaskRunsResponse' smart constructor.
data GetMLTaskRunsResponse = GetMLTaskRunsResponse'
  { -- | A pagination token, if more results are available.
    GetMLTaskRunsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of task runs that are associated with the transform.
    GetMLTaskRunsResponse -> Maybe [TaskRun]
taskRuns :: Prelude.Maybe [TaskRun],
    -- | The response's http status code.
    GetMLTaskRunsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool
(GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool)
-> (GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool)
-> Eq GetMLTaskRunsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool
$c/= :: GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool
== :: GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool
$c== :: GetMLTaskRunsResponse -> GetMLTaskRunsResponse -> Bool
Prelude.Eq, ReadPrec [GetMLTaskRunsResponse]
ReadPrec GetMLTaskRunsResponse
Int -> ReadS GetMLTaskRunsResponse
ReadS [GetMLTaskRunsResponse]
(Int -> ReadS GetMLTaskRunsResponse)
-> ReadS [GetMLTaskRunsResponse]
-> ReadPrec GetMLTaskRunsResponse
-> ReadPrec [GetMLTaskRunsResponse]
-> Read GetMLTaskRunsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMLTaskRunsResponse]
$creadListPrec :: ReadPrec [GetMLTaskRunsResponse]
readPrec :: ReadPrec GetMLTaskRunsResponse
$creadPrec :: ReadPrec GetMLTaskRunsResponse
readList :: ReadS [GetMLTaskRunsResponse]
$creadList :: ReadS [GetMLTaskRunsResponse]
readsPrec :: Int -> ReadS GetMLTaskRunsResponse
$creadsPrec :: Int -> ReadS GetMLTaskRunsResponse
Prelude.Read, Int -> GetMLTaskRunsResponse -> ShowS
[GetMLTaskRunsResponse] -> ShowS
GetMLTaskRunsResponse -> String
(Int -> GetMLTaskRunsResponse -> ShowS)
-> (GetMLTaskRunsResponse -> String)
-> ([GetMLTaskRunsResponse] -> ShowS)
-> Show GetMLTaskRunsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMLTaskRunsResponse] -> ShowS
$cshowList :: [GetMLTaskRunsResponse] -> ShowS
show :: GetMLTaskRunsResponse -> String
$cshow :: GetMLTaskRunsResponse -> String
showsPrec :: Int -> GetMLTaskRunsResponse -> ShowS
$cshowsPrec :: Int -> GetMLTaskRunsResponse -> ShowS
Prelude.Show, (forall x. GetMLTaskRunsResponse -> Rep GetMLTaskRunsResponse x)
-> (forall x. Rep GetMLTaskRunsResponse x -> GetMLTaskRunsResponse)
-> Generic GetMLTaskRunsResponse
forall x. Rep GetMLTaskRunsResponse x -> GetMLTaskRunsResponse
forall x. GetMLTaskRunsResponse -> Rep GetMLTaskRunsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMLTaskRunsResponse x -> GetMLTaskRunsResponse
$cfrom :: forall x. GetMLTaskRunsResponse -> Rep GetMLTaskRunsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMLTaskRunsResponse' 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', 'getMLTaskRunsResponse_nextToken' - A pagination token, if more results are available.
--
-- 'taskRuns', 'getMLTaskRunsResponse_taskRuns' - A list of task runs that are associated with the transform.
--
-- 'httpStatus', 'getMLTaskRunsResponse_httpStatus' - The response's http status code.
newGetMLTaskRunsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMLTaskRunsResponse
newGetMLTaskRunsResponse :: Int -> GetMLTaskRunsResponse
newGetMLTaskRunsResponse Int
pHttpStatus_ =
  GetMLTaskRunsResponse' :: Maybe Text -> Maybe [TaskRun] -> Int -> GetMLTaskRunsResponse
GetMLTaskRunsResponse'
    { $sel:nextToken:GetMLTaskRunsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskRuns:GetMLTaskRunsResponse' :: Maybe [TaskRun]
taskRuns = Maybe [TaskRun]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMLTaskRunsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A pagination token, if more results are available.
getMLTaskRunsResponse_nextToken :: Lens.Lens' GetMLTaskRunsResponse (Prelude.Maybe Prelude.Text)
getMLTaskRunsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetMLTaskRunsResponse -> f GetMLTaskRunsResponse
getMLTaskRunsResponse_nextToken = (GetMLTaskRunsResponse -> Maybe Text)
-> (GetMLTaskRunsResponse -> Maybe Text -> GetMLTaskRunsResponse)
-> Lens
     GetMLTaskRunsResponse
     GetMLTaskRunsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRunsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMLTaskRunsResponse' :: GetMLTaskRunsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMLTaskRunsResponse
s@GetMLTaskRunsResponse' {} Maybe Text
a -> GetMLTaskRunsResponse
s {$sel:nextToken:GetMLTaskRunsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetMLTaskRunsResponse)

-- | A list of task runs that are associated with the transform.
getMLTaskRunsResponse_taskRuns :: Lens.Lens' GetMLTaskRunsResponse (Prelude.Maybe [TaskRun])
getMLTaskRunsResponse_taskRuns :: (Maybe [TaskRun] -> f (Maybe [TaskRun]))
-> GetMLTaskRunsResponse -> f GetMLTaskRunsResponse
getMLTaskRunsResponse_taskRuns = (GetMLTaskRunsResponse -> Maybe [TaskRun])
-> (GetMLTaskRunsResponse
    -> Maybe [TaskRun] -> GetMLTaskRunsResponse)
-> Lens
     GetMLTaskRunsResponse
     GetMLTaskRunsResponse
     (Maybe [TaskRun])
     (Maybe [TaskRun])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMLTaskRunsResponse' {Maybe [TaskRun]
taskRuns :: Maybe [TaskRun]
$sel:taskRuns:GetMLTaskRunsResponse' :: GetMLTaskRunsResponse -> Maybe [TaskRun]
taskRuns} -> Maybe [TaskRun]
taskRuns) (\s :: GetMLTaskRunsResponse
s@GetMLTaskRunsResponse' {} Maybe [TaskRun]
a -> GetMLTaskRunsResponse
s {$sel:taskRuns:GetMLTaskRunsResponse' :: Maybe [TaskRun]
taskRuns = Maybe [TaskRun]
a} :: GetMLTaskRunsResponse) ((Maybe [TaskRun] -> f (Maybe [TaskRun]))
 -> GetMLTaskRunsResponse -> f GetMLTaskRunsResponse)
-> ((Maybe [TaskRun] -> f (Maybe [TaskRun]))
    -> Maybe [TaskRun] -> f (Maybe [TaskRun]))
-> (Maybe [TaskRun] -> f (Maybe [TaskRun]))
-> GetMLTaskRunsResponse
-> f GetMLTaskRunsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TaskRun] [TaskRun] [TaskRun] [TaskRun]
-> Iso
     (Maybe [TaskRun])
     (Maybe [TaskRun])
     (Maybe [TaskRun])
     (Maybe [TaskRun])
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 [TaskRun] [TaskRun] [TaskRun] [TaskRun]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetMLTaskRunsResponse