revokeInvitation method

Future<RevokeInvitation200Response?> revokeInvitation(
  1. String invitationId
)

Revokes an invitation

Revokes the given invitation. Revoking an invitation will prevent the user from using the invitation link that was sent to them. However, it doesn't prevent the user from signing up if they follow the sign up flow. Only active (i.e. non-revoked) invitations can be revoked.

Parameters:

  • String invitationId (required): The ID of the invitation to be revoked

Implementation

Future<RevokeInvitation200Response?> revokeInvitation(
  String invitationId,
) async {
  final response = await revokeInvitationWithHttpInfo(
    invitationId,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty &&
      response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(
      await _decodeBodyBytes(response),
      'RevokeInvitation200Response',
    ) as RevokeInvitation200Response;
  }
  return null;
}