module Network.AWS.IoT.DetachThingPrincipal
(
detachThingPrincipal
, DetachThingPrincipal
, dtpThingName
, dtpPrincipal
, detachThingPrincipalResponse
, DetachThingPrincipalResponse
, dtprsResponseStatus
) 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 DetachThingPrincipal = DetachThingPrincipal'
{ _dtpThingName :: !Text
, _dtpPrincipal :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
detachThingPrincipal
:: Text
-> Text
-> DetachThingPrincipal
detachThingPrincipal pThingName_ pPrincipal_ =
DetachThingPrincipal'
{ _dtpThingName = pThingName_
, _dtpPrincipal = pPrincipal_
}
dtpThingName :: Lens' DetachThingPrincipal Text
dtpThingName = lens _dtpThingName (\ s a -> s{_dtpThingName = a});
dtpPrincipal :: Lens' DetachThingPrincipal Text
dtpPrincipal = lens _dtpPrincipal (\ s a -> s{_dtpPrincipal = a});
instance AWSRequest DetachThingPrincipal where
type Rs DetachThingPrincipal =
DetachThingPrincipalResponse
request = delete ioT
response
= receiveEmpty
(\ s h x ->
DetachThingPrincipalResponse' <$>
(pure (fromEnum s)))
instance Hashable DetachThingPrincipal
instance NFData DetachThingPrincipal
instance ToHeaders DetachThingPrincipal where
toHeaders DetachThingPrincipal'{..}
= mconcat ["x-amzn-principal" =# _dtpPrincipal]
instance ToPath DetachThingPrincipal where
toPath DetachThingPrincipal'{..}
= mconcat
["/things/", toBS _dtpThingName, "/principals"]
instance ToQuery DetachThingPrincipal where
toQuery = const mempty
newtype DetachThingPrincipalResponse = DetachThingPrincipalResponse'
{ _dtprsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
detachThingPrincipalResponse
:: Int
-> DetachThingPrincipalResponse
detachThingPrincipalResponse pResponseStatus_ =
DetachThingPrincipalResponse'
{ _dtprsResponseStatus = pResponseStatus_
}
dtprsResponseStatus :: Lens' DetachThingPrincipalResponse Int
dtprsResponseStatus = lens _dtprsResponseStatus (\ s a -> s{_dtprsResponseStatus = a});
instance NFData DetachThingPrincipalResponse