export type CreateApiMerchantIdLiasettingsAccountIdSetposdataproviderArgs = {merchantId: string, accountId: string, country: string, posDataProviderId?: string | undefined, posExternalAccountId?: string | undefined}; export type CreateApiMerchantIdLiasettingsAccountIdSetposdataproviderOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets the POS data provider for the specified country. * * POST /{merchantId}/liasettings/{accountId}/setposdataprovider */ export const createApiMerchantIdLiasettingsAccountIdSetposdataprovider = async (args: CreateApiMerchantIdLiasettingsAccountIdSetposdataproviderArgs, options?: CreateApiMerchantIdLiasettingsAccountIdSetposdataproviderOptions) => { 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('accept', "*/*") if (args.country != null) query.append("country", String(args.country)) if (args.posDataProviderId != null) query.append("posDataProviderId", String(args.posDataProviderId)) if (args.posExternalAccountId != null) query.append("posExternalAccountId", String(args.posExternalAccountId)) 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))}/setposdataprovider${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };