createProvisionedProductPlan method
- required String planName,
- required ProvisionedProductPlanType planType,
- required String productId,
- required String provisionedProductName,
- required String provisioningArtifactId,
- String? acceptLanguage,
- String? idempotencyToken,
- List<
String> ? notificationArns, - String? pathId,
- List<
UpdateProvisioningParameter> ? provisioningParameters, - List<
Tag> ? tags,
Creates a plan. A plan includes the list of resources to be created (when provisioning a new product) or modified (when updating a provisioned product) when the plan is executed.
You can create one plan per provisioned product. To create a plan for an existing provisioned product, the product status must be AVAILBLE or TAINTED.
To view the resource changes in the change set, use DescribeProvisionedProductPlan. To create or modify the provisioned product, use ExecuteProvisionedProductPlan.
May throw InvalidParametersException. May throw ResourceNotFoundException. May throw InvalidStateException.
Parameter planName
:
The name of the plan.
Parameter planType
:
The plan type.
Parameter productId
:
The product identifier.
Parameter provisionedProductName
:
A user-friendly name for the provisioned product. This value must be
unique for the AWS account and cannot be updated after the product is
provisioned.
Parameter provisioningArtifactId
:
The identifier of the provisioning artifact.
Parameter acceptLanguage
:
The language code.
-
en
- English (default) -
jp
- Japanese -
zh
- Chinese
Parameter idempotencyToken
:
A unique identifier that you provide to ensure idempotency. If multiple
requests differ only by the idempotency token, the same response is
returned for each repeated request.
Parameter notificationArns
:
Passed to CloudFormation. The SNS topic ARNs to which to publish
stack-related events.
Parameter pathId
:
The path identifier of the product. This value is optional if the product
has a default path, and required if the product has more than one path. To
list the paths for a product, use ListLaunchPaths.
Parameter provisioningParameters
:
Parameters specified by the administrator that are required for
provisioning the product.
Parameter tags
:
One or more tags.
If the plan is for an existing provisioned product, the product must have
a RESOURCE_UPDATE
constraint with
TagUpdatesOnProvisionedProduct
set to ALLOWED
to
allow tag updates.
Implementation
Future<CreateProvisionedProductPlanOutput> createProvisionedProductPlan({
required String planName,
required ProvisionedProductPlanType planType,
required String productId,
required String provisionedProductName,
required String provisioningArtifactId,
String? acceptLanguage,
String? idempotencyToken,
List<String>? notificationArns,
String? pathId,
List<UpdateProvisioningParameter>? provisioningParameters,
List<Tag>? tags,
}) async {
ArgumentError.checkNotNull(planName, 'planName');
ArgumentError.checkNotNull(planType, 'planType');
ArgumentError.checkNotNull(productId, 'productId');
_s.validateStringLength(
'productId',
productId,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(
provisionedProductName, 'provisionedProductName');
_s.validateStringLength(
'provisionedProductName',
provisionedProductName,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(
provisioningArtifactId, 'provisioningArtifactId');
_s.validateStringLength(
'provisioningArtifactId',
provisioningArtifactId,
1,
100,
isRequired: true,
);
_s.validateStringLength(
'acceptLanguage',
acceptLanguage,
0,
100,
);
_s.validateStringLength(
'idempotencyToken',
idempotencyToken,
1,
128,
);
_s.validateStringLength(
'pathId',
pathId,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWS242ServiceCatalogService.CreateProvisionedProductPlan'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PlanName': planName,
'PlanType': planType.toValue(),
'ProductId': productId,
'ProvisionedProductName': provisionedProductName,
'ProvisioningArtifactId': provisioningArtifactId,
if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
'IdempotencyToken': idempotencyToken ?? _s.generateIdempotencyToken(),
if (notificationArns != null) 'NotificationArns': notificationArns,
if (pathId != null) 'PathId': pathId,
if (provisioningParameters != null)
'ProvisioningParameters': provisioningParameters,
if (tags != null) 'Tags': tags,
},
);
return CreateProvisionedProductPlanOutput.fromJson(jsonResponse.body);
}