listWorkloadShares method
List the workload shares associated with the workload.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter maxResults :
The maximum number of results to return for this request.
Parameter sharedWithPrefix :
The Amazon Web Services account ID, organization ID, or organizational
unit (OU) ID with which the workload is shared.
Implementation
Future<ListWorkloadSharesOutput> listWorkloadShares({
required String workloadId,
int? maxResults,
String? nextToken,
String? sharedWithPrefix,
ShareStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
50,
);
final $query = <String, List<String>>{
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (sharedWithPrefix != null) 'SharedWithPrefix': [sharedWithPrefix],
if (status != null) 'Status': [status.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/workloads/${Uri.encodeComponent(workloadId)}/shares',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListWorkloadSharesOutput.fromJson(response);
}