export type DeleteApiSshKeysIdArgs = {'ev-api-key': string, 'ev-access-token': string}; export type DeleteApiSshKeysIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an SSH Key * * DELETE /ssh-keys/{id} */ export const deleteApiSshKeysId = async (args: DeleteApiSshKeysIdArgs, options?: DeleteApiSshKeysIdOptions) => { const {baseUrl = "https://accountname.exavault.com/api/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['ev-api-key'] != null) headers.set("ev-api-key", String(args['ev-api-key'])) if (args['ev-access-token'] != null) headers.set("ev-access-token", String(args['ev-access-token'])) const url = `${baseUrl.replace(/\/+$/, '')}/ssh-keys/${encodeURIComponent(String(args.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 };