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.

Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jamf.rb +169 -0
  3. data/lib/jamf/api/abstract_classes/collection_resource.rb +422 -0
  4. data/lib/jamf/api/abstract_classes/generic_reference.rb +145 -0
  5. data/lib/jamf/api/abstract_classes/json_object.rb +1074 -0
  6. data/lib/jamf/api/abstract_classes/prestage.rb +219 -0
  7. data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +126 -0
  8. data/lib/jamf/api/abstract_classes/resource.rb +250 -0
  9. data/lib/jamf/api/abstract_classes/singleton_resource.rb +87 -0
  10. data/lib/jamf/api/attribute_classes/ip_address.rb +66 -0
  11. data/lib/jamf/api/attribute_classes/timestamp.rb +144 -0
  12. data/lib/jamf/api/connection.rb +734 -0
  13. data/lib/jamf/api/connection/api_error.rb +111 -0
  14. data/lib/jamf/api/connection/api_error_styleguide.rb +96 -0
  15. data/lib/jamf/api/connection/token.rb +220 -0
  16. data/lib/jamf/api/json_objects/account_prefs.rb +79 -0
  17. data/lib/jamf/api/json_objects/android_details.rb +139 -0
  18. data/lib/jamf/api/json_objects/appletv_details.rb +110 -0
  19. data/lib/jamf/api/json_objects/attachment.rb +68 -0
  20. data/lib/jamf/api/json_objects/cellular_network.rb +151 -0
  21. data/lib/jamf/api/json_objects/change_log_entry.rb +77 -0
  22. data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +67 -0
  23. data/lib/jamf/api/json_objects/country.rb +51 -0
  24. data/lib/jamf/api/json_objects/extension_attribute_value.rb +128 -0
  25. data/lib/jamf/api/json_objects/installed_application.rb +59 -0
  26. data/lib/jamf/api/json_objects/installed_certificate.rb +53 -0
  27. data/lib/jamf/api/json_objects/installed_configuration_profile.rb +67 -0
  28. data/lib/jamf/api/json_objects/installed_ebook.rb +58 -0
  29. data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +59 -0
  30. data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +52 -0
  31. data/lib/jamf/api/json_objects/ios_details.rb +244 -0
  32. data/lib/jamf/api/json_objects/location.rb +95 -0
  33. data/lib/jamf/api/json_objects/md_prestage_name.rb +57 -0
  34. data/lib/jamf/api/json_objects/md_prestage_names.rb +82 -0
  35. data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +165 -0
  36. data/lib/jamf/api/json_objects/mobile_device_details.rb +219 -0
  37. data/lib/jamf/api/json_objects/mobile_device_security.rb +101 -0
  38. data/lib/jamf/api/json_objects/prestage_assignment.rb +61 -0
  39. data/lib/jamf/api/json_objects/prestage_location.rb +104 -0
  40. data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +132 -0
  41. data/lib/jamf/api/json_objects/prestage_scope.rb +54 -0
  42. data/lib/jamf/api/json_objects/prestage_sync_status.rb +63 -0
  43. data/lib/jamf/api/json_objects/purchasing_data.rb +125 -0
  44. data/lib/jamf/api/mixins/abstract.rb +58 -0
  45. data/lib/jamf/api/mixins/bulk_deletable.rb +39 -0
  46. data/lib/jamf/api/mixins/change_log.rb +136 -0
  47. data/lib/jamf/api/mixins/extendable.rb +75 -0
  48. data/lib/jamf/api/mixins/immutable.rb +39 -0
  49. data/lib/jamf/api/mixins/locatable.rb +124 -0
  50. data/lib/jamf/api/mixins/lockable.rb +48 -0
  51. data/lib/jamf/api/mixins/referable.rb +92 -0
  52. data/lib/jamf/api/mixins/searchable.rb +202 -0
  53. data/lib/jamf/api/mixins/uncreatable.rb +40 -0
  54. data/lib/jamf/api/mixins/undeletable.rb +40 -0
  55. data/lib/jamf/api/resources/collection_resources/account.rb +163 -0
  56. data/lib/jamf/api/resources/collection_resources/building.rb +114 -0
  57. data/lib/jamf/api/resources/collection_resources/category.rb +82 -0
  58. data/lib/jamf/api/resources/collection_resources/computer.rb +49 -0
  59. data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +80 -0
  60. data/lib/jamf/api/resources/collection_resources/department.rb +79 -0
  61. data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +45 -0
  62. data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +274 -0
  63. data/lib/jamf/api/resources/collection_resources/md_prestage.rb +139 -0
  64. data/lib/jamf/api/resources/collection_resources/mobile_device.rb +315 -0
  65. data/lib/jamf/api/resources/collection_resources/script.rb +190 -0
  66. data/lib/jamf/api/resources/collection_resources/site.rb +77 -0
  67. data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +131 -0
  68. data/lib/jamf/api/resources/singleton_resources/authorization.rb +88 -0
  69. data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +139 -0
  70. data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +95 -0
  71. data/lib/jamf/client.rb +301 -0
  72. data/lib/jamf/client/jamf_binary.rb +132 -0
  73. data/lib/jamf/client/jamf_helper.rb +298 -0
  74. data/lib/jamf/client/management_action.rb +114 -0
  75. data/lib/jamf/compatibility.rb +88 -0
  76. data/lib/jamf/composer.rb +190 -0
  77. data/lib/jamf/configuration.rb +281 -0
  78. data/lib/jamf/exceptions.rb +107 -0
  79. data/lib/jamf/ruby_extensions.rb +36 -0
  80. data/lib/jamf/ruby_extensions/array.rb +35 -0
  81. data/lib/jamf/ruby_extensions/array/predicates.rb +46 -0
  82. data/lib/jamf/ruby_extensions/array/utils.rb +47 -0
  83. data/lib/jamf/ruby_extensions/filetest.rb +32 -0
  84. data/lib/jamf/ruby_extensions/filetest/predicates.rb +46 -0
  85. data/lib/jamf/ruby_extensions/hash.rb +33 -0
  86. data/lib/jamf/ruby_extensions/hash/backports.rb +92 -0
  87. data/lib/jamf/ruby_extensions/ipaddr.rb +37 -0
  88. data/lib/jamf/ruby_extensions/ipaddr/utils.rb +95 -0
  89. data/lib/jamf/ruby_extensions/object.rb +30 -0
  90. data/lib/jamf/ruby_extensions/object/predicates.rb +51 -0
  91. data/lib/jamf/ruby_extensions/pathname.rb +39 -0
  92. data/lib/jamf/ruby_extensions/pathname/predicates.rb +50 -0
  93. data/lib/jamf/ruby_extensions/pathname/utils.rb +75 -0
  94. data/lib/jamf/ruby_extensions/string.rb +35 -0
  95. data/lib/jamf/ruby_extensions/string/backports.rb +66 -0
  96. data/lib/jamf/ruby_extensions/string/conversions.rb +65 -0
  97. data/lib/jamf/ruby_extensions/string/predicates.rb +47 -0
  98. data/lib/jamf/utility.rb +423 -0
  99. data/lib/jamf/validate.rb +224 -0
  100. data/lib/jamf/version.rb +32 -0
  101. data/lib/jpapi.rb +26 -0
  102. data/lib/jss/version.rb +1 -1
  103. metadata +104 -4
