export type GetApiBookingsGetCoportatesAllBookingsArgs = {authorization: string, 'content-language': string, limit?: number | undefined, page?: number | undefined, status?: string | undefined, from?: string | undefined, to?: string | undefined, orderBy?: string | undefined, onlyPast?: boolean | undefined, onlyActives?: boolean | undefined, userID?: string | undefined}; export type GetApiBookingsGetCoportatesAllBookingsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get General info about businesses * * GET /bookings/getCoportatesAllBookings */ export const getApiBookingsGetCoportatesAllBookings = async (args: GetApiBookingsGetCoportatesAllBookingsArgs, options?: GetApiBookingsGetCoportatesAllBookingsOptions) => { const {baseUrl = "http://api.pickerexpress.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.authorization != null) headers.set("authorization", String(args.authorization)) if (args['content-language'] != null) headers.set("content-language", String(args['content-language'])) if (args.limit != null) query.append("limit", String(args.limit)) if (args.page != null) query.append("page", String(args.page)) if (args.status != null) query.append("status", String(args.status)) if (args.from != null) query.append("from", String(args.from)) if (args.to != null) query.append("to", String(args.to)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.onlyPast != null) query.append("onlyPast", String(args.onlyPast)) if (args.onlyActives != null) query.append("onlyActives", String(args.onlyActives)) if (args.userID != null) query.append("userID", String(args.userID)) const url = `${baseUrl.replace(/\/+$/, '')}/bookings/getCoportatesAllBookings${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 res.blob() };