export type GetApiV1HivesliceJobsArgs = {organizationId?: string | undefined, limit?: number | undefined, offset?: number | undefined}; export type GetApiV1HivesliceJobsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List slice jobs * * GET /v1/hiveslice/jobs */ export const getApiV1HivesliceJobs = async (args: GetApiV1HivesliceJobsArgs, options?: GetApiV1HivesliceJobsOptions) => { const {baseUrl = "https://api.printhiv3d.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.organizationId != null) query.append("organizationId", String(args.organizationId)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.offset != null) query.append("offset", String(args.offset)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/hiveslice/jobs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };