{-# 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.IoT.UpdateEventConfigurations
(
updateEventConfigurations
, UpdateEventConfigurations
, uecEventConfigurations
, updateEventConfigurationsResponse
, UpdateEventConfigurationsResponse
, uecrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype UpdateEventConfigurations = UpdateEventConfigurations'
{ _uecEventConfigurations :: Maybe (Map EventType Configuration)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEventConfigurations
:: UpdateEventConfigurations
updateEventConfigurations =
UpdateEventConfigurations' {_uecEventConfigurations = Nothing}
uecEventConfigurations :: Lens' UpdateEventConfigurations (HashMap EventType Configuration)
uecEventConfigurations = lens _uecEventConfigurations (\ s a -> s{_uecEventConfigurations = a}) . _Default . _Map
instance AWSRequest UpdateEventConfigurations where
type Rs UpdateEventConfigurations =
UpdateEventConfigurationsResponse
request = patchJSON ioT
response
= receiveEmpty
(\ s h x ->
UpdateEventConfigurationsResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateEventConfigurations where
instance NFData UpdateEventConfigurations where
instance ToHeaders UpdateEventConfigurations where
toHeaders = const mempty
instance ToJSON UpdateEventConfigurations where
toJSON UpdateEventConfigurations'{..}
= object
(catMaybes
[("eventConfigurations" .=) <$>
_uecEventConfigurations])
instance ToPath UpdateEventConfigurations where
toPath = const "/event-configurations"
instance ToQuery UpdateEventConfigurations where
toQuery = const mempty
newtype UpdateEventConfigurationsResponse = UpdateEventConfigurationsResponse'
{ _uecrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEventConfigurationsResponse
:: Int
-> UpdateEventConfigurationsResponse
updateEventConfigurationsResponse pResponseStatus_ =
UpdateEventConfigurationsResponse' {_uecrsResponseStatus = pResponseStatus_}
uecrsResponseStatus :: Lens' UpdateEventConfigurationsResponse Int
uecrsResponseStatus = lens _uecrsResponseStatus (\ s a -> s{_uecrsResponseStatus = a})
instance NFData UpdateEventConfigurationsResponse
where