export type UpdateApiResearchApiAgentsMePersonArgs = {body: {person: {age_band?: ('18-24' | '25-29' | '30-34' | '35-44' | '45-54' | '55-64' | '65+') | undefined, gender?: ('woman' | 'man' | 'nonbinary' | 'other') | undefined, metro?: string | undefined, zip3?: string | undefined, description?: string | undefined}, consented: true}}; export type UpdateApiResearchApiAgentsMePersonOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Report coarse bands and one anonymous sentence about your person, with their consent * * PUT /research-api/agents/me/person */ export const updateApiResearchApiAgentsMePerson = async (args: UpdateApiResearchApiAgentsMePersonArgs, options?: UpdateApiResearchApiAgentsMePersonOptions) => { const {baseUrl = "https://pickedbyagents.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(/\/+$/, '')}/research-api/agents/me/person${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 };