{-# 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.CreatePortfolioShare
(
createPortfolioShare
, CreatePortfolioShare
, cpsAcceptLanguage
, cpsPortfolioId
, cpsAccountId
, createPortfolioShareResponse
, CreatePortfolioShareResponse
, cpsrsResponseStatus
) 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 CreatePortfolioShare = CreatePortfolioShare'
{ _cpsAcceptLanguage :: !(Maybe Text)
, _cpsPortfolioId :: !Text
, _cpsAccountId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createPortfolioShare
:: Text
-> Text
-> CreatePortfolioShare
createPortfolioShare pPortfolioId_ pAccountId_ =
CreatePortfolioShare'
{ _cpsAcceptLanguage = Nothing
, _cpsPortfolioId = pPortfolioId_
, _cpsAccountId = pAccountId_
}
cpsAcceptLanguage :: Lens' CreatePortfolioShare (Maybe Text)
cpsAcceptLanguage = lens _cpsAcceptLanguage (\ s a -> s{_cpsAcceptLanguage = a});
cpsPortfolioId :: Lens' CreatePortfolioShare Text
cpsPortfolioId = lens _cpsPortfolioId (\ s a -> s{_cpsPortfolioId = a});
cpsAccountId :: Lens' CreatePortfolioShare Text
cpsAccountId = lens _cpsAccountId (\ s a -> s{_cpsAccountId = a});
instance AWSRequest CreatePortfolioShare where
type Rs CreatePortfolioShare =
CreatePortfolioShareResponse
request = postJSON serviceCatalog
response
= receiveEmpty
(\ s h x ->
CreatePortfolioShareResponse' <$>
(pure (fromEnum s)))
instance Hashable CreatePortfolioShare
instance NFData CreatePortfolioShare
instance ToHeaders CreatePortfolioShare where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.CreatePortfolioShare"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreatePortfolioShare where
toJSON CreatePortfolioShare'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _cpsAcceptLanguage,
Just ("PortfolioId" .= _cpsPortfolioId),
Just ("AccountId" .= _cpsAccountId)])
instance ToPath CreatePortfolioShare where
toPath = const "/"
instance ToQuery CreatePortfolioShare where
toQuery = const mempty
newtype CreatePortfolioShareResponse = CreatePortfolioShareResponse'
{ _cpsrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createPortfolioShareResponse
:: Int
-> CreatePortfolioShareResponse
createPortfolioShareResponse pResponseStatus_ =
CreatePortfolioShareResponse'
{ _cpsrsResponseStatus = pResponseStatus_
}
cpsrsResponseStatus :: Lens' CreatePortfolioShareResponse Int
cpsrsResponseStatus = lens _cpsrsResponseStatus (\ s a -> s{_cpsrsResponseStatus = a});
instance NFData CreatePortfolioShareResponse