{-# 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.UpdateProvisioningArtifact
(
updateProvisioningArtifact
, UpdateProvisioningArtifact
, upaName
, upaAcceptLanguage
, upaDescription
, upaProductId
, upaProvisioningArtifactId
, updateProvisioningArtifactResponse
, UpdateProvisioningArtifactResponse
, uparsStatus
, uparsInfo
, uparsProvisioningArtifactDetail
, uparsResponseStatus
) 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 UpdateProvisioningArtifact = UpdateProvisioningArtifact'
{ _upaName :: !(Maybe Text)
, _upaAcceptLanguage :: !(Maybe Text)
, _upaDescription :: !(Maybe Text)
, _upaProductId :: !Text
, _upaProvisioningArtifactId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateProvisioningArtifact
:: Text
-> Text
-> UpdateProvisioningArtifact
updateProvisioningArtifact pProductId_ pProvisioningArtifactId_ =
UpdateProvisioningArtifact'
{ _upaName = Nothing
, _upaAcceptLanguage = Nothing
, _upaDescription = Nothing
, _upaProductId = pProductId_
, _upaProvisioningArtifactId = pProvisioningArtifactId_
}
upaName :: Lens' UpdateProvisioningArtifact (Maybe Text)
upaName = lens _upaName (\ s a -> s{_upaName = a});
upaAcceptLanguage :: Lens' UpdateProvisioningArtifact (Maybe Text)
upaAcceptLanguage = lens _upaAcceptLanguage (\ s a -> s{_upaAcceptLanguage = a});
upaDescription :: Lens' UpdateProvisioningArtifact (Maybe Text)
upaDescription = lens _upaDescription (\ s a -> s{_upaDescription = a});
upaProductId :: Lens' UpdateProvisioningArtifact Text
upaProductId = lens _upaProductId (\ s a -> s{_upaProductId = a});
upaProvisioningArtifactId :: Lens' UpdateProvisioningArtifact Text
upaProvisioningArtifactId = lens _upaProvisioningArtifactId (\ s a -> s{_upaProvisioningArtifactId = a});
instance AWSRequest UpdateProvisioningArtifact where
type Rs UpdateProvisioningArtifact =
UpdateProvisioningArtifactResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
UpdateProvisioningArtifactResponse' <$>
(x .?> "Status") <*> (x .?> "Info" .!@ mempty) <*>
(x .?> "ProvisioningArtifactDetail")
<*> (pure (fromEnum s)))
instance Hashable UpdateProvisioningArtifact
instance NFData UpdateProvisioningArtifact
instance ToHeaders UpdateProvisioningArtifact where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.UpdateProvisioningArtifact"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateProvisioningArtifact where
toJSON UpdateProvisioningArtifact'{..}
= object
(catMaybes
[("Name" .=) <$> _upaName,
("AcceptLanguage" .=) <$> _upaAcceptLanguage,
("Description" .=) <$> _upaDescription,
Just ("ProductId" .= _upaProductId),
Just
("ProvisioningArtifactId" .=
_upaProvisioningArtifactId)])
instance ToPath UpdateProvisioningArtifact where
toPath = const "/"
instance ToQuery UpdateProvisioningArtifact where
toQuery = const mempty
data UpdateProvisioningArtifactResponse = UpdateProvisioningArtifactResponse'
{ _uparsStatus :: !(Maybe RequestStatus)
, _uparsInfo :: !(Maybe (Map Text Text))
, _uparsProvisioningArtifactDetail :: !(Maybe ProvisioningArtifactDetail)
, _uparsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateProvisioningArtifactResponse
:: Int
-> UpdateProvisioningArtifactResponse
updateProvisioningArtifactResponse pResponseStatus_ =
UpdateProvisioningArtifactResponse'
{ _uparsStatus = Nothing
, _uparsInfo = Nothing
, _uparsProvisioningArtifactDetail = Nothing
, _uparsResponseStatus = pResponseStatus_
}
uparsStatus :: Lens' UpdateProvisioningArtifactResponse (Maybe RequestStatus)
uparsStatus = lens _uparsStatus (\ s a -> s{_uparsStatus = a});
uparsInfo :: Lens' UpdateProvisioningArtifactResponse (HashMap Text Text)
uparsInfo = lens _uparsInfo (\ s a -> s{_uparsInfo = a}) . _Default . _Map;
uparsProvisioningArtifactDetail :: Lens' UpdateProvisioningArtifactResponse (Maybe ProvisioningArtifactDetail)
uparsProvisioningArtifactDetail = lens _uparsProvisioningArtifactDetail (\ s a -> s{_uparsProvisioningArtifactDetail = a});
uparsResponseStatus :: Lens' UpdateProvisioningArtifactResponse Int
uparsResponseStatus = lens _uparsResponseStatus (\ s a -> s{_uparsResponseStatus = a});
instance NFData UpdateProvisioningArtifactResponse