export type DeleteApiV1beta1SystemApiTokensApitokenArgs = {apitoken: string}; export type DeleteApiV1beta1SystemApiTokensApitokenOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a system-level API token * * DELETE /v1beta1/system/api-tokens/{apitoken} */ export const deleteApiV1beta1SystemApiTokensApitoken = async (args: DeleteApiV1beta1SystemApiTokensApitokenArgs, options: DeleteApiV1beta1SystemApiTokensApitokenOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1beta1/system/api-tokens/${encodeURIComponent(String(args.apitoken))}${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 };