export type AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteDataModel = {interaction_date_time?: (string | null) | undefined, interaction_notes?: (string | null) | undefined, disposition_type?: (string | null) | undefined}; export type AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteMetaModel = {agent_external_id?: (string | null) | undefined, contact_external_id?: (string | null) | undefined}; export type AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteRequestModel = {data?: AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteDataModel | undefined, meta?: AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteMetaModel | undefined}; export type CreateApiV1IntegrationsTalkDeskAddPersonNotesArgs = {body: AdaptekApiApplicationPeopleCommandsAddTalkDeskNoteAddPersonNoteRequestModel}; export type CreateApiV1IntegrationsTalkDeskAddPersonNotesOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Used by Talk Desk to add call interaction notes to a persons notes. * * POST /v1/Integrations/TalkDesk/AddPersonNotes */ export const createApiV1IntegrationsTalkDeskAddPersonNotes = async (args: CreateApiV1IntegrationsTalkDeskAddPersonNotesArgs, options: CreateApiV1IntegrationsTalkDeskAddPersonNotesOptions) => { 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/Integrations/TalkDesk/AddPersonNotes${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };