export type LiaInventorySettings = {inventoryVerificationContactName?: string | undefined, inventoryVerificationContactEmail?: string | undefined, status?: string | undefined, inventoryVerificationContactStatus?: string | undefined}; export type LiaOnDisplayToOrderSettings = {shippingCostPolicyUrl?: string | undefined, status?: string | undefined}; export type LiaPosDataProvider = {posDataProviderId?: unknown | undefined, posExternalAccountId?: string | undefined}; export type LiaOmnichannelExperience = {lsfType?: string | undefined, country?: string | undefined, pickupTypes?: Array | undefined}; export type LiaAboutPageSettings = {url?: string | undefined, status?: string | undefined}; export type LiaCountrySettings = {inventory?: LiaInventorySettings | undefined, onDisplayToOrder?: LiaOnDisplayToOrderSettings | undefined, posDataProvider?: LiaPosDataProvider | undefined, omnichannelExperience?: LiaOmnichannelExperience | undefined, hostedLocalStorefrontActive?: boolean | undefined, about?: LiaAboutPageSettings | undefined, country?: string | undefined, storePickupActive?: boolean | undefined}; export type LiaSettings = {countrySettings?: Array | undefined, kind?: string | undefined, accountId?: unknown | undefined}; export type UpdateApiMerchantIdLiasettingsAccountIdArgs = {merchantId: string, accountId: string, body: LiaSettings}; export type UpdateApiMerchantIdLiasettingsAccountIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the LIA settings of the account. Any fields that are not provided are deleted from the resource. * * PUT /{merchantId}/liasettings/{accountId} */ export const updateApiMerchantIdLiasettingsAccountId = async (args: UpdateApiMerchantIdLiasettingsAccountIdArgs, options?: UpdateApiMerchantIdLiasettingsAccountIdOptions) => { 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))}/liasettings/${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() };