{-# 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.DeleteSmsChannel
(
DeleteSmsChannel (..),
newDeleteSmsChannel,
deleteSmsChannel_applicationId,
DeleteSmsChannelResponse (..),
newDeleteSmsChannelResponse,
deleteSmsChannelResponse_httpStatus,
deleteSmsChannelResponse_sMSChannelResponse,
)
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 DeleteSmsChannel = DeleteSmsChannel'
{
DeleteSmsChannel -> Text
applicationId :: Prelude.Text
}
deriving (DeleteSmsChannel -> DeleteSmsChannel -> Bool
(DeleteSmsChannel -> DeleteSmsChannel -> Bool)
-> (DeleteSmsChannel -> DeleteSmsChannel -> Bool)
-> Eq DeleteSmsChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSmsChannel -> DeleteSmsChannel -> Bool
$c/= :: DeleteSmsChannel -> DeleteSmsChannel -> Bool
== :: DeleteSmsChannel -> DeleteSmsChannel -> Bool
$c== :: DeleteSmsChannel -> DeleteSmsChannel -> Bool
Prelude.Eq, ReadPrec [DeleteSmsChannel]
ReadPrec DeleteSmsChannel
Int -> ReadS DeleteSmsChannel
ReadS [DeleteSmsChannel]
(Int -> ReadS DeleteSmsChannel)
-> ReadS [DeleteSmsChannel]
-> ReadPrec DeleteSmsChannel
-> ReadPrec [DeleteSmsChannel]
-> Read DeleteSmsChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSmsChannel]
$creadListPrec :: ReadPrec [DeleteSmsChannel]
readPrec :: ReadPrec DeleteSmsChannel
$creadPrec :: ReadPrec DeleteSmsChannel
readList :: ReadS [DeleteSmsChannel]
$creadList :: ReadS [DeleteSmsChannel]
readsPrec :: Int -> ReadS DeleteSmsChannel
$creadsPrec :: Int -> ReadS DeleteSmsChannel
Prelude.Read, Int -> DeleteSmsChannel -> ShowS
[DeleteSmsChannel] -> ShowS
DeleteSmsChannel -> String
(Int -> DeleteSmsChannel -> ShowS)
-> (DeleteSmsChannel -> String)
-> ([DeleteSmsChannel] -> ShowS)
-> Show DeleteSmsChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSmsChannel] -> ShowS
$cshowList :: [DeleteSmsChannel] -> ShowS
show :: DeleteSmsChannel -> String
$cshow :: DeleteSmsChannel -> String
showsPrec :: Int -> DeleteSmsChannel -> ShowS
$cshowsPrec :: Int -> DeleteSmsChannel -> ShowS
Prelude.Show, (forall x. DeleteSmsChannel -> Rep DeleteSmsChannel x)
-> (forall x. Rep DeleteSmsChannel x -> DeleteSmsChannel)
-> Generic DeleteSmsChannel
forall x. Rep DeleteSmsChannel x -> DeleteSmsChannel
forall x. DeleteSmsChannel -> Rep DeleteSmsChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSmsChannel x -> DeleteSmsChannel
$cfrom :: forall x. DeleteSmsChannel -> Rep DeleteSmsChannel x
Prelude.Generic)
newDeleteSmsChannel ::
Prelude.Text ->
DeleteSmsChannel
newDeleteSmsChannel :: Text -> DeleteSmsChannel
newDeleteSmsChannel Text
pApplicationId_ =
DeleteSmsChannel' :: Text -> DeleteSmsChannel
DeleteSmsChannel' {$sel:applicationId:DeleteSmsChannel' :: Text
applicationId = Text
pApplicationId_}
deleteSmsChannel_applicationId :: Lens.Lens' DeleteSmsChannel Prelude.Text
deleteSmsChannel_applicationId :: (Text -> f Text) -> DeleteSmsChannel -> f DeleteSmsChannel
deleteSmsChannel_applicationId = (DeleteSmsChannel -> Text)
-> (DeleteSmsChannel -> Text -> DeleteSmsChannel)
-> Lens DeleteSmsChannel DeleteSmsChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSmsChannel' {Text
applicationId :: Text
$sel:applicationId:DeleteSmsChannel' :: DeleteSmsChannel -> Text
applicationId} -> Text
applicationId) (\s :: DeleteSmsChannel
s@DeleteSmsChannel' {} Text
a -> DeleteSmsChannel
s {$sel:applicationId:DeleteSmsChannel' :: Text
applicationId = Text
a} :: DeleteSmsChannel)
instance Core.AWSRequest DeleteSmsChannel where
type
AWSResponse DeleteSmsChannel =
DeleteSmsChannelResponse
request :: DeleteSmsChannel -> Request DeleteSmsChannel
request = Service -> DeleteSmsChannel -> Request DeleteSmsChannel
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSmsChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSmsChannel)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteSmsChannel))
-> Logger
-> Service
-> Proxy DeleteSmsChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSmsChannel)))
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 -> SMSChannelResponse -> DeleteSmsChannelResponse
DeleteSmsChannelResponse'
(Int -> SMSChannelResponse -> DeleteSmsChannelResponse)
-> Either String Int
-> Either String (SMSChannelResponse -> DeleteSmsChannelResponse)
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 (SMSChannelResponse -> DeleteSmsChannelResponse)
-> Either String SMSChannelResponse
-> Either String DeleteSmsChannelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String SMSChannelResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteSmsChannel
instance Prelude.NFData DeleteSmsChannel
instance Core.ToHeaders DeleteSmsChannel where
toHeaders :: DeleteSmsChannel -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteSmsChannel -> 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 DeleteSmsChannel where
toPath :: DeleteSmsChannel -> ByteString
toPath DeleteSmsChannel' {Text
applicationId :: Text
$sel:applicationId:DeleteSmsChannel' :: DeleteSmsChannel -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
ByteString
"/channels/sms"
]
instance Core.ToQuery DeleteSmsChannel where
toQuery :: DeleteSmsChannel -> QueryString
toQuery = QueryString -> DeleteSmsChannel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSmsChannelResponse = DeleteSmsChannelResponse'
{
DeleteSmsChannelResponse -> Int
httpStatus :: Prelude.Int,
DeleteSmsChannelResponse -> SMSChannelResponse
sMSChannelResponse :: SMSChannelResponse
}
deriving (DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool
(DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool)
-> (DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool)
-> Eq DeleteSmsChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool
$c/= :: DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool
== :: DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool
$c== :: DeleteSmsChannelResponse -> DeleteSmsChannelResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSmsChannelResponse]
ReadPrec DeleteSmsChannelResponse
Int -> ReadS DeleteSmsChannelResponse
ReadS [DeleteSmsChannelResponse]
(Int -> ReadS DeleteSmsChannelResponse)
-> ReadS [DeleteSmsChannelResponse]
-> ReadPrec DeleteSmsChannelResponse
-> ReadPrec [DeleteSmsChannelResponse]
-> Read DeleteSmsChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSmsChannelResponse]
$creadListPrec :: ReadPrec [DeleteSmsChannelResponse]
readPrec :: ReadPrec DeleteSmsChannelResponse
$creadPrec :: ReadPrec DeleteSmsChannelResponse
readList :: ReadS [DeleteSmsChannelResponse]
$creadList :: ReadS [DeleteSmsChannelResponse]
readsPrec :: Int -> ReadS DeleteSmsChannelResponse
$creadsPrec :: Int -> ReadS DeleteSmsChannelResponse
Prelude.Read, Int -> DeleteSmsChannelResponse -> ShowS
[DeleteSmsChannelResponse] -> ShowS
DeleteSmsChannelResponse -> String
(Int -> DeleteSmsChannelResponse -> ShowS)
-> (DeleteSmsChannelResponse -> String)
-> ([DeleteSmsChannelResponse] -> ShowS)
-> Show DeleteSmsChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSmsChannelResponse] -> ShowS
$cshowList :: [DeleteSmsChannelResponse] -> ShowS
show :: DeleteSmsChannelResponse -> String
$cshow :: DeleteSmsChannelResponse -> String
showsPrec :: Int -> DeleteSmsChannelResponse -> ShowS
$cshowsPrec :: Int -> DeleteSmsChannelResponse -> ShowS
Prelude.Show, (forall x.
DeleteSmsChannelResponse -> Rep DeleteSmsChannelResponse x)
-> (forall x.
Rep DeleteSmsChannelResponse x -> DeleteSmsChannelResponse)
-> Generic DeleteSmsChannelResponse
forall x.
Rep DeleteSmsChannelResponse x -> DeleteSmsChannelResponse
forall x.
DeleteSmsChannelResponse -> Rep DeleteSmsChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSmsChannelResponse x -> DeleteSmsChannelResponse
$cfrom :: forall x.
DeleteSmsChannelResponse -> Rep DeleteSmsChannelResponse x
Prelude.Generic)
newDeleteSmsChannelResponse ::
Prelude.Int ->
SMSChannelResponse ->
DeleteSmsChannelResponse
newDeleteSmsChannelResponse :: Int -> SMSChannelResponse -> DeleteSmsChannelResponse
newDeleteSmsChannelResponse
Int
pHttpStatus_
SMSChannelResponse
pSMSChannelResponse_ =
DeleteSmsChannelResponse' :: Int -> SMSChannelResponse -> DeleteSmsChannelResponse
DeleteSmsChannelResponse'
{ $sel:httpStatus:DeleteSmsChannelResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:sMSChannelResponse:DeleteSmsChannelResponse' :: SMSChannelResponse
sMSChannelResponse = SMSChannelResponse
pSMSChannelResponse_
}
deleteSmsChannelResponse_httpStatus :: Lens.Lens' DeleteSmsChannelResponse Prelude.Int
deleteSmsChannelResponse_httpStatus :: (Int -> f Int)
-> DeleteSmsChannelResponse -> f DeleteSmsChannelResponse
deleteSmsChannelResponse_httpStatus = (DeleteSmsChannelResponse -> Int)
-> (DeleteSmsChannelResponse -> Int -> DeleteSmsChannelResponse)
-> Lens DeleteSmsChannelResponse DeleteSmsChannelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSmsChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSmsChannelResponse' :: DeleteSmsChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSmsChannelResponse
s@DeleteSmsChannelResponse' {} Int
a -> DeleteSmsChannelResponse
s {$sel:httpStatus:DeleteSmsChannelResponse' :: Int
httpStatus = Int
a} :: DeleteSmsChannelResponse)
deleteSmsChannelResponse_sMSChannelResponse :: Lens.Lens' DeleteSmsChannelResponse SMSChannelResponse
deleteSmsChannelResponse_sMSChannelResponse :: (SMSChannelResponse -> f SMSChannelResponse)
-> DeleteSmsChannelResponse -> f DeleteSmsChannelResponse
deleteSmsChannelResponse_sMSChannelResponse = (DeleteSmsChannelResponse -> SMSChannelResponse)
-> (DeleteSmsChannelResponse
-> SMSChannelResponse -> DeleteSmsChannelResponse)
-> Lens
DeleteSmsChannelResponse
DeleteSmsChannelResponse
SMSChannelResponse
SMSChannelResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSmsChannelResponse' {SMSChannelResponse
sMSChannelResponse :: SMSChannelResponse
$sel:sMSChannelResponse:DeleteSmsChannelResponse' :: DeleteSmsChannelResponse -> SMSChannelResponse
sMSChannelResponse} -> SMSChannelResponse
sMSChannelResponse) (\s :: DeleteSmsChannelResponse
s@DeleteSmsChannelResponse' {} SMSChannelResponse
a -> DeleteSmsChannelResponse
s {$sel:sMSChannelResponse:DeleteSmsChannelResponse' :: SMSChannelResponse
sMSChannelResponse = SMSChannelResponse
a} :: DeleteSmsChannelResponse)
instance Prelude.NFData DeleteSmsChannelResponse