{-# 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.DataSync.ListTaskExecutions
-- 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)
--
-- Returns a list of executed tasks.
--
-- This operation returns paginated results.
module Amazonka.DataSync.ListTaskExecutions
  ( -- * Creating a Request
    ListTaskExecutions (..),
    newListTaskExecutions,

    -- * Request Lenses
    listTaskExecutions_taskArn,
    listTaskExecutions_nextToken,
    listTaskExecutions_maxResults,

    -- * Destructuring the Response
    ListTaskExecutionsResponse (..),
    newListTaskExecutionsResponse,

    -- * Response Lenses
    listTaskExecutionsResponse_nextToken,
    listTaskExecutionsResponse_taskExecutions,
    listTaskExecutionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.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

-- | ListTaskExecutions
--
-- /See:/ 'newListTaskExecutions' smart constructor.
data ListTaskExecutions = ListTaskExecutions'
  { -- | The Amazon Resource Name (ARN) of the task whose tasks you want to list.
    ListTaskExecutions -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
    -- | An opaque string that indicates the position at which to begin the next
    -- list of the executed tasks.
    ListTaskExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of executed tasks to list.
    ListTaskExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListTaskExecutions -> ListTaskExecutions -> Bool
(ListTaskExecutions -> ListTaskExecutions -> Bool)
-> (ListTaskExecutions -> ListTaskExecutions -> Bool)
-> Eq ListTaskExecutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTaskExecutions -> ListTaskExecutions -> Bool
$c/= :: ListTaskExecutions -> ListTaskExecutions -> Bool
== :: ListTaskExecutions -> ListTaskExecutions -> Bool
$c== :: ListTaskExecutions -> ListTaskExecutions -> Bool
Prelude.Eq, ReadPrec [ListTaskExecutions]
ReadPrec ListTaskExecutions
Int -> ReadS ListTaskExecutions
ReadS [ListTaskExecutions]
(Int -> ReadS ListTaskExecutions)
-> ReadS [ListTaskExecutions]
-> ReadPrec ListTaskExecutions
-> ReadPrec [ListTaskExecutions]
-> Read ListTaskExecutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTaskExecutions]
$creadListPrec :: ReadPrec [ListTaskExecutions]
readPrec :: ReadPrec ListTaskExecutions
$creadPrec :: ReadPrec ListTaskExecutions
readList :: ReadS [ListTaskExecutions]
$creadList :: ReadS [ListTaskExecutions]
readsPrec :: Int -> ReadS ListTaskExecutions
$creadsPrec :: Int -> ReadS ListTaskExecutions
Prelude.Read, Int -> ListTaskExecutions -> ShowS
[ListTaskExecutions] -> ShowS
ListTaskExecutions -> String
(Int -> ListTaskExecutions -> ShowS)
-> (ListTaskExecutions -> String)
-> ([ListTaskExecutions] -> ShowS)
-> Show ListTaskExecutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTaskExecutions] -> ShowS
$cshowList :: [ListTaskExecutions] -> ShowS
show :: ListTaskExecutions -> String
$cshow :: ListTaskExecutions -> String
showsPrec :: Int -> ListTaskExecutions -> ShowS
$cshowsPrec :: Int -> ListTaskExecutions -> ShowS
Prelude.Show, (forall x. ListTaskExecutions -> Rep ListTaskExecutions x)
-> (forall x. Rep ListTaskExecutions x -> ListTaskExecutions)
-> Generic ListTaskExecutions
forall x. Rep ListTaskExecutions x -> ListTaskExecutions
forall x. ListTaskExecutions -> Rep ListTaskExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTaskExecutions x -> ListTaskExecutions
$cfrom :: forall x. ListTaskExecutions -> Rep ListTaskExecutions x
Prelude.Generic)

-- |
-- Create a value of 'ListTaskExecutions' 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:
--
-- 'taskArn', 'listTaskExecutions_taskArn' - The Amazon Resource Name (ARN) of the task whose tasks you want to list.
--
-- 'nextToken', 'listTaskExecutions_nextToken' - An opaque string that indicates the position at which to begin the next
-- list of the executed tasks.
--
-- 'maxResults', 'listTaskExecutions_maxResults' - The maximum number of executed tasks to list.
newListTaskExecutions ::
  ListTaskExecutions
newListTaskExecutions :: ListTaskExecutions
newListTaskExecutions =
  ListTaskExecutions' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListTaskExecutions
ListTaskExecutions'
    { $sel:taskArn:ListTaskExecutions' :: Maybe Text
taskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTaskExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTaskExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the task whose tasks you want to list.
listTaskExecutions_taskArn :: Lens.Lens' ListTaskExecutions (Prelude.Maybe Prelude.Text)
listTaskExecutions_taskArn :: (Maybe Text -> f (Maybe Text))
-> ListTaskExecutions -> f ListTaskExecutions
listTaskExecutions_taskArn = (ListTaskExecutions -> Maybe Text)
-> (ListTaskExecutions -> Maybe Text -> ListTaskExecutions)
-> Lens
     ListTaskExecutions ListTaskExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTaskExecutions' {Maybe Text
taskArn :: Maybe Text
$sel:taskArn:ListTaskExecutions' :: ListTaskExecutions -> Maybe Text
taskArn} -> Maybe Text
taskArn) (\s :: ListTaskExecutions
s@ListTaskExecutions' {} Maybe Text
a -> ListTaskExecutions
s {$sel:taskArn:ListTaskExecutions' :: Maybe Text
taskArn = Maybe Text
a} :: ListTaskExecutions)

