{-# 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.DescribeVoices
-- 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 the list of voices that are available for use when requesting
-- speech synthesis. Each voice speaks a specified language, is either male
-- or female, and is identified by an ID, which is the ASCII version of the
-- voice name.
--
-- When synthesizing speech ( @SynthesizeSpeech@ ), you provide the voice
-- ID for the voice you want from the list of voices returned by
-- @DescribeVoices@.
--
-- For example, you want your news reader application to read news in a
-- specific language, but giving a user the option to choose the voice.
-- Using the @DescribeVoices@ operation you can provide the user with a
-- list of available voices to select from.
--
-- You can optionally specify a language code to filter the available
-- voices. For example, if you specify @en-US@, the operation returns a
-- list of all available US English voices.
--
-- This operation requires permissions to perform the
-- @polly:DescribeVoices@ action.
--
-- This operation returns paginated results.
module Amazonka.Polly.DescribeVoices
  ( -- * Creating a Request
    DescribeVoices (..),
    newDescribeVoices,

    -- * Request Lenses
    describeVoices_languageCode,
    describeVoices_engine,
    describeVoices_nextToken,
    describeVoices_includeAdditionalLanguageCodes,

    -- * Destructuring the Response
    DescribeVoicesResponse (..),
    newDescribeVoicesResponse,

    -- * Response Lenses
    describeVoicesResponse_nextToken,
    describeVoicesResponse_voices,
    describeVoicesResponse_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:/ 'newDescribeVoices' smart constructor.
data DescribeVoices = DescribeVoices'
  { -- | The language identification tag (ISO 639 code for the language name-ISO
    -- 3166 country code) for filtering the list of voices returned. If you
    -- don\'t specify this optional parameter, all available voices are
    -- returned.
    DescribeVoices -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
    -- | Specifies the engine (@standard@ or @neural@) used by Amazon Polly when
    -- processing input text for speech synthesis.
    DescribeVoices -> Maybe Engine
engine :: Prelude.Maybe Engine,
    -- | An opaque pagination token returned from the previous @DescribeVoices@
    -- operation. If present, this indicates where to continue the listing.
    DescribeVoices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Boolean value indicating whether to return any bilingual voices that use
    -- the specified language as an additional language. For instance, if you
    -- request all languages that use US English (es-US), and there is an
    -- Italian voice that speaks both Italian (it-IT) and US English, that
    -- voice will be included if you specify @yes@ but not if you specify @no@.
    DescribeVoices -> Maybe Bool
includeAdditionalLanguageCodes :: Prelude.Maybe Prelude.Bool
  }
  deriving (DescribeVoices -> DescribeVoices -> Bool
(DescribeVoices -> DescribeVoices -> Bool)
-> (DescribeVoices -> DescribeVoices -> Bool) -> Eq DescribeVoices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVoices -> DescribeVoices -> Bool
$c/= :: DescribeVoices -> DescribeVoices -> Bool
== :: DescribeVoices -> DescribeVoices -> Bool
$c== :: DescribeVoices -> DescribeVoices -> Bool
Prelude.Eq, ReadPrec [DescribeVoices]
ReadPrec DescribeVoices
Int -> ReadS DescribeVoices
ReadS [DescribeVoices]
(Int -> ReadS DescribeVoices)
-> ReadS [DescribeVoices]
-> ReadPrec DescribeVoices
-> ReadPrec [DescribeVoices]
-> Read DescribeVoices
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVoices]
$creadListPrec :: ReadPrec [DescribeVoices]
readPrec :: ReadPrec DescribeVoices
$creadPrec :: ReadPrec DescribeVoices
readList :: ReadS [DescribeVoices]
$creadList :: ReadS [DescribeVoices]
readsPrec :: Int -> ReadS DescribeVoices
$creadsPrec :: Int -> ReadS DescribeVoices
Prelude.Read, Int -> DescribeVoices -> ShowS
[DescribeVoices] -> ShowS
DescribeVoices -> String
(Int -> DescribeVoices -> ShowS)
-> (DescribeVoices -> String)
-> ([DescribeVoices] -> ShowS)
-> Show DescribeVoices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVoices] -> ShowS
$cshowList :: [DescribeVoices] -> ShowS
show :: DescribeVoices -> String
$cshow :: DescribeVoices -> String
showsPrec :: Int -> DescribeVoices -> ShowS
$cshowsPrec :: Int -> DescribeVoices -> ShowS
Prelude.Show, (forall x. DescribeVoices -> Rep DescribeVoices x)
-> (forall x. Rep DescribeVoices x -> DescribeVoices)
-> Generic DescribeVoices
forall x. Rep DescribeVoices x -> DescribeVoices
forall x. DescribeVoices -> Rep DescribeVoices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVoices x -> DescribeVoices
$cfrom :: forall x. DescribeVoices -> Rep DescribeVoices x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVoices' 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:
--
-- 'languageCode', 'describeVoices_languageCode' - The language identification tag (ISO 639 code for the language name-ISO
-- 3166 country code) for filtering the list of voices returned. If you
-- don\'t specify this optional parameter, all available voices are
-- returned.
--
-- 'engine', 'describeVoices_engine' - Specifies the engine (@standard@ or @neural@) used by Amazon Polly when
-- processing input text for speech synthesis.
--
-- 'nextToken', 'describeVoices_nextToken' - An opaque pagination token returned from the previous @DescribeVoices@
-- operation. If present, this indicates where to continue the listing.
--
-- 'includeAdditionalLanguageCodes', 'describeVoices_includeAdditionalLanguageCodes' - Boolean value indicating whether to return any bilingual voices that use
-- the specified language as an additional language. For instance, if you
-- request all languages that use US English (es-US), and there is an
-- Italian voice that speaks both Italian (it-IT) and US English, that
-- voice will be included if you specify @yes@ but not if you specify @no@.
newDescribeVoices ::
  DescribeVoices
newDescribeVoices :: DescribeVoices
newDescribeVoices =
  DescribeVoices' :: Maybe LanguageCode
-> Maybe Engine -> Maybe Text -> Maybe Bool -> DescribeVoices
DescribeVoices'
    { $sel:languageCode:DescribeVoices' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:DescribeVoices' :: Maybe Engine
engine = Maybe Engine
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeVoices' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:includeAdditionalLanguageCodes:DescribeVoices' :: Maybe Bool
includeAdditionalLanguageCodes = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The language identification tag (ISO 639 code for the language name-ISO
-- 3166 country code) for filtering the list of voices returned. If you
-- don\'t specify this optional parameter, all available voices are
-- returned.
describeVoices_languageCode :: Lens.Lens' DescribeVoices (Prelude.Maybe LanguageCode)
describeVoices_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> DescribeVoices -> f DescribeVoices
describeVoices_languageCode = (DescribeVoices -> Maybe LanguageCode)
-> (DescribeVoices -> Maybe LanguageCode -> DescribeVoices)
-> Lens
     DescribeVoices
     DescribeVoices
     (Maybe LanguageCode)
     (Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVoices' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:DescribeVoices' :: DescribeVoices -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: DescribeVoices
s@DescribeVoices' {} Maybe LanguageCode
a -> DescribeVoices
s {$sel:languageCode:DescribeVoices' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: DescribeVoices)

-- | Specifies the engine (@standard@ or @neural@) used by Amazon Polly when
-- processing input text for speech synthesis.
describeVoices_engine :: Lens.Lens' DescribeVoices (Prelude.Maybe Engine)
describeVoices_engine :: (Maybe Engine -> f (Maybe Engine))
-> DescribeVoices -> f DescribeVoices
describeVoices_engine = (DescribeVoices -> Maybe Engine)
-> (DescribeVoices -> Maybe Engine -> DescribeVoices)
-> Lens DescribeVoices DescribeVoices (Maybe Engine) (Maybe Engine)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVoices' {Maybe Engine
engine :: Maybe Engine
$sel:engine:DescribeVoices' :: DescribeVoices -> Maybe Engine
engine} -> Maybe Engine
engine) (\s :: DescribeVoices
s@DescribeVoices' {} Maybe Engine
a -> DescribeVoices
s {$sel:engine:DescribeVoices' :: Maybe Engine
engine = Maybe Engine
a} :: DescribeVoices)

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

-- | Boolean value indicating whether to return any bilingual voices that use
-- the specified language as an additional language. For instance, if you
-- request all languages that use US English (es-US), and there is an
-- Italian voice that speaks both Italian (it-IT) and US English, that
-- voice will be included if you specify @yes@ but not if you specify @no@.
describeVoices_includeAdditionalLanguageCodes :: Lens.Lens' DescribeVoices (Prelude.Maybe Prelude.Bool)
describeVoices_includeAdditionalLanguageCodes :: (Maybe Bool -> f (Maybe Bool))
-> DescribeVoices -> f DescribeVoices
describeVoices_includeAdditionalLanguageCodes = (DescribeVoices -> Maybe Bool)
-> (DescribeVoices -> Maybe Bool -> DescribeVoices)
-> Lens DescribeVoices DescribeVoices (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVoices' {Maybe Bool
includeAdditionalLanguageCodes :: Maybe Bool
$sel:includeAdditionalLanguageCodes:DescribeVoices' :: DescribeVoices -> Maybe Bool
includeAdditionalLanguageCodes} -> Maybe Bool
includeAdditionalLanguageCodes) (\s :: DescribeVoices
s@DescribeVoices' {} Maybe Bool
a -> DescribeVoices
s {$sel:includeAdditionalLanguageCodes:DescribeVoices' :: Maybe Bool
includeAdditionalLanguageCodes = Maybe Bool
a} :: DescribeVoices)

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

instance Prelude.NFData DescribeVoices

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

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

instance Core.ToQuery DescribeVoices where
  toQuery :: DescribeVoices -> QueryString
toQuery DescribeVoices' {Maybe Bool
Maybe Text
Maybe Engine
Maybe LanguageCode
includeAdditionalLanguageCodes :: Maybe Bool
nextToken :: Maybe Text
engine :: Maybe Engine
languageCode :: Maybe LanguageCode
$sel:includeAdditionalLanguageCodes:DescribeVoices' :: DescribeVoices -> Maybe Bool
$sel:nextToken:DescribeVoices' :: DescribeVoices -> Maybe Text
$sel:engine:DescribeVoices' :: DescribeVoices -> Maybe Engine
$sel:languageCode:DescribeVoices' :: DescribeVoices -> Maybe LanguageCode
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"LanguageCode" ByteString -> Maybe LanguageCode -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LanguageCode
languageCode,
        ByteString
"Engine" ByteString -> Maybe Engine -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Engine
engine,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"IncludeAdditionalLanguageCodes"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includeAdditionalLanguageCodes
      ]

