{-# 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.Polly.ListSpeechSynthesisTasks
-- 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 SpeechSynthesisTask objects ordered by their creation
-- date. This operation can filter the tasks by their status, for example,
-- allowing users to list only tasks that are completed.
--
-- This operation returns paginated results.
module Amazonka.Polly.ListSpeechSynthesisTasks
  ( -- * Creating a Request
    ListSpeechSynthesisTasks (..),
    newListSpeechSynthesisTasks,

    -- * Request Lenses
    listSpeechSynthesisTasks_status,
    listSpeechSynthesisTasks_nextToken,
    listSpeechSynthesisTasks_maxResults,

    -- * Destructuring the Response
    ListSpeechSynthesisTasksResponse (..),
    newListSpeechSynthesisTasksResponse,

    -- * Response Lenses
    listSpeechSynthesisTasksResponse_nextToken,
    listSpeechSynthesisTasksResponse_synthesisTasks,
    listSpeechSynthesisTasksResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListSpeechSynthesisTasks' smart constructor.
data ListSpeechSynthesisTasks = ListSpeechSynthesisTasks'
  { -- | Status of the speech synthesis tasks returned in a List operation
    ListSpeechSynthesisTasks -> Maybe TaskStatus
status :: Prelude.Maybe TaskStatus,
    -- | The pagination token to use in the next request to continue the listing
    -- of speech synthesis tasks.
    ListSpeechSynthesisTasks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of speech synthesis tasks returned in a List operation.
    ListSpeechSynthesisTasks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool
(ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool)
-> (ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool)
-> Eq ListSpeechSynthesisTasks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool
$c/= :: ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool
== :: ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool
$c== :: ListSpeechSynthesisTasks -> ListSpeechSynthesisTasks -> Bool
Prelude.Eq, ReadPrec [ListSpeechSynthesisTasks]
ReadPrec ListSpeechSynthesisTasks
Int -> ReadS ListSpeechSynthesisTasks
ReadS [ListSpeechSynthesisTasks]
(Int -> ReadS ListSpeechSynthesisTasks)
-> ReadS [ListSpeechSynthesisTasks]
-> ReadPrec ListSpeechSynthesisTasks
-> ReadPrec [ListSpeechSynthesisTasks]
-> Read ListSpeechSynthesisTasks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSpeechSynthesisTasks]
$creadListPrec :: ReadPrec [ListSpeechSynthesisTasks]
readPrec :: ReadPrec ListSpeechSynthesisTasks
$creadPrec :: ReadPrec ListSpeechSynthesisTasks
readList :: ReadS [ListSpeechSynthesisTasks]
$creadList :: ReadS [ListSpeechSynthesisTasks]
readsPrec :: Int -> ReadS ListSpeechSynthesisTasks
$creadsPrec :: Int -> ReadS ListSpeechSynthesisTasks
Prelude.Read, Int -> ListSpeechSynthesisTasks -> ShowS
[ListSpeechSynthesisTasks] -> ShowS
ListSpeechSynthesisTasks -> String
(Int -> ListSpeechSynthesisTasks -> ShowS)
-> (ListSpeechSynthesisTasks -> String)
-> ([ListSpeechSynthesisTasks] -> ShowS)
-> Show ListSpeechSynthesisTasks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSpeechSynthesisTasks] -> ShowS
$cshowList :: [ListSpeechSynthesisTasks] -> ShowS
show :: ListSpeechSynthesisTasks -> String
$cshow :: ListSpeechSynthesisTasks -> String
showsPrec :: Int -> ListSpeechSynthesisTasks -> ShowS
$cshowsPrec :: Int -> ListSpeechSynthesisTasks -> ShowS
Prelude.Show, (forall x.
 ListSpeechSynthesisTasks -> Rep ListSpeechSynthesisTasks x)
-> (forall x.
    Rep ListSpeechSynthesisTasks x -> ListSpeechSynthesisTasks)
-> Generic ListSpeechSynthesisTasks
forall x.
Rep ListSpeechSynthesisTasks x -> ListSpeechSynthesisTasks
forall x.
ListSpeechSynthesisTasks -> Rep ListSpeechSynthesisTasks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSpeechSynthesisTasks x -> ListSpeechSynthesisTasks
$cfrom :: forall x.
ListSpeechSynthesisTasks -> Rep ListSpeechSynthesisTasks x
Prelude.Generic)

-- |
-- Create a value of 'ListSpeechSynthesisTasks' 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:
--
-- 'status', 'listSpeechSynthesisTasks_status' - Status of the speech synthesis tasks returned in a List operation
--
-- 'nextToken', 'listSpeechSynthesisTasks_nextToken' - The pagination token to use in the next request to continue the listing
-- of speech synthesis tasks.
--
-- 'maxResults', 'listSpeechSynthesisTasks_maxResults' - Maximum number of speech synthesis tasks returned in a List operation.
newListSpeechSynthesisTasks ::
  ListSpeechSynthesisTasks
