describeWorkload method

Future<DescribeWorkloadResponse> describeWorkload({
  1. required String componentName,
  2. required String resourceGroupName,
  3. required String workloadId,
  4. String? accountId,
})

Describes a workload and its configuration.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter componentName : The name of the component.

Parameter resourceGroupName : The name of the resource group.

Parameter workloadId : The ID of the workload.

Parameter accountId : The Amazon Web Services account ID for the workload owner.

Implementation

Future<DescribeWorkloadResponse> describeWorkload({
  required String componentName,
  required String resourceGroupName,
  required String workloadId,
  String? accountId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'EC2WindowsBarleyService.DescribeWorkload'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ComponentName': componentName,
      'ResourceGroupName': resourceGroupName,
      'WorkloadId': workloadId,
      if (accountId != null) 'AccountId': accountId,
    },
  );

  return DescribeWorkloadResponse.fromJson(jsonResponse.body);
}