export type DeleteApiSuperuserApiKeysApiKeyArgs = {'api-key': string}; export type DeleteApiSuperuserApiKeysApiKeyOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an API Key * * DELETE /superuser/api-keys/{api-key} */ export const deleteApiSuperuserApiKeysApiKey = async (args: DeleteApiSuperuserApiKeysApiKeyArgs, options?: DeleteApiSuperuserApiKeysApiKeyOptions) => { const {baseUrl = "https://api.brla.digital:5567/v1", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/superuser/api-keys/${encodeURIComponent(String(args['api-key']))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };