export type StripeBalanceTransactions = {id?: unknown | undefined, amount?: number | undefined, currency?: unknown | undefined, description?: unknown | undefined, fee?: number | undefined, net?: number | undefined, status?: unknown | undefined, type?: unknown | undefined, created?: unknown | undefined, attrs: unknown}; export type PatchApiStripeBalanceTransactionsArgs = {id?: unknown | undefined, amount?: unknown | undefined, currency?: unknown | undefined, description?: unknown | undefined, fee?: unknown | undefined, net?: unknown | undefined, status?: unknown | undefined, type?: unknown | undefined, created?: unknown | undefined, attrs?: unknown | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined, body: StripeBalanceTransactions}; export type PatchApiStripeBalanceTransactionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /stripe_balance_transactions */ export const patchApiStripeBalanceTransactions = async (args: PatchApiStripeBalanceTransactionsArgs, options?: PatchApiStripeBalanceTransactionsOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.id != null) query.append("id", String(args.id)) if (args.amount != null) query.append("amount", String(args.amount)) if (args.currency != null) query.append("currency", String(args.currency)) if (args.description != null) query.append("description", String(args.description)) if (args.fee != null) query.append("fee", String(args.fee)) if (args.net != null) query.append("net", String(args.net)) if (args.status != null) query.append("status", String(args.status)) if (args.type != null) query.append("type", String(args.type)) if (args.created != null) query.append("created", String(args.created)) if (args.attrs != null) query.append("attrs", String(args.attrs)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/stripe_balance_transactions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };