batchCreateBillScenarioCommitmentModification method

Future<BatchCreateBillScenarioCommitmentModificationResponse> batchCreateBillScenarioCommitmentModification({
  1. required String billScenarioId,
  2. required List<BatchCreateBillScenarioCommitmentModificationEntry> commitmentModifications,
  3. String? clientToken,
})

Create Compute Savings Plans, EC2 Instance Savings Plans, or EC2 Reserved Instances commitments that you want to model in a Bill Scenario.

May throw ConflictException. May throw DataUnavailableException. May throw ResourceNotFoundException.

Parameter billScenarioId : The ID of the Bill Scenario for which you want to create the modeled commitment.

Parameter commitmentModifications : List of commitments that you want to model in the Bill Scenario.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Implementation

Future<BatchCreateBillScenarioCommitmentModificationResponse>
    batchCreateBillScenarioCommitmentModification({
  required String billScenarioId,
  required List<BatchCreateBillScenarioCommitmentModificationEntry>
      commitmentModifications,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'AWSBCMPricingCalculator.BatchCreateBillScenarioCommitmentModification'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'billScenarioId': billScenarioId,
      'commitmentModifications': commitmentModifications,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return BatchCreateBillScenarioCommitmentModificationResponse.fromJson(
      jsonResponse.body);
}