Class: Jamf::ComputerPrestage
- Inherits:
-
OAPISchemas::GetComputerPrestageV2
- Object
- OAPIObject
- OAPISchemas::GetComputerPrestageV2
- Jamf::ComputerPrestage
- Includes:
- CollectionResource, Prestage
- Defined in:
- lib/jamf/api/jamf_pro/api_objects/computer_prestage.rb
Overview
A building in the Jamf Pro API
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::ComputerPrestageSearchResultsV2
- 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::PostComputerPrestageV2
- 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::PutComputerPrestageV2
- 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_, PUT_, PATCH_, POST_, and DELETE_ paths don’t need to be defined if they are the same as LIST_PATH (followed by an id if needed)
'v2/computer-prestages'.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.
Instance Method Summary collapse
-
#assign(*sns_to_assign) ⇒ Object
(also: #add)
included
from Prestage
Assign.
-
#assigned?(sn) ⇒ Boolean
(also: #include?)
included
from Prestage
Is this SN assigned to this prestage?.
-
#assigned_sns(refresh: false) ⇒ Array<String>
included
from Prestage
The serialnumbers assigned to this prestage.
- #delete ⇒ Object included from CollectionResource
- #exist? ⇒ Boolean included from CollectionResource
-
#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 Prestage
-
#scope(refresh: false) ⇒ PrestageScope
included
from Prestage
The scope data for this prestage.
-
#scope_path ⇒ Object
included
from Prestage
The scope endpoint for this instance.
-
#to_s ⇒ String
included
from CollectionResource
A meaningful string representation of this object.
- #unassign(*sns_to_unassign) ⇒ Object (also: #remove) included from Prestage
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.
Instance Method Details
#assigned?(sn) ⇒ Boolean Also known as: include? Originally defined in module Prestage
Is this SN assigned to this prestage?
This method uses the instance’s scope object, from a different API path than the class-level .assigned? method.
#assigned_sns(refresh: false) ⇒ Array<String> Originally defined in module Prestage
Returns the serialnumbers assigned to this prestage.
#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.
#scope(refresh: false) ⇒ PrestageScope Originally defined in module Prestage
The scope data for this prestage
TODO: retain this caching?
#to_s ⇒ String Originally defined in module CollectionResource
A meaningful string representation of this object