{-# 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.ProvisionProduct
(
provisionProduct
, ProvisionProduct
, ppNotificationARNs
, ppAcceptLanguage
, ppPathId
, ppProvisioningParameters
, ppTags
, ppProductId
, ppProvisioningArtifactId
, ppProvisionedProductName
, ppProvisionToken
, provisionProductResponse
, ProvisionProductResponse
, pprsRecordDetail
, pprsResponseStatus
) 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 ProvisionProduct = ProvisionProduct'
{ _ppNotificationARNs :: !(Maybe [Text])
, _ppAcceptLanguage :: !(Maybe Text)
, _ppPathId :: !(Maybe Text)
, _ppProvisioningParameters :: !(Maybe [ProvisioningParameter])
, _ppTags :: !(Maybe [Tag])
, _ppProductId :: !Text
, _ppProvisioningArtifactId :: !Text
, _ppProvisionedProductName :: !Text
, _ppProvisionToken :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
provisionProduct
:: Text
-> Text
-> Text
-> Text
-> ProvisionProduct
provisionProduct pProductId_ pProvisioningArtifactId_ pProvisionedProductName_ pProvisionToken_ =
ProvisionProduct'
{ _ppNotificationARNs = Nothing
, _ppAcceptLanguage = Nothing
, _ppPathId = Nothing
, _ppProvisioningParameters = Nothing
, _ppTags = Nothing
, _ppProductId = pProductId_
, _ppProvisioningArtifactId = pProvisioningArtifactId_
, _ppProvisionedProductName = pProvisionedProductName_
, _ppProvisionToken = pProvisionToken_
}
ppNotificationARNs :: Lens' ProvisionProduct [Text]
ppNotificationARNs = lens _ppNotificationARNs (\ s a -> s{_ppNotificationARNs = a}) . _Default . _Coerce;
ppAcceptLanguage :: Lens' ProvisionProduct (Maybe Text)
ppAcceptLanguage = lens _ppAcceptLanguage (\ s a -> s{_ppAcceptLanguage = a});
ppPathId :: Lens' ProvisionProduct (Maybe Text)
ppPathId = lens _ppPathId (\ s a -> s{_ppPathId = a});
ppProvisioningParameters :: Lens' ProvisionProduct [ProvisioningParameter]
ppProvisioningParameters = lens _ppProvisioningParameters (\ s a -> s{_ppProvisioningParameters = a}) . _Default . _Coerce;
ppTags :: Lens' ProvisionProduct [Tag]
ppTags = lens _ppTags (\ s a -> s{_ppTags = a}) . _Default . _Coerce;
ppProductId :: Lens' ProvisionProduct Text
ppProductId = lens _ppProductId (\ s a -> s{_ppProductId = a});
ppProvisioningArtifactId :: Lens' ProvisionProduct Text
ppProvisioningArtifactId = lens _ppProvisioningArtifactId (\ s a -> s{_ppProvisioningArtifactId = a});
ppProvisionedProductName :: Lens' ProvisionProduct Text
ppProvisionedProductName = lens _ppProvisionedProductName (\ s a -> s{_ppProvisionedProductName = a});
ppProvisionToken :: Lens' ProvisionProduct Text
ppProvisionToken = lens _ppProvisionToken (\ s a -> s{_ppProvisionToken = a});
instance AWSRequest ProvisionProduct where
type Rs ProvisionProduct = ProvisionProductResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
ProvisionProductResponse' <$>
(x .?> "RecordDetail") <*> (pure (fromEnum s)))
instance Hashable ProvisionProduct
instance NFData ProvisionProduct
instance ToHeaders ProvisionProduct where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.ProvisionProduct" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ProvisionProduct where
toJSON ProvisionProduct'{..}
= object
(catMaybes
[("NotificationArns" .=) <$> _ppNotificationARNs,
("AcceptLanguage" .=) <$> _ppAcceptLanguage,
("PathId" .=) <$> _ppPathId,
("ProvisioningParameters" .=) <$>
_ppProvisioningParameters,
("Tags" .=) <$> _ppTags,
Just ("ProductId" .= _ppProductId),
Just
("ProvisioningArtifactId" .=
_ppProvisioningArtifactId),
Just
("ProvisionedProductName" .=
_ppProvisionedProductName),
Just ("ProvisionToken" .= _ppProvisionToken)])
instance ToPath ProvisionProduct where
toPath = const "/"
instance ToQuery ProvisionProduct where
toQuery = const mempty
data ProvisionProductResponse = ProvisionProductResponse'
{ _pprsRecordDetail :: !(Maybe RecordDetail)
, _pprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
provisionProductResponse
:: Int
-> ProvisionProductResponse
provisionProductResponse pResponseStatus_ =
ProvisionProductResponse'
{ _pprsRecordDetail = Nothing
, _pprsResponseStatus = pResponseStatus_
}
pprsRecordDetail :: Lens' ProvisionProductResponse (Maybe RecordDetail)
pprsRecordDetail = lens _pprsRecordDetail (\ s a -> s{_pprsRecordDetail = a});
pprsResponseStatus :: Lens' ProvisionProductResponse Int
pprsResponseStatus = lens _pprsResponseStatus (\ s a -> s{_pprsResponseStatus = a});
instance NFData ProvisionProductResponse