{-# 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 #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.ServiceCatalog.CreatePortfolioShare -- Copyright : (c) 2013-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Creates a new portfolio share. -- -- module Network.AWS.ServiceCatalog.CreatePortfolioShare ( -- * Creating a Request createPortfolioShare , CreatePortfolioShare -- * Request Lenses , cpsAcceptLanguage , cpsPortfolioId , cpsAccountId -- * Destructuring the Response , createPortfolioShareResponse , CreatePortfolioShareResponse -- * Response Lenses , 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 -- | /See:/ 'createPortfolioShare' smart constructor. data CreatePortfolioShare = CreatePortfolioShare' { _cpsAcceptLanguage :: !(Maybe Text) , _cpsPortfolioId :: !Text , _cpsAccountId :: !Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'CreatePortfolioShare' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'cpsAcceptLanguage' - The language code to use for this operation. Supported language codes are as follows: "en" (English) "jp" (Japanese) "zh" (Chinese) If no code is specified, "en" is used as the default. -- -- * 'cpsPortfolioId' - The portfolio identifier. -- -- * 'cpsAccountId' - The account ID with which to share the portfolio. createPortfolioShare :: Text -- ^ 'cpsPortfolioId' -> Text -- ^ 'cpsAccountId' -> CreatePortfolioShare createPortfolioShare pPortfolioId_ pAccountId_ = CreatePortfolioShare' { _cpsAcceptLanguage = Nothing , _cpsPortfolioId = pPortfolioId_ , _cpsAccountId = pAccountId_ } -- | The language code to use for this operation. Supported language codes are as follows: "en" (English) "jp" (Japanese) "zh" (Chinese) If no code is specified, "en" is used as the default. cpsAcceptLanguage :: Lens' CreatePortfolioShare (Maybe Text) cpsAcceptLanguage = lens _cpsAcceptLanguage (\ s a -> s{_cpsAcceptLanguage = a}); -- | The portfolio identifier. cpsPortfolioId :: Lens' CreatePortfolioShare Text cpsPortfolioId = lens _cpsPortfolioId (\ s a -> s{_cpsPortfolioId = a}); -- | The account ID with which to share the portfolio. 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 -- | /See:/ 'createPortfolioShareResponse' smart constructor. newtype CreatePortfolioShareResponse = CreatePortfolioShareResponse' { _cpsrsResponseStatus :: Int } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'CreatePortfolioShareResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'cpsrsResponseStatus' - -- | The response status code. createPortfolioShareResponse :: Int -- ^ 'cpsrsResponseStatus' -> CreatePortfolioShareResponse createPortfolioShareResponse pResponseStatus_ = CreatePortfolioShareResponse' { _cpsrsResponseStatus = pResponseStatus_ } -- | -- | The response status code. cpsrsResponseStatus :: Lens' CreatePortfolioShareResponse Int cpsrsResponseStatus = lens _cpsrsResponseStatus (\ s a -> s{_cpsrsResponseStatus = a}); instance NFData CreatePortfolioShareResponse