{-# 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.CreateProvisioningArtifact
(
createProvisioningArtifact
, CreateProvisioningArtifact
, cpaAcceptLanguage
, cpaProductId
, cpaParameters
, cpaIdempotencyToken
, createProvisioningArtifactResponse
, CreateProvisioningArtifactResponse
, cparsStatus
, cparsInfo
, cparsProvisioningArtifactDetail
, cparsResponseStatus
) 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 CreateProvisioningArtifact = CreateProvisioningArtifact'
{ _cpaAcceptLanguage :: !(Maybe Text)
, _cpaProductId :: !Text
, _cpaParameters :: !ProvisioningArtifactProperties
, _cpaIdempotencyToken :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createProvisioningArtifact
:: Text
-> ProvisioningArtifactProperties
-> Text
-> CreateProvisioningArtifact
createProvisioningArtifact pProductId_ pParameters_ pIdempotencyToken_ =
CreateProvisioningArtifact'
{ _cpaAcceptLanguage = Nothing
, _cpaProductId = pProductId_
, _cpaParameters = pParameters_
, _cpaIdempotencyToken = pIdempotencyToken_
}
cpaAcceptLanguage :: Lens' CreateProvisioningArtifact (Maybe Text)
cpaAcceptLanguage = lens _cpaAcceptLanguage (\ s a -> s{_cpaAcceptLanguage = a});
cpaProductId :: Lens' CreateProvisioningArtifact Text
cpaProductId = lens _cpaProductId (\ s a -> s{_cpaProductId = a});
cpaParameters :: Lens' CreateProvisioningArtifact ProvisioningArtifactProperties
cpaParameters = lens _cpaParameters (\ s a -> s{_cpaParameters = a});
cpaIdempotencyToken :: Lens' CreateProvisioningArtifact Text
cpaIdempotencyToken = lens _cpaIdempotencyToken (\ s a -> s{_cpaIdempotencyToken = a});
instance AWSRequest CreateProvisioningArtifact where
type Rs CreateProvisioningArtifact =
CreateProvisioningArtifactResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
CreateProvisioningArtifactResponse' <$>
(x .?> "Status") <*> (x .?> "Info" .!@ mempty) <*>
(x .?> "ProvisioningArtifactDetail")
<*> (pure (fromEnum s)))
instance Hashable CreateProvisioningArtifact
instance NFData CreateProvisioningArtifact
instance ToHeaders CreateProvisioningArtifact where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.CreateProvisioningArtifact"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateProvisioningArtifact where
toJSON CreateProvisioningArtifact'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _cpaAcceptLanguage,
Just ("ProductId" .= _cpaProductId),
Just ("Parameters" .= _cpaParameters),
Just ("IdempotencyToken" .= _cpaIdempotencyToken)])
instance ToPath CreateProvisioningArtifact where
toPath = const "/"
instance ToQuery CreateProvisioningArtifact where
toQuery = const mempty
data CreateProvisioningArtifactResponse = CreateProvisioningArtifactResponse'
{ _cparsStatus :: !(Maybe RequestStatus)
, _cparsInfo :: !(Maybe (Map Text Text))
, _cparsProvisioningArtifactDetail :: !(Maybe ProvisioningArtifactDetail)
, _cparsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createProvisioningArtifactResponse
:: Int
-> CreateProvisioningArtifactResponse
createProvisioningArtifactResponse pResponseStatus_ =
CreateProvisioningArtifactResponse'
{ _cparsStatus = Nothing
, _cparsInfo = Nothing
, _cparsProvisioningArtifactDetail = Nothing
, _cparsResponseStatus = pResponseStatus_
}
cparsStatus :: Lens' CreateProvisioningArtifactResponse (Maybe RequestStatus)
cparsStatus = lens _cparsStatus (\ s a -> s{_cparsStatus = a});
cparsInfo :: Lens' CreateProvisioningArtifactResponse (HashMap Text Text)
cparsInfo = lens _cparsInfo (\ s a -> s{_cparsInfo = a}) . _Default . _Map;
cparsProvisioningArtifactDetail :: Lens' CreateProvisioningArtifactResponse (Maybe ProvisioningArtifactDetail)
cparsProvisioningArtifactDetail = lens _cparsProvisioningArtifactDetail (\ s a -> s{_cparsProvisioningArtifactDetail = a});
cparsResponseStatus :: Lens' CreateProvisioningArtifactResponse Int
cparsResponseStatus = lens _cparsResponseStatus (\ s a -> s{_cparsResponseStatus = a});
instance NFData CreateProvisioningArtifactResponse