listResourceDelegates method

Future<ListResourceDelegatesResponse> listResourceDelegates({
  1. required String organizationId,
  2. required String resourceId,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the delegates associated with a resource. Users and groups can be resource delegates and answer requests on behalf of the resource.

May throw EntityNotFoundException. May throw EntityStateException. May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter organizationId : The identifier for the organization that contains the resource for which delegates are listed.

Parameter resourceId : The identifier for the resource whose delegates are listed.

Parameter maxResults : The number of maximum results in a page.

Parameter nextToken : The token used to paginate through the delegates associated with a resource.

Implementation

Future<ListResourceDelegatesResponse> listResourceDelegates({
  required String organizationId,
  required String resourceId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  _s.validateStringLength(
    'resourceId',
    resourceId,
    12,
    256,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.ListResourceDelegates'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OrganizationId': organizationId,
      'ResourceId': resourceId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListResourceDelegatesResponse.fromJson(jsonResponse.body);
}