{-# 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 #-}
module Amazonka.Polly.GetSpeechSynthesisTask
(
GetSpeechSynthesisTask (..),
newGetSpeechSynthesisTask,
getSpeechSynthesisTask_taskId,
GetSpeechSynthesisTaskResponse (..),
newGetSpeechSynthesisTaskResponse,
getSpeechSynthesisTaskResponse_synthesisTask,
getSpeechSynthesisTaskResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Polly.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetSpeechSynthesisTask = GetSpeechSynthesisTask'
{
GetSpeechSynthesisTask -> Text
taskId :: Prelude.Text
}
deriving (GetSpeechSynthesisTask -> GetSpeechSynthesisTask -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSpeechSynthesisTask -> GetSpeechSynthesisTask -> Bool
$c/= :: GetSpeechSynthesisTask -> GetSpeechSynthesisTask -> Bool
== :: GetSpeechSynthesisTask -> GetSpeechSynthesisTask -> Bool
$c== :: GetSpeechSynthesisTask -> GetSpeechSynthesisTask -> Bool
Prelude.Eq, ReadPrec [GetSpeechSynthesisTask]
ReadPrec GetSpeechSynthesisTask
Int -> ReadS GetSpeechSynthesisTask
ReadS [GetSpeechSynthesisTask]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSpeechSynthesisTask]
$creadListPrec :: ReadPrec [GetSpeechSynthesisTask]
readPrec :: ReadPrec GetSpeechSynthesisTask
$creadPrec :: ReadPrec GetSpeechSynthesisTask
readList :: ReadS [GetSpeechSynthesisTask]
$creadList :: ReadS [GetSpeechSynthesisTask]
readsPrec :: Int -> ReadS GetSpeechSynthesisTask
$creadsPrec :: Int -> ReadS GetSpeechSynthesisTask
Prelude.Read, Int -> GetSpeechSynthesisTask -> ShowS
[GetSpeechSynthesisTask] -> ShowS
GetSpeechSynthesisTask -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSpeechSynthesisTask] -> ShowS
$cshowList :: [GetSpeechSynthesisTask] -> ShowS
show :: GetSpeechSynthesisTask -> String
$cshow :: GetSpeechSynthesisTask -> String
showsPrec :: Int -> GetSpeechSynthesisTask -> ShowS
$cshowsPrec :: Int -> GetSpeechSynthesisTask -> ShowS
Prelude.Show, forall x. Rep GetSpeechSynthesisTask x -> GetSpeechSynthesisTask
forall x. GetSpeechSynthesisTask -> Rep GetSpeechSynthesisTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSpeechSynthesisTask x -> GetSpeechSynthesisTask
$cfrom :: forall x. GetSpeechSynthesisTask -> Rep GetSpeechSynthesisTask x
Prelude.Generic)
newGetSpeechSynthesisTask ::
Prelude.Text ->
GetSpeechSynthesisTask
newGetSpeechSynthesisTask :: Text -> GetSpeechSynthesisTask
newGetSpeechSynthesisTask Text
pTaskId_ =
GetSpeechSynthesisTask' {$sel:taskId:GetSpeechSynthesisTask' :: Text
taskId = Text
pTaskId_}
getSpeechSynthesisTask_taskId :: Lens.Lens' GetSpeechSynthesisTask Prelude.Text
getSpeechSynthesisTask_taskId :: Lens' GetSpeechSynthesisTask Text
getSpeechSynthesisTask_taskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSpeechSynthesisTask' {Text
taskId :: Text
$sel:taskId:GetSpeechSynthesisTask' :: GetSpeechSynthesisTask -> Text
taskId} -> Text
taskId) (\s :: GetSpeechSynthesisTask
s@GetSpeechSynthesisTask' {} Text
a -> GetSpeechSynthesisTask
s {$sel:taskId:GetSpeechSynthesisTask' :: Text
taskId = Text
a} :: GetSpeechSynthesisTask)
instance Core.AWSRequest GetSpeechSynthesisTask where
type
AWSResponse GetSpeechSynthesisTask =
GetSpeechSynthesisTaskResponse
request :: (Service -> Service)
-> GetSpeechSynthesisTask -> Request GetSpeechSynthesisTask
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSpeechSynthesisTask
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSpeechSynthesisTask)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SynthesisTask -> Int -> GetSpeechSynthesisTaskResponse
GetSpeechSynthesisTaskResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SynthesisTask")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetSpeechSynthesisTask where
hashWithSalt :: Int -> GetSpeechSynthesisTask -> Int
hashWithSalt Int
_salt GetSpeechSynthesisTask' {Text
taskId :: Text
$sel:taskId:GetSpeechSynthesisTask' :: GetSpeechSynthesisTask -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
taskId
instance Prelude.NFData GetSpeechSynthesisTask where
rnf :: GetSpeechSynthesisTask -> ()
rnf GetSpeechSynthesisTask' {Text
taskId :: Text
$sel:taskId:GetSpeechSynthesisTask' :: GetSpeechSynthesisTask -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
taskId
instance Data.ToHeaders GetSpeechSynthesisTask where
toHeaders :: GetSpeechSynthesisTask -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetSpeechSynthesisTask where
toPath :: GetSpeechSynthesisTask -> ByteString
toPath GetSpeechSynthesisTask' {Text
taskId :: Text
$sel:taskId:GetSpeechSynthesisTask' :: GetSpeechSynthesisTask -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/synthesisTasks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
taskId]
instance Data.ToQuery GetSpeechSynthesisTask where
toQuery :: GetSpeechSynthesisTask -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSpeechSynthesisTaskResponse = GetSpeechSynthesisTaskResponse'
{
GetSpeechSynthesisTaskResponse -> Maybe SynthesisTask
synthesisTask :: Prelude.Maybe SynthesisTask,
GetSpeechSynthesisTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSpeechSynthesisTaskResponse
-> GetSpeechSynthesisTaskResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSpeechSynthesisTaskResponse
-> GetSpeechSynthesisTaskResponse -> Bool
$c/= :: GetSpeechSynthesisTaskResponse
-> GetSpeechSynthesisTaskResponse -> Bool
== :: GetSpeechSynthesisTaskResponse
-> GetSpeechSynthesisTaskResponse -> Bool
$c== :: GetSpeechSynthesisTaskResponse
-> GetSpeechSynthesisTaskResponse -> Bool
Prelude.Eq, ReadPrec [GetSpeechSynthesisTaskResponse]
ReadPrec GetSpeechSynthesisTaskResponse
Int -> ReadS GetSpeechSynthesisTaskResponse
ReadS [GetSpeechSynthesisTaskResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSpeechSynthesisTaskResponse]
$creadListPrec :: ReadPrec [GetSpeechSynthesisTaskResponse]
readPrec :: ReadPrec GetSpeechSynthesisTaskResponse
$creadPrec :: ReadPrec GetSpeechSynthesisTaskResponse
readList :: ReadS [GetSpeechSynthesisTaskResponse]
$creadList :: ReadS [GetSpeechSynthesisTaskResponse]
readsPrec :: Int -> ReadS GetSpeechSynthesisTaskResponse
$creadsPrec :: Int -> ReadS GetSpeechSynthesisTaskResponse
Prelude.Read, Int -> GetSpeechSynthesisTaskResponse -> ShowS
[GetSpeechSynthesisTaskResponse] -> ShowS
GetSpeechSynthesisTaskResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSpeechSynthesisTaskResponse] -> ShowS
$cshowList :: [GetSpeechSynthesisTaskResponse] -> ShowS
show :: GetSpeechSynthesisTaskResponse -> String
$cshow :: GetSpeechSynthesisTaskResponse -> String
showsPrec :: Int -> GetSpeechSynthesisTaskResponse -> ShowS
$cshowsPrec :: Int -> GetSpeechSynthesisTaskResponse -> ShowS
Prelude.Show, forall x.
Rep GetSpeechSynthesisTaskResponse x
-> GetSpeechSynthesisTaskResponse
forall x.
GetSpeechSynthesisTaskResponse
-> Rep GetSpeechSynthesisTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSpeechSynthesisTaskResponse x
-> GetSpeechSynthesisTaskResponse
$cfrom :: forall x.
GetSpeechSynthesisTaskResponse
-> Rep GetSpeechSynthesisTaskResponse x
Prelude.Generic)
newGetSpeechSynthesisTaskResponse ::
Prelude.Int ->
GetSpeechSynthesisTaskResponse
newGetSpeechSynthesisTaskResponse :: Int -> GetSpeechSynthesisTaskResponse
newGetSpeechSynthesisTaskResponse Int
pHttpStatus_ =
GetSpeechSynthesisTaskResponse'
{ $sel:synthesisTask:GetSpeechSynthesisTaskResponse' :: Maybe SynthesisTask
synthesisTask =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSpeechSynthesisTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSpeechSynthesisTaskResponse_synthesisTask :: Lens.Lens' GetSpeechSynthesisTaskResponse (Prelude.Maybe SynthesisTask)
getSpeechSynthesisTaskResponse_synthesisTask :: Lens' GetSpeechSynthesisTaskResponse (Maybe SynthesisTask)
getSpeechSynthesisTaskResponse_synthesisTask = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSpeechSynthesisTaskResponse' {Maybe SynthesisTask
synthesisTask :: Maybe SynthesisTask
$sel:synthesisTask:GetSpeechSynthesisTaskResponse' :: GetSpeechSynthesisTaskResponse -> Maybe SynthesisTask
synthesisTask} -> Maybe SynthesisTask
synthesisTask) (\s :: GetSpeechSynthesisTaskResponse
s@GetSpeechSynthesisTaskResponse' {} Maybe SynthesisTask
a -> GetSpeechSynthesisTaskResponse
s {$sel:synthesisTask:GetSpeechSynthesisTaskResponse' :: Maybe SynthesisTask
synthesisTask = Maybe SynthesisTask
a} :: GetSpeechSynthesisTaskResponse)
getSpeechSynthesisTaskResponse_httpStatus :: Lens.Lens' GetSpeechSynthesisTaskResponse Prelude.Int
getSpeechSynthesisTaskResponse_httpStatus :: Lens' GetSpeechSynthesisTaskResponse Int
getSpeechSynthesisTaskResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSpeechSynthesisTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSpeechSynthesisTaskResponse' :: GetSpeechSynthesisTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSpeechSynthesisTaskResponse
s@GetSpeechSynthesisTaskResponse' {} Int
a -> GetSpeechSynthesisTaskResponse
s {$sel:httpStatus:GetSpeechSynthesisTaskResponse' :: Int
httpStatus = Int
a} :: GetSpeechSynthesisTaskResponse)
instance
Prelude.NFData
GetSpeechSynthesisTaskResponse
where
rnf :: GetSpeechSynthesisTaskResponse -> ()
rnf GetSpeechSynthesisTaskResponse' {Int
Maybe SynthesisTask
httpStatus :: Int
synthesisTask :: Maybe SynthesisTask
$sel:httpStatus:GetSpeechSynthesisTaskResponse' :: GetSpeechSynthesisTaskResponse -> Int
$sel:synthesisTask:GetSpeechSynthesisTaskResponse' :: GetSpeechSynthesisTaskResponse -> Maybe SynthesisTask
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SynthesisTask
synthesisTask
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus