export type PatchApiPaymentMethodGroupsIdArgs = {Authorization: string, 'Sub-Account'?: string | undefined, id: string, body: {payment_method_ids?: Array | undefined}}; export type PatchApiPaymentMethodGroupsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a Payment Method Group * * PATCH /payment_method_groups/{id} */ export const patchApiPaymentMethodGroupsId = async (args: PatchApiPaymentMethodGroupsIdArgs, options?: PatchApiPaymentMethodGroupsIdOptions) => { const {baseUrl = "https://api.justifi.ai/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['Sub-Account'] != null) headers.set("Sub-Account", String(args['Sub-Account'])) const url = `${baseUrl.replace(/\/+$/, '')}/payment_method_groups/${encodeURIComponent(String(args.id))}${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 };