export type Account = {id?: (string | null) | undefined, name?: (string | null) | undefined, tags?: (string | null) | undefined, business_name?: (string | null) | undefined, address_1?: (string | null) | undefined, address_2?: (string | null) | undefined, city?: (string | null) | undefined, state?: (string | null) | undefined, postal_code?: (string | null) | undefined, country?: (string | null) | undefined, phone?: (string | null) | undefined, fax?: (string | null) | undefined, primary_contact_id?: (string | null) | undefined, secondary_contact_id?: (string | null) | undefined, created_on?: (string | null) | undefined, timeZone?: (string | null) | undefined, logo_url?: (string | null) | undefined}; export type UpdateApiAccountArgs = {body: Account}; export type UpdateApiAccountOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates an account. * * PUT /account * * Also accepts auth: ApiKeyInHeader, ApiKeyInQuery */ export const updateApiAccount = async (args: UpdateApiAccountArgs, options?: UpdateApiAccountOptions) => { const {baseUrl = "https://api.reveldigital.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/account${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 };