{-# 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.ElasticTranscoder.UpdatePipelineNotifications
(
updatePipelineNotifications
, UpdatePipelineNotifications
, upnId
, upnNotifications
, updatePipelineNotificationsResponse
, UpdatePipelineNotificationsResponse
, upnrsPipeline
, upnrsResponseStatus
) where
import Network.AWS.ElasticTranscoder.Types
import Network.AWS.ElasticTranscoder.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdatePipelineNotifications = UpdatePipelineNotifications'
{ _upnId :: !Text
, _upnNotifications :: !Notifications
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updatePipelineNotifications
:: Text
-> Notifications
-> UpdatePipelineNotifications
updatePipelineNotifications pId_ pNotifications_ =
UpdatePipelineNotifications'
{ _upnId = pId_
, _upnNotifications = pNotifications_
}
upnId :: Lens' UpdatePipelineNotifications Text
upnId = lens _upnId (\ s a -> s{_upnId = a});
upnNotifications :: Lens' UpdatePipelineNotifications Notifications
upnNotifications = lens _upnNotifications (\ s a -> s{_upnNotifications = a});
instance AWSRequest UpdatePipelineNotifications where
type Rs UpdatePipelineNotifications =
UpdatePipelineNotificationsResponse
request = postJSON elasticTranscoder
response
= receiveJSON
(\ s h x ->
UpdatePipelineNotificationsResponse' <$>
(x .?> "Pipeline") <*> (pure (fromEnum s)))
instance Hashable UpdatePipelineNotifications
instance NFData UpdatePipelineNotifications
instance ToHeaders UpdatePipelineNotifications where
toHeaders = const mempty
instance ToJSON UpdatePipelineNotifications where
toJSON UpdatePipelineNotifications'{..}
= object
(catMaybes
[Just ("Notifications" .= _upnNotifications)])
instance ToPath UpdatePipelineNotifications where
toPath UpdatePipelineNotifications'{..}
= mconcat
["/2012-09-25/pipelines/", toBS _upnId,
"/notifications"]
instance ToQuery UpdatePipelineNotifications where
toQuery = const mempty
data UpdatePipelineNotificationsResponse = UpdatePipelineNotificationsResponse'
{ _upnrsPipeline :: !(Maybe Pipeline)
, _upnrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updatePipelineNotificationsResponse
:: Int
-> UpdatePipelineNotificationsResponse
updatePipelineNotificationsResponse pResponseStatus_ =
UpdatePipelineNotificationsResponse'
{ _upnrsPipeline = Nothing
, _upnrsResponseStatus = pResponseStatus_
}
upnrsPipeline :: Lens' UpdatePipelineNotificationsResponse (Maybe Pipeline)
upnrsPipeline = lens _upnrsPipeline (\ s a -> s{_upnrsPipeline = a});
upnrsResponseStatus :: Lens' UpdatePipelineNotificationsResponse Int
upnrsResponseStatus = lens _upnrsResponseStatus (\ s a -> s{_upnrsResponseStatus = a});
instance NFData UpdatePipelineNotificationsResponse