export type UserSettingsDTO = {name?: string | undefined, email?: string | undefined, dailyReport?: boolean | undefined, region?: ('US_EST' | 'US_EST_OHIO' | 'US_WEST_OREGON' | 'US_WEST_CAL' | 'EU' | 'EU_FRANKFURT' | 'ASIA_HONG_KONG' | 'ASIA_MUMBAI' | 'ASIA_SEOUL' | 'ASIA_SINGAPORE' | 'ASIA_SIDNEY' | 'ASIA_TOKYO' | 'SOUTH_AMERICA' | 'AFRICA_CAPE_TOWN' | 'ASIA_CHINA' | 'CANADA' | 'LONDON' | 'EU_PARIS' | 'EU_STOCKHOLM' | 'EU_ZURICH') | undefined, partnerID?: string | undefined, currency?: ('USD' | 'EUR' | 'AUD' | 'GBP' | 'ILS' | 'CAD' | 'JPY') | undefined, invoiceLineType?: ('PERSERVICE' | 'PERTASK' | 'PERTOTAL') | undefined, externalId?: string | undefined}; export type UpdateApiV1UserSettingsArgs = {body: UserSettingsDTO}; export type UpdateApiV1UserSettingsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * updateMeSettings * * PUT /v1/user/settings */ export const updateApiV1UserSettings = async (args: UpdateApiV1UserSettingsArgs, options?: UpdateApiV1UserSettingsOptions) => { const {baseUrl = "https://api.cloudally.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/user/settings${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() };