Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/jamf_school/models/user.ts>User

A simple, secure, correct, and modern Jamf School API wrapper. (Unofficial)
Latest
interface User
import { type User } from "https://deno.land/x/jamf_school@0.5.0/models/user.ts";

User represents a single user.

Properties

readonly
type: "User"

Discriminator for type checks.

readonly
id: number

The Jamf-assigned ID of the user.

readonly
email: string

The user's email address.

readonly
username: string

The username of the user.

readonly
domain: string

The user's domain, if they were imported from a LDAP server.

readonly
name: string

The full name of the user.

readonly
firstName: string

The user's first name.

readonly
lastName: string

The user's last name.

readonly
notes: string

Additional notes associated with the user.

readonly
isTrashed: boolean

Whether the user is in the trash (deleted).

readonly
isExcludedFromRestrictions: boolean

Whether the user is excluded from teacher restrictions.

readonly
locationId: number

The ID of this user's location.

Methods

toJSON(): unknown

Return the data used to create this object.

toString(): string

The full name of the user.

update(): Promise<void>

(Read) Update this user's data.

Other users created from the same data will not be updated.

getDevices(): Promise<Device[]>

(Read) Get all the devices assigned to this user.

getGroups(): Promise<UserGroup[]>

(Read) Get all the groups the user is in.

getClasses(): Promise<UserGroup[]>

(Read) Get all the groups the user can teach.

getLocation(): Promise<Location | null>

(Read) Get the location this user belongs to.

setUsername(username: string): Promise<void>

(Edit) Set this user's username.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the username is the same as the user's current username.

setDomain(domain: string): Promise<void>

(Edit) Set this user's LDAP domain.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the domain is the same as the user's current domain.

setFirstName(firstName: string): Promise<void>

(Edit) Set this user's first name.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the name is the same as the user's current first name.

setLastName(lastName: string): Promise<void>

(Edit) Set this user's last name.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the name is the same as the user's current last name.

setPassword(password: string): Promise<void>

(Edit) Set this user's Jamf School login password.

This method will not update the user object. To update the object, call User.update().

setEmail(email: string): Promise<void>

(Edit) Set this user's email address.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the email is the same as the user's current email.

setGroups(groups: { id: number; }[]): Promise<void>

(Edit) Set the groups this user is in.

This method will not update the user object. To update the object, call User.update().

setLocation(location: { id: number; }): Promise<void>

(Edit) Set this user's location. Moving a user will also move all the devices they own.

This method will not update the user object. To update the object, call User.update().

This method is a no-op if the location ID is the same as the user's current location ID.

setClasses(groups: { id: number; }[]): Promise<void>

(Edit) Set the groups this user can teach.

This method will not update the user object. To update the object, call User.update().

setChildren(children: { id: number; }[]): Promise<void>

(Edit) Set this user's children.

This method will not update the user object. To update the object, call User.update().

restartDevices(): Promise<void>

(Read, Add) Restart all of this user's devices.

Note that failing to restart a device will not throw an exception.