Class: Jamf::Building

Inherits:
CollectionResource show all
Extended by:
BulkDeletable
Includes:
ChangeLog
Defined in:
lib/jamf/api/resources/collection_resources/building.rb

Overview

A building defined in the JSS

Constant Summary collapse

RSRC_VERSION =

Constants

'v1'.freeze
RSRC_PATH =
'buildings'.freeze
OBJECT_MODEL =

Object Model / Attributes See APIObject class documentation for details of how the OBJECT_MODEL hash works.

{

  # @!attribute [r] id
  #   @return [Integer]
  id: {
    class: :j_id,
    identifier: :primary,
    readonly: true
  },

  # @!attribute name
  #   @return [String]
  name: {
    class: :string,
    identifier: true,
    validator: :non_empty_string,
    required: true,
    filter_key: true
  },

  # @!attribute street1
  #   @return [String]
  streetAddress1: {
    class: :string,
    filter_key: true
  },

  # @!attribute street2
  #   @return [String]
  streetAddress2: {
    class: :string,
    filter_key: true
  },

  # @!attribute city
  #   @return [String]
  city: {
    class: :string,
    filter_key: true
  },

  # @!attribute state_province
  #   @return [String]
  stateProvince: {
    class: :string,
    aliases: %i[state province],
    filter_key: true
  },

  # @!attribute zip_postal_code
  #   @return [String]
  zipPostalCode: {
    class: :string,
    aliases: %i[zip zipcode zip_code postal_code postalcode],
    filter_key: true
  },

  # @!attribute country
  #   @return [String]
  country: {
    class: :string,
    filter_key: true
  }
}.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Jamf::JSONObject

Instance Attribute Details

#cityString

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 86

#countryString

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 109

#idInteger (readonly)

Returns:

  • (Integer)


# File 'lib/jamf/api/resources/collection_resources/building.rb', line 54

#nameString

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 62

#state_provinceString

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 93

#street1String

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 72

#street2String

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 79

#zip_postal_codeString

Returns:



# File 'lib/jamf/api/resources/collection_resources/building.rb', line 101

Class Method Details

.bulk_delete(ids, cnx: Jamf.cnx) ⇒ Array<Jamf::Connection::APIError::ErrorInfo] Info about any ids that failed to be deleted. Originally defined in module BulkDeletable

Delete multiple objects by providing an array of their

Parameters:

  • ids (Array<String,Integer>)

    The ids to delete

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    The connection to use, default: Jamf.cnx

Returns:

Instance Method Details

#add_change_log_note(note, cnx: Jamf.cnx) ⇒ void Originally defined in module ChangeLog

This method returns an undefined value.

Add a note to this resource’s change log.

If the change history has been cached already, the cache is flushed after adding the note.

Parameters:

  • note (String)

    The note to add. It cannot be empty.

#change_log(sort: nil, filter: nil, paged: nil, page_size: nil, refresh: false, cnx: Jamf.cnx) ⇒ Array<Jamf::ChangeLogEntry> Originally defined in module ChangeLog

The change and note history for this resource. This is a collection of objects as a sub-resource of some primary resource. As such, retriving the change log returns an array of objects, and can be paged, sorted and filtered.

This method is very similar to CollectionResource.all, see the docs for that method for more details

successive page.

Parameters:

  • sort (String, Array<String>) (defaults to: nil)

    Server-side sorting criteria in the format: property:direction, where direction is ‘asc’ or ‘desc’. Multiple properties are supported, either as separate strings in an Array, or a single string, comma separated.

  • filter (String) (defaults to: nil)

    An RSQL filter string. Not all change_log resources currently support filters, and if they don’t, this will be ignored.

  • paged (Boolean) (defaults to: nil)

    Defaults to false. Returns only the first page of ‘page_size` log entries. Use #next_page_of_change_log to retrieve each

  • page_size (Integer) (defaults to: nil)

    How many log entries are returned per page? Minimum is 1, maximum is 2000, default is 100. Ignored unless paged: is truthy. Note: the final page may contain fewer entries than the page_size

  • refresh (Boolean) (defaults to: false)

    re-fetch and re-cache the full list of all entries. Ignored if paged:, page_size:, sort:, or filter: are used.

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    The API connection to use, default: Jamf.cnx. If this is an instance of a Collection Resource, this is always the connection from which it was fetched.

Returns:

#change_log_count(cnx: Jamf.cnx) ⇒ Integer Originally defined in module ChangeLog

how many change log entries are there? needed when using paged #change_log calls

Parameters:

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    The API connection to use, default: Jamf.cnx This is ignored for instances of Collection Resources, which always use the same connection from which they were fetched.

Returns:

  • (Integer)

    How many changelog entries exist?

#next_page_of_change_logArray<Jamf::ChangeHistoryEntry> Originally defined in module ChangeLog

Fetch the next page of a paged #change_log request Returns an empty array if there’s been no paged request or if the last one has no more pages.

Returns:

  • (Array<Jamf::ChangeHistoryEntry>)

    The next page of the change and note history for this resource