export type CreateApiV1MachinesMachineIDPickListArgs = {MachineID: number, UseMinPick?: boolean | undefined, AddOnlineSales?: boolean | undefined, AddEstimatedSales?: string | undefined}; export type CreateApiV1MachinesMachineIDPickListOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Pick List * * POST /v1/machines/{MachineID}/pickList */ export const createApiV1MachinesMachineIDPickList = async (args: CreateApiV1MachinesMachineIDPickListArgs, options?: CreateApiV1MachinesMachineIDPickListOptions) => { const {baseUrl = "https://example.com:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.UseMinPick != null) query.append("UseMinPick", String(args.UseMinPick)) if (args.AddOnlineSales != null) query.append("AddOnlineSales", String(args.AddOnlineSales)) if (args.AddEstimatedSales != null) query.append("AddEstimatedSales", String(args.AddEstimatedSales)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/machines/${encodeURIComponent(String(args.MachineID))}/pickList${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };