export type UpdateApiEtlJobsJobIdInputsInputIdFileArgs = {jobId: string, inputId: string, body: BodyInit}; export type UpdateApiEtlJobsJobIdInputsInputIdFileOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Load File to Specific Input * * PUT /etl/jobs/{jobId}/inputs/{inputId}/file */ export const updateApiEtlJobsJobIdInputsInputIdFile = async (args: UpdateApiEtlJobsJobIdInputsInputIdFileArgs, options?: UpdateApiEtlJobsJobIdInputsInputIdFileOptions) => { const {baseUrl = "https://us1.vena.io/api/public/v1", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/etl/jobs/${encodeURIComponent(String(args.jobId))}/inputs/${encodeURIComponent(String(args.inputId))}/file${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };