export type GetApiSitesSiteIdPaymentIntegrationsArgs = {siteId: number, page?: number | undefined, pageSize?: number | undefined, orderBy?: string | undefined, order?: string | undefined}; export type GetApiSitesSiteIdPaymentIntegrationsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Payment Integrations * * GET /Sites/{siteId}/PaymentIntegrations */ export const getApiSitesSiteIdPaymentIntegrations = async (args: GetApiSitesSiteIdPaymentIntegrationsArgs, options?: GetApiSitesSiteIdPaymentIntegrationsOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.page != null) query.append("page", String(args.page)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.order != null) query.append("order", String(args.order)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/Sites/${encodeURIComponent(String(args.siteId))}/PaymentIntegrations${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 };