{-# 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
, dppAcceptLanguage
, dppId
, 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'
{ _dppAcceptLanguage :: !(Maybe Text)
, _dppId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteProduct
:: Text
-> DeleteProduct
deleteProduct pId_ =
DeleteProduct' {_dppAcceptLanguage = Nothing, _dppId = pId_}
dppAcceptLanguage :: Lens' DeleteProduct (Maybe Text)
dppAcceptLanguage = lens _dppAcceptLanguage (\ s a -> s{_dppAcceptLanguage = a})
dppId :: Lens' DeleteProduct Text
dppId = lens _dppId (\ s a -> s{_dppId = a})
instance AWSRequest DeleteProduct where
type Rs DeleteProduct = DeleteProductResponse
request = postJSON serviceCatalog
response
= receiveEmpty
(\ s h x ->
DeleteProductResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteProduct where
instance NFData DeleteProduct where
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" .=) <$> _dppAcceptLanguage,
Just ("Id" .= _dppId)])
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 where