export type CreateApiV1AdminDqSshHostDisconnectArgs = {host: string}; export type CreateApiV1AdminDqSshHostDisconnectOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/admin/dq/ssh/{host}/disconnect */ export const createApiV1AdminDqSshHostDisconnect = async (args: CreateApiV1AdminDqSshHostDisconnectArgs, options: CreateApiV1AdminDqSshHostDisconnectOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/dq/ssh/${encodeURIComponent(String(args.host))}/disconnect${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };