export type AccountTaxTaxRule = {ratePercent?: string | undefined, country?: string | undefined, locationId?: unknown | undefined, shippingTaxed?: boolean | undefined, useGlobalRate?: boolean | undefined}; export type AccountTax = {accountId?: unknown | undefined, rules?: Array | undefined, kind?: string | undefined}; export type UpdateApiMerchantIdAccounttaxAccountIdArgs = {merchantId: string, accountId: string, body: AccountTax}; export type UpdateApiMerchantIdAccounttaxAccountIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the tax settings of the account. Any fields that are not provided are deleted from the resource. * * PUT /{merchantId}/accounttax/{accountId} */ export const updateApiMerchantIdAccounttaxAccountId = async (args: UpdateApiMerchantIdAccounttaxAccountIdArgs, options?: UpdateApiMerchantIdAccounttaxAccountIdOptions) => { const {baseUrl = "https://shoppingcontent.googleapis.com/content/v2.1", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.merchantId))}/accounttax/${encodeURIComponent(String(args.accountId))}${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 res.blob() };