export type CreateApiV1OrganizationsOrganizationIdHostsHostIdUpdateAttemptsArgs = {organizationId: string, hostId: string, body: {targetVersion: string, sourceVersion: string, platform: 'linux' | 'windows' | 'macos'}}; export type CreateApiV1OrganizationsOrganizationIdHostsHostIdUpdateAttemptsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/organizations/{organizationId}/hosts/{hostId}/update-attempts */ export const createApiV1OrganizationsOrganizationIdHostsHostIdUpdateAttempts = async (args: CreateApiV1OrganizationsOrganizationIdHostsHostIdUpdateAttemptsArgs, options?: CreateApiV1OrganizationsOrganizationIdHostsHostIdUpdateAttemptsOptions) => { const {baseUrl = "https://api.printhiv3d.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.organizationId))}/hosts/${encodeURIComponent(String(args.hostId))}/update-attempts${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };