revokeUser static method

Future<Map<String, Object?>> revokeUser(
  1. Client cloudApiClient, {
  2. required String projectId,
  3. required String email,
  4. List<String> unassignRoleNames = const [],
  5. bool unassignAllRoles = false,
})

Implementation

static Future<Map<String, Object?>> revokeUser(
  final Client cloudApiClient, {
  required final String projectId,
  required final String email,
  final List<String> unassignRoleNames = const [],
  final bool unassignAllRoles = false,
}) async {
  final List<String> actuallyUnassigned;
  try {
    actuallyUnassigned = await cloudApiClient.projects.revokeUser(
      cloudProjectId: projectId,
      email: email,
      unassignRoleNames: unassignRoleNames,
      unassignAllRoles: unassignAllRoles,
    );
  } on NotFoundException catch (e) {
    throw FailureException(error: e.message);
  } on Exception catch (e, s) {
    throw FailureException.nested(e, s, 'Failed to revoke user from project');
  }

  return {
    'unassigned': actuallyUnassigned,
    'unassignAllRoles': unassignAllRoles,
  };
}