{-# 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.AssociateProductWithPortfolio
(
associateProductWithPortfolio
, AssociateProductWithPortfolio
, apwpSourcePortfolioId
, apwpAcceptLanguage
, apwpProductId
, apwpPortfolioId
, associateProductWithPortfolioResponse
, AssociateProductWithPortfolioResponse
, arsResponseStatus
) 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 AssociateProductWithPortfolio = AssociateProductWithPortfolio'
{ _apwpSourcePortfolioId :: !(Maybe Text)
, _apwpAcceptLanguage :: !(Maybe Text)
, _apwpProductId :: !Text
, _apwpPortfolioId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
associateProductWithPortfolio
:: Text
-> Text
-> AssociateProductWithPortfolio
associateProductWithPortfolio pProductId_ pPortfolioId_ =
AssociateProductWithPortfolio'
{ _apwpSourcePortfolioId = Nothing
, _apwpAcceptLanguage = Nothing
, _apwpProductId = pProductId_
, _apwpPortfolioId = pPortfolioId_
}
apwpSourcePortfolioId :: Lens' AssociateProductWithPortfolio (Maybe Text)
apwpSourcePortfolioId = lens _apwpSourcePortfolioId (\ s a -> s{_apwpSourcePortfolioId = a});
apwpAcceptLanguage :: Lens' AssociateProductWithPortfolio (Maybe Text)
apwpAcceptLanguage = lens _apwpAcceptLanguage (\ s a -> s{_apwpAcceptLanguage = a});
apwpProductId :: Lens' AssociateProductWithPortfolio Text
apwpProductId = lens _apwpProductId (\ s a -> s{_apwpProductId = a});
apwpPortfolioId :: Lens' AssociateProductWithPortfolio Text
apwpPortfolioId = lens _apwpPortfolioId (\ s a -> s{_apwpPortfolioId = a});
instance AWSRequest AssociateProductWithPortfolio
where
type Rs AssociateProductWithPortfolio =
AssociateProductWithPortfolioResponse
request = postJSON serviceCatalog
response
= receiveEmpty
(\ s h x ->
AssociateProductWithPortfolioResponse' <$>
(pure (fromEnum s)))
instance Hashable AssociateProductWithPortfolio
instance NFData AssociateProductWithPortfolio
instance ToHeaders AssociateProductWithPortfolio
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.AssociateProductWithPortfolio"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateProductWithPortfolio where
toJSON AssociateProductWithPortfolio'{..}
= object
(catMaybes
[("SourcePortfolioId" .=) <$> _apwpSourcePortfolioId,
("AcceptLanguage" .=) <$> _apwpAcceptLanguage,
Just ("ProductId" .= _apwpProductId),
Just ("PortfolioId" .= _apwpPortfolioId)])
instance ToPath AssociateProductWithPortfolio where
toPath = const "/"
instance ToQuery AssociateProductWithPortfolio where
toQuery = const mempty
newtype AssociateProductWithPortfolioResponse = AssociateProductWithPortfolioResponse'
{ _arsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
associateProductWithPortfolioResponse
:: Int
-> AssociateProductWithPortfolioResponse
associateProductWithPortfolioResponse pResponseStatus_ =
AssociateProductWithPortfolioResponse'
{ _arsResponseStatus = pResponseStatus_
}
arsResponseStatus :: Lens' AssociateProductWithPortfolioResponse Int
arsResponseStatus = lens _arsResponseStatus (\ s a -> s{_arsResponseStatus = a});
instance NFData AssociateProductWithPortfolioResponse