{-# 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.DeleteThingGroup
(
deleteThingGroup
, DeleteThingGroup
, dExpectedVersion
, dThingGroupName
, deleteThingGroupResponse
, DeleteThingGroupResponse
, dtgtrsResponseStatus
) 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 DeleteThingGroup = DeleteThingGroup'
{ _dExpectedVersion :: !(Maybe Integer)
, _dThingGroupName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteThingGroup
:: Text
-> DeleteThingGroup
deleteThingGroup pThingGroupName_ =
DeleteThingGroup'
{_dExpectedVersion = Nothing, _dThingGroupName = pThingGroupName_}
dExpectedVersion :: Lens' DeleteThingGroup (Maybe Integer)
dExpectedVersion = lens _dExpectedVersion (\ s a -> s{_dExpectedVersion = a})
dThingGroupName :: Lens' DeleteThingGroup Text
dThingGroupName = lens _dThingGroupName (\ s a -> s{_dThingGroupName = a})
instance AWSRequest DeleteThingGroup where
type Rs DeleteThingGroup = DeleteThingGroupResponse
request = delete ioT
response
= receiveEmpty
(\ s h x ->
DeleteThingGroupResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteThingGroup where
instance NFData DeleteThingGroup where
instance ToHeaders DeleteThingGroup where
toHeaders = const mempty
instance ToPath DeleteThingGroup where
toPath DeleteThingGroup'{..}
= mconcat ["/thing-groups/", toBS _dThingGroupName]
instance ToQuery DeleteThingGroup where
toQuery DeleteThingGroup'{..}
= mconcat ["expectedVersion" =: _dExpectedVersion]
newtype DeleteThingGroupResponse = DeleteThingGroupResponse'
{ _dtgtrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteThingGroupResponse
:: Int
-> DeleteThingGroupResponse
deleteThingGroupResponse pResponseStatus_ =
DeleteThingGroupResponse' {_dtgtrsResponseStatus = pResponseStatus_}
dtgtrsResponseStatus :: Lens' DeleteThingGroupResponse Int
dtgtrsResponseStatus = lens _dtgtrsResponseStatus (\ s a -> s{_dtgtrsResponseStatus = a})
instance NFData DeleteThingGroupResponse where