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