-- | /See:/ 'newDescribeVoicesResponse' smart constructor.
data DescribeVoicesResponse = DescribeVoicesResponse'
  { -- | The pagination token to use in the next request to continue the listing
    -- of voices. @NextToken@ is returned only if the response is truncated.
    DescribeVoicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of voices with their properties.
    DescribeVoicesResponse -> Maybe [Voice]
voices :: Prelude.Maybe [Voice],
    -- | The response's http status code.
    DescribeVoicesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeVoicesResponse -> DescribeVoicesResponse -> Bool
(DescribeVoicesResponse -> DescribeVoicesResponse -> Bool)
-> (DescribeVoicesResponse -> DescribeVoicesResponse -> Bool)
-> Eq DescribeVoicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVoicesResponse -> DescribeVoicesResponse -> Bool
$c/= :: DescribeVoicesResponse -> DescribeVoicesResponse -> Bool
== :: DescribeVoicesResponse -> DescribeVoicesResponse -> Bool
$c== :: DescribeVoicesResponse -> DescribeVoicesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVoicesResponse]
ReadPrec DescribeVoicesResponse
Int -> ReadS DescribeVoicesResponse
ReadS [DescribeVoicesResponse]
(Int -> ReadS DescribeVoicesResponse)
-> ReadS [DescribeVoicesResponse]
-> ReadPrec DescribeVoicesResponse
-> ReadPrec [DescribeVoicesResponse]
-> Read DescribeVoicesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVoicesResponse]
$creadListPrec :: ReadPrec [DescribeVoicesResponse]
readPrec :: ReadPrec DescribeVoicesResponse
$creadPrec :: ReadPrec DescribeVoicesResponse
readList :: ReadS [DescribeVoicesResponse]
$creadList :: ReadS [DescribeVoicesResponse]
readsPrec :: Int -> ReadS DescribeVoicesResponse
$creadsPrec :: Int -> ReadS DescribeVoicesResponse
Prelude.Read, Int -> DescribeVoicesResponse -> ShowS
[DescribeVoicesResponse] -> ShowS
DescribeVoicesResponse -> String
(Int -> DescribeVoicesResponse -> ShowS)
-> (DescribeVoicesResponse -> String)
-> ([DescribeVoicesResponse] -> ShowS)
-> Show DescribeVoicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVoicesResponse] -> ShowS
$cshowList :: [DescribeVoicesResponse] -> ShowS
show :: DescribeVoicesResponse -> String
$cshow :: DescribeVoicesResponse -> String
showsPrec :: Int -> DescribeVoicesResponse -> ShowS
$cshowsPrec :: Int -> DescribeVoicesResponse -> ShowS
Prelude.Show, (forall x. DescribeVoicesResponse -> Rep DescribeVoicesResponse x)
-> (forall x.
    Rep DescribeVoicesResponse x -> DescribeVoicesResponse)
