{-# 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
, ddrsResponseStatus
) 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 where
instance NFData DeleteThing where
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'
{ _ddrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteThingResponse
:: Int
-> DeleteThingResponse
deleteThingResponse pResponseStatus_ =
DeleteThingResponse' {_ddrsResponseStatus = pResponseStatus_}
ddrsResponseStatus :: Lens' DeleteThingResponse Int
ddrsResponseStatus = lens _ddrsResponseStatus (\ s a -> s{_ddrsResponseStatus = a})
instance NFData DeleteThingResponse where