export type GetApiApiV1WorkspacesSlugBrokerConnectionsProviderOperationsArgs = {provider: string, refresh: string}; export type GetApiApiV1WorkspacesSlugBrokerConnectionsProviderOperationsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v1/workspaces/{slug}/broker/connections/{provider}/operations */ export const getApiApiV1WorkspacesSlugBrokerConnectionsProviderOperations = async (args: GetApiApiV1WorkspacesSlugBrokerConnectionsProviderOperationsArgs, options?: GetApiApiV1WorkspacesSlugBrokerConnectionsProviderOperationsOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.refresh != null) query.append("refresh", String(args.refresh)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/broker/connections/${encodeURIComponent(String(args.provider))}/operations${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 };