{-# 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.Organizations.DeletePolicy
(
deletePolicy
, DeletePolicy
, dPolicyId
, deletePolicyResponse
, DeletePolicyResponse
) where
import Network.AWS.Lens
import Network.AWS.Organizations.Types
import Network.AWS.Organizations.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeletePolicy = DeletePolicy'
{ _dPolicyId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deletePolicy
:: Text
-> DeletePolicy
deletePolicy pPolicyId_ = DeletePolicy' {_dPolicyId = pPolicyId_}
dPolicyId :: Lens' DeletePolicy Text
dPolicyId = lens _dPolicyId (\ s a -> s{_dPolicyId = a})
instance AWSRequest DeletePolicy where
type Rs DeletePolicy = DeletePolicyResponse
request = postJSON organizations
response = receiveNull DeletePolicyResponse'
instance Hashable DeletePolicy where
instance NFData DeletePolicy where
instance ToHeaders DeletePolicy where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSOrganizationsV20161128.DeletePolicy" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeletePolicy where
toJSON DeletePolicy'{..}
= object
(catMaybes [Just ("PolicyId" .= _dPolicyId)])
instance ToPath DeletePolicy where
toPath = const "/"
instance ToQuery DeletePolicy where
toQuery = const mempty
data DeletePolicyResponse =
DeletePolicyResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
deletePolicyResponse
:: DeletePolicyResponse
deletePolicyResponse = DeletePolicyResponse'
instance NFData DeletePolicyResponse where