Skip to main content
Module

x/jamf_school/mod.ts>Location

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

Location represents a physical site. All data in Jamf School must be assigned to a location. Locations are able to get the data that is assigned to them.

Many of the properties are nullable because the only required field when creating a location is its name.

Properties

readonly
type: "Location"

Discriminator for type checks.

readonly
id: number

The ID of this location, starting from zero.

readonly
name: string

The name of the location.

readonly
isDistrict: boolean

Whether this location is a district.

readonly
streetName: string | null

The street this location is on.

readonly
streetNumber: string | null

The street number this location is at.

readonly
postalCode: string | null

The post code this location is in.

readonly
city: string | null

The city this location is in.

readonly
asmIdentifier: string | null

The ID this location is assigned in Apple School Manager.

readonly
schoolNumber: string | null

The number assigned to this school. This data is arbitrary and may not necessarily be a numeric string.

Methods

toJSON(): unknown

Return the data used to create this object.

toString(): string

The name of the location.

getDevices(): Promise<Device[]>

(Read) Get all devices that belong to this location.

getDeviceGroups(): Promise<DeviceGroup[]>

(Read) Get all device groups that belong to this location.

getUsers(): Promise<User[]>

(Read) Get all users that belong to this location.

getUserGroups(): Promise<UserGroup[]>

(Read) Get all user groups that belong to this location.

getApps(): Promise<App[]>

(Read) Get all apps that belong to this location.

getProfiles(): Promise<Profile[]>

(Read) Get all profiles that belong to this location.

update(): Promise<void>

(Read) Update this location's data.

Other locations created from this data will not be updated.

moveDevices(devices: { udid: string; }[]): Promise<void>

(Edit) Move devices to this location. This will also move the device's owner and any other devices they own.

Devices already in this location will not be affected.

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

moveUsers(users: { id: number; }[]): Promise<void>

(Edit) Move users and their devices to this location.

Users already in this location will not be affected.

Note that failing to move a user will not throw an exception.

restartDevices(): Promise<void>

(Read, Add) Restart all the devices in this location.

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