describeResourcePermissions method
Describes the permissions of a specified resource.
May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.
Parameter resourceId
:
The ID of the resource.
Parameter authenticationToken
:
Amazon WorkDocs authentication token. Not required when using AWS
administrator credentials to access the API.
Parameter limit
:
The maximum number of items to return with this call.
Parameter marker
:
The marker for the next set of results. (You received this marker from a
previous call)
Parameter principalId
:
The ID of the principal to filter permissions by.
Implementation
Future<DescribeResourcePermissionsResponse> describeResourcePermissions({
required String resourceId,
String? authenticationToken,
int? limit,
String? marker,
String? principalId,
}) async {
ArgumentError.checkNotNull(resourceId, 'resourceId');
_s.validateStringLength(
'resourceId',
resourceId,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
_s.validateNumRange(
'limit',
limit,
1,
999,
);
_s.validateStringLength(
'marker',
marker,
1,
2048,
);
_s.validateStringLength(
'principalId',
principalId,
1,
256,
);
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (limit != null) 'limit': [limit.toString()],
if (marker != null) 'marker': [marker],
if (principalId != null) 'principalId': [principalId],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/api/v1/resources/${Uri.encodeComponent(resourceId)}/permissions',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return DescribeResourcePermissionsResponse.fromJson(response);
}