-- | An opaque string that indicates the position at which to begin the next
-- list of the executed tasks.
listTaskExecutions_nextToken :: Lens.Lens' ListTaskExecutions (Prelude.Maybe Prelude.Text)
listTaskExecutions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTaskExecutions -> f ListTaskExecutions
listTaskExecutions_nextToken = (ListTaskExecutions -> Maybe Text)
-> (ListTaskExecutions -> Maybe Text -> ListTaskExecutions)
-> Lens
     ListTaskExecutions ListTaskExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTaskExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTaskExecutions' :: ListTaskExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTaskExecutions
s@ListTaskExecutions' {} Maybe Text
a -> ListTaskExecutions
s {$sel:nextToken:ListTaskExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListTaskExecutions)

-- | The maximum number of executed tasks to list.
listTaskExecutions_maxResults :: Lens.Lens' ListTaskExecutions (Prelude.Maybe Prelude.Natural)
listTaskExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListTaskExecutions -> f ListTaskExecutions
listTaskExecutions_maxResults = (ListTaskExecutions -> Maybe Natural)
-> (ListTaskExecutions -> Maybe Natural -> ListTaskExecutions)
-> Lens
     ListTaskExecutions
     ListTaskExecutions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTaskExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTaskExecutions' :: ListTaskExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTaskExecutions
s@ListTaskExecutions' {} Maybe Natural
a -> ListTaskExecutions
s {$sel:maxResults:ListTaskExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTaskExecutions)

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

instance Prelude.NFData ListTaskExecutions

instance Core.ToHeaders ListTaskExecutions where
  toHeaders :: ListTaskExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTaskExecutions -> 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
"FmrsService.ListTaskExecutions" ::
                          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 ListTaskExecutions where
  toJSON :: ListTaskExecutions -> Value
toJSON ListTaskExecutions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
taskArn :: Maybe Text
$sel:maxResults:ListTaskExecutions' :: ListTaskExecutions -> Maybe Natural
$sel:nextToken:ListTaskExecutions' :: ListTaskExecutions -> Maybe Text
$sel:taskArn:ListTaskExecutions' :: ListTaskExecutions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TaskArn" 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
taskArn,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> 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
          ]
      )

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

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

-- | ListTaskExecutionsResponse
--
-- /See:/ 'newListTaskExecutionsResponse' smart constructor.
data ListTaskExecutionsResponse = ListTaskExecutionsResponse'
  { -- | An opaque string that indicates the position at which to begin returning
    -- the next list of executed tasks.
    ListTaskExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of executed tasks.
    ListTaskExecutionsResponse -> Maybe [TaskExecutionListEntry]
taskExecutions :: Prelude.Maybe [TaskExecutionListEntry],
    -- | The response's http status code.
    ListTaskExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool
(ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool)
-> (ListTaskExecutionsResponse
    -> ListTaskExecutionsResponse -> Bool)
-> Eq ListTaskExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool
$c/= :: ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool
== :: ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool
$c== :: ListTaskExecutionsResponse -> ListTaskExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListTaskExecutionsResponse]
ReadPrec ListTaskExecutionsResponse
Int -> ReadS ListTaskExecutionsResponse
ReadS [ListTaskExecutionsResponse]
(Int -> ReadS ListTaskExecutionsResponse)
-> ReadS [ListTaskExecutionsResponse]
-> ReadPrec ListTaskExecutionsResponse
-> ReadPrec [ListTaskExecutionsResponse]
-> Read ListTaskExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTaskExecutionsResponse]
$creadListPrec :: ReadPrec [ListTaskExecutionsResponse]
readPrec :: ReadPrec ListTaskExecutionsResponse
$creadPrec :: ReadPrec ListTaskExecutionsResponse
readList :: ReadS [ListTaskExecutionsResponse]
$creadList :: ReadS [ListTaskExecutionsResponse]
readsPrec :: Int -> ReadS ListTaskExecutionsResponse
$creadsPrec :: Int -> ReadS ListTaskExecutionsResponse
Prelude.Read, Int -> ListTaskExecutionsResponse -> ShowS
[ListTaskExecutionsResponse] -> ShowS
ListTaskExecutionsResponse -> String
(Int -> ListTaskExecutionsResponse -> ShowS)
-> (ListTaskExecutionsResponse -> String)
-> ([ListTaskExecutionsResponse] -> ShowS)
-> Show ListTaskExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTaskExecutionsResponse] -> ShowS
$cshowList :: [ListTaskExecutionsResponse] -> ShowS
show :: ListTaskExecutionsResponse -> String
$cshow :: ListTaskExecutionsResponse -> String
showsPrec :: Int -> ListTaskExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListTaskExecutionsResponse -> ShowS
Prelude.Show, (forall x.
 ListTaskExecutionsResponse -> Rep ListTaskExecutionsResponse x)
