module Network.AWS.IoT.ReplaceTopicRule
(
replaceTopicRule
, ReplaceTopicRule
, rtrRuleName
, rtrTopicRulePayload
, replaceTopicRuleResponse
, ReplaceTopicRuleResponse
) 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
data ReplaceTopicRule = ReplaceTopicRule'
{ _rtrRuleName :: !Text
, _rtrTopicRulePayload :: !TopicRulePayload
} deriving (Eq,Read,Show,Data,Typeable,Generic)
replaceTopicRule
:: Text
-> TopicRulePayload
-> ReplaceTopicRule
replaceTopicRule pRuleName_ pTopicRulePayload_ =
ReplaceTopicRule'
{ _rtrRuleName = pRuleName_
, _rtrTopicRulePayload = pTopicRulePayload_
}
rtrRuleName :: Lens' ReplaceTopicRule Text
rtrRuleName = lens _rtrRuleName (\ s a -> s{_rtrRuleName = a});
rtrTopicRulePayload :: Lens' ReplaceTopicRule TopicRulePayload
rtrTopicRulePayload = lens _rtrTopicRulePayload (\ s a -> s{_rtrTopicRulePayload = a});
instance AWSRequest ReplaceTopicRule where
type Rs ReplaceTopicRule = ReplaceTopicRuleResponse
request = patchJSON ioT
response = receiveNull ReplaceTopicRuleResponse'
instance Hashable ReplaceTopicRule
instance NFData ReplaceTopicRule
instance ToHeaders ReplaceTopicRule where
toHeaders = const mempty
instance ToJSON ReplaceTopicRule where
toJSON ReplaceTopicRule'{..}
= object
(catMaybes
[Just ("topicRulePayload" .= _rtrTopicRulePayload)])
instance ToPath ReplaceTopicRule where
toPath ReplaceTopicRule'{..}
= mconcat ["/rules/", toBS _rtrRuleName]
instance ToQuery ReplaceTopicRule where
toQuery = const mempty
data ReplaceTopicRuleResponse =
ReplaceTopicRuleResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
replaceTopicRuleResponse
:: ReplaceTopicRuleResponse
replaceTopicRuleResponse = ReplaceTopicRuleResponse'
instance NFData ReplaceTopicRuleResponse