export type OrderStatus = 0 | 1 | 2 | 3 | 4 | 5; export type OrderNotificationAttachmentFormat = 0 | 1; export type OrderNotificationStatusSettingDto = {status?: OrderStatus | undefined, attachment?: OrderNotificationAttachmentFormat | undefined}; export type UpdateAccountRequest = {accountName?: (string | null) | undefined, mfaEnabled?: (boolean | null) | undefined, orderNotificationsEnabled?: (boolean | null) | undefined, orderNotificationReceivers?: (Array | null) | undefined, orderNotificationStatuses?: (Array | null) | undefined, showImagesInSearch?: (boolean | null) | undefined, showPricesOnApps?: (boolean | null) | undefined, showPricesOnReports?: (boolean | null) | undefined}; export type UpdateApiV1AccountsAccountIdArgs = {accountId: number, body: UpdateAccountRequest}; export type UpdateApiV1AccountsAccountIdOptions = {baseUrl: string, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/Accounts/{accountId} */ export const updateApiV1AccountsAccountId = async (args: UpdateApiV1AccountsAccountIdArgs, options: UpdateApiV1AccountsAccountIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json-patch+json; x-api-version=1.0") if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Accounts/${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 undefined };