{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:version:DeleteSmsTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
$sel:templateName:DeleteSmsTemplate' :: Text
templateName = Text
pTemplateName_
}
deleteSmsTemplate_version :: Lens.Lens' DeleteSmsTemplate (Prelude.Maybe Prelude.Text)
deleteSmsTemplate_version :: Lens' DeleteSmsTemplate (Maybe Text)
deleteSmsTemplate_version = 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 :: Lens' DeleteSmsTemplate Text
deleteSmsTemplate_templateName = 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 :: (Service -> Service)
-> DeleteSmsTemplate -> Request DeleteSmsTemplate
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteSmsTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSmsTemplate)))
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 ->
Int -> MessageBody -> DeleteSmsTemplateResponse
DeleteSmsTemplateResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteSmsTemplate where
hashWithSalt :: Int -> DeleteSmsTemplate -> Int
hashWithSalt Int
_salt DeleteSmsTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:DeleteSmsTemplate' :: DeleteSmsTemplate -> Text
$sel:version:DeleteSmsTemplate' :: DeleteSmsTemplate -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
instance Prelude.NFData DeleteSmsTemplate where
rnf :: DeleteSmsTemplate -> ()
rnf DeleteSmsTemplate' {Maybe Text
Text
templateName :: Text
version :: Maybe Text
$sel:templateName:DeleteSmsTemplate' :: DeleteSmsTemplate -> Text
$sel:version:DeleteSmsTemplate' :: DeleteSmsTemplate -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
instance Data.ToHeaders DeleteSmsTemplate where
toHeaders :: DeleteSmsTemplate -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/templates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
templateName, ByteString
"/sms"]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"version" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
version]
data DeleteSmsTemplateResponse = DeleteSmsTemplateResponse'
{
DeleteSmsTemplateResponse -> Int
httpStatus :: Prelude.Int,
DeleteSmsTemplateResponse -> MessageBody
messageBody :: MessageBody
}
deriving (DeleteSmsTemplateResponse -> DeleteSmsTemplateResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DeleteSmsTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:messageBody:DeleteSmsTemplateResponse' :: MessageBody
messageBody = MessageBody
pMessageBody_
}
deleteSmsTemplateResponse_httpStatus :: Lens.Lens' DeleteSmsTemplateResponse Prelude.Int
deleteSmsTemplateResponse_httpStatus :: Lens' DeleteSmsTemplateResponse Int
deleteSmsTemplateResponse_httpStatus = 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 :: Lens' DeleteSmsTemplateResponse MessageBody
deleteSmsTemplateResponse_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 where
rnf :: DeleteSmsTemplateResponse -> ()
rnf DeleteSmsTemplateResponse' {Int
MessageBody
messageBody :: MessageBody
httpStatus :: Int
$sel:messageBody:DeleteSmsTemplateResponse' :: DeleteSmsTemplateResponse -> MessageBody
$sel:httpStatus:DeleteSmsTemplateResponse' :: DeleteSmsTemplateResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MessageBody
messageBody