-> Generic DescribeVoicesResponse
forall x. Rep DescribeVoicesResponse x -> DescribeVoicesResponse
forall x. DescribeVoicesResponse -> Rep DescribeVoicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVoicesResponse x -> DescribeVoicesResponse
$cfrom :: forall x. DescribeVoicesResponse -> Rep DescribeVoicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVoicesResponse' 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', 'describeVoicesResponse_nextToken' - The pagination token to use in the next request to continue the listing
-- of voices. @NextToken@ is returned only if the response is truncated.
--
-- 'voices', 'describeVoicesResponse_voices' - A list of voices with their properties.
--
-- 'httpStatus', 'describeVoicesResponse_httpStatus' - The response's http status code.
newDescribeVoicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVoicesResponse
newDescribeVoicesResponse :: Int -> DescribeVoicesResponse
newDescribeVoicesResponse Int
pHttpStatus_ =
  DescribeVoicesResponse' :: Maybe Text -> Maybe [Voice] -> Int -> DescribeVoicesResponse
DescribeVoicesResponse'
    { $sel:nextToken:DescribeVoicesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:voices:DescribeVoicesResponse' :: Maybe [Voice]
voices = Maybe [Voice]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeVoicesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token to use in the next request to continue the listing
-- of voices. @NextToken@ is returned only if the response is truncated.
describeVoicesResponse_nextToken :: Lens.Lens' DescribeVoicesResponse (Prelude.Maybe Prelude.Text)
describeVoicesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeVoicesResponse -> f DescribeVoicesResponse
describeVoicesResponse_nextToken = (DescribeVoicesResponse -> Maybe Text)
-> (DescribeVoicesResponse -> Maybe Text -> DescribeVoicesResponse)
-> Lens' DescribeVoicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVoicesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVoicesResponse' :: DescribeVoicesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVoicesResponse
s@DescribeVoicesResponse' {} Maybe Text
a -> DescribeVoicesResponse
s {$sel:nextToken:DescribeVoicesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVoicesResponse)

-- | A list of voices with their properties.
describeVoicesResponse_voices :: Lens.Lens' DescribeVoicesResponse (Prelude.Maybe [Voice])
describeVoicesResponse_voices :: (Maybe [Voice] -> f (Maybe [Voice]))
-> DescribeVoicesResponse -> f DescribeVoicesResponse
describeVoicesResponse_voices = (DescribeVoicesResponse -> Maybe [Voice])
-> (DescribeVoicesResponse
    -> Maybe [Voice] -> DescribeVoicesResponse)
-> Lens' DescribeVoicesResponse (Maybe [Voice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVoicesResponse' {Maybe [Voice]
voices :: Maybe [Voice]
$sel:voices:DescribeVoicesResponse' :: DescribeVoicesResponse -> Maybe [Voice]
voices} -> Maybe [Voice]
voices) (\s :: DescribeVoicesResponse
s@DescribeVoicesResponse' {} Maybe [Voice]
a -> DescribeVoicesResponse
s {$sel:voices:DescribeVoicesResponse' :: Maybe [Voice]
voices = Maybe [Voice]
a} :: DescribeVoicesResponse) ((Maybe [Voice] -> f (Maybe [Voice]))
 -> DescribeVoicesResponse -> f DescribeVoicesResponse)
-> ((Maybe [Voice] -> f (Maybe [Voice]))
    -> Maybe [Voice] -> f (Maybe [Voice]))
-> (Maybe [Voice] -> f (Maybe [Voice]))
-> DescribeVoicesResponse
-> f DescribeVoicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Voice] [Voice] [Voice] [Voice]
-> Iso
     (Maybe [Voice]) (Maybe [Voice]) (Maybe [Voice]) (Maybe [Voice])
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 [Voice] [Voice] [Voice] [Voice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeVoicesResponse