export type AtlantisCommonIdNameDto1SystemInt32 = {id?: number | undefined, name?: (string | null) | undefined, isDeleted?: boolean | undefined, isDisabled?: boolean | undefined}; export type CoachingBllDtoUserCertificationHistory = {id?: number | undefined, isDeleted?: boolean | undefined, startDate?: (string | null) | undefined, certificationDate?: (string | null) | undefined, isLapsed?: boolean | undefined}; export type CoachingBllDtoUserPracticeCertification = {id?: number | undefined, isDeleted?: boolean | undefined, certification: AtlantisCommonIdNameDto1SystemInt32, currentCertificationDetail?: CoachingBllDtoUserCertificationHistory | undefined, endDate?: string | undefined, startDate?: string | undefined}; export type CoachingBllDtoUserPractice = {id?: number | undefined, isDeleted?: boolean | undefined, practice: AtlantisCommonIdNameDto1SystemInt32, role?: AtlantisCommonIdNameDto1SystemInt32 | undefined, selectedStates?: (Array | null) | undefined, selectedOrganizations: Array, selectedSites?: (Array | null) | undefined, userCertifications?: (Array | null) | undefined}; export type CoachingBllDtoUser = {id?: number | undefined, isDeleted?: boolean | undefined, qualoId: string, firstName: string, lastName: string, userName: string, secondaryEmail?: (string | null) | undefined, state?: (string | null) | undefined, organization?: AtlantisCommonIdNameDto1SystemInt32 | undefined, site?: AtlantisCommonIdNameDto1SystemInt32 | undefined, timeZone?: (string | null) | undefined, title?: (string | null) | undefined, userPractices?: (Array | null) | undefined, defaultPractice?: AtlantisCommonIdNameDto1SystemInt32 | undefined, isActive?: boolean | undefined, isSystemAdmin?: boolean | undefined}; export type CreateApiCoachingUserArgs = {body: CoachingBllDtoUser}; export type CreateApiCoachingUserOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /coaching/user */ export const createApiCoachingUser = async (args: CreateApiCoachingUserArgs, options: CreateApiCoachingUserOptions) => { const {baseUrl, 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) const url = `${baseUrl.replace(/\/+$/, '')}/coaching/user${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 };