export type CreateApiNotificationsScheduledOrdersIdSubscribeArgs = {id: number, connectionId?: string | undefined}; export type CreateApiNotificationsScheduledOrdersIdSubscribeOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /Notifications/ScheduledOrders/{id}/Subscribe */ export const createApiNotificationsScheduledOrdersIdSubscribe = async (args: CreateApiNotificationsScheduledOrdersIdSubscribeArgs, options?: CreateApiNotificationsScheduledOrdersIdSubscribeOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.connectionId != null) query.append("connectionId", String(args.connectionId)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/Notifications/ScheduledOrders/${encodeURIComponent(String(args.id))}/Subscribe${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 };