{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Budgets.DeleteNotification
(
deleteNotification
, DeleteNotification
, dnAccountId
, dnBudgetName
, dnNotification
, deleteNotificationResponse
, DeleteNotificationResponse
, dnrsResponseStatus
) where
import Network.AWS.Budgets.Types
import Network.AWS.Budgets.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteNotification = DeleteNotification'
{ _dnAccountId :: !Text
, _dnBudgetName :: !Text
, _dnNotification :: !Notification
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteNotification
:: Text
-> Text
-> Notification
-> DeleteNotification
deleteNotification pAccountId_ pBudgetName_ pNotification_ =
DeleteNotification'
{ _dnAccountId = pAccountId_
, _dnBudgetName = pBudgetName_
, _dnNotification = pNotification_
}
dnAccountId :: Lens' DeleteNotification Text
dnAccountId = lens _dnAccountId (\ s a -> s{_dnAccountId = a})
dnBudgetName :: Lens' DeleteNotification Text
dnBudgetName = lens _dnBudgetName (\ s a -> s{_dnBudgetName = a})
dnNotification :: Lens' DeleteNotification Notification
dnNotification = lens _dnNotification (\ s a -> s{_dnNotification = a})
instance AWSRequest DeleteNotification where
type Rs DeleteNotification =
DeleteNotificationResponse
request = postJSON budgets
response
= receiveEmpty
(\ s h x ->
DeleteNotificationResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteNotification where
instance NFData DeleteNotification where
instance ToHeaders DeleteNotification where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSBudgetServiceGateway.DeleteNotification" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteNotification where
toJSON DeleteNotification'{..}
= object
(catMaybes
[Just ("AccountId" .= _dnAccountId),
Just ("BudgetName" .= _dnBudgetName),
Just ("Notification" .= _dnNotification)])
instance ToPath DeleteNotification where
toPath = const "/"
instance ToQuery DeleteNotification where
toQuery = const mempty
newtype DeleteNotificationResponse = DeleteNotificationResponse'
{ _dnrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteNotificationResponse
:: Int
-> DeleteNotificationResponse
deleteNotificationResponse pResponseStatus_ =
DeleteNotificationResponse' {_dnrsResponseStatus = pResponseStatus_}
dnrsResponseStatus :: Lens' DeleteNotificationResponse Int
dnrsResponseStatus = lens _dnrsResponseStatus (\ s a -> s{_dnrsResponseStatus = a})
instance NFData DeleteNotificationResponse where