newListSpeechSynthesisTasks :: ListSpeechSynthesisTasks
newListSpeechSynthesisTasks =
  ListSpeechSynthesisTasks' :: Maybe TaskStatus
-> Maybe Text -> Maybe Natural -> ListSpeechSynthesisTasks
ListSpeechSynthesisTasks'
    { $sel:status:ListSpeechSynthesisTasks' :: Maybe TaskStatus
status = Maybe TaskStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSpeechSynthesisTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSpeechSynthesisTasks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Status of the speech synthesis tasks returned in a List operation
listSpeechSynthesisTasks_status :: Lens.Lens' ListSpeechSynthesisTasks (Prelude.Maybe TaskStatus)
listSpeechSynthesisTasks_status :: (Maybe TaskStatus -> f (Maybe TaskStatus))
-> ListSpeechSynthesisTasks -> f ListSpeechSynthesisTasks
listSpeechSynthesisTasks_status = (ListSpeechSynthesisTasks -> Maybe TaskStatus)
-> (ListSpeechSynthesisTasks
    -> Maybe TaskStatus -> ListSpeechSynthesisTasks)
-> Lens
     ListSpeechSynthesisTasks
     ListSpeechSynthesisTasks
     (Maybe TaskStatus)
     (Maybe TaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpeechSynthesisTasks' {Maybe TaskStatus
status :: Maybe TaskStatus
$sel:status:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe TaskStatus
status} -> Maybe TaskStatus
status) (\s :: ListSpeechSynthesisTasks
s@ListSpeechSynthesisTasks' {} Maybe TaskStatus
a -> ListSpeechSynthesisTasks
s {$sel:status:ListSpeechSynthesisTasks' :: Maybe TaskStatus
status = Maybe TaskStatus
a} :: ListSpeechSynthesisTasks)

-- | The pagination token to use in the next request to continue the listing
-- of speech synthesis tasks.
listSpeechSynthesisTasks_nextToken :: Lens.Lens' ListSpeechSynthesisTasks (Prelude.Maybe Prelude.Text)
listSpeechSynthesisTasks_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSpeechSynthesisTasks -> f ListSpeechSynthesisTasks
listSpeechSynthesisTasks_nextToken = (ListSpeechSynthesisTasks -> Maybe Text)
-> (ListSpeechSynthesisTasks
    -> Maybe Text -> ListSpeechSynthesisTasks)
-> Lens
     ListSpeechSynthesisTasks
     ListSpeechSynthesisTasks
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpeechSynthesisTasks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSpeechSynthesisTasks
s@ListSpeechSynthesisTasks' {} Maybe Text
a -> ListSpeechSynthesisTasks
s {$sel:nextToken:ListSpeechSynthesisTasks' :: Maybe Text
nextToken = Maybe Text
a} :: ListSpeechSynthesisTasks)

-- | Maximum number of speech synthesis tasks returned in a List operation.
listSpeechSynthesisTasks_maxResults :: Lens.Lens' ListSpeechSynthesisTasks (Prelude.Maybe Prelude.Natural)
listSpeechSynthesisTasks_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSpeechSynthesisTasks -> f ListSpeechSynthesisTasks
listSpeechSynthesisTasks_maxResults = (ListSpeechSynthesisTasks -> Maybe Natural)
-> (ListSpeechSynthesisTasks
    -> Maybe Natural -> ListSpeechSynthesisTasks)
-> Lens
     ListSpeechSynthesisTasks
     ListSpeechSynthesisTasks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpeechSynthesisTasks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSpeechSynthesisTasks
