export type RenderAccountIssuesRequestPayload = {contentOption?: ('CONTENT_OPTION_UNSPECIFIED' | 'PRE_RENDERED_HTML') | undefined, userInputActionOption?: ('USER_INPUT_ACTION_RENDERING_OPTION_UNSPECIFIED' | 'REDIRECT_TO_MERCHANT_CENTER' | 'BUILT_IN_USER_INPUT_ACTIONS') | undefined}; export type CreateApiMerchantIdMerchantsupportRenderaccountissuesArgs = {merchantId: string, languageCode?: string | undefined, timeZone?: string | undefined, body: RenderAccountIssuesRequestPayload}; export type CreateApiMerchantIdMerchantsupportRenderaccountissuesOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Provide a list of merchant's issues with a support content and available actions. This content and actions are meant to be rendered and shown in third-party applications. * * POST /{merchantId}/merchantsupport/renderaccountissues */ export const createApiMerchantIdMerchantsupportRenderaccountissues = async (args: CreateApiMerchantIdMerchantsupportRenderaccountissuesArgs, options?: CreateApiMerchantIdMerchantsupportRenderaccountissuesOptions) => { 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 (args.languageCode != null) query.append("languageCode", String(args.languageCode)) if (args.timeZone != null) query.append("timeZone", String(args.timeZone)) if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.merchantId))}/merchantsupport/renderaccountissues${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() };