{-# 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.CreateProvisionedProductPlan
(
createProvisionedProductPlan
, CreateProvisionedProductPlan
, cpppNotificationARNs
, cpppAcceptLanguage
, cpppPathId
, cpppProvisioningParameters
, cpppTags
, cpppPlanName
, cpppPlanType
, cpppProductId
, cpppProvisionedProductName
, cpppProvisioningArtifactId
, cpppIdempotencyToken
, createProvisionedProductPlanResponse
, CreateProvisionedProductPlanResponse
, cppprsProvisionedProductName
, cppprsProvisionProductId
, cppprsProvisioningArtifactId
, cppprsPlanId
, cppprsPlanName
, cppprsResponseStatus
) 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 CreateProvisionedProductPlan = CreateProvisionedProductPlan'
{ _cpppNotificationARNs :: !(Maybe [Text])
, _cpppAcceptLanguage :: !(Maybe Text)
, _cpppPathId :: !(Maybe Text)
, _cpppProvisioningParameters :: !(Maybe [UpdateProvisioningParameter])
, _cpppTags :: !(Maybe [Tag])
, _cpppPlanName :: !Text
, _cpppPlanType :: !ProvisionedProductPlanType
, _cpppProductId :: !Text
, _cpppProvisionedProductName :: !Text
, _cpppProvisioningArtifactId :: !Text
, _cpppIdempotencyToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createProvisionedProductPlan
:: Text
-> ProvisionedProductPlanType
-> Text
-> Text
-> Text
-> Text
-> CreateProvisionedProductPlan
createProvisionedProductPlan pPlanName_ pPlanType_ pProductId_ pProvisionedProductName_ pProvisioningArtifactId_ pIdempotencyToken_ =
CreateProvisionedProductPlan'
{ _cpppNotificationARNs = Nothing
, _cpppAcceptLanguage = Nothing
, _cpppPathId = Nothing
, _cpppProvisioningParameters = Nothing
, _cpppTags = Nothing
, _cpppPlanName = pPlanName_
, _cpppPlanType = pPlanType_
, _cpppProductId = pProductId_
, _cpppProvisionedProductName = pProvisionedProductName_
, _cpppProvisioningArtifactId = pProvisioningArtifactId_
, _cpppIdempotencyToken = pIdempotencyToken_
}
cpppNotificationARNs :: Lens' CreateProvisionedProductPlan [Text]
cpppNotificationARNs = lens _cpppNotificationARNs (\ s a -> s{_cpppNotificationARNs = a}) . _Default . _Coerce
cpppAcceptLanguage :: Lens' CreateProvisionedProductPlan (Maybe Text)
cpppAcceptLanguage = lens _cpppAcceptLanguage (\ s a -> s{_cpppAcceptLanguage = a})
cpppPathId :: Lens' CreateProvisionedProductPlan (Maybe Text)
cpppPathId = lens _cpppPathId (\ s a -> s{_cpppPathId = a})
cpppProvisioningParameters :: Lens' CreateProvisionedProductPlan [UpdateProvisioningParameter]
cpppProvisioningParameters = lens _cpppProvisioningParameters (\ s a -> s{_cpppProvisioningParameters = a}) . _Default . _Coerce
cpppTags :: Lens' CreateProvisionedProductPlan [Tag]
cpppTags = lens _cpppTags (\ s a -> s{_cpppTags = a}) . _Default . _Coerce
cpppPlanName :: Lens' CreateProvisionedProductPlan Text
cpppPlanName = lens _cpppPlanName (\ s a -> s{_cpppPlanName = a})
cpppPlanType :: Lens' CreateProvisionedProductPlan ProvisionedProductPlanType
cpppPlanType = lens _cpppPlanType (\ s a -> s{_cpppPlanType = a})
cpppProductId :: Lens' CreateProvisionedProductPlan Text
cpppProductId = lens _cpppProductId (\ s a -> s{_cpppProductId = a})
cpppProvisionedProductName :: Lens' CreateProvisionedProductPlan Text
cpppProvisionedProductName = lens _cpppProvisionedProductName (\ s a -> s{_cpppProvisionedProductName = a})
cpppProvisioningArtifactId :: Lens' CreateProvisionedProductPlan Text
cpppProvisioningArtifactId = lens _cpppProvisioningArtifactId (\ s a -> s{_cpppProvisioningArtifactId = a})
cpppIdempotencyToken :: Lens' CreateProvisionedProductPlan Text
cpppIdempotencyToken = lens _cpppIdempotencyToken (\ s a -> s{_cpppIdempotencyToken = a})
instance AWSRequest CreateProvisionedProductPlan
where
type Rs CreateProvisionedProductPlan =
CreateProvisionedProductPlanResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
CreateProvisionedProductPlanResponse' <$>
(x .?> "ProvisionedProductName") <*>
(x .?> "ProvisionProductId")
<*> (x .?> "ProvisioningArtifactId")
<*> (x .?> "PlanId")
<*> (x .?> "PlanName")
<*> (pure (fromEnum s)))
instance Hashable CreateProvisionedProductPlan where
instance NFData CreateProvisionedProductPlan where
instance ToHeaders CreateProvisionedProductPlan where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.CreateProvisionedProductPlan"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateProvisionedProductPlan where
toJSON CreateProvisionedProductPlan'{..}
= object
(catMaybes
[("NotificationArns" .=) <$> _cpppNotificationARNs,
("AcceptLanguage" .=) <$> _cpppAcceptLanguage,
("PathId" .=) <$> _cpppPathId,
("ProvisioningParameters" .=) <$>
_cpppProvisioningParameters,
("Tags" .=) <$> _cpppTags,
Just ("PlanName" .= _cpppPlanName),
Just ("PlanType" .= _cpppPlanType),
Just ("ProductId" .= _cpppProductId),
Just
("ProvisionedProductName" .=
_cpppProvisionedProductName),
Just
("ProvisioningArtifactId" .=
_cpppProvisioningArtifactId),
Just ("IdempotencyToken" .= _cpppIdempotencyToken)])
instance ToPath CreateProvisionedProductPlan where
toPath = const "/"
instance ToQuery CreateProvisionedProductPlan where
toQuery = const mempty
data CreateProvisionedProductPlanResponse = CreateProvisionedProductPlanResponse'
{ _cppprsProvisionedProductName :: !(Maybe Text)
, _cppprsProvisionProductId :: !(Maybe Text)
, _cppprsProvisioningArtifactId :: !(Maybe Text)
, _cppprsPlanId :: !(Maybe Text)
, _cppprsPlanName :: !(Maybe Text)
, _cppprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createProvisionedProductPlanResponse
:: Int
-> CreateProvisionedProductPlanResponse
createProvisionedProductPlanResponse pResponseStatus_ =
CreateProvisionedProductPlanResponse'
{ _cppprsProvisionedProductName = Nothing
, _cppprsProvisionProductId = Nothing
, _cppprsProvisioningArtifactId = Nothing
, _cppprsPlanId = Nothing
, _cppprsPlanName = Nothing
, _cppprsResponseStatus = pResponseStatus_
}
cppprsProvisionedProductName :: Lens' CreateProvisionedProductPlanResponse (Maybe Text)
cppprsProvisionedProductName = lens _cppprsProvisionedProductName (\ s a -> s{_cppprsProvisionedProductName = a})
cppprsProvisionProductId :: Lens' CreateProvisionedProductPlanResponse (Maybe Text)
cppprsProvisionProductId = lens _cppprsProvisionProductId (\ s a -> s{_cppprsProvisionProductId = a})
cppprsProvisioningArtifactId :: Lens' CreateProvisionedProductPlanResponse (Maybe Text)
cppprsProvisioningArtifactId = lens _cppprsProvisioningArtifactId (\ s a -> s{_cppprsProvisioningArtifactId = a})
cppprsPlanId :: Lens' CreateProvisionedProductPlanResponse (Maybe Text)
cppprsPlanId = lens _cppprsPlanId (\ s a -> s{_cppprsPlanId = a})
cppprsPlanName :: Lens' CreateProvisionedProductPlanResponse (Maybe Text)
cppprsPlanName = lens _cppprsPlanName (\ s a -> s{_cppprsPlanName = a})
cppprsResponseStatus :: Lens' CreateProvisionedProductPlanResponse Int
cppprsResponseStatus = lens _cppprsResponseStatus (\ s a -> s{_cppprsResponseStatus = a})
instance NFData CreateProvisionedProductPlanResponse
where