ruby-jss 1.2.3 → 1.2.4a1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ruby-jss might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/jamf.rb +169 -0
- data/lib/jamf/api/abstract_classes/collection_resource.rb +422 -0
- data/lib/jamf/api/abstract_classes/generic_reference.rb +145 -0
- data/lib/jamf/api/abstract_classes/json_object.rb +1074 -0
- data/lib/jamf/api/abstract_classes/prestage.rb +219 -0
- data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +126 -0
- data/lib/jamf/api/abstract_classes/resource.rb +250 -0
- data/lib/jamf/api/abstract_classes/singleton_resource.rb +87 -0
- data/lib/jamf/api/attribute_classes/ip_address.rb +66 -0
- data/lib/jamf/api/attribute_classes/timestamp.rb +144 -0
- data/lib/jamf/api/connection.rb +734 -0
- data/lib/jamf/api/connection/api_error.rb +111 -0
- data/lib/jamf/api/connection/api_error_styleguide.rb +96 -0
- data/lib/jamf/api/connection/token.rb +220 -0
- data/lib/jamf/api/json_objects/account_prefs.rb +79 -0
- data/lib/jamf/api/json_objects/android_details.rb +139 -0
- data/lib/jamf/api/json_objects/appletv_details.rb +110 -0
- data/lib/jamf/api/json_objects/attachment.rb +68 -0
- data/lib/jamf/api/json_objects/cellular_network.rb +151 -0
- data/lib/jamf/api/json_objects/change_log_entry.rb +77 -0
- data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +67 -0
- data/lib/jamf/api/json_objects/country.rb +51 -0
- data/lib/jamf/api/json_objects/extension_attribute_value.rb +128 -0
- data/lib/jamf/api/json_objects/installed_application.rb +59 -0
- data/lib/jamf/api/json_objects/installed_certificate.rb +53 -0
- data/lib/jamf/api/json_objects/installed_configuration_profile.rb +67 -0
- data/lib/jamf/api/json_objects/installed_ebook.rb +58 -0
- data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +59 -0
- data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +52 -0
- data/lib/jamf/api/json_objects/ios_details.rb +244 -0
- data/lib/jamf/api/json_objects/location.rb +95 -0
- data/lib/jamf/api/json_objects/md_prestage_name.rb +57 -0
- data/lib/jamf/api/json_objects/md_prestage_names.rb +82 -0
- data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +165 -0
- data/lib/jamf/api/json_objects/mobile_device_details.rb +219 -0
- data/lib/jamf/api/json_objects/mobile_device_security.rb +101 -0
- data/lib/jamf/api/json_objects/prestage_assignment.rb +61 -0
- data/lib/jamf/api/json_objects/prestage_location.rb +104 -0
- data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +132 -0
- data/lib/jamf/api/json_objects/prestage_scope.rb +54 -0
- data/lib/jamf/api/json_objects/prestage_sync_status.rb +63 -0
- data/lib/jamf/api/json_objects/purchasing_data.rb +125 -0
- data/lib/jamf/api/mixins/abstract.rb +58 -0
- data/lib/jamf/api/mixins/bulk_deletable.rb +39 -0
- data/lib/jamf/api/mixins/change_log.rb +136 -0
- data/lib/jamf/api/mixins/extendable.rb +75 -0
- data/lib/jamf/api/mixins/immutable.rb +39 -0
- data/lib/jamf/api/mixins/locatable.rb +124 -0
- data/lib/jamf/api/mixins/lockable.rb +48 -0
- data/lib/jamf/api/mixins/referable.rb +92 -0
- data/lib/jamf/api/mixins/searchable.rb +202 -0
- data/lib/jamf/api/mixins/uncreatable.rb +40 -0
- data/lib/jamf/api/mixins/undeletable.rb +40 -0
- data/lib/jamf/api/resources/collection_resources/account.rb +163 -0
- data/lib/jamf/api/resources/collection_resources/building.rb +114 -0
- data/lib/jamf/api/resources/collection_resources/category.rb +82 -0
- data/lib/jamf/api/resources/collection_resources/computer.rb +49 -0
- data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +80 -0
- data/lib/jamf/api/resources/collection_resources/department.rb +79 -0
- data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +45 -0
- data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +274 -0
- data/lib/jamf/api/resources/collection_resources/md_prestage.rb +139 -0
- data/lib/jamf/api/resources/collection_resources/mobile_device.rb +315 -0
- data/lib/jamf/api/resources/collection_resources/script.rb +190 -0
- data/lib/jamf/api/resources/collection_resources/site.rb +77 -0
- data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +131 -0
- data/lib/jamf/api/resources/singleton_resources/authorization.rb +88 -0
- data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +139 -0
- data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +95 -0
- data/lib/jamf/client.rb +301 -0
- data/lib/jamf/client/jamf_binary.rb +132 -0
- data/lib/jamf/client/jamf_helper.rb +298 -0
- data/lib/jamf/client/management_action.rb +114 -0
- data/lib/jamf/compatibility.rb +88 -0
- data/lib/jamf/composer.rb +190 -0
- data/lib/jamf/configuration.rb +281 -0
- data/lib/jamf/exceptions.rb +107 -0
- data/lib/jamf/ruby_extensions.rb +36 -0
- data/lib/jamf/ruby_extensions/array.rb +35 -0
- data/lib/jamf/ruby_extensions/array/predicates.rb +46 -0
- data/lib/jamf/ruby_extensions/array/utils.rb +47 -0
- data/lib/jamf/ruby_extensions/filetest.rb +32 -0
- data/lib/jamf/ruby_extensions/filetest/predicates.rb +46 -0
- data/lib/jamf/ruby_extensions/hash.rb +33 -0
- data/lib/jamf/ruby_extensions/hash/backports.rb +92 -0
- data/lib/jamf/ruby_extensions/ipaddr.rb +37 -0
- data/lib/jamf/ruby_extensions/ipaddr/utils.rb +95 -0
- data/lib/jamf/ruby_extensions/object.rb +30 -0
- data/lib/jamf/ruby_extensions/object/predicates.rb +51 -0
- data/lib/jamf/ruby_extensions/pathname.rb +39 -0
- data/lib/jamf/ruby_extensions/pathname/predicates.rb +50 -0
- data/lib/jamf/ruby_extensions/pathname/utils.rb +75 -0
- data/lib/jamf/ruby_extensions/string.rb +35 -0
- data/lib/jamf/ruby_extensions/string/backports.rb +66 -0
- data/lib/jamf/ruby_extensions/string/conversions.rb +65 -0
- data/lib/jamf/ruby_extensions/string/predicates.rb +47 -0
- data/lib/jamf/utility.rb +423 -0
- data/lib/jamf/validate.rb +224 -0
- data/lib/jamf/version.rb +32 -0
- data/lib/jpapi.rb +26 -0
- data/lib/jss/version.rb +1 -1
- metadata +104 -4
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
# with the following modification; you may not use this file except in
|
5
|
+
# compliance with the Apache License and the following modification to it:
|
6
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
#
|
8
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
# names, trademarks, service marks, or product names of the Licensor
|
10
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
# the License and to reproduce the content of the NOTICE file.
|
12
|
+
#
|
13
|
+
# You may obtain a copy of the Apache License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the Apache License with the above modification is
|
19
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
# KIND, either express or implied. See the Apache License for the specific
|
21
|
+
# language governing permissions and limitations under the Apache License.
|
22
|
+
#
|
23
|
+
#
|
24
|
+
|
25
|
+
module Jamf
|
26
|
+
|
27
|
+
# This mixin overrides CollectionResource.creatable? to return false,
|
28
|
+
# meaning that CollectionResource.create will raise an exception
|
29
|
+
# It should be extended into appropriate subclasses of CollectionResource
|
30
|
+
#
|
31
|
+
# Note that SingletonResource subclasses are never creatable
|
32
|
+
module UnCreatable
|
33
|
+
|
34
|
+
def creatable?
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
38
|
+
end # Lockable
|
39
|
+
|
40
|
+
end # Jamf
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
# with the following modification; you may not use this file except in
|
5
|
+
# compliance with the Apache License and the following modification to it:
|
6
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
#
|
8
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
# names, trademarks, service marks, or product names of the Licensor
|
10
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
# the License and to reproduce the content of the NOTICE file.
|
12
|
+
#
|
13
|
+
# You may obtain a copy of the Apache License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the Apache License with the above modification is
|
19
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
# KIND, either express or implied. See the Apache License for the specific
|
21
|
+
# language governing permissions and limitations under the Apache License.
|
22
|
+
#
|
23
|
+
#
|
24
|
+
|
25
|
+
module Jamf
|
26
|
+
|
27
|
+
# This mixin overrides CollectionResource.deletable? to return false,
|
28
|
+
# meaning that CollectionResource.delete and #delete will raise an exception
|
29
|
+
# It should be extended into subclasses of CollectionResource
|
30
|
+
#
|
31
|
+
# Note that SingletonResource subclasses are never deletable
|
32
|
+
module UnDeletable
|
33
|
+
|
34
|
+
def deletable?
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
38
|
+
end # Lockable
|
39
|
+
|
40
|
+
end # Jamf
|
@@ -0,0 +1,163 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
5
|
+
# with the following modification; you may not use this file except in
|
6
|
+
# compliance with the Apache License and the following modification to it:
|
7
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
8
|
+
#
|
9
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
10
|
+
# names, trademarks, service marks, or product names of the Licensor
|
11
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
12
|
+
# the License and to reproduce the content of the NOTICE file.
|
13
|
+
#
|
14
|
+
# You may obtain a copy of the Apache License at
|
15
|
+
#
|
16
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
#
|
18
|
+
# Unless required by applicable law or agreed to in writing, software
|
19
|
+
# distributed under the Apache License with the above modification is
|
20
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
21
|
+
# KIND, either express or implied. See the Apache License for the specific
|
22
|
+
# language governing permissions and limitations under the Apache License.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
|
26
|
+
# The Module
|
27
|
+
module Jamf
|
28
|
+
|
29
|
+
# Classes
|
30
|
+
#####################################
|
31
|
+
|
32
|
+
# An administrator account in the JSS
|
33
|
+
#
|
34
|
+
# ISSUES FOR JAMF:
|
35
|
+
# - Seems like there needs to be some cleanup/coordination
|
36
|
+
# with the endpoints GET/auth, POST/auth/current, and GET/user
|
37
|
+
# Things are currently wonky enough that I can't really move forward
|
38
|
+
# with this class.
|
39
|
+
#
|
40
|
+
class Account < Jamf::JSONObject
|
41
|
+
|
42
|
+
# Constants
|
43
|
+
#####################################
|
44
|
+
|
45
|
+
ACCESS_LEVEL_FULL = 'FullAccess'.freeze
|
46
|
+
ACCESS_LEVEL_SITE = 'SiteAccess'.freeze,
|
47
|
+
ACCESS_LEVEL_GROUP = 'GroupBasedAccess'.freeze
|
48
|
+
|
49
|
+
ACCESS_LEVELS = [
|
50
|
+
ACCESS_LEVEL_FULL,
|
51
|
+
ACCESS_LEVEL_SITE,
|
52
|
+
ACCESS_LEVEL_GROUP
|
53
|
+
].freeze
|
54
|
+
|
55
|
+
PRIVILEGE_SET_ADMIN = 'ADMINISTRATOR'.freeze
|
56
|
+
PRIVILEGE_SET_AUDITOR = 'AUDITOR'.freeze
|
57
|
+
PRIVILEGE_SET_ENROLL = 'ENROLLMENT'.freeze
|
58
|
+
PRIVILEGE_SET_CUSTOM = 'CUSTOM'.freeze
|
59
|
+
|
60
|
+
PRIVILEGE_SETS = [
|
61
|
+
PRIVILEGE_SET_ADMIN,
|
62
|
+
PRIVILEGE_SET_AUDITOR,
|
63
|
+
PRIVILEGE_SET_ENROLL,
|
64
|
+
PRIVILEGE_SET_CUSTOM
|
65
|
+
].freeze
|
66
|
+
|
67
|
+
# Object Model / Attributes
|
68
|
+
# See APIObject class documentation for details
|
69
|
+
# of how the OBJECT_MODEL hash works.
|
70
|
+
#####################################
|
71
|
+
OBJECT_MODEL = {
|
72
|
+
# @!attribute [r] id
|
73
|
+
# @return [Integer]
|
74
|
+
id: {
|
75
|
+
class: :integer,
|
76
|
+
readonly: true
|
77
|
+
},
|
78
|
+
|
79
|
+
# @!attribute [r] username
|
80
|
+
# @return [String]
|
81
|
+
username: {
|
82
|
+
class: :string,
|
83
|
+
readonly: true
|
84
|
+
},
|
85
|
+
|
86
|
+
# @!attribute [r] realName
|
87
|
+
# @return [String]
|
88
|
+
realName: {
|
89
|
+
class: :string,
|
90
|
+
readonly: true
|
91
|
+
},
|
92
|
+
|
93
|
+
# @!attribute [r] email
|
94
|
+
# @return [String]
|
95
|
+
email: {
|
96
|
+
class: :string,
|
97
|
+
readonly: true
|
98
|
+
},
|
99
|
+
|
100
|
+
# @!attribute [r] preferences
|
101
|
+
# @return [String]
|
102
|
+
preferences: {
|
103
|
+
class: Jamf::AccountPreferences,
|
104
|
+
readonly: true
|
105
|
+
},
|
106
|
+
|
107
|
+
# @!attribute [r] isMultiSiteAdmin
|
108
|
+
# @return [Boolean]
|
109
|
+
isMultiSiteAdmin: {
|
110
|
+
class: :boolean,
|
111
|
+
readonly: true
|
112
|
+
},
|
113
|
+
|
114
|
+
# @!attribute [r] accessLevel
|
115
|
+
# @return [String]
|
116
|
+
accessLevel: {
|
117
|
+
class: :string,
|
118
|
+
readonly: true,
|
119
|
+
enum: Jamf::Account::ACCESS_LEVELS
|
120
|
+
},
|
121
|
+
|
122
|
+
# @!attribute [r] accessLevel
|
123
|
+
# @return [String]
|
124
|
+
privilegeSet: {
|
125
|
+
class: :string,
|
126
|
+
readonly: true,
|
127
|
+
enum: Jamf::Account::PRIVILEGE_SETS
|
128
|
+
},
|
129
|
+
|
130
|
+
}.freeze
|
131
|
+
parse_object_model
|
132
|
+
|
133
|
+
# CurrentAccount {
|
134
|
+
# id (integer, optional),
|
135
|
+
# username (string, optional),
|
136
|
+
# realName (string, optional),
|
137
|
+
# email (string, optional),
|
138
|
+
# preferences (AccountPreferences, optional),
|
139
|
+
# isMultiSiteAdmin (boolean, optional),
|
140
|
+
# accessLevel (string, optional) = ['FullAccess', 'SiteAccess', 'GroupBasedAccess'],
|
141
|
+
# privilegeSet (string, optional) = ['ADMINISTRATOR', 'AUDITOR', 'ENROLLMENT', 'CUSTOM'],
|
142
|
+
# privileges (Array[string], optional),
|
143
|
+
# groupIds (Array[integer], optional),
|
144
|
+
# currentSiteId (integer, optional)
|
145
|
+
# }
|
146
|
+
|
147
|
+
# Account/AuthAccount {
|
148
|
+
# id (integer, optional),
|
149
|
+
# username (string, optional),
|
150
|
+
# realName (string, optional),
|
151
|
+
# email (string, optional),
|
152
|
+
# preferences (AccountPreferences, optional),
|
153
|
+
# isMultiSiteAdmin (boolean, optional),
|
154
|
+
# accessLevel (string, optional) = ['FullAccess', 'SiteAccess', 'GroupBasedAccess'],
|
155
|
+
# privilegeSet (string, optional) = ['ADMINISTRATOR', 'AUDITOR', 'ENROLLMENT', 'CUSTOM'],
|
156
|
+
# privilegesBySite (object, optional),
|
157
|
+
# groupIds (Array[integer], optional),
|
158
|
+
# currentSiteId (integer, optional)
|
159
|
+
# }
|
160
|
+
|
161
|
+
end # class
|
162
|
+
|
163
|
+
end # module
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
5
|
+
# with the following modification; you may not use this file except in
|
6
|
+
# compliance with the Apache License and the following modification to it:
|
7
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
8
|
+
#
|
9
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
10
|
+
# names, trademarks, service marks, or product names of the Licensor
|
11
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
12
|
+
# the License and to reproduce the content of the NOTICE file.
|
13
|
+
#
|
14
|
+
# You may obtain a copy of the Apache License at
|
15
|
+
#
|
16
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
#
|
18
|
+
# Unless required by applicable law or agreed to in writing, software
|
19
|
+
# distributed under the Apache License with the above modification is
|
20
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
21
|
+
# KIND, either express or implied. See the Apache License for the specific
|
22
|
+
# language governing permissions and limitations under the Apache License.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
|
26
|
+
# The Module
|
27
|
+
module Jamf
|
28
|
+
|
29
|
+
# Classes
|
30
|
+
#####################################
|
31
|
+
|
32
|
+
# A building defined in the JSS
|
33
|
+
class Building < Jamf::CollectionResource
|
34
|
+
|
35
|
+
# Mix-Ins
|
36
|
+
#####################################
|
37
|
+
|
38
|
+
include Jamf::ChangeLog
|
39
|
+
include Jamf::Referable
|
40
|
+
|
41
|
+
# Constants
|
42
|
+
#####################################
|
43
|
+
|
44
|
+
RSRC_VERSION = 'v1'.freeze
|
45
|
+
|
46
|
+
RSRC_PATH = 'buildings'.freeze
|
47
|
+
|
48
|
+
# Object Model / Attributes
|
49
|
+
# See APIObject class documentation for details
|
50
|
+
# of how the OBJECT_MODEL hash works.
|
51
|
+
#####################################
|
52
|
+
OBJECT_MODEL = {
|
53
|
+
|
54
|
+
# @!attribute [r] id
|
55
|
+
# @return [Integer]
|
56
|
+
id: {
|
57
|
+
class: :integer,
|
58
|
+
identifier: :primary,
|
59
|
+
readonly: true
|
60
|
+
},
|
61
|
+
|
62
|
+
# @!attribute name
|
63
|
+
# @return [String]
|
64
|
+
name: {
|
65
|
+
class: :string,
|
66
|
+
identifier: true,
|
67
|
+
validator: :non_empty_string,
|
68
|
+
required: true
|
69
|
+
},
|
70
|
+
|
71
|
+
# @!attribute street1
|
72
|
+
# @return [String]
|
73
|
+
streetAddress1: {
|
74
|
+
class: :string
|
75
|
+
},
|
76
|
+
|
77
|
+
# @!attribute street2
|
78
|
+
# @return [String]
|
79
|
+
streetAddress2: {
|
80
|
+
class: :string
|
81
|
+
},
|
82
|
+
|
83
|
+
# @!attribute city
|
84
|
+
# @return [String]
|
85
|
+
city: {
|
86
|
+
class: :string
|
87
|
+
},
|
88
|
+
|
89
|
+
# @!attribute state_province
|
90
|
+
# @return [String]
|
91
|
+
stateProvince: {
|
92
|
+
class: :string,
|
93
|
+
aliases: %i[state province]
|
94
|
+
},
|
95
|
+
|
96
|
+
# @!attribute zip_postal_code
|
97
|
+
# @return [String]
|
98
|
+
zipPostalCode: {
|
99
|
+
class: :string,
|
100
|
+
aliases: %i[zip zipcode zip_code postal_code postalcode]
|
101
|
+
},
|
102
|
+
|
103
|
+
# @!attribute country
|
104
|
+
# @return [String]
|
105
|
+
country: {
|
106
|
+
class: :string
|
107
|
+
}
|
108
|
+
}.freeze
|
109
|
+
|
110
|
+
parse_object_model
|
111
|
+
|
112
|
+
end # class
|
113
|
+
|
114
|
+
end # module
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
5
|
+
# with the following modification; you may not use this file except in
|
6
|
+
# compliance with the Apache License and the following modification to it:
|
7
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
8
|
+
#
|
9
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
10
|
+
# names, trademarks, service marks, or product names of the Licensor
|
11
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
12
|
+
# the License and to reproduce the content of the NOTICE file.
|
13
|
+
#
|
14
|
+
# You may obtain a copy of the Apache License at
|
15
|
+
#
|
16
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
#
|
18
|
+
# Unless required by applicable law or agreed to in writing, software
|
19
|
+
# distributed under the Apache License with the above modification is
|
20
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
21
|
+
# KIND, either express or implied. See the Apache License for the specific
|
22
|
+
# language governing permissions and limitations under the Apache License.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
|
26
|
+
# The Module
|
27
|
+
module Jamf
|
28
|
+
|
29
|
+
# Classes
|
30
|
+
#####################################
|
31
|
+
|
32
|
+
# A building defined in the JSS
|
33
|
+
class Category < Jamf::CollectionResource
|
34
|
+
|
35
|
+
# Mix-Ins
|
36
|
+
#####################################
|
37
|
+
|
38
|
+
include Jamf::ChangeLog
|
39
|
+
include Jamf::Referable
|
40
|
+
|
41
|
+
# Constants
|
42
|
+
#####################################
|
43
|
+
|
44
|
+
RSRC_VERSION = 'v2'.freeze
|
45
|
+
|
46
|
+
RSRC_PATH = 'categories'.freeze
|
47
|
+
|
48
|
+
# Object Model / Attributes
|
49
|
+
# See APIObject class documentation for details
|
50
|
+
# of how the OBJECT_MODEL hash works.
|
51
|
+
#####################################
|
52
|
+
OBJECT_MODEL = {
|
53
|
+
|
54
|
+
# @!attribute [r] id
|
55
|
+
# @return [Integer]
|
56
|
+
id: {
|
57
|
+
class: :integer,
|
58
|
+
identifier: :primary,
|
59
|
+
readonly: true
|
60
|
+
},
|
61
|
+
|
62
|
+
# @!attribute name
|
63
|
+
# @return [String]
|
64
|
+
name: {
|
65
|
+
class: :string,
|
66
|
+
identifier: true,
|
67
|
+
validator: :non_empty_string,
|
68
|
+
required: true
|
69
|
+
},
|
70
|
+
|
71
|
+
# @!attribute priority
|
72
|
+
# @return [Integer]
|
73
|
+
priority: {
|
74
|
+
class: :integer
|
75
|
+
}
|
76
|
+
}.freeze
|
77
|
+
|
78
|
+
parse_object_model
|
79
|
+
|
80
|
+
end # class
|
81
|
+
|
82
|
+
end # module
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Copyright 2019 Pixar
|
2
|
+
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
5
|
+
# with the following modification; you may not use this file except in
|
6
|
+
# compliance with the Apache License and the following modification to it:
|
7
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
8
|
+
#
|
9
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
10
|
+
# names, trademarks, service marks, or product names of the Licensor
|
11
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
12
|
+
# the License and to reproduce the content of the NOTICE file.
|
13
|
+
#
|
14
|
+
# You may obtain a copy of the Apache License at
|
15
|
+
#
|
16
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
#
|
18
|
+
# Unless required by applicable law or agreed to in writing, software
|
19
|
+
# distributed under the Apache License with the above modification is
|
20
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
21
|
+
# KIND, either express or implied. See the Apache License for the specific
|
22
|
+
# language governing permissions and limitations under the Apache License.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
|
26
|
+
# The Module
|
27
|
+
module Jamf
|
28
|
+
|
29
|
+
# Classes
|
30
|
+
#####################################
|
31
|
+
|
32
|
+
# A building defined in the JSS
|
33
|
+
class Computer < Jamf::CollectionResource
|
34
|
+
|
35
|
+
# Mix-Ins
|
36
|
+
#####################################
|
37
|
+
include Jamf::Referable
|
38
|
+
|
39
|
+
# Constants
|
40
|
+
#####################################
|
41
|
+
|
42
|
+
RSRC_PATH = 'inventory/obj/computer'.freeze
|
43
|
+
|
44
|
+
OBJECT_MODEL = {}.freeze
|
45
|
+
parse_object_model
|
46
|
+
|
47
|
+
end # class
|
48
|
+
|
49
|
+
end # module
|