updateWorkloadEstimate method

Future<UpdateWorkloadEstimateResponse> updateWorkloadEstimate({
  1. required String identifier,
  2. DateTime? expiresAt,
  3. String? name,
})

Updates an existing workload estimate.

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

Parameter identifier : The unique identifier of the workload estimate to update.

Parameter expiresAt : The new expiration date for the workload estimate.

Parameter name : The new name for the workload estimate.

Implementation

Future<UpdateWorkloadEstimateResponse> updateWorkloadEstimate({
  required String identifier,
  DateTime? expiresAt,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBCMPricingCalculator.UpdateWorkloadEstimate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'identifier': identifier,
      if (expiresAt != null) 'expiresAt': unixTimestampToJson(expiresAt),
      if (name != null) 'name': name,
    },
  );

  return UpdateWorkloadEstimateResponse.fromJson(jsonResponse.body);
}