{-# 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.Budgets.DeleteSubscriber
(
DeleteSubscriber (..),
newDeleteSubscriber,
deleteSubscriber_accountId,
deleteSubscriber_budgetName,
deleteSubscriber_notification,
deleteSubscriber_subscriber,
DeleteSubscriberResponse (..),
newDeleteSubscriberResponse,
deleteSubscriberResponse_httpStatus,
)
where
import Amazonka.Budgets.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteSubscriber = DeleteSubscriber'
{
DeleteSubscriber -> Text
accountId :: Prelude.Text,
DeleteSubscriber -> Text
budgetName :: Prelude.Text,
DeleteSubscriber -> Notification
notification :: Notification,
DeleteSubscriber -> Subscriber
subscriber :: Subscriber
}
deriving (DeleteSubscriber -> DeleteSubscriber -> Bool
(DeleteSubscriber -> DeleteSubscriber -> Bool)
-> (DeleteSubscriber -> DeleteSubscriber -> Bool)
-> Eq DeleteSubscriber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriber -> DeleteSubscriber -> Bool
$c/= :: DeleteSubscriber -> DeleteSubscriber -> Bool
== :: DeleteSubscriber -> DeleteSubscriber -> Bool
$c== :: DeleteSubscriber -> DeleteSubscriber -> Bool
Prelude.Eq, Int -> DeleteSubscriber -> ShowS
[DeleteSubscriber] -> ShowS
DeleteSubscriber -> String
(Int -> DeleteSubscriber -> ShowS)
-> (DeleteSubscriber -> String)
-> ([DeleteSubscriber] -> ShowS)
-> Show DeleteSubscriber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriber] -> ShowS
$cshowList :: [DeleteSubscriber] -> ShowS
show :: DeleteSubscriber -> String
$cshow :: DeleteSubscriber -> String
showsPrec :: Int -> DeleteSubscriber -> ShowS
$cshowsPrec :: Int -> DeleteSubscriber -> ShowS
Prelude.Show, (forall x. DeleteSubscriber -> Rep DeleteSubscriber x)
-> (forall x. Rep DeleteSubscriber x -> DeleteSubscriber)
-> Generic DeleteSubscriber
forall x. Rep DeleteSubscriber x -> DeleteSubscriber
forall x. DeleteSubscriber -> Rep DeleteSubscriber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSubscriber x -> DeleteSubscriber
$cfrom :: forall x. DeleteSubscriber -> Rep DeleteSubscriber x
Prelude.Generic)
newDeleteSubscriber ::
Prelude.Text ->
Prelude.Text ->
Notification ->
Subscriber ->
DeleteSubscriber
newDeleteSubscriber :: Text -> Text -> Notification -> Subscriber -> DeleteSubscriber
newDeleteSubscriber
Text
pAccountId_
Text
pBudgetName_
Notification
pNotification_
Subscriber
pSubscriber_ =
DeleteSubscriber' :: Text -> Text -> Notification -> Subscriber -> DeleteSubscriber
DeleteSubscriber'
{ $sel:accountId:DeleteSubscriber' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:DeleteSubscriber' :: Text
budgetName = Text
pBudgetName_,
$sel:notification:DeleteSubscriber' :: Notification
notification = Notification
pNotification_,
$sel:subscriber:DeleteSubscriber' :: Subscriber
subscriber = Subscriber
pSubscriber_
}
deleteSubscriber_accountId :: Lens.Lens' DeleteSubscriber Prelude.Text
deleteSubscriber_accountId :: (Text -> f Text) -> DeleteSubscriber -> f DeleteSubscriber
deleteSubscriber_accountId = (DeleteSubscriber -> Text)
-> (DeleteSubscriber -> Text -> DeleteSubscriber)
-> Lens DeleteSubscriber DeleteSubscriber Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriber' {Text
accountId :: Text
$sel:accountId:DeleteSubscriber' :: DeleteSubscriber -> Text
accountId} -> Text
accountId) (\s :: DeleteSubscriber
s@DeleteSubscriber' {} Text
a -> DeleteSubscriber
s {$sel:accountId:DeleteSubscriber' :: Text
accountId = Text
a} :: DeleteSubscriber)
deleteSubscriber_budgetName :: Lens.Lens' DeleteSubscriber Prelude.Text
deleteSubscriber_budgetName :: (Text -> f Text) -> DeleteSubscriber -> f DeleteSubscriber
deleteSubscriber_budgetName = (DeleteSubscriber -> Text)
-> (DeleteSubscriber -> Text -> DeleteSubscriber)
-> Lens DeleteSubscriber DeleteSubscriber Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriber' {Text
budgetName :: Text
$sel:budgetName:DeleteSubscriber' :: DeleteSubscriber -> Text
budgetName} -> Text
budgetName) (\s :: DeleteSubscriber
s@DeleteSubscriber' {} Text
a -> DeleteSubscriber
s {$sel:budgetName:DeleteSubscriber' :: Text
budgetName = Text
a} :: DeleteSubscriber)
deleteSubscriber_notification :: Lens.Lens' DeleteSubscriber Notification
deleteSubscriber_notification :: (Notification -> f Notification)
-> DeleteSubscriber -> f DeleteSubscriber
deleteSubscriber_notification = (DeleteSubscriber -> Notification)
-> (DeleteSubscriber -> Notification -> DeleteSubscriber)
-> Lens DeleteSubscriber DeleteSubscriber Notification Notification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriber' {Notification
notification :: Notification
$sel:notification:DeleteSubscriber' :: DeleteSubscriber -> Notification
notification} -> Notification
notification) (\s :: DeleteSubscriber
s@DeleteSubscriber' {} Notification
a -> DeleteSubscriber
s {$sel:notification:DeleteSubscriber' :: Notification
notification = Notification
a} :: DeleteSubscriber)
deleteSubscriber_subscriber :: Lens.Lens' DeleteSubscriber Subscriber
deleteSubscriber_subscriber :: (Subscriber -> f Subscriber)
-> DeleteSubscriber -> f DeleteSubscriber
deleteSubscriber_subscriber = (DeleteSubscriber -> Subscriber)
-> (DeleteSubscriber -> Subscriber -> DeleteSubscriber)
-> Lens DeleteSubscriber DeleteSubscriber Subscriber Subscriber
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriber' {Subscriber
subscriber :: Subscriber
$sel:subscriber:DeleteSubscriber' :: DeleteSubscriber -> Subscriber
subscriber} -> Subscriber
subscriber) (\s :: DeleteSubscriber
s@DeleteSubscriber' {} Subscriber
a -> DeleteSubscriber
s {$sel:subscriber:DeleteSubscriber' :: Subscriber
subscriber = Subscriber
a} :: DeleteSubscriber)
instance Core.AWSRequest DeleteSubscriber where
type
AWSResponse DeleteSubscriber =
DeleteSubscriberResponse
request :: DeleteSubscriber -> Request DeleteSubscriber
request = Service -> DeleteSubscriber -> Request DeleteSubscriber
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSubscriber
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSubscriber)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteSubscriber))
-> Logger
-> Service
-> Proxy DeleteSubscriber
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSubscriber)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteSubscriberResponse
DeleteSubscriberResponse'
(Int -> DeleteSubscriberResponse)
-> Either String Int -> Either String DeleteSubscriberResponse
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))
)
instance Prelude.Hashable DeleteSubscriber
instance Prelude.NFData DeleteSubscriber
instance Core.ToHeaders DeleteSubscriber where
toHeaders :: DeleteSubscriber -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteSubscriber -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSBudgetServiceGateway.DeleteSubscriber" ::
Prelude.ByteString
),
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.ToJSON DeleteSubscriber where
toJSON :: DeleteSubscriber -> Value
toJSON DeleteSubscriber' {Text
Subscriber
Notification
subscriber :: Subscriber
notification :: Notification
budgetName :: Text
accountId :: Text
$sel:subscriber:DeleteSubscriber' :: DeleteSubscriber -> Subscriber
$sel:notification:DeleteSubscriber' :: DeleteSubscriber -> Notification
$sel:budgetName:DeleteSubscriber' :: DeleteSubscriber -> Text
$sel:accountId:DeleteSubscriber' :: DeleteSubscriber -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BudgetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
budgetName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Notification" Text -> Notification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Notification
notification),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Subscriber" Text -> Subscriber -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Subscriber
subscriber)
]
)
instance Core.ToPath DeleteSubscriber where
toPath :: DeleteSubscriber -> ByteString
toPath = ByteString -> DeleteSubscriber -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSubscriber where
toQuery :: DeleteSubscriber -> QueryString
toQuery = QueryString -> DeleteSubscriber -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSubscriberResponse = DeleteSubscriberResponse'
{
DeleteSubscriberResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool
(DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool)
-> (DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool)
-> Eq DeleteSubscriberResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool
$c/= :: DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool
== :: DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool
$c== :: DeleteSubscriberResponse -> DeleteSubscriberResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSubscriberResponse]
ReadPrec DeleteSubscriberResponse
Int -> ReadS DeleteSubscriberResponse
ReadS [DeleteSubscriberResponse]
(Int -> ReadS DeleteSubscriberResponse)
-> ReadS [DeleteSubscriberResponse]
-> ReadPrec DeleteSubscriberResponse
-> ReadPrec [DeleteSubscriberResponse]
-> Read DeleteSubscriberResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSubscriberResponse]
$creadListPrec :: ReadPrec [DeleteSubscriberResponse]
readPrec :: ReadPrec DeleteSubscriberResponse
$creadPrec :: ReadPrec DeleteSubscriberResponse
readList :: ReadS [DeleteSubscriberResponse]
$creadList :: ReadS [DeleteSubscriberResponse]
readsPrec :: Int -> ReadS DeleteSubscriberResponse
$creadsPrec :: Int -> ReadS DeleteSubscriberResponse
Prelude.Read, Int -> DeleteSubscriberResponse -> ShowS
[DeleteSubscriberResponse] -> ShowS
DeleteSubscriberResponse -> String
(Int -> DeleteSubscriberResponse -> ShowS)
-> (DeleteSubscriberResponse -> String)
-> ([DeleteSubscriberResponse] -> ShowS)
-> Show DeleteSubscriberResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriberResponse] -> ShowS
$cshowList :: [DeleteSubscriberResponse] -> ShowS
show :: DeleteSubscriberResponse -> String
$cshow :: DeleteSubscriberResponse -> String
showsPrec :: Int -> DeleteSubscriberResponse -> ShowS
$cshowsPrec :: Int -> DeleteSubscriberResponse -> ShowS
Prelude.Show, (forall x.
DeleteSubscriberResponse -> Rep DeleteSubscriberResponse x)
-> (forall x.
Rep DeleteSubscriberResponse x -> DeleteSubscriberResponse)
-> Generic DeleteSubscriberResponse
forall x.
Rep DeleteSubscriberResponse x -> DeleteSubscriberResponse
forall x.
DeleteSubscriberResponse -> Rep DeleteSubscriberResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSubscriberResponse x -> DeleteSubscriberResponse
$cfrom :: forall x.
DeleteSubscriberResponse -> Rep DeleteSubscriberResponse x
Prelude.Generic)
newDeleteSubscriberResponse ::
Prelude.Int ->
DeleteSubscriberResponse
newDeleteSubscriberResponse :: Int -> DeleteSubscriberResponse
newDeleteSubscriberResponse Int
pHttpStatus_ =
DeleteSubscriberResponse' :: Int -> DeleteSubscriberResponse
DeleteSubscriberResponse'
{ $sel:httpStatus:DeleteSubscriberResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteSubscriberResponse_httpStatus :: Lens.Lens' DeleteSubscriberResponse Prelude.Int
deleteSubscriberResponse_httpStatus :: (Int -> f Int)
-> DeleteSubscriberResponse -> f DeleteSubscriberResponse
deleteSubscriberResponse_httpStatus = (DeleteSubscriberResponse -> Int)
-> (DeleteSubscriberResponse -> Int -> DeleteSubscriberResponse)
-> Lens DeleteSubscriberResponse DeleteSubscriberResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriberResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSubscriberResponse' :: DeleteSubscriberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSubscriberResponse
s@DeleteSubscriberResponse' {} Int
a -> DeleteSubscriberResponse
s {$sel:httpStatus:DeleteSubscriberResponse' :: Int
httpStatus = Int
a} :: DeleteSubscriberResponse)
instance Prelude.NFData DeleteSubscriberResponse