s@ListSpeechSynthesisTasks' {} Maybe Natural
a -> ListSpeechSynthesisTasks
s {$sel:maxResults:ListSpeechSynthesisTasks' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSpeechSynthesisTasks)

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

instance Prelude.NFData ListSpeechSynthesisTasks

instance Core.ToHeaders ListSpeechSynthesisTasks where
  toHeaders :: ListSpeechSynthesisTasks -> ResponseHeaders
toHeaders = ResponseHeaders -> ListSpeechSynthesisTasks -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListSpeechSynthesisTasks where
  toQuery :: ListSpeechSynthesisTasks -> QueryString
toQuery ListSpeechSynthesisTasks' {Maybe Natural
Maybe Text
Maybe TaskStatus
maxResults :: Maybe Natural
nextToken :: Maybe Text
status :: Maybe TaskStatus
$sel:maxResults:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe Natural
$sel:nextToken:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe Text
$sel:status:ListSpeechSynthesisTasks' :: ListSpeechSynthesisTasks -> Maybe TaskStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Status" ByteString -> Maybe TaskStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TaskStatus
status,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListSpeechSynthesisTasksResponse' smart constructor.
data ListSpeechSynthesisTasksResponse = ListSpeechSynthesisTasksResponse'
  { -- | An opaque pagination token returned from the previous List operation in
    -- this request. If present, this indicates where to continue the listing.
    ListSpeechSynthesisTasksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of SynthesisTask objects that provides information from the
    -- specified task in the list request, including output format, creation
    -- time, task status, and so on.
    ListSpeechSynthesisTasksResponse -> Maybe [SynthesisTask]
synthesisTasks :: Prelude.Maybe [SynthesisTask],
    -- | The response's http status code.
    ListSpeechSynthesisTasksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSpeechSynthesisTasksResponse
-> ListSpeechSynthesisTasksResponse -> Bool
(ListSpeechSynthesisTasksResponse
 -> ListSpeechSynthesisTasksResponse -> Bool)
-> (ListSpeechSynthesisTasksResponse
    -> ListSpeechSynthesisTasksResponse -> Bool)
-> Eq ListSpeechSynthesisTasksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSpeechSynthesisTasksResponse
-> ListSpeechSynthesisTasksResponse -> Bool
$c/= :: ListSpeechSynthesisTasksResponse
-> ListSpeechSynthesisTasksResponse -> Bool
== :: ListSpeechSynthesisTasksResponse
-> ListSpeechSynthesisTasksResponse -> Bool
$c== :: ListSpeechSynthesisTasksResponse
-> ListSpeechSynthesisTasksResponse -> Bool
Prelude.Eq, ReadPrec [ListSpeechSynthesisTasksResponse]
ReadPrec ListSpeechSynthesisTasksResponse
Int -> ReadS ListSpeechSynthesisTasksResponse
ReadS [ListSpeechSynthesisTasksResponse]
(Int -> ReadS ListSpeechSynthesisTasksResponse)
-> ReadS [ListSpeechSynthesisTasksResponse]
-> ReadPrec ListSpeechSynthesisTasksResponse
-> ReadPrec [ListSpeechSynthesisTasksResponse]
-> Read ListSpeechSynthesisTasksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSpeechSynthesisTasksResponse]
$creadListPrec :: ReadPrec [ListSpeechSynthesisTasksResponse]
readPrec :: ReadPrec ListSpeechSynthesisTasksResponse
$creadPrec :: ReadPrec ListSpeechSynthesisTasksResponse
readList :: ReadS [ListSpeechSynthesisTasksResponse]
$creadList :: ReadS [ListSpeechSynthesisTasksResponse]
readsPrec :: Int -> ReadS ListSpeechSynthesisTasksResponse
$creadsPrec :: Int -> ReadS ListSpeechSynthesisTasksResponse
Prelude.Read, Int -> ListSpeechSynthesisTasksResponse -> ShowS
[ListSpeechSynthesisTasksResponse] -> ShowS
ListSpeechSynthesisTasksResponse -> String
(Int -> ListSpeechSynthesisTasksResponse -> ShowS)
-> (ListSpeechSynthesisTasksResponse -> String)
-> ([ListSpeechSynthesisTasksResponse] -> ShowS)
-> Show ListSpeechSynthesisTasksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSpeechSynthesisTasksResponse] -> ShowS
$cshowList :: [ListSpeechSynthesisTasksResponse] -> ShowS
show :: ListSpeechSynthesisTasksResponse -> String
$cshow :: ListSpeechSynthesisTasksResponse -> String
showsPrec :: Int -> ListSpeechSynthesisTasksResponse -> ShowS
$cshowsPrec :: Int -> ListSpeechSynthesisTasksResponse -> ShowS
Prelude.Show, (forall x.
 ListSpeechSynthesisTasksResponse
 -> Rep ListSpeechSynthesisTasksResponse x)
-> (forall x.
    Rep ListSpeechSynthesisTasksResponse x
    -> ListSpeechSynthesisTasksResponse)
-> Generic ListSpeechSynthesisTasksResponse
forall x.
Rep ListSpeechSynthesisTasksResponse x
-> ListSpeechSynthesisTasksResponse
forall x.
ListSpeechSynthesisTasksResponse
-> Rep ListSpeechSynthesisTasksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSpeechSynthesisTasksResponse x
-> ListSpeechSynthesisTasksResponse
$cfrom :: forall x.
ListSpeechSynthesisTasksResponse
-> Rep ListSpeechSynthesisTasksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSpeechSynthesisTasksResponse' 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', 'listSpeechSynthesisTasksResponse_nextToken' - An opaque pagination token returned from the previous List operation in
-- this request. If present, this indicates where to continue the listing.
--
-- 'synthesisTasks', 'listSpeechSynthesisTasksResponse_synthesisTasks' - List of SynthesisTask objects that provides information from the
-- specified task in the list request, including output format, creation
-- time, task status, and so on.
--
-- 'httpStatus', 'listSpeechSynthesisTasksResponse_httpStatus' - The response's http status code.
newListSpeechSynthesisTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSpeechSynthesisTasksResponse
newListSpeechSynthesisTasksResponse :: Int -> ListSpeechSynthesisTasksResponse
newListSpeechSynthesisTasksResponse Int
pHttpStatus_ =
  ListSpeechSynthesisTasksResponse' :: Maybe Text
