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 LiasettingsCustomBatchRequestEntry = {method?: string | undefined, country?: string | undefined, accountId?: unknown | undefined, posDataProviderId?: unknown | undefined, liaSettings?: LiaSettings | undefined, merchantId?: unknown | undefined, omnichannelExperience?: LiaOmnichannelExperience | undefined, gmbEmail?: string | undefined, contactEmail?: string | undefined, contactName?: string | undefined, posExternalAccountId?: string | undefined, batchId?: number | undefined}; export type LiasettingsCustomBatchRequest = {entries?: Array | undefined}; export type CreateApiLiasettingsBatchArgs = {body: LiasettingsCustomBatchRequest}; export type CreateApiLiasettingsBatchOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieves and/or updates the LIA settings of multiple accounts in a single request. * * POST /liasettings/batch */ export const createApiLiasettingsBatch = async (args: CreateApiLiasettingsBatchArgs, options?: CreateApiLiasettingsBatchOptions) => { 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(/\/+$/, '')}/liasettings/batch${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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() };