{-# 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.DeleteThing
(
deleteThing
, DeleteThing
, dtExpectedVersion
, dtThingName
, deleteThingResponse
, DeleteThingResponse
, delrsResponseStatus
) 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 DeleteThing = DeleteThing'
{ _dtExpectedVersion :: !(Maybe Integer)
, _dtThingName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteThing
:: Text
-> DeleteThing
deleteThing pThingName_ =
DeleteThing'
{ _dtExpectedVersion = Nothing
, _dtThingName = pThingName_
}
dtExpectedVersion :: Lens' DeleteThing (Maybe Integer)
dtExpectedVersion = lens _dtExpectedVersion (\ s a -> s{_dtExpectedVersion = a});
dtThingName :: Lens' DeleteThing Text
dtThingName = lens _dtThingName (\ s a -> s{_dtThingName = a});
instance AWSRequest DeleteThing where
type Rs DeleteThing = DeleteThingResponse
request = delete ioT
response
= receiveEmpty
(\ s h x ->
DeleteThingResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteThing
instance NFData DeleteThing
instance ToHeaders DeleteThing where
toHeaders = const mempty
instance ToPath DeleteThing where
toPath DeleteThing'{..}
= mconcat ["/things/", toBS _dtThingName]
instance ToQuery DeleteThing where
toQuery DeleteThing'{..}
= mconcat ["expectedVersion" =: _dtExpectedVersion]
newtype DeleteThingResponse = DeleteThingResponse'
{ _delrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteThingResponse
:: Int
-> DeleteThingResponse
deleteThingResponse pResponseStatus_ =
DeleteThingResponse'
{ _delrsResponseStatus = pResponseStatus_
}
delrsResponseStatus :: Lens' DeleteThingResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});
instance NFData DeleteThingResponse