export type UpdateApiCandidatesIdArgs = {id: number, body: {first_name: string, middle_name?: string | undefined, last_name: string, title?: string | undefined, address?: ({street?: string | undefined, city?: string | undefined, state?: string | undefined, postal_code?: string | undefined}) | undefined, country_code?: string | undefined, social_media_urls?: Array | undefined, website?: string | undefined, best_time_to_call?: string | undefined, current_employer?: string | undefined, date_available?: string | undefined, current_pay?: string | undefined, desired_pay?: string | undefined, is_willing_to_relocate?: boolean | undefined, key_skills?: string | undefined, notes?: string | undefined, source?: string | undefined, owner_id?: number | undefined, is_active?: boolean | undefined, is_hot?: boolean | undefined, password?: string | undefined, custom_fields?: Array | undefined}}; export type UpdateApiCandidatesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a candidate * * PUT /candidates/{id} */ export const updateApiCandidatesId = async (args: UpdateApiCandidatesIdArgs, options?: UpdateApiCandidatesIdOptions) => { const {baseUrl = "https://api.catsone.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/candidates/${encodeURIComponent(String(args.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 undefined };