module Network.AWS.IoT.UpdateThing
(
updateThing
, UpdateThing
, utThingName
, utAttributePayload
, updateThingResponse
, UpdateThingResponse
, utrsResponseStatus
) 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 UpdateThing = UpdateThing'
{ _utThingName :: !Text
, _utAttributePayload :: !AttributePayload
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateThing
:: Text
-> AttributePayload
-> UpdateThing
updateThing pThingName_ pAttributePayload_ =
UpdateThing'
{ _utThingName = pThingName_
, _utAttributePayload = pAttributePayload_
}
utThingName :: Lens' UpdateThing Text
utThingName = lens _utThingName (\ s a -> s{_utThingName = a});
utAttributePayload :: Lens' UpdateThing AttributePayload
utAttributePayload = lens _utAttributePayload (\ s a -> s{_utAttributePayload = a});
instance AWSRequest UpdateThing where
type Rs UpdateThing = UpdateThingResponse
request = patchJSON ioT
response
= receiveEmpty
(\ s h x ->
UpdateThingResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateThing
instance NFData UpdateThing
instance ToHeaders UpdateThing where
toHeaders = const mempty
instance ToJSON UpdateThing where
toJSON UpdateThing'{..}
= object
(catMaybes
[Just ("attributePayload" .= _utAttributePayload)])
instance ToPath UpdateThing where
toPath UpdateThing'{..}
= mconcat ["/things/", toBS _utThingName]
instance ToQuery UpdateThing where
toQuery = const mempty
newtype UpdateThingResponse = UpdateThingResponse'
{ _utrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateThingResponse
:: Int
-> UpdateThingResponse
updateThingResponse pResponseStatus_ =
UpdateThingResponse'
{ _utrsResponseStatus = pResponseStatus_
}
utrsResponseStatus :: Lens' UpdateThingResponse Int
utrsResponseStatus = lens _utrsResponseStatus (\ s a -> s{_utrsResponseStatus = a});
instance NFData UpdateThingResponse