Class: JSS::Building

Inherits:
APIObject show all
Includes:
Creatable, Updatable
Defined in:
lib/jss/api_object/building.rb,
lib/jss.rb

Overview

A Building in the JSS. These are simple, in that they only have an ID and a name.

See Also:

Constant Summary collapse

RSRC_BASE =

The base for REST resources of this class

'buildings'.freeze
RSRC_LIST_KEY =

the hash key used for the JSON list output of all objects in the JSS

:buildings
RSRC_OBJECT_KEY =

The hash key used for the JSON object output. It’s also used in various error messages

:building
VALID_DATA_KEYS =

these keys, as well as :id and :name, are present in valid API JSON data for this class

[].freeze
OBJECT_HISTORY_OBJECT_TYPE =

the object type for this object in the object history table. See APIObject#add_object_history_entry

41

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from JSS::APIObject

Instance Attribute Details

#need_to_updateBoolean (readonly) Originally defined in module Updatable

Returns do we have unsaved changes?.

Returns:

  • (Boolean)

    do we have unsaved changes?

Instance Method Details

#clone(new_name, api: nil) ⇒ APIObject Originally defined in module Creatable

make a clone of this API object, with a new name. The class must be creatable

Parameters:

  • name (String)

    the name for the new object

  • api (JSS::APIConnection) (defaults to: nil)

    the API in which to create the object Defaults to the API used to instantiate this object

Returns:

  • (APIObject)

    An uncreated clone of this APIObject with the given name

Raises:

#create(api: nil) ⇒ Integer Originally defined in module Creatable

Create a new object in the JSS.

Parameters:

  • api (JSS::APIConnection) (defaults to: nil)

    the API in which to create the object Defaults to the API used to instantiate this object

Returns:

  • (Integer)

    the jss ID of the newly created object

Raises:

#name=(newname) ⇒ void Originally defined in module Updatable

This method returns an undefined value.

Change the name of this item Remember to #update to push changes to the server.

Parameters:

  • newname (String)

    the new name

Raises:

#updateBoolean Originally defined in module Updatable

Save changes to the JSS

Returns:

  • (Boolean)

    success

Raises: