removeResourcePermission method

Future<void> removeResourcePermission({
  1. required String principalId,
  2. required String resourceId,
  3. String? authenticationToken,
  4. PrincipalType? principalType,
})

Removes the permission for the specified principal from the specified resource.

May throw FailedDependencyException. May throw ServiceUnavailableException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException.

Parameter principalId : The principal ID of the resource.

Parameter resourceId : The ID of the resource.

Parameter authenticationToken : Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

Parameter principalType : The principal type of the resource.

Implementation

Future<void> removeResourcePermission({
  required String principalId,
  required String resourceId,
  String? authenticationToken,
  PrincipalType? principalType,
}) async {
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $query = <String, List<String>>{
    if (principalType != null) 'type': [principalType.value],
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/api/v1/resources/${Uri.encodeComponent(resourceId)}/permissions/${Uri.encodeComponent(principalId)}',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}