export type UpdateApiAccountsAccountIdArgs = {account_id: number, body: {name?: string | undefined, domain?: string | undefined, picture?: string | undefined, size?: number | undefined, website?: string | undefined, description?: string | undefined, address?: ({id?: number | undefined, city?: string | undefined, country?: string | undefined, region?: string | undefined, state_region?: string | undefined, street?: string | undefined, zip?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}) | undefined, addresses?: (Array<{id?: number | undefined, city?: string | undefined, country?: string | undefined, region?: string | undefined, state_region?: string | undefined, street?: string | undefined, zip?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, email?: string | undefined, email_addresses?: (Array<{id?: number | undefined, email?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, phone_number?: string | undefined, phone_numbers?: (Array<{id?: number | undefined, number?: string | undefined, type?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, social_profiles?: Array | undefined, tags?: Array | undefined, links?: string | undefined, _dirty?: boolean | undefined, parent_account?: number | undefined, custom?: Record | undefined, q?: ({condition: 'AND' | 'OR', rules: Array<{id: string, query_builder_id?: string | undefined, customfield_id: string, label?: string | undefined, type?: ('integer' | 'double' | 'boolean' | 'tri_state_boolean' | 'string' | 'long_string' | 'select' | 'date' | 'datetime' | 'file') | undefined, input?: string | undefined, operator: 'equal' | 'not_equal' | 'in' | 'not_in' | 'less' | 'less_or_equal' | 'greater' | 'greater_or_equal' | 'between' | 'not_between' | 'begins_with' | 'not_begins_with' | 'contains' | 'not_contains' | 'ends_with' | 'not_ends_with' | 'is_empty' | 'is_not_empty' | 'is_null' | 'is_not_null' | 'true' | 'false' | 'past_less' | 'past_exactly' | 'past_more_than' | 'future_less' | 'future_exactly' | 'future_more_than' | 'after' | 'on' | 'before' | 'is' | 'is_not', value?: Array | undefined, entity?: ('account' | 'person' | 'opportunity' | 'campaign' | 'tag' | 'task' | 'workflow' | 'workflow_record' | 'workflow_step_record' | 'lead') | undefined, display_entity?: ('Account' | 'Contact' | 'Opportunity' | 'Campaign' | 'Tag' | 'Task' | 'Workflow' | 'Lead') | undefined, pipeline?: number | undefined, enabled: string, internal?: boolean | undefined}>, order_by?: string | undefined, not?: boolean | undefined, valid?: boolean | undefined, search?: string | undefined}) | undefined}}; export type UpdateApiAccountsAccountIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an account * * PUT /accounts/{account_id} */ export const updateApiAccountsAccountId = async (args: UpdateApiAccountsAccountIdArgs, options?: UpdateApiAccountsAccountIdOptions) => { const {baseUrl = "https://api.salesflare.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(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.account_id))}${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() };