export type DeleteApiV0ApiKeysApiKeyIdArgs = {'api-key-id': string}; export type DeleteApiV0ApiKeysApiKeyIdOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete API key * * DELETE /v0/api-keys/{api-key-id} */ export const deleteApiV0ApiKeysApiKeyId = async (args: DeleteApiV0ApiKeysApiKeyIdArgs, options?: DeleteApiV0ApiKeysApiKeyIdOptions) => { const {baseUrl = "https://api.griffin.com", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyAuth !== undefined) headers.set("Authorization", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v0/api-keys/${encodeURIComponent(String(args['api-key-id']))}${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 };