{-# 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.UpdateThingGroupsForThing
(
updateThingGroupsForThing
, UpdateThingGroupsForThing
, utgftThingGroupsToAdd
, utgftThingGroupsToRemove
, utgftThingName
, updateThingGroupsForThingResponse
, UpdateThingGroupsForThingResponse
, utgftrsResponseStatus
) 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 UpdateThingGroupsForThing = UpdateThingGroupsForThing'
{ _utgftThingGroupsToAdd :: !(Maybe [Text])
, _utgftThingGroupsToRemove :: !(Maybe [Text])
, _utgftThingName :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateThingGroupsForThing
:: UpdateThingGroupsForThing
updateThingGroupsForThing =
UpdateThingGroupsForThing'
{ _utgftThingGroupsToAdd = Nothing
, _utgftThingGroupsToRemove = Nothing
, _utgftThingName = Nothing
}
utgftThingGroupsToAdd :: Lens' UpdateThingGroupsForThing [Text]
utgftThingGroupsToAdd = lens _utgftThingGroupsToAdd (\ s a -> s{_utgftThingGroupsToAdd = a}) . _Default . _Coerce
utgftThingGroupsToRemove :: Lens' UpdateThingGroupsForThing [Text]
utgftThingGroupsToRemove = lens _utgftThingGroupsToRemove (\ s a -> s{_utgftThingGroupsToRemove = a}) . _Default . _Coerce
utgftThingName :: Lens' UpdateThingGroupsForThing (Maybe Text)
utgftThingName = lens _utgftThingName (\ s a -> s{_utgftThingName = a})
instance AWSRequest UpdateThingGroupsForThing where
type Rs UpdateThingGroupsForThing =
UpdateThingGroupsForThingResponse
request = putJSON ioT
response
= receiveEmpty
(\ s h x ->
UpdateThingGroupsForThingResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateThingGroupsForThing where
instance NFData UpdateThingGroupsForThing where
instance ToHeaders UpdateThingGroupsForThing where
toHeaders = const mempty
instance ToJSON UpdateThingGroupsForThing where
toJSON UpdateThingGroupsForThing'{..}
= object
(catMaybes
[("thingGroupsToAdd" .=) <$> _utgftThingGroupsToAdd,
("thingGroupsToRemove" .=) <$>
_utgftThingGroupsToRemove,
("thingName" .=) <$> _utgftThingName])
instance ToPath UpdateThingGroupsForThing where
toPath
= const "/thing-groups/updateThingGroupsForThing"
instance ToQuery UpdateThingGroupsForThing where
toQuery = const mempty
newtype UpdateThingGroupsForThingResponse = UpdateThingGroupsForThingResponse'
{ _utgftrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateThingGroupsForThingResponse
:: Int
-> UpdateThingGroupsForThingResponse
updateThingGroupsForThingResponse pResponseStatus_ =
UpdateThingGroupsForThingResponse' {_utgftrsResponseStatus = pResponseStatus_}
utgftrsResponseStatus :: Lens' UpdateThingGroupsForThingResponse Int
utgftrsResponseStatus = lens _utgftrsResponseStatus (\ s a -> s{_utgftrsResponseStatus = a})
instance NFData UpdateThingGroupsForThingResponse
where