export type ScheduleFileParam = {region: string, marketParticipants: Array, marketStage: string, marketStatus: string, firstIntervalBegin?: string | undefined, lastIntervalEnd?: string | undefined, applications: Array, format?: ('xml' | 'csv') | undefined}; export type UpdateApiFileRegistryGetScheduleDataFileNameArgs = {fileName: string, body: ScheduleFileParam}; export type UpdateApiFileRegistryGetScheduleDataFileNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Query for ISO Scheduling data with current status. * * PUT /fileRegistry/getScheduleData/{fileName} */ export const updateApiFileRegistryGetScheduleDataFileName = async (args: UpdateApiFileRegistryGetScheduleDataFileNameArgs, options?: UpdateApiFileRegistryGetScheduleDataFileNameOptions) => { const {baseUrl = "https://pm-file-api.apx.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/fileRegistry/getScheduleData/${encodeURIComponent(String(args.fileName))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 res.blob() };