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