{-# 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.PinpointSmsVoiceV2.DeleteDefaultSenderId
(
DeleteDefaultSenderId (..),
newDeleteDefaultSenderId,
deleteDefaultSenderId_configurationSetName,
DeleteDefaultSenderIdResponse (..),
newDeleteDefaultSenderIdResponse,
deleteDefaultSenderIdResponse_configurationSetArn,
deleteDefaultSenderIdResponse_configurationSetName,
deleteDefaultSenderIdResponse_senderId,
deleteDefaultSenderIdResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointSmsVoiceV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDefaultSenderId = DeleteDefaultSenderId'
{
DeleteDefaultSenderId -> Text
configurationSetName :: Prelude.Text
}
deriving (DeleteDefaultSenderId -> DeleteDefaultSenderId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDefaultSenderId -> DeleteDefaultSenderId -> Bool
$c/= :: DeleteDefaultSenderId -> DeleteDefaultSenderId -> Bool
== :: DeleteDefaultSenderId -> DeleteDefaultSenderId -> Bool
$c== :: DeleteDefaultSenderId -> DeleteDefaultSenderId -> Bool
Prelude.Eq, ReadPrec [DeleteDefaultSenderId]
ReadPrec DeleteDefaultSenderId
Int -> ReadS DeleteDefaultSenderId
ReadS [DeleteDefaultSenderId]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDefaultSenderId]
$creadListPrec :: ReadPrec [DeleteDefaultSenderId]
readPrec :: ReadPrec DeleteDefaultSenderId
$creadPrec :: ReadPrec DeleteDefaultSenderId
readList :: ReadS [DeleteDefaultSenderId]
$creadList :: ReadS [DeleteDefaultSenderId]
readsPrec :: Int -> ReadS DeleteDefaultSenderId
$creadsPrec :: Int -> ReadS DeleteDefaultSenderId
Prelude.Read, Int -> DeleteDefaultSenderId -> ShowS
[DeleteDefaultSenderId] -> ShowS
DeleteDefaultSenderId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDefaultSenderId] -> ShowS
$cshowList :: [DeleteDefaultSenderId] -> ShowS
show :: DeleteDefaultSenderId -> String
$cshow :: DeleteDefaultSenderId -> String
showsPrec :: Int -> DeleteDefaultSenderId -> ShowS
$cshowsPrec :: Int -> DeleteDefaultSenderId -> ShowS
Prelude.Show, forall x. Rep DeleteDefaultSenderId x -> DeleteDefaultSenderId
forall x. DeleteDefaultSenderId -> Rep DeleteDefaultSenderId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDefaultSenderId x -> DeleteDefaultSenderId
$cfrom :: forall x. DeleteDefaultSenderId -> Rep DeleteDefaultSenderId x
Prelude.Generic)
newDeleteDefaultSenderId ::
Prelude.Text ->
DeleteDefaultSenderId
newDeleteDefaultSenderId :: Text -> DeleteDefaultSenderId
newDeleteDefaultSenderId Text
pConfigurationSetName_ =
DeleteDefaultSenderId'
{ $sel:configurationSetName:DeleteDefaultSenderId' :: Text
configurationSetName =
Text
pConfigurationSetName_
}
deleteDefaultSenderId_configurationSetName :: Lens.Lens' DeleteDefaultSenderId Prelude.Text
deleteDefaultSenderId_configurationSetName :: Lens' DeleteDefaultSenderId Text
deleteDefaultSenderId_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDefaultSenderId' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteDefaultSenderId' :: DeleteDefaultSenderId -> Text
configurationSetName} -> Text
configurationSetName) (\s :: DeleteDefaultSenderId
s@DeleteDefaultSenderId' {} Text
a -> DeleteDefaultSenderId
s {$sel:configurationSetName:DeleteDefaultSenderId' :: Text
configurationSetName = Text
a} :: DeleteDefaultSenderId)
instance Core.AWSRequest DeleteDefaultSenderId where
type
AWSResponse DeleteDefaultSenderId =
DeleteDefaultSenderIdResponse
request :: (Service -> Service)
-> DeleteDefaultSenderId -> Request DeleteDefaultSenderId
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteDefaultSenderId
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDefaultSenderId)))
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 ->
Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteDefaultSenderIdResponse
DeleteDefaultSenderIdResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConfigurationSetArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConfigurationSetName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SenderId")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DeleteDefaultSenderId where
hashWithSalt :: Int -> DeleteDefaultSenderId -> Int
hashWithSalt Int
_salt DeleteDefaultSenderId' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteDefaultSenderId' :: DeleteDefaultSenderId -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationSetName
instance Prelude.NFData DeleteDefaultSenderId where
rnf :: DeleteDefaultSenderId -> ()
rnf DeleteDefaultSenderId' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteDefaultSenderId' :: DeleteDefaultSenderId -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
configurationSetName
instance Data.ToHeaders DeleteDefaultSenderId where
toHeaders :: DeleteDefaultSenderId -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"PinpointSMSVoiceV2.DeleteDefaultSenderId" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteDefaultSenderId where
toJSON :: DeleteDefaultSenderId -> Value
toJSON DeleteDefaultSenderId' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteDefaultSenderId' :: DeleteDefaultSenderId -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"ConfigurationSetName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
configurationSetName
)
]
)
instance Data.ToPath DeleteDefaultSenderId where
toPath :: DeleteDefaultSenderId -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteDefaultSenderId where
toQuery :: DeleteDefaultSenderId -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteDefaultSenderIdResponse = DeleteDefaultSenderIdResponse'
{
DeleteDefaultSenderIdResponse -> Maybe Text
configurationSetArn :: Prelude.Maybe Prelude.Text,
DeleteDefaultSenderIdResponse -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
DeleteDefaultSenderIdResponse -> Maybe Text
senderId :: Prelude.Maybe Prelude.Text,
DeleteDefaultSenderIdResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDefaultSenderIdResponse
-> DeleteDefaultSenderIdResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDefaultSenderIdResponse
-> DeleteDefaultSenderIdResponse -> Bool
$c/= :: DeleteDefaultSenderIdResponse
-> DeleteDefaultSenderIdResponse -> Bool
== :: DeleteDefaultSenderIdResponse
-> DeleteDefaultSenderIdResponse -> Bool
$c== :: DeleteDefaultSenderIdResponse
-> DeleteDefaultSenderIdResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDefaultSenderIdResponse]
ReadPrec DeleteDefaultSenderIdResponse
Int -> ReadS DeleteDefaultSenderIdResponse
ReadS [DeleteDefaultSenderIdResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDefaultSenderIdResponse]
$creadListPrec :: ReadPrec [DeleteDefaultSenderIdResponse]
readPrec :: ReadPrec DeleteDefaultSenderIdResponse
$creadPrec :: ReadPrec DeleteDefaultSenderIdResponse
readList :: ReadS [DeleteDefaultSenderIdResponse]
$creadList :: ReadS [DeleteDefaultSenderIdResponse]
readsPrec :: Int -> ReadS DeleteDefaultSenderIdResponse
$creadsPrec :: Int -> ReadS DeleteDefaultSenderIdResponse
Prelude.Read, Int -> DeleteDefaultSenderIdResponse -> ShowS
[DeleteDefaultSenderIdResponse] -> ShowS
DeleteDefaultSenderIdResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDefaultSenderIdResponse] -> ShowS
$cshowList :: [DeleteDefaultSenderIdResponse] -> ShowS
show :: DeleteDefaultSenderIdResponse -> String
$cshow :: DeleteDefaultSenderIdResponse -> String
showsPrec :: Int -> DeleteDefaultSenderIdResponse -> ShowS
$cshowsPrec :: Int -> DeleteDefaultSenderIdResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteDefaultSenderIdResponse x
-> DeleteDefaultSenderIdResponse
forall x.
DeleteDefaultSenderIdResponse
-> Rep DeleteDefaultSenderIdResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDefaultSenderIdResponse x
-> DeleteDefaultSenderIdResponse
$cfrom :: forall x.
DeleteDefaultSenderIdResponse
-> Rep DeleteDefaultSenderIdResponse x
Prelude.Generic)
newDeleteDefaultSenderIdResponse ::
Prelude.Int ->
DeleteDefaultSenderIdResponse
newDeleteDefaultSenderIdResponse :: Int -> DeleteDefaultSenderIdResponse
newDeleteDefaultSenderIdResponse Int
pHttpStatus_ =
DeleteDefaultSenderIdResponse'
{ $sel:configurationSetArn:DeleteDefaultSenderIdResponse' :: Maybe Text
configurationSetArn =
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:DeleteDefaultSenderIdResponse' :: Maybe Text
configurationSetName = forall a. Maybe a
Prelude.Nothing,
$sel:senderId:DeleteDefaultSenderIdResponse' :: Maybe Text
senderId = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDefaultSenderIdResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDefaultSenderIdResponse_configurationSetArn :: Lens.Lens' DeleteDefaultSenderIdResponse (Prelude.Maybe Prelude.Text)
deleteDefaultSenderIdResponse_configurationSetArn :: Lens' DeleteDefaultSenderIdResponse (Maybe Text)
deleteDefaultSenderIdResponse_configurationSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDefaultSenderIdResponse' {Maybe Text
configurationSetArn :: Maybe Text
$sel:configurationSetArn:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
configurationSetArn} -> Maybe Text
configurationSetArn) (\s :: DeleteDefaultSenderIdResponse
s@DeleteDefaultSenderIdResponse' {} Maybe Text
a -> DeleteDefaultSenderIdResponse
s {$sel:configurationSetArn:DeleteDefaultSenderIdResponse' :: Maybe Text
configurationSetArn = Maybe Text
a} :: DeleteDefaultSenderIdResponse)
deleteDefaultSenderIdResponse_configurationSetName :: Lens.Lens' DeleteDefaultSenderIdResponse (Prelude.Maybe Prelude.Text)
deleteDefaultSenderIdResponse_configurationSetName :: Lens' DeleteDefaultSenderIdResponse (Maybe Text)
deleteDefaultSenderIdResponse_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDefaultSenderIdResponse' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: DeleteDefaultSenderIdResponse
s@DeleteDefaultSenderIdResponse' {} Maybe Text
a -> DeleteDefaultSenderIdResponse
s {$sel:configurationSetName:DeleteDefaultSenderIdResponse' :: Maybe Text
configurationSetName = Maybe Text
a} :: DeleteDefaultSenderIdResponse)
deleteDefaultSenderIdResponse_senderId :: Lens.Lens' DeleteDefaultSenderIdResponse (Prelude.Maybe Prelude.Text)
deleteDefaultSenderIdResponse_senderId :: Lens' DeleteDefaultSenderIdResponse (Maybe Text)
deleteDefaultSenderIdResponse_senderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDefaultSenderIdResponse' {Maybe Text
senderId :: Maybe Text
$sel:senderId:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
senderId} -> Maybe Text
senderId) (\s :: DeleteDefaultSenderIdResponse
s@DeleteDefaultSenderIdResponse' {} Maybe Text
a -> DeleteDefaultSenderIdResponse
s {$sel:senderId:DeleteDefaultSenderIdResponse' :: Maybe Text
senderId = Maybe Text
a} :: DeleteDefaultSenderIdResponse)
deleteDefaultSenderIdResponse_httpStatus :: Lens.Lens' DeleteDefaultSenderIdResponse Prelude.Int
deleteDefaultSenderIdResponse_httpStatus :: Lens' DeleteDefaultSenderIdResponse Int
deleteDefaultSenderIdResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDefaultSenderIdResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDefaultSenderIdResponse
s@DeleteDefaultSenderIdResponse' {} Int
a -> DeleteDefaultSenderIdResponse
s {$sel:httpStatus:DeleteDefaultSenderIdResponse' :: Int
httpStatus = Int
a} :: DeleteDefaultSenderIdResponse)
instance Prelude.NFData DeleteDefaultSenderIdResponse where
rnf :: DeleteDefaultSenderIdResponse -> ()
rnf DeleteDefaultSenderIdResponse' {Int
Maybe Text
httpStatus :: Int
senderId :: Maybe Text
configurationSetName :: Maybe Text
configurationSetArn :: Maybe Text
$sel:httpStatus:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Int
$sel:senderId:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
$sel:configurationSetName:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
$sel:configurationSetArn:DeleteDefaultSenderIdResponse' :: DeleteDefaultSenderIdResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
senderId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus