{-# 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.DeleteNotification
(
DeleteNotification (..),
newDeleteNotification,
deleteNotification_accountId,
deleteNotification_budgetName,
deleteNotification_notification,
DeleteNotificationResponse (..),
newDeleteNotificationResponse,
deleteNotificationResponse_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 DeleteNotification = DeleteNotification'
{
DeleteNotification -> Text
accountId :: Prelude.Text,
DeleteNotification -> Text
budgetName :: Prelude.Text,
DeleteNotification -> Notification
notification :: Notification
}
deriving (DeleteNotification -> DeleteNotification -> Bool
(DeleteNotification -> DeleteNotification -> Bool)
-> (DeleteNotification -> DeleteNotification -> Bool)
-> Eq DeleteNotification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNotification -> DeleteNotification -> Bool
$c/= :: DeleteNotification -> DeleteNotification -> Bool
== :: DeleteNotification -> DeleteNotification -> Bool
$c== :: DeleteNotification -> DeleteNotification -> Bool
Prelude.Eq, ReadPrec [DeleteNotification]
ReadPrec DeleteNotification
Int -> ReadS DeleteNotification
ReadS [DeleteNotification]
(Int -> ReadS DeleteNotification)
-> ReadS [DeleteNotification]
-> ReadPrec DeleteNotification
-> ReadPrec [DeleteNotification]
-> Read DeleteNotification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNotification]
$creadListPrec :: ReadPrec [DeleteNotification]
readPrec :: ReadPrec DeleteNotification
$creadPrec :: ReadPrec DeleteNotification
readList :: ReadS [DeleteNotification]
$creadList :: ReadS [DeleteNotification]
readsPrec :: Int -> ReadS DeleteNotification
$creadsPrec :: Int -> ReadS DeleteNotification
Prelude.Read, Int -> DeleteNotification -> ShowS
[DeleteNotification] -> ShowS
DeleteNotification -> String
(Int -> DeleteNotification -> ShowS)
-> (DeleteNotification -> String)
-> ([DeleteNotification] -> ShowS)
-> Show DeleteNotification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNotification] -> ShowS
$cshowList :: [DeleteNotification] -> ShowS
show :: DeleteNotification -> String
$cshow :: DeleteNotification -> String
showsPrec :: Int -> DeleteNotification -> ShowS
$cshowsPrec :: Int -> DeleteNotification -> ShowS
Prelude.Show, (forall x. DeleteNotification -> Rep DeleteNotification x)
-> (forall x. Rep DeleteNotification x -> DeleteNotification)
-> Generic DeleteNotification
forall x. Rep DeleteNotification x -> DeleteNotification
forall x. DeleteNotification -> Rep DeleteNotification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteNotification x -> DeleteNotification
$cfrom :: forall x. DeleteNotification -> Rep DeleteNotification x
Prelude.Generic)
newDeleteNotification ::
Prelude.Text ->
Prelude.Text ->
Notification ->
DeleteNotification
newDeleteNotification :: Text -> Text -> Notification -> DeleteNotification
newDeleteNotification
Text
pAccountId_
Text
pBudgetName_
Notification
pNotification_ =
DeleteNotification' :: Text -> Text -> Notification -> DeleteNotification
DeleteNotification'
{ $sel:accountId:DeleteNotification' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:DeleteNotification' :: Text
budgetName = Text
pBudgetName_,
$sel:notification:DeleteNotification' :: Notification
notification = Notification
pNotification_
}
deleteNotification_accountId :: Lens.Lens' DeleteNotification Prelude.Text
deleteNotification_accountId :: (Text -> f Text) -> DeleteNotification -> f DeleteNotification
deleteNotification_accountId = (DeleteNotification -> Text)
-> (DeleteNotification -> Text -> DeleteNotification)
-> Lens DeleteNotification DeleteNotification Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotification' {Text
accountId :: Text
$sel:accountId:DeleteNotification' :: DeleteNotification -> Text
accountId} -> Text
accountId) (\s :: DeleteNotification
s@DeleteNotification' {} Text
a -> DeleteNotification
s {$sel:accountId:DeleteNotification' :: Text
accountId = Text
a} :: DeleteNotification)
deleteNotification_budgetName :: Lens.Lens' DeleteNotification Prelude.Text
deleteNotification_budgetName :: (Text -> f Text) -> DeleteNotification -> f DeleteNotification
deleteNotification_budgetName = (DeleteNotification -> Text)
-> (DeleteNotification -> Text -> DeleteNotification)
-> Lens DeleteNotification DeleteNotification Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotification' {Text
budgetName :: Text
$sel:budgetName:DeleteNotification' :: DeleteNotification -> Text
budgetName} -> Text
budgetName) (\s :: DeleteNotification
s@DeleteNotification' {} Text
a -> DeleteNotification
s {$sel:budgetName:DeleteNotification' :: Text
budgetName = Text
a} :: DeleteNotification)
deleteNotification_notification :: Lens.Lens' DeleteNotification Notification
deleteNotification_notification :: (Notification -> f Notification)
-> DeleteNotification -> f DeleteNotification
deleteNotification_notification = (DeleteNotification -> Notification)
-> (DeleteNotification -> Notification -> DeleteNotification)
-> Lens
DeleteNotification DeleteNotification Notification Notification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotification' {Notification
notification :: Notification
$sel:notification:DeleteNotification' :: DeleteNotification -> Notification
notification} -> Notification
notification) (\s :: DeleteNotification
s@DeleteNotification' {} Notification
a -> DeleteNotification
s {$sel:notification:DeleteNotification' :: Notification
notification = Notification
a} :: DeleteNotification)
instance Core.AWSRequest DeleteNotification where
type
AWSResponse DeleteNotification =
DeleteNotificationResponse
request :: DeleteNotification -> Request DeleteNotification
request = Service -> DeleteNotification -> Request DeleteNotification
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteNotification
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteNotification)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteNotification))
-> Logger
-> Service
-> Proxy DeleteNotification
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteNotification)))
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 -> DeleteNotificationResponse
DeleteNotificationResponse'
(Int -> DeleteNotificationResponse)
-> Either String Int -> Either String DeleteNotificationResponse
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 DeleteNotification
instance Prelude.NFData DeleteNotification
instance Core.ToHeaders DeleteNotification where
toHeaders :: DeleteNotification -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteNotification -> 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.DeleteNotification" ::
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 DeleteNotification where
toJSON :: DeleteNotification -> Value
toJSON DeleteNotification' {Text
Notification
notification :: Notification
budgetName :: Text
accountId :: Text
$sel:notification:DeleteNotification' :: DeleteNotification -> Notification
$sel:budgetName:DeleteNotification' :: DeleteNotification -> Text
$sel:accountId:DeleteNotification' :: DeleteNotification -> 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)
]
)
instance Core.ToPath DeleteNotification where
toPath :: DeleteNotification -> ByteString
toPath = ByteString -> DeleteNotification -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteNotification where
toQuery :: DeleteNotification -> QueryString
toQuery = QueryString -> DeleteNotification -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteNotificationResponse = DeleteNotificationResponse'
{
DeleteNotificationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteNotificationResponse -> DeleteNotificationResponse -> Bool
(DeleteNotificationResponse -> DeleteNotificationResponse -> Bool)
-> (DeleteNotificationResponse
-> DeleteNotificationResponse -> Bool)
-> Eq DeleteNotificationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNotificationResponse -> DeleteNotificationResponse -> Bool
$c/= :: DeleteNotificationResponse -> DeleteNotificationResponse -> Bool
== :: DeleteNotificationResponse -> DeleteNotificationResponse -> Bool
$c== :: DeleteNotificationResponse -> DeleteNotificationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteNotificationResponse]
ReadPrec DeleteNotificationResponse
Int -> ReadS DeleteNotificationResponse
ReadS [DeleteNotificationResponse]
(Int -> ReadS DeleteNotificationResponse)
-> ReadS [DeleteNotificationResponse]
-> ReadPrec DeleteNotificationResponse
-> ReadPrec [DeleteNotificationResponse]
-> Read DeleteNotificationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNotificationResponse]
$creadListPrec :: ReadPrec [DeleteNotificationResponse]
readPrec :: ReadPrec DeleteNotificationResponse
$creadPrec :: ReadPrec DeleteNotificationResponse
readList :: ReadS [DeleteNotificationResponse]
$creadList :: ReadS [DeleteNotificationResponse]
readsPrec :: Int -> ReadS DeleteNotificationResponse
$creadsPrec :: Int -> ReadS DeleteNotificationResponse
Prelude.Read, Int -> DeleteNotificationResponse -> ShowS
[DeleteNotificationResponse] -> ShowS
DeleteNotificationResponse -> String
(Int -> DeleteNotificationResponse -> ShowS)
-> (DeleteNotificationResponse -> String)
-> ([DeleteNotificationResponse] -> ShowS)
-> Show DeleteNotificationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNotificationResponse] -> ShowS
$cshowList :: [DeleteNotificationResponse] -> ShowS
show :: DeleteNotificationResponse -> String
$cshow :: DeleteNotificationResponse -> String
showsPrec :: Int -> DeleteNotificationResponse -> ShowS
$cshowsPrec :: Int -> DeleteNotificationResponse -> ShowS
Prelude.Show, (forall x.
DeleteNotificationResponse -> Rep DeleteNotificationResponse x)
-> (forall x.
Rep DeleteNotificationResponse x -> DeleteNotificationResponse)
-> Generic DeleteNotificationResponse
forall x.
Rep DeleteNotificationResponse x -> DeleteNotificationResponse
forall x.
DeleteNotificationResponse -> Rep DeleteNotificationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteNotificationResponse x -> DeleteNotificationResponse
$cfrom :: forall x.
DeleteNotificationResponse -> Rep DeleteNotificationResponse x
Prelude.Generic)
newDeleteNotificationResponse ::
Prelude.Int ->
DeleteNotificationResponse
newDeleteNotificationResponse :: Int -> DeleteNotificationResponse
newDeleteNotificationResponse Int
pHttpStatus_ =
DeleteNotificationResponse' :: Int -> DeleteNotificationResponse
DeleteNotificationResponse'
{ $sel:httpStatus:DeleteNotificationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteNotificationResponse_httpStatus :: Lens.Lens' DeleteNotificationResponse Prelude.Int
deleteNotificationResponse_httpStatus :: (Int -> f Int)
-> DeleteNotificationResponse -> f DeleteNotificationResponse
deleteNotificationResponse_httpStatus = (DeleteNotificationResponse -> Int)
-> (DeleteNotificationResponse
-> Int -> DeleteNotificationResponse)
-> Lens
DeleteNotificationResponse DeleteNotificationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNotificationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteNotificationResponse' :: DeleteNotificationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteNotificationResponse
s@DeleteNotificationResponse' {} Int
a -> DeleteNotificationResponse
s {$sel:httpStatus:DeleteNotificationResponse' :: Int
httpStatus = Int
a} :: DeleteNotificationResponse)
instance Prelude.NFData DeleteNotificationResponse