export type GetApiGetAvailableSans2ristpanelArgs = {ServiceUniqueId?: string | undefined, LicenseUniqueId?: string | undefined, PersianDate?: string | undefined, TicketTypeUniqueIds?: string | undefined, Page?: string | undefined}; export type GetApiGetAvailableSans2ristpanelOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /GetAvailableSans2ristpanel */ export const getApiGetAvailableSans2ristpanel = async (args: GetApiGetAvailableSans2ristpanelArgs, options: GetApiGetAvailableSans2ristpanelOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.ServiceUniqueId != null) query.append("ServiceUniqueId", String(args.ServiceUniqueId)) if (args.LicenseUniqueId != null) query.append("LicenseUniqueId", String(args.LicenseUniqueId)) if (args.PersianDate != null) query.append("PersianDate", String(args.PersianDate)) if (args.TicketTypeUniqueIds != null) query.append("TicketTypeUniqueIds", String(args.TicketTypeUniqueIds)) if (args.Page != null) query.append("Page", String(args.Page)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/GetAvailableSans2ristpanel${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 };