@@ -0,0 +1,58 @@
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
+ # The collection of security settings for a device
30
+ class InstalledEBook < Jamf::JSONObject
31
+
32
+ OBJECT_MODEL = {
33
+
34
+ # @!attribute [r] author
35
+ # @return [String]
36
+ author: {
37
+ class: :string,
38
+ readonly: true
39
+ },
40
+
41
+ # @!attribute [r] title
42
+ # @return [String]
43
+ title: {
44
+ class: :string,
45
+ readonly: true
46
+ },
47
+
48
+ # @!attribute [r] version
49
+ # @return [String]
50
+ version: {
51
+ class: :string,
52
+ readonly: true
53
+ }
54
+ }.freeze
55
+ parse_object_model
56
+ end # class Mobile Device security
57
+
58
+ end # module
@@ -0,0 +1,59 @@
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
+ # The collection of security settings for a device
30
+ class InstalledProvisioningProfile < Jamf::JSONObject
31
+
32
+ OBJECT_MODEL = {
33
+
34
+ # @!attribute [r] displayName
35
+ # @return [String]
36
+ displayName: {
37
+ class: :string,
38
+ readonly: true
39
+ },
40
+
41
+ # @!attribute [r] uuid
42
+ # @return [String]
43
+ uuid: {
44
+ class: :string,
45
+ readonly: true
46
+ },
47
+
48
+ # @!attribute [r] expirationDate
49
+ # @return [String]
50
+ expirationDate: {
51
+ class: Jamf::Timestamp,
52
+ readonly: true
53
+ }
54
+
55
+ }.freeze
56
+ parse_object_model
57
+ end # class Mobile Device security
58
+
59
+ end # module
@@ -0,0 +1,52 @@
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
+ class InventoryPreloadExtensionAttribute < Jamf::JSONObject
32
+ OBJECT_MODEL= {
33
+
34
+ # @!attribute name
35
+ # @return [String]
36
+ name: {
37
+ class: :string,
38
+ required: true
39
+ },
40
+
41
+ # @!attribute value
42
+ # @return [#to_s]
43
+ value: {
44
+ class: :string
45
+ }
46
+
47
+ }.freeze
48
+
49
+ parse_object_model
50
+ end # class
51
+
52
+ end # module
@@ -0,0 +1,244 @@
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
+ class IosDetails < Jamf::JSONObject
30
+
31
+ # Class Constants
32
+ #####################################
33
+
34
+ # Since instances of this class are always embedded in the
35
+ # matching MobileDevice instance, duplicated attributes are
36
+ # omitted from OBJECT_MODEL
37
+ OBJECT_MODEL = {
38
+
39
+ # @!attribute [r] model
40
+ # @param [String]
41
+ # @return [String]
42
+ model: {
43
+ class: :string,
44
+ readonly: true
45
+ },
46
+
47
+ # @!attribute [r] modelIdentifier
48
+ # @param [String]
49
+ # @return [String]
50
+ modelIdentifier: {
51
+ class: :string,
52
+ readonly: true
53
+ },
54
+
55
+ # @!attribute [r] modelNumber
56
+ # @param [String]
57
+ # @return [String]
58
+ modelNumber: {
59
+ class: :string,
60
+ readonly: true
61
+ },
62
+
63
+ # @!attribute [r] isSupervised
64
+ # @return [Boolean]
65
+ isSupervised: {
66
+ class: :boolean,
67
+ readonly: true
68
+ },
69
+
70
+ # @!attribute [r] batteryLevel
71
+ # @return [Integer]
72
+ batteryLevel: {
73
+ class: :integer,
74
+ readonly: true
75
+ },
76
+
77
+ # @!attribute [r] lastBackupTimestamp
78
+ # @return [Jamf::Timestamp]
79
+ lastBackupTimestamp: {
80
+ class: Jamf::Timestamp,
81
+ readonly: true,
82
+ aliases: [:lastBackup]
83
+ },
84
+
85
+ # @!attribute [r] capacityMb
86
+ # @return [Integer]
87
+ capacityMb: {
88
+ class: :integer,
89
+ readonly: true
90
+ },
91
+
92
+ # @!attribute [r] availableMb
93
+ # @return [Integer]
94
+ availableMb: {
95
+ class: :integer,
96
+ readonly: true
97
+ },
98
+
99
+ # @!attribute [r] percentageUsed
100
+ # @return [Integer]
101
+ percentageUsed: {
102
+ class: :integer,
103
+ readonly: true
104
+ },
105
+
106
+ # @!attribute [r] isShared
107
+ # @return [Boolean]
108
+ isShared: {
109
+ class: :boolean,
110
+ readonly: true
111
+ },
112
+
113
+ # @!attribute [r] isDeviceLocatorServiceEnabled
114
+ # @return [Boolean]
115
+ isDeviceLocatorServiceEnabled: {
116
+ class: :boolean,
117
+ readonly: true
118
+ },
119
+
120
+ # @!attribute [r] isDoNotDisturbEnabled
121
+ # @return [Boolean]
122
+ isDoNotDisturbEnabled: {
123
+ class: :boolean,
124
+ readonly: true
125
+ },
126
+
127
+ # @!attribute [r] isCloudBackupEnabled
128
+ # @return [Boolean]
129
+ isCloudBackupEnabled: {
130
+ class: :boolean,
131
+ readonly: true
132
+ },
133
+
134
+ # @!attribute lastCloudBackupTimestamp
135
+ # @return [Jamf::Timestamp]
136
+ lastCloudBackupTimestamp: {
137
+ class: Jamf::Timestamp,
138
+ readonly: true,
139
+ aliases: [:lastCloudBackup]
140
+ },
141
+
142
+ # @!attribute [r] isLocationServicesEnabled
143
+ # @return [Boolean]
144
+ isLocationServicesEnabled: {
145
+ class: :boolean,
146
+ readonly: true
147
+ },
148
+
149
+ # @!attribute [r] isITunesStoreAccountActive
150
+ # @return [Boolean]
151
+ isITunesStoreAccountActive: {
152
+ class: :boolean,
153
+ readonly: true
154
+ },
155
+
156
+ # @!attribute [r] isBleCapable
157
+ # @return [Boolean]
158
+ isBleCapable: {
159
+ class: :boolean,
160
+ readonly: true
161
+ },
162
+
163
+ # @!attribute [r] computer
164
+ # @return [Jamf::Computer::Reference]
165
+ computer: {
166
+ class: Jamf::Computer::Reference,
167
+ readonly: true
168
+ },
169
+
170
+ # @!attribute [r] purchasing
171
+ # @return [Jamf::Computer::Reference]
172
+ purchasing: {
173
+ class: Jamf::PurchasingData,
174
+ readonly: true
175
+ },
176
+
177
+ # @!attribute [r] security
178
+ # @return [Jamf::MobileDeviceSecurity]
179
+ security: {
180
+ class: Jamf::MobileDeviceSecurity,
181
+ readonly: true
182
+ },
183
+
184
+ # @!attribute [r] network
185
+ # @return [Jamf::CCellularNetwork]
186
+ network: {
187
+ class: Jamf::CellularNetwork,
188
+ readonly: true
189
+ },
190
+
191
+ # @!attribute [r] applications
192
+ # @return [Jamf::InstalledApplication]
193
+ applications: {
194
+ class: Jamf::InstalledApplication,
195
+ readonly: true,
196
+ multi: true
197
+ },
198
+
199
+ # @!attribute [r] certificates
200
+ # @return [Jamf::InstalledApplication]
201
+ certificates: {
202
+ class: Jamf::InstalledCertificate,
203
+ readonly: true,
204
+ multi: true
205
+ },
206
+
207
+ # @!attribute [r] ebooks
208
+ # @return [Jamf::InstalledApplication]
209
+ ebooks: {
210
+ class: Jamf::InstalledEBook,
211
+ readonly: true,
212
+ multi: true
213
+ },
214
+
215
+ # @!attribute [r] configurationProfiles
216
+ # @return [Jamf::InstalledConfigurationProfile]
217
+ configurationProfiles: {
218
+ class: Jamf::InstalledConfigurationProfile,
219
+ readonly: true,
220
+ multi: true
221
+ },
222
+
223
+ # @!attribute [r] provisioningProfiles
224
+ # @return [Jamf::InstalledConfigurationProfile]
225
+ provisioningProfiles: {
226
+ class: Jamf::InstalledProvisioningProfile,
227
+ readonly: true,
228
+ multi: true
229
+ },
230
+
231
+ # @!attribute [r] attachments
232
+ # @return [Jamf::InstalledConfigurationProfile]
233
+ attachments: {
234
+ class: Jamf::Attachment::Reference,
235
+ readonly: true,
236
+ multi: true
237
+ }
238
+ }.freeze
239
+ parse_object_model
240
+
241
+
242
+ end # class Details
243
+
244
+ end # module
@@ -0,0 +1,95 @@
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
+ # A 'location' for a managed object in Jamf Pro
30
+ class Location < Jamf::JSONObject
31
+
32
+ OBJECT_MODEL = {
33
+
34
+ # @!attribute username
35
+ # @param [String]
36
+ # @return [String]
37
+ username: {
38
+ class: :string
39
+ },
40
+
41
+ # @!attribute realName
42
+ # @param [String]
43
+ # @return [String]
44
+ realName: {
45
+ class: :string
46
+ },
47
+
48
+ # @!attribute emailAddress
49
+ # @param [String]
50
+ # @return [String]
51
+ emailAddress: {
52
+ class: :string
53
+ },
54
+
55
+ # @!attribute position
56
+ # @param [String]
57
+ # @return [String]
58
+ position: {
59
+ class: :string
60
+ },
61
+
62
+ # @!attribute phoneNumber
63
+ # @param [String]
64
+ # @return [String]
65
+ phoneNumber: {
66
+ class: :string
67
+ },
68
+
69
+ # @!attribute department
70
+ # @param [String]
71
+ # @return [String]
72
+ department: {
73
+ class: Jamf::Department::Reference
74
+ },
75
+
76
+ # @!attribute building
77
+ # @param [String]
78
+ # @return [String]
79
+ building: {
80
+ class: Jamf::Building::Reference
81
+ },
82
+
83
+ # @!attribute room
84
+ # @param [String]
85
+ # @return [String]
86
+ room: {
87
+ class: :string
88
+ }
89
+ }.freeze
90
+
91
+ parse_object_model
92
+
93
+ end # class location
94
+
95
+ end # module