delete method

Future<Invite> delete(
  1. String code,
  2. {String? auditLogReason}
)

Delete an invite.

Implementation

Future<Invite> delete(String code, {String? auditLogReason}) async {
  final route = HttpRoute()..invites(id: code);
  final request = BasicRequest(route, method: 'DELETE', auditLogReason: auditLogReason);

  final response = await client.httpHandler.executeSafe(request);
  final invite = parse(response.jsonBody as Map<String, Object?>);

  // Invites aren't cached, so we don't need to remove it, but it still contains nested objects we can cache.
  client.updateCacheWith(invite);
  return invite;
}