{-# 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.UpdateNotification
(
updateNotification
, UpdateNotification
, unAccountId
, unBudgetName
, unOldNotification
, unNewNotification
, updateNotificationResponse
, UpdateNotificationResponse
, unrsResponseStatus
) 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 UpdateNotification = UpdateNotification'
{ _unAccountId :: !Text
, _unBudgetName :: !Text
, _unOldNotification :: !Notification
, _unNewNotification :: !Notification
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateNotification
:: Text
-> Text
-> Notification
-> Notification
-> UpdateNotification
updateNotification pAccountId_ pBudgetName_ pOldNotification_ pNewNotification_ =
UpdateNotification'
{ _unAccountId = pAccountId_
, _unBudgetName = pBudgetName_
, _unOldNotification = pOldNotification_
, _unNewNotification = pNewNotification_
}
unAccountId :: Lens' UpdateNotification Text
unAccountId = lens _unAccountId (\ s a -> s{_unAccountId = a})
unBudgetName :: Lens' UpdateNotification Text
unBudgetName = lens _unBudgetName (\ s a -> s{_unBudgetName = a})
unOldNotification :: Lens' UpdateNotification Notification
unOldNotification = lens _unOldNotification (\ s a -> s{_unOldNotification = a})
unNewNotification :: Lens' UpdateNotification Notification
unNewNotification = lens _unNewNotification (\ s a -> s{_unNewNotification = a})
instance AWSRequest UpdateNotification where
type Rs UpdateNotification =
UpdateNotificationResponse
request = postJSON budgets
response
= receiveEmpty
(\ s h x ->
UpdateNotificationResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateNotification where
instance NFData UpdateNotification where
instance ToHeaders UpdateNotification where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSBudgetServiceGateway.UpdateNotification" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateNotification where
toJSON UpdateNotification'{..}
= object
(catMaybes
[Just ("AccountId" .= _unAccountId),
Just ("BudgetName" .= _unBudgetName),
Just ("OldNotification" .= _unOldNotification),
Just ("NewNotification" .= _unNewNotification)])
instance ToPath UpdateNotification where
toPath = const "/"
instance ToQuery UpdateNotification where
toQuery = const mempty
newtype UpdateNotificationResponse = UpdateNotificationResponse'
{ _unrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateNotificationResponse
:: Int
-> UpdateNotificationResponse
updateNotificationResponse pResponseStatus_ =
UpdateNotificationResponse' {_unrsResponseStatus = pResponseStatus_}
unrsResponseStatus :: Lens' UpdateNotificationResponse Int
unrsResponseStatus = lens _unrsResponseStatus (\ s a -> s{_unrsResponseStatus = a})
instance NFData UpdateNotificationResponse where