createBillEstimate method
Create a Bill estimate from a Bill scenario. In the Bill scenario you can model usage addition, usage changes, and usage removal. You can also model commitment addition and commitment removal. After all changes in a Bill scenario is made satisfactorily, you can call this API with a Bill scenario ID to generate the Bill estimate. Bill estimate calculates the pre-tax cost for your consolidated billing family, incorporating all modeled usage and commitments alongside existing usage and commitments from your most recent completed anniversary bill, with any applicable discounts applied.
May throw ConflictException.
May throw DataUnavailableException.
May throw ResourceNotFoundException.
Parameter billScenarioId :
The ID of the Bill Scenario for which you want to create a Bill estimate.
Parameter name :
The name of the Bill estimate that will be created. Names must be unique
for an account.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter tags :
An optional list of tags to associate with the specified BillEstimate. You
can use resource tags to control access to your BillEstimate using IAM
policies. Each tag consists of a key and a value, and each key must be
unique for the resource. The following restrictions apply to resource
tags:
- Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services.
- The maximum length of a key is 128 characters.
- The maximum length of a value is 256 characters.
-
Keys and values can only contain alphanumeric characters, spaces, and any
of the following:
_.:/=+@-. - Keys and values are case sensitive.
- Keys and values are trimmed for any leading or trailing whitespaces.
-
Don't use
aws:as a prefix for your keys. This prefix is reserved for Amazon Web Services.
Implementation
Future<CreateBillEstimateResponse> createBillEstimate({
required String billScenarioId,
required String name,
String? clientToken,
Map<String, String>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AWSBCMPricingCalculator.CreateBillEstimate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'billScenarioId': billScenarioId,
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'tags': tags,
},
);
return CreateBillEstimateResponse.fromJson(jsonResponse.body);
}