export type Ssh = {type?: string | undefined, id?: string | undefined, attributes?: ({createdBy?: string | undefined, createdDate?: string | undefined, description?: string | undefined, name?: string | undefined, privateKey?: string | undefined, sshType?: ('rsa' | 'ed25519') | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined}) | undefined}; export type PatchApiWorkspaceWorkspaceIdSshSshIdArgs = {body: {data?: Ssh | undefined}}; export type PatchApiWorkspaceWorkspaceIdSshSshIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type ssh * * PATCH /workspace/{workspaceId}/ssh/{sshId} */ export const patchApiWorkspaceWorkspaceIdSshSshId = async (args: PatchApiWorkspaceWorkspaceIdSshSshIdArgs, options: PatchApiWorkspaceWorkspaceIdSshSshIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/workspace/${encodeURIComponent(String(args.workspaceId))}/ssh/${encodeURIComponent(String(args.sshId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };