{-# 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.Pinpoint.GetVoiceTemplate
(
GetVoiceTemplate (..),
newGetVoiceTemplate,
getVoiceTemplate_version,
getVoiceTemplate_templateName,
GetVoiceTemplateResponse (..),
newGetVoiceTemplateResponse,
getVoiceTemplateResponse_httpStatus,
getVoiceTemplateResponse_voiceTemplateResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetVoiceTemplate = GetVoiceTemplate'
{
GetVoiceTemplate -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
GetVoiceTemplate -> Text
templateName :: Prelude.Text
}
deriving (GetVoiceTemplate -> GetVoiceTemplate -> Bool
(GetVoiceTemplate -> GetVoiceTemplate -> Bool)
-> (GetVoiceTemplate -> GetVoiceTemplate -> Bool)
-> Eq GetVoiceTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceTemplate -> GetVoiceTemplate -> Bool
$c/= :: GetVoiceTemplate -> GetVoiceTemplate -> Bool
== :: GetVoiceTemplate -> GetVoiceTemplate -> Bool
$c== :: GetVoiceTemplate -> GetVoiceTemplate -> Bool
Prelude.Eq, ReadPrec [GetVoiceTemplate]
ReadPrec GetVoiceTemplate
Int -> ReadS GetVoiceTemplate
ReadS [GetVoiceTemplate]
(Int -> ReadS GetVoiceTemplate)
-> ReadS [GetVoiceTemplate]
-> ReadPrec GetVoiceTemplate
-> ReadPrec [GetVoiceTemplate]
-> Read GetVoiceTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceTemplate]
$creadListPrec :: ReadPrec [GetVoiceTemplate]
readPrec :: ReadPrec GetVoiceTemplate
$creadPrec :: ReadPrec GetVoiceTemplate
readList :: ReadS [GetVoiceTemplate]
$creadList :: ReadS [GetVoiceTemplate]
readsPrec :: Int -> ReadS GetVoiceTemplate
$creadsPrec :: Int -> ReadS GetVoiceTemplate
Prelude.Read, Int -> GetVoiceTemplate -> ShowS
[GetVoiceTemplate] -> ShowS
GetVoiceTemplate -> String
(Int -> GetVoiceTemplate -> ShowS)
-> (GetVoiceTemplate -> String)
-> ([GetVoiceTemplate] -> ShowS)
-> Show GetVoiceTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceTemplate] -> ShowS
$cshowList :: [GetVoiceTemplate] -> ShowS
show :: GetVoiceTemplate -> String
$cshow :: GetVoiceTemplate -> String
showsPrec :: Int -> GetVoiceTemplate -> ShowS
$cshowsPrec :: Int -> GetVoiceTemplate -> ShowS
Prelude.Show, (forall x. GetVoiceTemplate -> Rep GetVoiceTemplate x)
-> (forall x. Rep GetVoiceTemplate x -> GetVoiceTemplate)
-> Generic GetVoiceTemplate
forall x. Rep GetVoiceTemplate x -> GetVoiceTemplate
forall x. GetVoiceTemplate -> Rep GetVoiceTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVoiceTemplate x -> GetVoiceTemplate
$cfrom :: forall x. GetVoiceTemplate -> Rep GetVoiceTemplate x
Prelude.Generic)
newGetVoiceTemplate ::
Prelude.Text ->
GetVoiceTemplate
newGetVoiceTemplate :: Text -> GetVoiceTemplate
newGetVoiceTemplate Text
pTemplateName_ =
GetVoiceTemplate' :: Maybe Text -> Text -> GetVoiceTemplate
GetVoiceTemplate'
{ $sel:version:GetVoiceTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateName:GetVoiceTemplate' :: Text
templateName = Text
pTemplateName_
}
getVoiceTemplate_version :: Lens.Lens' GetVoiceTemplate (Prelude.Maybe Prelude.Text)
getVoiceTemplate_version :: (Maybe Text -> f (Maybe Text))
-> GetVoiceTemplate -> f GetVoiceTemplate
getVoiceTemplate_version = (GetVoiceTemplate -> Maybe Text)
-> (GetVoiceTemplate -> Maybe Text -> GetVoiceTemplate)
-> Lens GetVoiceTemplate GetVoiceTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceTemplate' {Maybe Text
version :: Maybe Text
$sel:version:GetVoiceTemplate' :: GetVoiceTemplate -> Maybe Text
version} -> Maybe Text
version) (\s :: GetVoiceTemplate
s@GetVoiceTemplate' {} Maybe Text
a -> GetVoiceTemplate
s {$sel:version:GetVoiceTemplate' :: Maybe Text
version = Maybe Text
a} :: GetVoiceTemplate)
getVoiceTemplate_templateName :: Lens.Lens' GetVoiceTemplate Prelude.Text
getVoiceTemplate_templateName :: (Text -> f Text) -> GetVoiceTemplate -> f GetVoiceTemplate
getVoiceTemplate_templateName = (GetVoiceTemplate -> Text)
-> (GetVoiceTemplate -> Text -> GetVoiceTemplate)
-> Lens GetVoiceTemplate GetVoiceTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceTemplate' {Text
templateName :: Text
$sel:templateName:GetVoiceTemplate' :: GetVoiceTemplate -> Text
templateName} -> Text
templateName) (\s :: GetVoiceTemplate
s@GetVoiceTemplate' {} Text
a -> GetVoiceTemplate
s {$sel:templateName:GetVoiceTemplate' :: Text
templateName = Text
a} :: GetVoiceTemplate)
instance Core.AWSRequest GetVoiceTemplate where
type
AWSResponse GetVoiceTemplate =
GetVoiceTemplateResponse
request :: GetVoiceTemplate -> Request GetVoiceTemplate
request = Service -> GetVoiceTemplate -> Request GetVoiceTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetVoiceTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetVoiceTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetVoiceTemplate))
-> Logger
-> Service
-> Proxy GetVoiceTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetVoiceTemplate)))
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 ->
Int -> VoiceTemplateResponse -> GetVoiceTemplateResponse
GetVoiceTemplateResponse'
(Int -> VoiceTemplateResponse -> GetVoiceTemplateResponse)
-> Either String Int
-> Either
String (VoiceTemplateResponse -> GetVoiceTemplateResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (VoiceTemplateResponse -> GetVoiceTemplateResponse)
-> Either String VoiceTemplateResponse
-> Either String GetVoiceTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String VoiceTemplateResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable GetVoiceTemplate
instance Prelude.NFData GetVoiceTemplate
instance Core.ToHeaders GetVoiceTemplate where
toHeaders :: GetVoiceTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetVoiceTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetVoiceTemplate where
toPath :: GetVoiceTemplate -> ByteString
toPath GetVoiceTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:GetVoiceTemplate' :: GetVoiceTemplate -> Text
$sel:version:GetVoiceTemplate' :: GetVoiceTemplate -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateName, ByteString
"/voice"]
instance Core.ToQuery GetVoiceTemplate where
toQuery :: GetVoiceTemplate -> QueryString
toQuery GetVoiceTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:GetVoiceTemplate' :: GetVoiceTemplate -> Text
$sel:version:GetVoiceTemplate' :: GetVoiceTemplate -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"version" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
version]
data GetVoiceTemplateResponse = GetVoiceTemplateResponse'
{
GetVoiceTemplateResponse -> Int
httpStatus :: Prelude.Int,
GetVoiceTemplateResponse -> VoiceTemplateResponse
voiceTemplateResponse :: VoiceTemplateResponse
}
deriving (GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool
(GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool)
-> (GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool)
-> Eq GetVoiceTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool
$c/= :: GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool
== :: GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool
$c== :: GetVoiceTemplateResponse -> GetVoiceTemplateResponse -> Bool
Prelude.Eq, ReadPrec [GetVoiceTemplateResponse]
ReadPrec GetVoiceTemplateResponse
Int -> ReadS GetVoiceTemplateResponse
ReadS [GetVoiceTemplateResponse]
(Int -> ReadS GetVoiceTemplateResponse)
-> ReadS [GetVoiceTemplateResponse]
-> ReadPrec GetVoiceTemplateResponse
-> ReadPrec [GetVoiceTemplateResponse]
-> Read GetVoiceTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceTemplateResponse]
$creadListPrec :: ReadPrec [GetVoiceTemplateResponse]
readPrec :: ReadPrec GetVoiceTemplateResponse
$creadPrec :: ReadPrec GetVoiceTemplateResponse
readList :: ReadS [GetVoiceTemplateResponse]
$creadList :: ReadS [GetVoiceTemplateResponse]
readsPrec :: Int -> ReadS GetVoiceTemplateResponse
$creadsPrec :: Int -> ReadS GetVoiceTemplateResponse
Prelude.Read, Int -> GetVoiceTemplateResponse -> ShowS
[GetVoiceTemplateResponse] -> ShowS
GetVoiceTemplateResponse -> String
(Int -> GetVoiceTemplateResponse -> ShowS)
-> (GetVoiceTemplateResponse -> String)
-> ([GetVoiceTemplateResponse] -> ShowS)
-> Show GetVoiceTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceTemplateResponse] -> ShowS
$cshowList :: [GetVoiceTemplateResponse] -> ShowS
show :: GetVoiceTemplateResponse -> String
$cshow :: GetVoiceTemplateResponse -> String
showsPrec :: Int -> GetVoiceTemplateResponse -> ShowS
$cshowsPrec :: Int -> GetVoiceTemplateResponse -> ShowS
Prelude.Show, (forall x.
GetVoiceTemplateResponse -> Rep GetVoiceTemplateResponse x)
-> (forall x.
Rep GetVoiceTemplateResponse x -> GetVoiceTemplateResponse)
-> Generic GetVoiceTemplateResponse
forall x.
Rep GetVoiceTemplateResponse x -> GetVoiceTemplateResponse
forall x.
GetVoiceTemplateResponse -> Rep GetVoiceTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceTemplateResponse x -> GetVoiceTemplateResponse
$cfrom :: forall x.
GetVoiceTemplateResponse -> Rep GetVoiceTemplateResponse x
Prelude.Generic)
newGetVoiceTemplateResponse ::
Prelude.Int ->
VoiceTemplateResponse ->
GetVoiceTemplateResponse
newGetVoiceTemplateResponse :: Int -> VoiceTemplateResponse -> GetVoiceTemplateResponse
newGetVoiceTemplateResponse
Int
pHttpStatus_
VoiceTemplateResponse
pVoiceTemplateResponse_ =
GetVoiceTemplateResponse' :: Int -> VoiceTemplateResponse -> GetVoiceTemplateResponse
GetVoiceTemplateResponse'
{ $sel:httpStatus:GetVoiceTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:voiceTemplateResponse:GetVoiceTemplateResponse' :: VoiceTemplateResponse
voiceTemplateResponse = VoiceTemplateResponse
pVoiceTemplateResponse_
}
getVoiceTemplateResponse_httpStatus :: Lens.Lens' GetVoiceTemplateResponse Prelude.Int
getVoiceTemplateResponse_httpStatus :: (Int -> f Int)
-> GetVoiceTemplateResponse -> f GetVoiceTemplateResponse
getVoiceTemplateResponse_httpStatus = (GetVoiceTemplateResponse -> Int)
-> (GetVoiceTemplateResponse -> Int -> GetVoiceTemplateResponse)
-> Lens GetVoiceTemplateResponse GetVoiceTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetVoiceTemplateResponse' :: GetVoiceTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetVoiceTemplateResponse
s@GetVoiceTemplateResponse' {} Int
a -> GetVoiceTemplateResponse
s {$sel:httpStatus:GetVoiceTemplateResponse' :: Int
httpStatus = Int
a} :: GetVoiceTemplateResponse)
getVoiceTemplateResponse_voiceTemplateResponse :: Lens.Lens' GetVoiceTemplateResponse VoiceTemplateResponse
getVoiceTemplateResponse_voiceTemplateResponse :: (VoiceTemplateResponse -> f VoiceTemplateResponse)
-> GetVoiceTemplateResponse -> f GetVoiceTemplateResponse
getVoiceTemplateResponse_voiceTemplateResponse = (GetVoiceTemplateResponse -> VoiceTemplateResponse)
-> (GetVoiceTemplateResponse
-> VoiceTemplateResponse -> GetVoiceTemplateResponse)
-> Lens
GetVoiceTemplateResponse
GetVoiceTemplateResponse
VoiceTemplateResponse
VoiceTemplateResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceTemplateResponse' {VoiceTemplateResponse
voiceTemplateResponse :: VoiceTemplateResponse
$sel:voiceTemplateResponse:GetVoiceTemplateResponse' :: GetVoiceTemplateResponse -> VoiceTemplateResponse
voiceTemplateResponse} -> VoiceTemplateResponse
voiceTemplateResponse) (\s :: GetVoiceTemplateResponse
s@GetVoiceTemplateResponse' {} VoiceTemplateResponse
a -> GetVoiceTemplateResponse
s {$sel:voiceTemplateResponse:GetVoiceTemplateResponse' :: VoiceTemplateResponse
voiceTemplateResponse = VoiceTemplateResponse
a} :: GetVoiceTemplateResponse)
instance Prelude.NFData GetVoiceTemplateResponse