{-# 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.ListTasks
-- 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 all the tasks.
--
-- This operation returns paginated results.
module Amazonka.DataSync.ListTasks
  ( -- * Creating a Request
    ListTasks (..),
    newListTasks,

    -- * Request Lenses
    listTasks_filters,
    listTasks_nextToken,
    listTasks_maxResults,

    -- * Destructuring the Response
    ListTasksResponse (..),
    newListTasksResponse,

    -- * Response Lenses
    listTasksResponse_tasks,
    listTasksResponse_nextToken,
    listTasksResponse_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

-- | ListTasksRequest
--
-- /See:/ 'newListTasks' smart constructor.
data ListTasks = ListTasks'
  { -- | You can use API filters to narrow down the list of resources returned by
    -- @ListTasks@. For example, to retrieve all tasks on a specific source
    -- location, you can use @ListTasks@ with filter name @LocationId@ and
    -- @Operator Equals@ with the ARN for the location.
    ListTasks -> Maybe [TaskFilter]
filters :: Prelude.Maybe [TaskFilter],
    -- | An opaque string that indicates the position at which to begin the next
    -- list of tasks.
    ListTasks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of tasks to return.
    ListTasks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListTasks -> ListTasks -> Bool
(ListTasks -> ListTasks -> Bool)
-> (ListTasks -> ListTasks -> Bool) -> Eq ListTasks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTasks -> ListTasks -> Bool
$c/= :: ListTasks -> ListTasks -> Bool
== :: ListTasks -> ListTasks -> Bool
$c== :: ListTasks -> ListTasks -> Bool
Prelude.Eq, ReadPrec [ListTasks]
ReadPrec ListTasks
Int -> ReadS ListTasks
ReadS [ListTasks]
(Int -> ReadS ListTasks)
-> ReadS [ListTasks]
-> ReadPrec ListTasks
-> ReadPrec [ListTasks]
-> Read ListTasks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTasks]
$creadListPrec :: ReadPrec [ListTasks]
readPrec :: ReadPrec ListTasks
$creadPrec :: ReadPrec ListTasks
readList :: ReadS [ListTasks]
$creadList :: ReadS [ListTasks]
readsPrec :: Int -> ReadS ListTasks
$creadsPrec :: Int -> ReadS ListTasks
Prelude.Read, Int -> ListTasks -> ShowS
[ListTasks] -> ShowS
ListTasks -> String
(Int -> ListTasks -> ShowS)
-> (ListTasks -> String)
-> ([ListTasks] -> ShowS)
-> Show ListTasks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTasks] -> ShowS
$cshowList :: [ListTasks] -> ShowS
show :: ListTasks -> String
$cshow :: ListTasks -> String
showsPrec :: Int -> ListTasks -> ShowS
$cshowsPrec :: Int -> ListTasks -> ShowS
Prelude.Show, (forall x. ListTasks -> Rep ListTasks x)
-> (forall x. Rep ListTasks x -> ListTasks) -> Generic ListTasks
forall x. Rep ListTasks x -> ListTasks
forall x. ListTasks -> Rep ListTasks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTasks x -> ListTasks
$cfrom :: forall x. ListTasks -> Rep ListTasks x
Prelude.Generic)

-- |
-- Create a value of 'ListTasks' 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:
--
-- 'filters', 'listTasks_filters' - You can use API filters to narrow down the list of resources returned by
-- @ListTasks@. For example, to retrieve all tasks on a specific source
-- location, you can use @ListTasks@ with filter name @LocationId@ and
-- @Operator Equals@ with the ARN for the location.
--
-- 'nextToken', 'listTasks_nextToken' - An opaque string that indicates the position at which to begin the next
-- list of tasks.
--
-- 'maxResults', 'listTasks_maxResults' - The maximum number of tasks to return.
newListTasks ::
  ListTasks
newListTasks :: ListTasks
newListTasks =
  ListTasks' :: Maybe [TaskFilter] -> Maybe Text -> Maybe Natural -> ListTasks
