Class: Jamf::JpBuilding
- Inherits:
-
OAPISchemas::Building
- Object
- OAPIObject
- OAPISchemas::Building
- Jamf::JpBuilding
- Extended by:
- Filterable
- Includes:
- ChangeLog, CollectionResource
- Defined in:
- lib/jamf/api/jamf_pro/api_objects/jp_building.rb
Overview
A building in the Jamf Pro API
Alas we can't migrate Jamf::Building to use the JPAPI - it must stay in the classic API because of how it interacts Scopes in scopable objects over there.
The parent class is the OAPI object representing a single member of the collection, i.e. the 'GET_OBJECT' similar to the POST_OBJECT defined in the class below.
Constant Summary collapse
- SEARCH_RESULT_OBJECT =
The OAPI object class we get back from a 'list' query to get the whole collection, or a subset of it. It contains a :results key which is an array of data for objects of the parent class.
Jamf::OAPISchemas::BuildingSearchResults
- POST_OBJECT =
The OAPI object class we send with a POST request to make a new member of the collection in Jamf. This is usually the same as the parent class.
Jamf::OAPISchemas::Building
- PUT_OBJECT =
The OAPI object class we send with a PUT request to change an object in Jamf by specifying all its values. Most updates happen this way, and this is usually the same as the parent class
Jamf::OAPISchemas::Building
- LIST_PATH =
The path for GETting the list of all objects in the collection, possibly filtered, sorted, and/or paged REQUIRED for all collection resources
GET_PATH, POST_PATH, PUT_PATH, PATCH_PATH, and DELETE_PATH are automatically assumed from the LIST_PATH if they follow the standards:
-
GET_PATH = “#LIST_PATH/id”
-
fetch an object from the collection
-
-
POST_PATH = LIST_PATH
-
create a new object in the collection
-
-
PUT_PATH = “#LIST_PATH/id”
-
update an object passing all its values back. Most objects use this or PATCH but not both
-
-
PATCH_PATH = “#LIST_PATH/id”
-
update an object passing some of its values back Most objects use this or PUT but not both
-
-
DELETE_PATH = “#LIST_PATH/id”
-
delete an object from the collection
-
If those paths differ from the standards, the constants must be defined here
-
'v1/buildings'.freeze
- GET_PATH =
See Jamf::CollectionResource::ClassMethods#get_path
LIST_PATH
- ALT_IDENTIFIERS =
Identifiers not marked in the superclass's OAPI_PROPERTIES constant which usually only identifies ':id'
%i[name].freeze
- FILTER_KEYS =
Must define this when extending Filterable
%i[ name streetAddress1 streetAddress2 city stateProvince zipPostalCode country ].freeze
Instance Attribute Summary collapse
-
#cnx ⇒ Jamf::Connection
included
from JPAPIResource
readonly
The API connection thru which we deal with this resource.
-
#delete_path ⇒ String
included
from CollectionResource
readonly
The path for deleting a this item from the collection in the JPAPI.
-
#get_path ⇒ String
included
from JPAPIResource
readonly
The path for fetching this thing from the JPAPI.
-
#post_path ⇒ String
included
from CollectionResource
readonly
The path for creating a new item in the collection in the JPAPI.
-
#update_path ⇒ String
included
from JPAPIResource
readonly
The path for updating this thing from the JPAPI.
Class Method Summary collapse
- .filter_keys ⇒ Object extended from Filterable
Instance Method Summary collapse
-
#add_change_log_note(note) ⇒ Object
included
from ChangeLog
Instance Methods.
- #change_log(sort: nil, filter: nil) ⇒ Object included from ChangeLog
- #change_log_count ⇒ Object included from ChangeLog
- #change_log_pager(page_size: Jamf::Pager::DEFAULT_PAGE_SIZE, sort: nil, filter: nil) ⇒ Object included from ChangeLog
- #delete ⇒ Object included from CollectionResource
- #exist? ⇒ Boolean included from CollectionResource
- #history_path ⇒ Object included from ChangeLog
-
#initialize(**data) ⇒ Object
included
from CollectionResource
Constructor.
-
#pretty_print_instance_variables ⇒ Array
included
from JPAPIResource
Remove large cached items from the instance_variables used to create pretty-print (pp) output.
-
#save ⇒ Object
included
from JPAPIResource
TODO: error handling.
-
#to_s ⇒ String
included
from CollectionResource
A meaningful string representation of this object.
Instance Attribute Details
#cnx ⇒ Jamf::Connection (readonly) Originally defined in module JPAPIResource
Returns the API connection thru which we deal with this resource.
#delete_path ⇒ String (readonly) Originally defined in module CollectionResource
Returns The path for deleting a this item from the collection in the JPAPI.
#get_path ⇒ String (readonly) Originally defined in module JPAPIResource
Returns The path for fetching this thing from the JPAPI
this gets set in the constructor in the CollectionResource or SingletonResource mixins.
#post_path ⇒ String (readonly) Originally defined in module CollectionResource
Returns The path for creating a new item in the collection in the JPAPI.
#update_path ⇒ String (readonly) Originally defined in module JPAPIResource
Returns The path for updating this thing from the JPAPI
this gets set in the constructor in the CollectionResource or SingletonResource mixins
We use 'update_path' because some items are updated via a PUT_PATH and others via a PATCH_PATH. When this gets set, it will contain the appropriate one.
Class Method Details
.filter_keys ⇒ Object Originally defined in module Filterable
Instance Method Details
#add_change_log_note(note) ⇒ Object Originally defined in module ChangeLog
Instance Methods
wrappers for the class methods, which pass the id and cnx should work on Singleton Resources since @id will be nil but @cnx will be set.
#change_log_pager(page_size: Jamf::Pager::DEFAULT_PAGE_SIZE, sort: nil, filter: nil) ⇒ Object Originally defined in module ChangeLog
#delete ⇒ Object Originally defined in module CollectionResource
#exist? ⇒ Boolean Originally defined in module CollectionResource
#initialize(**data) ⇒ Object Originally defined in module CollectionResource
Constructor
#pretty_print_instance_variables ⇒ Array Originally defined in module JPAPIResource
Remove large cached items from the instance_variables used to create pretty-print (pp) output.
#save ⇒ Object Originally defined in module JPAPIResource
TODO: error handling
#to_s ⇒ String Originally defined in module CollectionResource
A meaningful string representation of this object