export type MindbodyRestApiCommonModelsSiteTaxTable = {Id?: number | undefined, Tax1?: number | undefined, Tax2?: number | undefined, Tax3?: number | undefined, Tax4?: number | undefined, Tax5?: number | undefined}; export type UpdateApiSettingsTaxTablesIdArgs = {Authorization: string, SiteId: number, id: number, body: MindbodyRestApiCommonModelsSiteTaxTable}; export type UpdateApiSettingsTaxTablesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replaces tax tables with the given resource. Each location may have up to a maximum of 5 taxes. * * PUT /Settings/TaxTables/{id} */ export const updateApiSettingsTaxTablesId = async (args: UpdateApiSettingsTaxTablesIdArgs, options?: UpdateApiSettingsTaxTablesIdOptions) => { const {baseUrl = "https://api.mindbodyonline.com", 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.SiteId != null) headers.set("SiteId", String(args.SiteId)) const url = `${baseUrl.replace(/\/+$/, '')}/Settings/TaxTables/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };