{-# 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.AddThingToThingGroup
(
addThingToThingGroup
, AddThingToThingGroup
, atttgThingGroupARN
, atttgThingARN
, atttgThingGroupName
, atttgThingName
, addThingToThingGroupResponse
, AddThingToThingGroupResponse
, atttgrsResponseStatus
) 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 AddThingToThingGroup = AddThingToThingGroup'
{ _atttgThingGroupARN :: !(Maybe Text)
, _atttgThingARN :: !(Maybe Text)
, _atttgThingGroupName :: !(Maybe Text)
, _atttgThingName :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addThingToThingGroup
:: AddThingToThingGroup
addThingToThingGroup =
AddThingToThingGroup'
{ _atttgThingGroupARN = Nothing
, _atttgThingARN = Nothing
, _atttgThingGroupName = Nothing
, _atttgThingName = Nothing
}
atttgThingGroupARN :: Lens' AddThingToThingGroup (Maybe Text)
atttgThingGroupARN = lens _atttgThingGroupARN (\ s a -> s{_atttgThingGroupARN = a})
atttgThingARN :: Lens' AddThingToThingGroup (Maybe Text)
atttgThingARN = lens _atttgThingARN (\ s a -> s{_atttgThingARN = a})
atttgThingGroupName :: Lens' AddThingToThingGroup (Maybe Text)
atttgThingGroupName = lens _atttgThingGroupName (\ s a -> s{_atttgThingGroupName = a})
atttgThingName :: Lens' AddThingToThingGroup (Maybe Text)
atttgThingName = lens _atttgThingName (\ s a -> s{_atttgThingName = a})
instance AWSRequest AddThingToThingGroup where
type Rs AddThingToThingGroup =
AddThingToThingGroupResponse
request = putJSON ioT
response
= receiveEmpty
(\ s h x ->
AddThingToThingGroupResponse' <$>
(pure (fromEnum s)))
instance Hashable AddThingToThingGroup where
instance NFData AddThingToThingGroup where
instance ToHeaders AddThingToThingGroup where
toHeaders = const mempty
instance ToJSON AddThingToThingGroup where
toJSON AddThingToThingGroup'{..}
= object
(catMaybes
[("thingGroupArn" .=) <$> _atttgThingGroupARN,
("thingArn" .=) <$> _atttgThingARN,
("thingGroupName" .=) <$> _atttgThingGroupName,
("thingName" .=) <$> _atttgThingName])
instance ToPath AddThingToThingGroup where
toPath = const "/thing-groups/addThingToThingGroup"
instance ToQuery AddThingToThingGroup where
toQuery = const mempty
newtype AddThingToThingGroupResponse = AddThingToThingGroupResponse'
{ _atttgrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addThingToThingGroupResponse
:: Int
-> AddThingToThingGroupResponse
addThingToThingGroupResponse pResponseStatus_ =
AddThingToThingGroupResponse' {_atttgrsResponseStatus = pResponseStatus_}
atttgrsResponseStatus :: Lens' AddThingToThingGroupResponse Int
atttgrsResponseStatus = lens _atttgrsResponseStatus (\ s a -> s{_atttgrsResponseStatus = a})
instance NFData AddThingToThingGroupResponse where