ListTasks'
    { $sel:filters:ListTasks' :: Maybe [TaskFilter]
filters = Maybe [TaskFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTasks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | You can use API filters to narrow down the list of resources returned by
-- @ListTasks@. For example, to retrieve all tasks on a specific source
-- location, you can use @ListTasks@ with filter name @LocationId@ and
-- @Operator Equals@ with the ARN for the location.
listTasks_filters :: Lens.Lens' ListTasks (Prelude.Maybe [TaskFilter])
listTasks_filters :: (Maybe [TaskFilter] -> f (Maybe [TaskFilter]))
-> ListTasks -> f ListTasks
listTasks_filters = (ListTasks -> Maybe [TaskFilter])
-> (ListTasks -> Maybe [TaskFilter] -> ListTasks)
-> Lens
     ListTasks ListTasks (Maybe [TaskFilter]) (Maybe [TaskFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTasks' {Maybe [TaskFilter]
filters :: Maybe [TaskFilter]
$sel:filters:ListTasks' :: ListTasks -> Maybe [TaskFilter]
filters} -> Maybe [TaskFilter]
filters) (\s :: ListTasks
s@ListTasks' {} Maybe [TaskFilter]
a -> ListTasks
s {$sel:filters:ListTasks' :: Maybe [TaskFilter]
filters = Maybe [TaskFilter]
a} :: ListTasks) ((Maybe [TaskFilter] -> f (Maybe [TaskFilter]))
 -> ListTasks -> f ListTasks)
-> ((Maybe [TaskFilter] -> f (Maybe [TaskFilter]))
    -> Maybe [TaskFilter] -> f (Maybe [TaskFilter]))
-> (Maybe [TaskFilter] -> f (Maybe [TaskFilter]))
-> ListTasks
-> f ListTasks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TaskFilter] [TaskFilter] [TaskFilter] [TaskFilter]
-> Iso
     (Maybe [TaskFilter])
     (Maybe [TaskFilter])
     (Maybe [TaskFilter])
     (Maybe [TaskFilter])
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 [TaskFilter] [TaskFilter] [TaskFilter] [TaskFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

instance Prelude.NFData ListTasks

instance Core.ToHeaders ListTasks where
  toHeaders :: ListTasks -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTasks -> 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.ListTasks" :: 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 ListTasks where
  toJSON :: ListTasks -> Value
toJSON ListTasks' {Maybe Natural
Maybe [TaskFilter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [TaskFilter]
$sel:maxResults:ListTasks' :: ListTasks -> Maybe Natural
$sel:nextToken:ListTasks' :: ListTasks -> Maybe Text
$sel:filters:ListTasks' :: ListTasks -> Maybe [TaskFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [TaskFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([TaskFilter] -> Pair) -> Maybe [TaskFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TaskFilter]
filters,
            (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 ListTasks where
  toPath :: ListTasks -> ByteString
toPath = ByteString -> ListTasks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ListTasksResponse' 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:
--
-- 'tasks', 'listTasksResponse_tasks' - A list of all the tasks that are returned.
--
-- 'nextToken', 'listTasksResponse_nextToken' - An opaque string that indicates the position at which to begin returning
-- the next list of tasks.
--
-- 'httpStatus', 'listTasksResponse_httpStatus' - The response's http status code.
newListTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTasksResponse
newListTasksResponse :: Int -> ListTasksResponse
newListTasksResponse Int
pHttpStatus_ =
  ListTasksResponse' :: Maybe [TaskListEntry] -> Maybe Text -> Int -> ListTasksResponse
ListTasksResponse'
    { $sel:tasks:ListTasksResponse' :: Maybe [TaskListEntry]
tasks = Maybe [TaskListEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTasksResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTasksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of all the tasks that are returned.
listTasksResponse_tasks :: Lens.Lens' ListTasksResponse (Prelude.Maybe [TaskListEntry])
listTasksResponse_tasks :: (Maybe [TaskListEntry] -> f (Maybe [TaskListEntry]))
-> ListTasksResponse -> f ListTasksResponse
listTasksResponse_tasks = (ListTasksResponse -> Maybe [TaskListEntry])
-> (ListTasksResponse
    -> Maybe [TaskListEntry] -> ListTasksResponse)
-> Lens' ListTasksResponse (Maybe [TaskListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTasksResponse' {Maybe [TaskListEntry]
tasks :: Maybe [TaskListEntry]
$sel:tasks:ListTasksResponse' :: ListTasksResponse -> Maybe [TaskListEntry]
tasks} -> Maybe [TaskListEntry]
tasks) (\s :: ListTasksResponse
s@ListTasksResponse' {} Maybe [TaskListEntry]
a -> ListTasksResponse
s {$sel:tasks:ListTasksResponse' :: Maybe [TaskListEntry]
tasks = Maybe [TaskListEntry]
a} :: ListTasksResponse) ((Maybe [TaskListEntry] -> f (Maybe [TaskListEntry]))
 -> ListTasksResponse -> f ListTasksResponse)
-> ((Maybe [TaskListEntry] -> f (Maybe [TaskListEntry]))
    -> Maybe [TaskListEntry] -> f (Maybe [TaskListEntry]))
-> (Maybe [TaskListEntry] -> f (Maybe [TaskListEntry]))
-> ListTasksResponse
-> f ListTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TaskListEntry] [TaskListEntry] [TaskListEntry] [TaskListEntry]
-> Iso
     (Maybe [TaskListEntry])
     (Maybe [TaskListEntry])
     (Maybe [TaskListEntry])
     (Maybe [TaskListEntry])
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
  [TaskListEntry] [TaskListEntry] [TaskListEntry] [TaskListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListTasksResponse