export type DeleteApiApiV1UserSshKeysKeyIdArgs = {key_id: string}; export type DeleteApiApiV1UserSshKeysKeyIdOptions = {baseUrl?: string | undefined, OAuth2AuthorizationCodeBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete SSH key * * DELETE /api/v1/user/ssh-keys/{key_id} */ export const deleteApiApiV1UserSshKeysKeyId = async (args: DeleteApiApiV1UserSshKeysKeyIdArgs, options?: DeleteApiApiV1UserSshKeysKeyIdOptions) => { const {baseUrl = "https://cloud-api.phala.com", fetch: fetchFn = fetch, OAuth2AuthorizationCodeBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2AuthorizationCodeBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2AuthorizationCodeBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/user/ssh-keys/${encodeURIComponent(String(args.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 };