export type AdaptekApiApplicationAdvisorsCommandsUpdateAdvisorUpdateAdvisorCommand = {id?: number | undefined, title?: (string | null) | undefined, firstName?: (string | null) | undefined, middleName?: (string | null) | undefined, lastName?: (string | null) | undefined, email?: (string | null) | undefined, isDebugging?: boolean | undefined, useImapSync?: boolean | undefined, portalIdentifier?: (number | null) | undefined, bio?: (string | null) | undefined, imageFile?: (string | null) | undefined, address?: (string | null) | undefined, address2?: (string | null) | undefined, city?: (string | null) | undefined, state?: (string | null) | undefined, zip?: (string | null) | undefined}; export type UpdateApiV1AdvisorsAdvisorIdArgs = {advisorId: number, body: AdaptekApiApplicationAdvisorsCommandsUpdateAdvisorUpdateAdvisorCommand}; export type UpdateApiV1AdvisorsAdvisorIdOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates an existing advisor * * PUT /v1/Advisors/{advisorId} */ export const updateApiV1AdvisorsAdvisorId = async (args: UpdateApiV1AdvisorsAdvisorIdArgs, options: UpdateApiV1AdvisorsAdvisorIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Advisors/${encodeURIComponent(String(args.advisorId))}${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 };