export type GetApiV1JobsJobIdSplitArtifactsArtifactRefArgs = {artifact_ref: string, job_id: string, Range?: (string | null) | undefined}; export type GetApiV1JobsJobIdSplitArtifactsArtifactRefOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * get_split_artifact_content * * GET /v1/jobs/{job_id}/split-artifacts/{artifact_ref} */ export const getApiV1JobsJobIdSplitArtifactsArtifactRef = async (args: GetApiV1JobsJobIdSplitArtifactsArtifactRefArgs, options?: GetApiV1JobsJobIdSplitArtifactsArtifactRefOptions) => { const {baseUrl = "https://ndi-api.nace.ai", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Range != null) headers.set("Range", String(args.Range)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/jobs/${encodeURIComponent(String(args.job_id))}/split-artifacts/${encodeURIComponent(String(args.artifact_ref))}${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 };