-> (forall x.
    Rep ListTaskExecutionsResponse x -> ListTaskExecutionsResponse)
-> Generic ListTaskExecutionsResponse
forall x.
Rep ListTaskExecutionsResponse x -> ListTaskExecutionsResponse
forall x.
ListTaskExecutionsResponse -> Rep ListTaskExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTaskExecutionsResponse x -> ListTaskExecutionsResponse
$cfrom :: forall x.
ListTaskExecutionsResponse -> Rep ListTaskExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTaskExecutionsResponse' 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', 'listTaskExecutionsResponse_nextToken' - An opaque string that indicates the position at which to begin returning
-- the next list of executed tasks.
--
-- 'taskExecutions', 'listTaskExecutionsResponse_taskExecutions' - A list of executed tasks.
--
-- 'httpStatus', 'listTaskExecutionsResponse_httpStatus' - The response's http status code.
newListTaskExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTaskExecutionsResponse
newListTaskExecutionsResponse :: Int -> ListTaskExecutionsResponse
newListTaskExecutionsResponse Int
pHttpStatus_ =
  ListTaskExecutionsResponse' :: Maybe Text
-> Maybe [TaskExecutionListEntry]
-> Int
-> ListTaskExecutionsResponse
ListTaskExecutionsResponse'
    { $sel:nextToken:ListTaskExecutionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskExecutions:ListTaskExecutionsResponse' :: Maybe [TaskExecutionListEntry]
taskExecutions = Maybe [TaskExecutionListEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTaskExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An opaque string that indicates the position at which to begin returning
-- the next list of executed tasks.
listTaskExecutionsResponse_nextToken :: Lens.Lens' ListTaskExecutionsResponse (Prelude.Maybe Prelude.Text)
listTaskExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTaskExecutionsResponse -> f ListTaskExecutionsResponse
listTaskExecutionsResponse_nextToken = (ListTaskExecutionsResponse -> Maybe Text)
-> (ListTaskExecutionsResponse
    -> Maybe Text -> ListTaskExecutionsResponse)
-> Lens' ListTaskExecutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTaskExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTaskExecutionsResponse' :: ListTaskExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTaskExecutionsResponse
s@ListTaskExecutionsResponse' {} Maybe Text
a -> ListTaskExecutionsResponse
s {$sel:nextToken:ListTaskExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTaskExecutionsResponse)

-- | A list of executed tasks.
listTaskExecutionsResponse_taskExecutions :: Lens.Lens' ListTaskExecutionsResponse (Prelude.Maybe [TaskExecutionListEntry])
listTaskExecutionsResponse_taskExecutions :: (Maybe [TaskExecutionListEntry]
 -> f (Maybe [TaskExecutionListEntry]))
-> ListTaskExecutionsResponse -> f ListTaskExecutionsResponse
listTaskExecutionsResponse_taskExecutions = (ListTaskExecutionsResponse -> Maybe [TaskExecutionListEntry])
-> (ListTaskExecutionsResponse
    -> Maybe [TaskExecutionListEntry] -> ListTaskExecutionsResponse)
-> Lens'
     ListTaskExecutionsResponse (Maybe [TaskExecutionListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTaskExecutionsResponse' {Maybe [TaskExecutionListEntry]
taskExecutions :: Maybe [TaskExecutionListEntry]
$sel:taskExecutions:ListTaskExecutionsResponse' :: ListTaskExecutionsResponse -> Maybe [TaskExecutionListEntry]
taskExecutions} -> Maybe [TaskExecutionListEntry]
taskExecutions) (\s :: ListTaskExecutionsResponse
s@ListTaskExecutionsResponse' {} Maybe [TaskExecutionListEntry]
a -> ListTaskExecutionsResponse
s {$sel:taskExecutions:ListTaskExecutionsResponse' :: Maybe [TaskExecutionListEntry]
taskExecutions = Maybe [TaskExecutionListEntry]
a} :: ListTaskExecutionsResponse) ((Maybe [TaskExecutionListEntry]
  -> f (Maybe [TaskExecutionListEntry]))
 -> ListTaskExecutionsResponse -> f ListTaskExecutionsResponse)
-> ((Maybe [TaskExecutionListEntry]
     -> f (Maybe [TaskExecutionListEntry]))
    -> Maybe [TaskExecutionListEntry]
    -> f (Maybe [TaskExecutionListEntry]))
-> (Maybe [TaskExecutionListEntry]
    -> f (Maybe [TaskExecutionListEntry]))
-> ListTaskExecutionsResponse
-> f ListTaskExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
-> Iso
     (Maybe [TaskExecutionListEntry])
     (Maybe [TaskExecutionListEntry])
     (Maybe [TaskExecutionListEntry])
     (Maybe [TaskExecutionListEntry])
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
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
  [TaskExecutionListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListTaskExecutionsResponse