{-# 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.DetachPolicy
(
detachPolicy
, DetachPolicy
, dPolicyName
, dTarget
, detachPolicyResponse
, DetachPolicyResponse
) 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 DetachPolicy = DetachPolicy'
{ _dPolicyName :: !Text
, _dTarget :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
detachPolicy
:: Text
-> Text
-> DetachPolicy
detachPolicy pPolicyName_ pTarget_ =
DetachPolicy' {_dPolicyName = pPolicyName_, _dTarget = pTarget_}
dPolicyName :: Lens' DetachPolicy Text
dPolicyName = lens _dPolicyName (\ s a -> s{_dPolicyName = a})
dTarget :: Lens' DetachPolicy Text
dTarget = lens _dTarget (\ s a -> s{_dTarget = a})
instance AWSRequest DetachPolicy where
type Rs DetachPolicy = DetachPolicyResponse
request = postJSON ioT
response = receiveNull DetachPolicyResponse'
instance Hashable DetachPolicy where
instance NFData DetachPolicy where
instance ToHeaders DetachPolicy where
toHeaders = const mempty
instance ToJSON DetachPolicy where
toJSON DetachPolicy'{..}
= object (catMaybes [Just ("target" .= _dTarget)])
instance ToPath DetachPolicy where
toPath DetachPolicy'{..}
= mconcat ["/target-policies/", toBS _dPolicyName]
instance ToQuery DetachPolicy where
toQuery = const mempty
data DetachPolicyResponse =
DetachPolicyResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
detachPolicyResponse
:: DetachPolicyResponse
detachPolicyResponse = DetachPolicyResponse'
instance NFData DetachPolicyResponse where