{-# 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.DeleteProduct
(
deleteProduct
, DeleteProduct
, delAcceptLanguage
, delId
, deleteProductResponse
, DeleteProductResponse
, delersResponseStatus
) 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 DeleteProduct = DeleteProduct'
{ _delAcceptLanguage :: !(Maybe Text)
, _delId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteProduct
:: Text
-> DeleteProduct
deleteProduct pId_ =
DeleteProduct'
{ _delAcceptLanguage = Nothing
, _delId = pId_
}
delAcceptLanguage :: Lens' DeleteProduct (Maybe Text)
delAcceptLanguage = lens _delAcceptLanguage (\ s a -> s{_delAcceptLanguage = a});
delId :: Lens' DeleteProduct Text
delId = lens _delId (\ s a -> s{_delId = a});
instance AWSRequest DeleteProduct where
type Rs DeleteProduct = DeleteProductResponse
request = postJSON serviceCatalog
response
= receiveEmpty
(\ s h x ->
DeleteProductResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteProduct
instance NFData DeleteProduct
instance ToHeaders DeleteProduct where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DeleteProduct" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteProduct where
toJSON DeleteProduct'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _delAcceptLanguage,
Just ("Id" .= _delId)])
instance ToPath DeleteProduct where
toPath = const "/"
instance ToQuery DeleteProduct where
toQuery = const mempty
newtype DeleteProductResponse = DeleteProductResponse'
{ _delersResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteProductResponse
:: Int
-> DeleteProductResponse
deleteProductResponse pResponseStatus_ =
DeleteProductResponse'
{ _delersResponseStatus = pResponseStatus_
}
delersResponseStatus :: Lens' DeleteProductResponse Int
delersResponseStatus = lens _delersResponseStatus (\ s a -> s{_delersResponseStatus = a});
instance NFData DeleteProductResponse