export type Coordinates = {latitude?: number | undefined, longitude?: number | undefined}; export type Location = {countryName?: string | undefined, countryCode?: string | undefined, stateName?: string | undefined, stateCode?: string | undefined, city?: string | undefined, street?: string | undefined, postalCode?: string | undefined, continent?: string | undefined, regionName?: string | undefined, timeZone?: string | undefined, coordinates?: Coordinates | undefined}; export type Account = {id: string, name: string, trackedSubscriptionId?: string | undefined, sfdcId?: string | undefined, lastSeenDate?: number | undefined, dunsNumber?: string | undefined, industry?: string | undefined, numberOfEmployees?: number | undefined, sicCode?: string | undefined, website?: string | undefined, naicsCode?: string | undefined, plan?: string | undefined, location?: Location | undefined, numberOfUsers?: number | undefined, propertyKeys: Array, createDate?: number | undefined, lastModifiedDate?: number | undefined, customAttributes?: Record | undefined, parentGroupId?: string | undefined, renewalDate?: number | undefined, healthScore?: number | undefined, gsId?: string | undefined, nps?: number | undefined, csm?: string | undefined}; export type UpdateApiV1AccountsAccountIdArgs = {accountId: string, body: Account}; export type UpdateApiV1AccountsAccountIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update account * * PUT /v1/accounts/{accountId} */ export const updateApiV1AccountsAccountId = async (args: UpdateApiV1AccountsAccountIdArgs, options?: UpdateApiV1AccountsAccountIdOptions) => { const {baseUrl = "https://app.aptrinsic.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") 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 res.blob() };