{-# 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.DeprecateThingType
(
deprecateThingType
, DeprecateThingType
, depUndoDeprecate
, depThingTypeName
, deprecateThingTypeResponse
, DeprecateThingTypeResponse
, deprsResponseStatus
) 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 DeprecateThingType = DeprecateThingType'
{ _depUndoDeprecate :: !(Maybe Bool)
, _depThingTypeName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deprecateThingType
:: Text
-> DeprecateThingType
deprecateThingType pThingTypeName_ =
DeprecateThingType'
{ _depUndoDeprecate = Nothing
, _depThingTypeName = pThingTypeName_
}
depUndoDeprecate :: Lens' DeprecateThingType (Maybe Bool)
depUndoDeprecate = lens _depUndoDeprecate (\ s a -> s{_depUndoDeprecate = a});
depThingTypeName :: Lens' DeprecateThingType Text
depThingTypeName = lens _depThingTypeName (\ s a -> s{_depThingTypeName = a});
instance AWSRequest DeprecateThingType where
type Rs DeprecateThingType =
DeprecateThingTypeResponse
request = postJSON ioT
response
= receiveEmpty
(\ s h x ->
DeprecateThingTypeResponse' <$> (pure (fromEnum s)))
instance Hashable DeprecateThingType
instance NFData DeprecateThingType
instance ToHeaders DeprecateThingType where
toHeaders = const mempty
instance ToJSON DeprecateThingType where
toJSON DeprecateThingType'{..}
= object
(catMaybes
[("undoDeprecate" .=) <$> _depUndoDeprecate])
instance ToPath DeprecateThingType where
toPath DeprecateThingType'{..}
= mconcat
["/thing-types/", toBS _depThingTypeName,
"/deprecate"]
instance ToQuery DeprecateThingType where
toQuery = const mempty
newtype DeprecateThingTypeResponse = DeprecateThingTypeResponse'
{ _deprsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deprecateThingTypeResponse
:: Int
-> DeprecateThingTypeResponse
deprecateThingTypeResponse pResponseStatus_ =
DeprecateThingTypeResponse'
{ _deprsResponseStatus = pResponseStatus_
}
deprsResponseStatus :: Lens' DeprecateThingTypeResponse Int
deprsResponseStatus = lens _deprsResponseStatus (\ s a -> s{_deprsResponseStatus = a});
instance NFData DeprecateThingTypeResponse