{-# 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.ServiceCatalog.TerminateProvisionedProduct
(
terminateProvisionedProduct
, TerminateProvisionedProduct
, tppProvisionedProductName
, tppAcceptLanguage
, tppIgnoreErrors
, tppProvisionedProductId
, tppTerminateToken
, terminateProvisionedProductResponse
, TerminateProvisionedProductResponse
, tpprsRecordDetail
, tpprsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.ServiceCatalog.Types
import Network.AWS.ServiceCatalog.Types.Product
data TerminateProvisionedProduct = TerminateProvisionedProduct'
{ _tppProvisionedProductName :: !(Maybe Text)
, _tppAcceptLanguage :: !(Maybe Text)
, _tppIgnoreErrors :: !(Maybe Bool)
, _tppProvisionedProductId :: !(Maybe Text)
, _tppTerminateToken :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
terminateProvisionedProduct
:: Text
-> TerminateProvisionedProduct
terminateProvisionedProduct pTerminateToken_ =
TerminateProvisionedProduct'
{ _tppProvisionedProductName = Nothing
, _tppAcceptLanguage = Nothing
, _tppIgnoreErrors = Nothing
, _tppProvisionedProductId = Nothing
, _tppTerminateToken = pTerminateToken_
}
tppProvisionedProductName :: Lens' TerminateProvisionedProduct (Maybe Text)
tppProvisionedProductName = lens _tppProvisionedProductName (\ s a -> s{_tppProvisionedProductName = a});
tppAcceptLanguage :: Lens' TerminateProvisionedProduct (Maybe Text)
tppAcceptLanguage = lens _tppAcceptLanguage (\ s a -> s{_tppAcceptLanguage = a});
tppIgnoreErrors :: Lens' TerminateProvisionedProduct (Maybe Bool)
tppIgnoreErrors = lens _tppIgnoreErrors (\ s a -> s{_tppIgnoreErrors = a});
tppProvisionedProductId :: Lens' TerminateProvisionedProduct (Maybe Text)
tppProvisionedProductId = lens _tppProvisionedProductId (\ s a -> s{_tppProvisionedProductId = a});
tppTerminateToken :: Lens' TerminateProvisionedProduct Text
tppTerminateToken = lens _tppTerminateToken (\ s a -> s{_tppTerminateToken = a});
instance AWSRequest TerminateProvisionedProduct where
type Rs TerminateProvisionedProduct =
TerminateProvisionedProductResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
TerminateProvisionedProductResponse' <$>
(x .?> "RecordDetail") <*> (pure (fromEnum s)))
instance Hashable TerminateProvisionedProduct
instance NFData TerminateProvisionedProduct
instance ToHeaders TerminateProvisionedProduct where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.TerminateProvisionedProduct"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON TerminateProvisionedProduct where
toJSON TerminateProvisionedProduct'{..}
= object
(catMaybes
[("ProvisionedProductName" .=) <$>
_tppProvisionedProductName,
("AcceptLanguage" .=) <$> _tppAcceptLanguage,
("IgnoreErrors" .=) <$> _tppIgnoreErrors,
("ProvisionedProductId" .=) <$>
_tppProvisionedProductId,
Just ("TerminateToken" .= _tppTerminateToken)])
instance ToPath TerminateProvisionedProduct where
toPath = const "/"
instance ToQuery TerminateProvisionedProduct where
toQuery = const mempty
data TerminateProvisionedProductResponse = TerminateProvisionedProductResponse'
{ _tpprsRecordDetail :: !(Maybe RecordDetail)
, _tpprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
terminateProvisionedProductResponse
:: Int
-> TerminateProvisionedProductResponse
terminateProvisionedProductResponse pResponseStatus_ =
TerminateProvisionedProductResponse'
{ _tpprsRecordDetail = Nothing
, _tpprsResponseStatus = pResponseStatus_
}
tpprsRecordDetail :: Lens' TerminateProvisionedProductResponse (Maybe RecordDetail)
tpprsRecordDetail = lens _tpprsRecordDetail (\ s a -> s{_tpprsRecordDetail = a});
tpprsResponseStatus :: Lens' TerminateProvisionedProductResponse Int
tpprsResponseStatus = lens _tpprsResponseStatus (\ s a -> s{_tpprsResponseStatus = a});
instance NFData TerminateProvisionedProductResponse