-> Maybe [SynthesisTask] -> Int -> ListSpeechSynthesisTasksResponse
ListSpeechSynthesisTasksResponse'
    { $sel:nextToken:ListSpeechSynthesisTasksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:synthesisTasks:ListSpeechSynthesisTasksResponse' :: Maybe [SynthesisTask]
synthesisTasks = Maybe [SynthesisTask]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSpeechSynthesisTasksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An opaque pagination token returned from the previous List operation in
-- this request. If present, this indicates where to continue the listing.
listSpeechSynthesisTasksResponse_nextToken :: Lens.Lens' ListSpeechSynthesisTasksResponse (Prelude.Maybe Prelude.Text)
listSpeechSynthesisTasksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSpeechSynthesisTasksResponse
-> f ListSpeechSynthesisTasksResponse
listSpeechSynthesisTasksResponse_nextToken = (ListSpeechSynthesisTasksResponse -> Maybe Text)
-> (ListSpeechSynthesisTasksResponse
    -> Maybe Text -> ListSpeechSynthesisTasksResponse)
-> Lens' ListSpeechSynthesisTasksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpeechSynthesisTasksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSpeechSynthesisTasksResponse' :: ListSpeechSynthesisTasksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSpeechSynthesisTasksResponse
s@ListSpeechSynthesisTasksResponse' {} Maybe Text
a -> ListSpeechSynthesisTasksResponse
s {$sel:nextToken:ListSpeechSynthesisTasksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSpeechSynthesisTasksResponse)

-- | List of SynthesisTask objects that provides information from the
-- specified task in the list request, including output format, creation
-- time, task status, and so on.
listSpeechSynthesisTasksResponse_synthesisTasks :: Lens.Lens' ListSpeechSynthesisTasksResponse (Prelude.Maybe [SynthesisTask])
listSpeechSynthesisTasksResponse_synthesisTasks :: (Maybe [SynthesisTask] -> f (Maybe [SynthesisTask]))
-> ListSpeechSynthesisTasksResponse
-> f ListSpeechSynthesisTasksResponse
listSpeechSynthesisTasksResponse_synthesisTasks = (ListSpeechSynthesisTasksResponse -> Maybe [SynthesisTask])
-> (ListSpeechSynthesisTasksResponse
    -> Maybe [SynthesisTask] -> ListSpeechSynthesisTasksResponse)
-> Lens' ListSpeechSynthesisTasksResponse (Maybe [SynthesisTask])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpeechSynthesisTasksResponse' {Maybe [SynthesisTask]
synthesisTasks :: Maybe [SynthesisTask]
$sel:synthesisTasks:ListSpeechSynthesisTasksResponse' :: ListSpeechSynthesisTasksResponse -> Maybe [SynthesisTask]
synthesisTasks} -> Maybe [SynthesisTask]
synthesisTasks) (\s :: ListSpeechSynthesisTasksResponse
s@ListSpeechSynthesisTasksResponse' {} Maybe [SynthesisTask]
a -> ListSpeechSynthesisTasksResponse
s {$sel:synthesisTasks:ListSpeechSynthesisTasksResponse' :: Maybe [SynthesisTask]
synthesisTasks = Maybe [SynthesisTask]
a} :: ListSpeechSynthesisTasksResponse) ((Maybe [SynthesisTask] -> f (Maybe [SynthesisTask]))
 -> ListSpeechSynthesisTasksResponse
 -> f ListSpeechSynthesisTasksResponse)
-> ((Maybe [SynthesisTask] -> f (Maybe [SynthesisTask]))
    -> Maybe [SynthesisTask] -> f (Maybe [SynthesisTask]))
-> (Maybe [SynthesisTask] -> f (Maybe [SynthesisTask]))
-> ListSpeechSynthesisTasksResponse
-> f ListSpeechSynthesisTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SynthesisTask] [SynthesisTask] [SynthesisTask] [SynthesisTask]
-> Iso
     (Maybe [SynthesisTask])
     (Maybe [SynthesisTask])
     (Maybe [SynthesisTask])
     (Maybe [SynthesisTask])
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
  [SynthesisTask] [SynthesisTask] [SynthesisTask] [SynthesisTask]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListSpeechSynthesisTasksResponse