{-# 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.DeleteVoiceTemplate
(
DeleteVoiceTemplate (..),
newDeleteVoiceTemplate,
deleteVoiceTemplate_version,
deleteVoiceTemplate_templateName,
DeleteVoiceTemplateResponse (..),
newDeleteVoiceTemplateResponse,
deleteVoiceTemplateResponse_httpStatus,
deleteVoiceTemplateResponse_messageBody,
)
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 DeleteVoiceTemplate = DeleteVoiceTemplate'
{
DeleteVoiceTemplate -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
DeleteVoiceTemplate -> Text
templateName :: Prelude.Text
}
deriving (DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool
(DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool)
-> (DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool)
-> Eq DeleteVoiceTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool
$c/= :: DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool
== :: DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool
$c== :: DeleteVoiceTemplate -> DeleteVoiceTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteVoiceTemplate]
ReadPrec DeleteVoiceTemplate
Int -> ReadS DeleteVoiceTemplate
ReadS [DeleteVoiceTemplate]
(Int -> ReadS DeleteVoiceTemplate)
-> ReadS [DeleteVoiceTemplate]
-> ReadPrec DeleteVoiceTemplate
-> ReadPrec [DeleteVoiceTemplate]
-> Read DeleteVoiceTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVoiceTemplate]
$creadListPrec :: ReadPrec [DeleteVoiceTemplate]
readPrec :: ReadPrec DeleteVoiceTemplate
$creadPrec :: ReadPrec DeleteVoiceTemplate
readList :: ReadS [DeleteVoiceTemplate]
$creadList :: ReadS [DeleteVoiceTemplate]
readsPrec :: Int -> ReadS DeleteVoiceTemplate
$creadsPrec :: Int -> ReadS DeleteVoiceTemplate
Prelude.Read, Int -> DeleteVoiceTemplate -> ShowS
[DeleteVoiceTemplate] -> ShowS
DeleteVoiceTemplate -> String
(Int -> DeleteVoiceTemplate -> ShowS)
-> (DeleteVoiceTemplate -> String)
-> ([DeleteVoiceTemplate] -> ShowS)
-> Show DeleteVoiceTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVoiceTemplate] -> ShowS
$cshowList :: [DeleteVoiceTemplate] -> ShowS
show :: DeleteVoiceTemplate -> String
$cshow :: DeleteVoiceTemplate -> String
showsPrec :: Int -> DeleteVoiceTemplate -> ShowS
$cshowsPrec :: Int -> DeleteVoiceTemplate -> ShowS
Prelude.Show, (forall x. DeleteVoiceTemplate -> Rep DeleteVoiceTemplate x)
-> (forall x. Rep DeleteVoiceTemplate x -> DeleteVoiceTemplate)
-> Generic DeleteVoiceTemplate
forall x. Rep DeleteVoiceTemplate x -> DeleteVoiceTemplate
forall x. DeleteVoiceTemplate -> Rep DeleteVoiceTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVoiceTemplate x -> DeleteVoiceTemplate
$cfrom :: forall x. DeleteVoiceTemplate -> Rep DeleteVoiceTemplate x
Prelude.Generic)
newDeleteVoiceTemplate ::
Prelude.Text ->
DeleteVoiceTemplate
newDeleteVoiceTemplate :: Text -> DeleteVoiceTemplate
newDeleteVoiceTemplate Text
pTemplateName_ =
DeleteVoiceTemplate' :: Maybe Text -> Text -> DeleteVoiceTemplate
DeleteVoiceTemplate'
{ $sel:version:DeleteVoiceTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateName:DeleteVoiceTemplate' :: Text
templateName = Text
pTemplateName_
}
deleteVoiceTemplate_version :: Lens.Lens' DeleteVoiceTemplate (Prelude.Maybe Prelude.Text)
deleteVoiceTemplate_version :: (Maybe Text -> f (Maybe Text))
-> DeleteVoiceTemplate -> f DeleteVoiceTemplate
deleteVoiceTemplate_version = (DeleteVoiceTemplate -> Maybe Text)
-> (DeleteVoiceTemplate -> Maybe Text -> DeleteVoiceTemplate)
-> Lens
DeleteVoiceTemplate DeleteVoiceTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceTemplate' {Maybe Text
version :: Maybe Text
$sel:version:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> Maybe Text
version} -> Maybe Text
version) (\s :: DeleteVoiceTemplate
s@DeleteVoiceTemplate' {} Maybe Text
a -> DeleteVoiceTemplate
s {$sel:version:DeleteVoiceTemplate' :: Maybe Text
version = Maybe Text
a} :: DeleteVoiceTemplate)
deleteVoiceTemplate_templateName :: Lens.Lens' DeleteVoiceTemplate Prelude.Text
deleteVoiceTemplate_templateName :: (Text -> f Text) -> DeleteVoiceTemplate -> f DeleteVoiceTemplate
deleteVoiceTemplate_templateName = (DeleteVoiceTemplate -> Text)
-> (DeleteVoiceTemplate -> Text -> DeleteVoiceTemplate)
-> Lens DeleteVoiceTemplate DeleteVoiceTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceTemplate' {Text
templateName :: Text
$sel:templateName:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> Text
templateName} -> Text
templateName) (\s :: DeleteVoiceTemplate
s@DeleteVoiceTemplate' {} Text
a -> DeleteVoiceTemplate
s {$sel:templateName:DeleteVoiceTemplate' :: Text
templateName = Text
a} :: DeleteVoiceTemplate)
instance Core.AWSRequest DeleteVoiceTemplate where
type
AWSResponse DeleteVoiceTemplate =
DeleteVoiceTemplateResponse
request :: DeleteVoiceTemplate -> Request DeleteVoiceTemplate
request = Service -> DeleteVoiceTemplate -> Request DeleteVoiceTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteVoiceTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVoiceTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteVoiceTemplate))
-> Logger
-> Service
-> Proxy DeleteVoiceTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteVoiceTemplate)))
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 -> MessageBody -> DeleteVoiceTemplateResponse
DeleteVoiceTemplateResponse'
(Int -> MessageBody -> DeleteVoiceTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> DeleteVoiceTemplateResponse)
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 (MessageBody -> DeleteVoiceTemplateResponse)
-> Either String MessageBody
-> Either String DeleteVoiceTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String MessageBody
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteVoiceTemplate
instance Prelude.NFData DeleteVoiceTemplate
instance Core.ToHeaders DeleteVoiceTemplate where
toHeaders :: DeleteVoiceTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteVoiceTemplate -> 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 DeleteVoiceTemplate where
toPath :: DeleteVoiceTemplate -> ByteString
toPath DeleteVoiceTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> Text
$sel:version:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> 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 DeleteVoiceTemplate where
toQuery :: DeleteVoiceTemplate -> QueryString
toQuery DeleteVoiceTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> Text
$sel:version:DeleteVoiceTemplate' :: DeleteVoiceTemplate -> 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 DeleteVoiceTemplateResponse = DeleteVoiceTemplateResponse'
{
DeleteVoiceTemplateResponse -> Int
httpStatus :: Prelude.Int,
DeleteVoiceTemplateResponse -> MessageBody
messageBody :: MessageBody
}
deriving (DeleteVoiceTemplateResponse -> DeleteVoiceTemplateResponse -> Bool
(DeleteVoiceTemplateResponse
-> DeleteVoiceTemplateResponse -> Bool)
-> (DeleteVoiceTemplateResponse
-> DeleteVoiceTemplateResponse -> Bool)
-> Eq DeleteVoiceTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVoiceTemplateResponse -> DeleteVoiceTemplateResponse -> Bool
$c/= :: DeleteVoiceTemplateResponse -> DeleteVoiceTemplateResponse -> Bool
== :: DeleteVoiceTemplateResponse -> DeleteVoiceTemplateResponse -> Bool
$c== :: DeleteVoiceTemplateResponse -> DeleteVoiceTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteVoiceTemplateResponse]
ReadPrec DeleteVoiceTemplateResponse
Int -> ReadS DeleteVoiceTemplateResponse
ReadS [DeleteVoiceTemplateResponse]
(Int -> ReadS DeleteVoiceTemplateResponse)
-> ReadS [DeleteVoiceTemplateResponse]
-> ReadPrec DeleteVoiceTemplateResponse
-> ReadPrec [DeleteVoiceTemplateResponse]
-> Read DeleteVoiceTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVoiceTemplateResponse]
$creadListPrec :: ReadPrec [DeleteVoiceTemplateResponse]
readPrec :: ReadPrec DeleteVoiceTemplateResponse
$creadPrec :: ReadPrec DeleteVoiceTemplateResponse
readList :: ReadS [DeleteVoiceTemplateResponse]
$creadList :: ReadS [DeleteVoiceTemplateResponse]
readsPrec :: Int -> ReadS DeleteVoiceTemplateResponse
$creadsPrec :: Int -> ReadS DeleteVoiceTemplateResponse
Prelude.Read, Int -> DeleteVoiceTemplateResponse -> ShowS
[DeleteVoiceTemplateResponse] -> ShowS
DeleteVoiceTemplateResponse -> String
(Int -> DeleteVoiceTemplateResponse -> ShowS)
-> (DeleteVoiceTemplateResponse -> String)
-> ([DeleteVoiceTemplateResponse] -> ShowS)
-> Show DeleteVoiceTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVoiceTemplateResponse] -> ShowS
$cshowList :: [DeleteVoiceTemplateResponse] -> ShowS
show :: DeleteVoiceTemplateResponse -> String
$cshow :: DeleteVoiceTemplateResponse -> String
showsPrec :: Int -> DeleteVoiceTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteVoiceTemplateResponse -> ShowS
Prelude.Show, (forall x.
DeleteVoiceTemplateResponse -> Rep DeleteVoiceTemplateResponse x)
-> (forall x.
Rep DeleteVoiceTemplateResponse x -> DeleteVoiceTemplateResponse)
-> Generic DeleteVoiceTemplateResponse
forall x.
Rep DeleteVoiceTemplateResponse x -> DeleteVoiceTemplateResponse
forall x.
DeleteVoiceTemplateResponse -> Rep DeleteVoiceTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVoiceTemplateResponse x -> DeleteVoiceTemplateResponse
$cfrom :: forall x.
DeleteVoiceTemplateResponse -> Rep DeleteVoiceTemplateResponse x
Prelude.Generic)
newDeleteVoiceTemplateResponse ::
Prelude.Int ->
MessageBody ->
DeleteVoiceTemplateResponse
newDeleteVoiceTemplateResponse :: Int -> MessageBody -> DeleteVoiceTemplateResponse
newDeleteVoiceTemplateResponse
Int
pHttpStatus_
MessageBody
pMessageBody_ =
DeleteVoiceTemplateResponse' :: Int -> MessageBody -> DeleteVoiceTemplateResponse
DeleteVoiceTemplateResponse'
{ $sel:httpStatus:DeleteVoiceTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:messageBody:DeleteVoiceTemplateResponse' :: MessageBody
messageBody = MessageBody
pMessageBody_
}
deleteVoiceTemplateResponse_httpStatus :: Lens.Lens' DeleteVoiceTemplateResponse Prelude.Int
deleteVoiceTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteVoiceTemplateResponse -> f DeleteVoiceTemplateResponse
deleteVoiceTemplateResponse_httpStatus = (DeleteVoiceTemplateResponse -> Int)
-> (DeleteVoiceTemplateResponse
-> Int -> DeleteVoiceTemplateResponse)
-> Lens
DeleteVoiceTemplateResponse DeleteVoiceTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVoiceTemplateResponse' :: DeleteVoiceTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteVoiceTemplateResponse
s@DeleteVoiceTemplateResponse' {} Int
a -> DeleteVoiceTemplateResponse
s {$sel:httpStatus:DeleteVoiceTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteVoiceTemplateResponse)
deleteVoiceTemplateResponse_messageBody :: Lens.Lens' DeleteVoiceTemplateResponse MessageBody
deleteVoiceTemplateResponse_messageBody :: (MessageBody -> f MessageBody)
-> DeleteVoiceTemplateResponse -> f DeleteVoiceTemplateResponse
deleteVoiceTemplateResponse_messageBody = (DeleteVoiceTemplateResponse -> MessageBody)
-> (DeleteVoiceTemplateResponse
-> MessageBody -> DeleteVoiceTemplateResponse)
-> Lens
DeleteVoiceTemplateResponse
DeleteVoiceTemplateResponse
MessageBody
MessageBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVoiceTemplateResponse' {MessageBody
messageBody :: MessageBody
$sel:messageBody:DeleteVoiceTemplateResponse' :: DeleteVoiceTemplateResponse -> MessageBody
messageBody} -> MessageBody
messageBody) (\s :: DeleteVoiceTemplateResponse
s@DeleteVoiceTemplateResponse' {} MessageBody
a -> DeleteVoiceTemplateResponse
s {$sel:messageBody:DeleteVoiceTemplateResponse' :: MessageBody
messageBody = MessageBody
a} :: DeleteVoiceTemplateResponse)
instance Prelude.NFData DeleteVoiceTemplateResponse