ruby-jss 1.6.4 → 2.0.0a10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (705) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/CHANGES.md +40 -4
  4. data/README-2.0.0.md +316 -0
  5. data/README.md +48 -34
  6. data/bin/cgrouper +3 -3
  7. data/bin/jamfHelperBackgrounder +2 -2
  8. data/bin/netseg-update +3 -3
  9. data/data/ruby-jss.conf.example +1 -1
  10. data/lib/{jss/api_object → jamf/api/classic/api_objects}/account.rb +29 -22
  11. data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_computer_search.rb +6 -6
  12. data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_mobile_device_search.rb +6 -6
  13. data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_user_search.rb +6 -6
  14. data/lib/{jss/api_object → jamf/api/classic/api_objects}/building.rb +6 -6
  15. data/lib/{jss/api_object → jamf/api/classic/api_objects}/categorizable.rb +10 -10
  16. data/lib/{jss/api_object → jamf/api/classic/api_objects}/category.rb +17 -15
  17. data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer.rb +210 -111
  18. data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/computer_extension_attribute.rb +19 -19
  19. data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/computer_group.rb +8 -8
  20. data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer_invitation.rb +8 -8
  21. data/lib/{jss/api_object → jamf/api/classic/api_objects}/creatable.rb +22 -24
  22. data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criteria.rb +24 -24
  23. data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criterion.rb +15 -15
  24. data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable.rb +25 -28
  25. data/lib/{jss/api_object → jamf/api/classic/api_objects}/department.rb +7 -7
  26. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding.rb +40 -40
  27. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/active_directory.rb +47 -47
  28. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/admitmac.rb +56 -56
  29. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/centrify.rb +15 -15
  30. data/lib/{jss/api_object → jamf/api/classic/api_objects/directory_binding_type}/directory_binding_type.rb +2 -25
  31. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/open_directory.rb +19 -19
  32. data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/powerbroker_identity_services.rb +1 -1
  33. data/lib/jamf/api/classic/api_objects/directory_binding_type.rb +47 -0
  34. data/lib/{jss/api_object/disk_encryption_configurations.rb → jamf/api/classic/api_objects/disk_encryption_configuration.rb} +14 -14
  35. data/lib/{jss/api_object → jamf/api/classic/api_objects}/distribution_point.rb +41 -35
  36. data/lib/{jss/api_object → jamf/api/classic/api_objects}/dock_item.rb +12 -12
  37. data/lib/{jss/api_object → jamf/api/classic/api_objects}/ebook.rb +3 -3
  38. data/lib/{jss/api_object → jamf/api/classic/api_objects}/extendable.rb +23 -23
  39. data/lib/{jss/api_object → jamf/api/classic/api_objects}/ibeacon.rb +15 -15
  40. data/lib/{jss/api_object/self_servable → jamf/api/classic/api_objects}/icon.rb +8 -8
  41. data/lib/{jss/api_object → jamf/api/classic/api_objects}/ldap_server.rb +45 -34
  42. data/lib/{jss/api_object → jamf/api/classic/api_objects}/locatable.rb +6 -6
  43. data/lib/{jss/api_object → jamf/api/classic/api_objects}/mac_application.rb +18 -18
  44. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/audit_event.rb +4 -4
  45. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_imaging_log.rb +4 -5
  46. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_remote_log.rb +4 -4
  47. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/computer_usage_log.rb +4 -4
  48. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/ebook.rb +7 -7
  49. data/lib/{jss/api_object/management_history/hashlike.rb → jamf/api/classic/api_objects/management_history/hash_like.rb} +3 -3
  50. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mac_app_store_app.rb +4 -4
  51. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mdm_command.rb +9 -9
  52. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mobile_device_app.rb +4 -4
  53. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/policy_log.rb +5 -5
  54. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/screen_sharing_log.rb +4 -4
  55. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/user_location_change.rb +4 -4
  56. data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history.rb +226 -189
  57. data/lib/{jss/api_object → jamf/api/classic/api_objects}/matchable.rb +9 -6
  58. data/lib/{jss/api_object → jamf/api/classic/api_objects}/mdm.rb +256 -151
  59. data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device.rb +55 -39
  60. data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device_application.rb +77 -35
  61. data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/mobile_device_configuration_profile.rb +7 -10
  62. data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/mobile_device_extension_attribute.rb +19 -19
  63. data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/mobile_device_group.rb +8 -8
  64. data/lib/{jss/api_object → jamf/api/classic/api_objects}/netboot_server.rb +6 -6
  65. data/lib/{jss/api_object → jamf/api/classic/api_objects}/network_segment.rb +75 -61
  66. data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/osx_configuration_profile.rb +7 -7
  67. data/lib/{jss/api_object → jamf/api/classic/api_objects}/package.rb +83 -74
  68. data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_external_source.rb +9 -9
  69. data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_internal_source.rb +5 -5
  70. data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_policy.rb +70 -68
  71. data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title/version.rb +15 -15
  72. data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title.rb +76 -64
  73. data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral.rb +24 -24
  74. data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral_type.rb +20 -20
  75. data/lib/{jss/api_object → jamf/api/classic/api_objects}/policy.rb +113 -112
  76. data/lib/{jss/api_object → jamf/api/classic/api_objects}/printer.rb +52 -52
  77. data/lib/{jss/api_object → jamf/api/classic/api_objects}/purchasable.rb +6 -6
  78. data/lib/{jss/api_object → jamf/api/classic/api_objects}/removable_macaddr.rb +7 -7
  79. data/lib/{jss/api_object → jamf/api/classic/api_objects}/restricted_software.rb +21 -21
  80. data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable/scope.rb +69 -64
  81. data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable.rb +11 -13
  82. data/lib/{jss/api_object → jamf/api/classic/api_objects}/script.rb +22 -22
  83. data/lib/{jss/api_object → jamf/api/classic/api_objects}/self_servable.rb +49 -47
  84. data/lib/{jss/api_object → jamf/api/classic/api_objects}/sitable.rb +8 -8
  85. data/lib/{jss/api_object → jamf/api/classic/api_objects}/site.rb +6 -6
  86. data/lib/{jss/api_object → jamf/api/classic/api_objects}/software_update_server.rb +5 -5
  87. data/lib/{jss/api_object → jamf/api/classic/api_objects}/updatable.rb +13 -13
  88. data/lib/{jss/api_object → jamf/api/classic/api_objects}/uploadable.rb +71 -29
  89. data/lib/{jss/api_object → jamf/api/classic/api_objects}/user.rb +18 -18
  90. data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/user_extension_attribute.rb +12 -12
  91. data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/user_group.rb +7 -7
  92. data/lib/{jss/api_object → jamf/api/classic/api_objects}/vpp_account.rb +15 -15
  93. data/lib/{jss/api_object → jamf/api/classic/api_objects}/vppable.rb +5 -5
  94. data/lib/{jss/api_object/webhook.rb → jamf/api/classic/api_objects/web_hook.rb} +15 -15
  95. data/lib/{jss/api_object → jamf/api/classic/base_classes}/advanced_search.rb +36 -40
  96. data/lib/{jss → jamf/api/classic/base_classes}/api_object.rb +314 -274
  97. data/lib/{jss/api_object → jamf/api/classic/base_classes}/configuration_profile.rb +13 -16
  98. data/lib/{jss/api_object → jamf/api/classic/base_classes}/extension_attribute.rb +55 -59
  99. data/lib/{jss/api_object → jamf/api/classic/base_classes}/group.rb +45 -43
  100. data/lib/{jss/api_object → jamf/api/classic/base_classes}/patch_source.rb +107 -87
  101. data/lib/{jss → jamf/api/classic}/xml_workaround.rb +12 -12
  102. data/lib/jamf/api/connection/attributes.rb +177 -0
  103. data/lib/jamf/api/connection/cache.rb +148 -0
  104. data/lib/jamf/api/connection/classic_api.rb +287 -0
  105. data/lib/jamf/api/connection/connect.rb +491 -0
  106. data/lib/jamf/api/connection/constants.rb +106 -0
  107. data/lib/jamf/api/connection/default_connection.rb +103 -0
  108. data/lib/jamf/api/connection/jamf_pro_api.rb +170 -0
  109. data/lib/jamf/api/connection/jamf_pro_api_error.rb +109 -0
  110. data/lib/jamf/api/connection/token.rb +289 -99
  111. data/lib/jamf/api/connection.rb +186 -819
  112. data/lib/jamf/api/jamf_pro/api_objects/computer_prestage.rb +82 -0
  113. data/lib/jamf/api/jamf_pro/api_objects/device_enrollment.rb +358 -0
  114. data/lib/jamf/api/jamf_pro/api_objects/inventory_preload_record.rb +163 -0
  115. data/lib/jamf/api/jamf_pro/api_objects/jp_building.rb +116 -0
  116. data/lib/jamf/api/jamf_pro/api_objects/mobile_device_prestage.rb +87 -0
  117. data/lib/jamf/api/jamf_pro/base_classes/oapi_object.rb +602 -0
  118. data/lib/jamf/api/{mixins → jamf_pro/mixins}/bulk_deletable.rb +2 -1
  119. data/lib/jamf/api/jamf_pro/mixins/change_log.rb +246 -0
  120. data/lib/jamf/api/jamf_pro/mixins/collection_resource.rb +762 -0
  121. data/lib/jamf/api/{mixins → jamf_pro/mixins}/filterable.rb +21 -14
  122. data/lib/jamf/api/{mixins → jamf_pro/mixins}/immutable.rb +6 -8
  123. data/lib/jamf/api/jamf_pro/mixins/jpapi_resource.rb +167 -0
  124. data/lib/jamf/api/{mixins → jamf_pro/mixins}/lockable.rb +29 -3
  125. data/lib/jamf/api/jamf_pro/mixins/prestage.rb +346 -0
  126. data/lib/jamf/api/{mixins → jamf_pro/mixins}/sortable.rb +7 -17
  127. data/lib/jamf/api/{mixins → jamf_pro/mixins}/uncreatable.rb +2 -2
  128. data/lib/jamf/api/{mixins → jamf_pro/mixins}/undeletable.rb +2 -2
  129. data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_preview_search_results.rb +90 -0
  130. data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_search_results.rb +90 -0
  131. data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_v2_search_results.rb +90 -0
  132. data/lib/jamf/api/jamf_pro/oapi_schemas/account.rb +160 -0
  133. data/lib/jamf/api/jamf_pro/oapi_schemas/account_group.rb +124 -0
  134. data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences.rb +108 -0
  135. data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v1.rb +106 -0
  136. data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v4.rb +118 -0
  137. data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history.rb +161 -0
  138. data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history_search_results.rb +90 -0
  139. data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_summary.rb +132 -0
  140. data/lib/jamf/api/jamf_pro/oapi_schemas/admin_account.rb +83 -0
  141. data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search.rb +117 -0
  142. data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_criteria_choices.rb +84 -0
  143. data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_search_results.rb +90 -0
  144. data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search.rb +117 -0
  145. data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search_search_results.rb +90 -0
  146. data/lib/jamf/api/jamf_pro/oapi_schemas/android_details.rb +163 -0
  147. data/lib/jamf/api/jamf_pro/oapi_schemas/api_error.rb +90 -0
  148. data/lib/jamf/api/jamf_pro/oapi_schemas/api_error_cause.rb +107 -0
  149. data/lib/jamf/api/jamf_pro/oapi_schemas/app_analytics_setting.rb +88 -0
  150. data/lib/jamf/api/jamf_pro/oapi_schemas/app_dynamics_config.rb +134 -0
  151. data/lib/jamf/api/jamf_pro/oapi_schemas/app_path.rb +91 -0
  152. data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field.rb +115 -0
  153. data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field_search_results.rb +90 -0
  154. data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_settings.rb +105 -0
  155. data/lib/jamf/api/jamf_pro/oapi_schemas/apple_tv_details.rb +133 -0
  156. data/lib/jamf/api/jamf_pro/oapi_schemas/application_attributes.rb +88 -0
  157. data/lib/jamf/api/jamf_pro/oapi_schemas/application_configuration.rb +88 -0
  158. data/lib/jamf/api/jamf_pro/oapi_schemas/assign_remove_profile_response_sync_state.rb +113 -0
  159. data/lib/jamf/api/jamf_pro/oapi_schemas/attributes.rb +101 -0
  160. data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account.rb +159 -0
  161. data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account_v1.rb +159 -0
  162. data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token.rb +91 -0
  163. data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token_v1.rb +91 -0
  164. data/lib/jamf/api/jamf_pro/oapi_schemas/authorization.rb +117 -0
  165. data/lib/jamf/api/jamf_pro/oapi_schemas/authorization_v1.rb +117 -0
  166. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_process_status.rb +116 -0
  167. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_request.rb +103 -0
  168. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration.rb +95 -0
  169. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_request.rb +93 -0
  170. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_update.rb +93 -0
  171. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_mappings.rb +158 -0
  172. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration.rb +147 -0
  173. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_request.rb +146 -0
  174. data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_update.rb +132 -0
  175. data/lib/jamf/api/jamf_pro/oapi_schemas/branding_image_url.rb +87 -0
  176. data/lib/jamf/api/jamf_pro/oapi_schemas/building.rb +138 -0
  177. data/lib/jamf/api/jamf_pro/oapi_schemas/building_search_results.rb +90 -0
  178. data/lib/jamf/api/jamf_pro/oapi_schemas/cache_settings.rb +150 -0
  179. data/lib/jamf/api/jamf_pro/oapi_schemas/categories_search_results.rb +90 -0
  180. data/lib/jamf/api/jamf_pro/oapi_schemas/category.rb +104 -0
  181. data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_details.rb +91 -0
  182. data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_identity_v1.rb +102 -0
  183. data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_identity_v2.rb +108 -0
  184. data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_key.rb +90 -0
  185. data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_record.rb +147 -0
  186. data/lib/jamf/api/jamf_pro/oapi_schemas/classic_ldap_mappings.rb +169 -0
  187. data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v2.rb +165 -0
  188. data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v3.rb +135 -0
  189. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common.rb +109 -0
  190. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_request.rb +98 -0
  191. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_response.rb +109 -0
  192. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_pool_statistics.rb +175 -0
  193. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_status.rb +84 -0
  194. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore.rb +104 -0
  195. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore_file.rb +106 -0
  196. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_request.rb +106 -0
  197. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_response.rb +109 -0
  198. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_request.rb +152 -0
  199. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_response.rb +149 -0
  200. data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_update.rb +149 -0
  201. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_application.rb +125 -0
  202. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_attachment.rb +103 -0
  203. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_certificate.rb +128 -0
  204. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_configuration_profile.rb +119 -0
  205. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching.rb +373 -0
  206. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_alert.rb +121 -0
  207. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_cache_detail.rb +98 -0
  208. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error.rb +99 -0
  209. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error_user_info.rb +90 -0
  210. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent.rb +132 -0
  211. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_alert.rb +106 -0
  212. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_capabilities.rb +125 -0
  213. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_details.rb +119 -0
  214. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_local_network.rb +98 -0
  215. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk.rb +144 -0
  216. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk_encryption.rb +121 -0
  217. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_extension_attribute.rb +176 -0
  218. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_font.rb +94 -0
  219. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general.rb +231 -0
  220. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general_update.rb +113 -0
  221. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware.rb +265 -0
  222. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware_update.rb +107 -0
  223. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_ibeacon.rb +82 -0
  224. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_preferences.rb +166 -0
  225. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_settings.rb +109 -0
  226. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_recovery_lock_password_response.rb +84 -0
  227. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_response.rb +276 -0
  228. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_search_results.rb +90 -0
  229. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_update_request.rb +125 -0
  230. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_licensed_software.rb +89 -0
  231. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_local_user_account.rb +190 -0
  232. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_location.rb +94 -0
  233. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_mdm_capability.rb +89 -0
  234. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system.rb +133 -0
  235. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system_update.rb +83 -0
  236. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_overview.rb +180 -0
  237. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_package_receipts.rb +98 -0
  238. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition.rb +146 -0
  239. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_encryption.rb +94 -0
  240. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_file_vault2_state.rb +98 -0
  241. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_plugin.rb +94 -0
  242. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage.rb +107 -0
  243. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results.rb +90 -0
  244. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results_v2.rb +90 -0
  245. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_v2.rb +130 -0
  246. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_printer.rb +100 -0
  247. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_purchase.rb +159 -0
  248. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_remote_management.rb +95 -0
  249. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_section.rb +110 -0
  250. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_security.rb +180 -0
  251. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_service.rb +82 -0
  252. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_software_update.rb +94 -0
  253. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_storage.rb +91 -0
  254. data/lib/jamf/api/jamf_pro/oapi_schemas/computer_user_and_location.rb +132 -0
  255. data/lib/jamf/api/jamf_pro/oapi_schemas/computers_search_results.rb +90 -0
  256. data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_profile.rb +103 -0
  257. data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_search_results.rb +91 -0
  258. data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_candidate_request.rb +124 -0
  259. data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_response.rb +123 -0
  260. data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_status_response.rb +86 -0
  261. data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_update_request.rb +110 -0
  262. data/lib/jamf/api/jamf_pro/oapi_schemas/country.rb +88 -0
  263. data/lib/jamf/api/jamf_pro/oapi_schemas/country_codes.rb +84 -0
  264. data/lib/jamf/api/jamf_pro/oapi_schemas/create_path.rb +98 -0
  265. data/lib/jamf/api/jamf_pro/oapi_schemas/csa_token.rb +94 -0
  266. data/lib/jamf/api/jamf_pro/oapi_schemas/current_account.rb +160 -0
  267. data/lib/jamf/api/jamf_pro/oapi_schemas/current_authorization.rb +109 -0
  268. data/lib/jamf/api/jamf_pro/oapi_schemas/data_roaming_setting.rb +88 -0
  269. data/lib/jamf/api/jamf_pro/oapi_schemas/database_password.rb +89 -0
  270. data/lib/jamf/api/jamf_pro/oapi_schemas/day_of_week.rb +93 -0
  271. data/lib/jamf/api/jamf_pro/oapi_schemas/delete_user_command.rb +94 -0
  272. data/lib/jamf/api/jamf_pro/oapi_schemas/department.rb +98 -0
  273. data/lib/jamf/api/jamf_pro/oapi_schemas/departments_search_results.rb +90 -0
  274. data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task.rb +130 -0
  275. data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task_search_results.rb +92 -0
  276. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_configuration_request.rb +92 -0
  277. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_configuration_response.rb +105 -0
  278. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_configuration_search_results.rb +91 -0
  279. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_configuration_update.rb +92 -0
  280. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_server_request.rb +166 -0
  281. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_server_response.rb +163 -0
  282. data/lib/jamf/api/jamf_pro/oapi_schemas/deprecated_server_update.rb +171 -0
  283. data/lib/jamf/api/jamf_pro/oapi_schemas/device_communication_settings.rb +129 -0
  284. data/lib/jamf/api/jamf_pro/oapi_schemas/device_compliance_information.rb +118 -0
  285. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device.rb +163 -0
  286. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device_search_results.rb +90 -0
  287. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_body.rb +84 -0
  288. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_response.rb +83 -0
  289. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance.rb +164 -0
  290. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_search_results.rb +90 -0
  291. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_sync_status.rb +99 -0
  292. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage.rb +216 -0
  293. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage_v2.rb +235 -0
  294. data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_token.rb +95 -0
  295. data/lib/jamf/api/jamf_pro/oapi_schemas/diagnostic_submission_setting.rb +88 -0
  296. data/lib/jamf/api/jamf_pro/oapi_schemas/ebook.rb +153 -0
  297. data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_exclusions.rb +138 -0
  298. data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_limitations.rb +98 -0
  299. data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_scope.rb +171 -0
  300. data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_search_results.rb +90 -0
  301. data/lib/jamf/api/jamf_pro/oapi_schemas/enable_lost_mode_command.rb +94 -0
  302. data/lib/jamf/api/jamf_pro/oapi_schemas/engage.rb +85 -0
  303. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group.rb +123 -0
  304. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_preview.rb +135 -0
  305. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_v2.rb +133 -0
  306. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization.rb +107 -0
  307. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_branding_settings.rb +112 -0
  308. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependencies.rb +84 -0
  309. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependency.rb +94 -0
  310. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_ldap_group_access.rb +88 -0
  311. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel.rb +90 -0
  312. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_ldap_auth.rb +122 -0
  313. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_list.rb +84 -0
  314. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_sso_auth.rb +114 -0
  315. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_text.rb +113 -0
  316. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results.rb +90 -0
  317. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results_v2.rb +90 -0
  318. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_v2.rb +116 -0
  319. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_method.rb +98 -0
  320. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_process_text_object.rb +347 -0
  321. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_settings.rb +264 -0
  322. data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_settings_v2.rb +274 -0
  323. data/lib/jamf/api/jamf_pro/oapi_schemas/export_field.rb +92 -0
  324. data/lib/jamf/api/jamf_pro/oapi_schemas/export_parameters.rb +118 -0
  325. data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute.rb +116 -0
  326. data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute_v2.rb +117 -0
  327. data/lib/jamf/api/jamf_pro/oapi_schemas/external_recipient.rb +92 -0
  328. data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment.rb +90 -0
  329. data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_delete.rb +84 -0
  330. data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_v2.rb +90 -0
  331. data/lib/jamf/api/jamf_pro/oapi_schemas/filter.rb +105 -0
  332. data/lib/jamf/api/jamf_pro/oapi_schemas/font_path.rb +91 -0
  333. data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage.rb +106 -0
  334. data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage_v2.rb +105 -0
  335. data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization.rb +88 -0
  336. data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel.rb +90 -0
  337. data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_ldap_auth.rb +94 -0
  338. data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_sso_auth.rb +94 -0
  339. data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_text.rb +94 -0
  340. data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage.rb +106 -0
  341. data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage_v2.rb +104 -0
  342. data/lib/jamf/api/jamf_pro/oapi_schemas/group_mappings.rb +139 -0
  343. data/lib/jamf/api/jamf_pro/oapi_schemas/group_membership.rb +95 -0
  344. data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search.rb +107 -0
  345. data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_request.rb +86 -0
  346. data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_response.rb +92 -0
  347. data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results.rb +142 -0
  348. data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results_v1.rb +92 -0
  349. data/lib/jamf/api/jamf_pro/oapi_schemas/href_response.rb +169 -0
  350. data/lib/jamf/api/jamf_pro/oapi_schemas/icon_response.rb +92 -0
  351. data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name.rb +93 -0
  352. data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name_v2.rb +89 -0
  353. data/lib/jamf/api/jamf_pro/oapi_schemas/ids.rb +96 -0
  354. data/lib/jamf/api/jamf_pro/oapi_schemas/initialize.rb +134 -0
  355. data/lib/jamf/api/jamf_pro/oapi_schemas/initialize_v1.rb +134 -0
  356. data/lib/jamf/api/jamf_pro/oapi_schemas/install_package.rb +104 -0
  357. data/lib/jamf/api/jamf_pro/oapi_schemas/integer_wrapper.rb +85 -0
  358. data/lib/jamf/api/jamf_pro/oapi_schemas/internal_recipient.rb +95 -0
  359. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_information.rb +114 -0
  360. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_error.rb +124 -0
  361. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error.rb +90 -0
  362. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error_cause.rb +106 -0
  363. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_success.rb +87 -0
  364. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute.rb +90 -0
  365. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column.rb +88 -0
  366. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column_result.rb +90 -0
  367. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_invalid_csv_response.rb +89 -0
  368. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record.rb +249 -0
  369. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results.rb +92 -0
  370. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results_v2.rb +90 -0
  371. data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_v2.rb +264 -0
  372. data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_configuration.rb +130 -0
  373. data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_search_results.rb +90 -0
  374. data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details.rb +256 -0
  375. data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details_v2.rb +256 -0
  376. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_application_response.rb +96 -0
  377. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_nation_credentials.rb +91 -0
  378. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_package_response.rb +108 -0
  379. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_information.rb +125 -0
  380. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_server_url.rb +93 -0
  381. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_version.rb +83 -0
  382. data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_protect_plan.rb +126 -0
  383. data/lib/jamf/api/jamf_pro/oapi_schemas/language_code.rb +95 -0
  384. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_request.rb +100 -0
  385. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_response.rb +102 -0
  386. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_update.rb +100 -0
  387. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group.rb +108 -0
  388. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group_search_results.rb +92 -0
  389. data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_server.rb +95 -0
  390. data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile.rb +127 -0
  391. data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile_search_results.rb +90 -0
  392. data/lib/jamf/api/jamf_pro/oapi_schemas/locale.rb +89 -0
  393. data/lib/jamf/api/jamf_pro/oapi_schemas/location.rb +126 -0
  394. data/lib/jamf/api/jamf_pro/oapi_schemas/location_information.rb +147 -0
  395. data/lib/jamf/api/jamf_pro/oapi_schemas/location_information_v2.rb +147 -0
  396. data/lib/jamf/api/jamf_pro/oapi_schemas/location_v2.rb +125 -0
  397. data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_configuration.rb +119 -0
  398. data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_search_results.rb +90 -0
  399. data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update.rb +113 -0
  400. data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update_response.rb +92 -0
  401. data/lib/jamf/api/jamf_pro/oapi_schemas/markdown.rb +85 -0
  402. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_client_type.rb +91 -0
  403. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command.rb +110 -0
  404. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_client.rb +89 -0
  405. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_request.rb +90 -0
  406. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_state.rb +90 -0
  407. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_type.rb +173 -0
  408. data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_signing_certificate.rb +102 -0
  409. data/lib/jamf/api/jamf_pro/oapi_schemas/membership_mappings.rb +85 -0
  410. data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_request.rb +93 -0
  411. data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_response.rb +91 -0
  412. data/lib/jamf/api/jamf_pro/oapi_schemas/memcached_endpoints.rb +114 -0
  413. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device.rb +154 -0
  414. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_application.rb +101 -0
  415. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment.rb +90 -0
  416. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment_v2.rb +90 -0
  417. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v1.rb +88 -0
  418. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v2.rb +88 -0
  419. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details.rb +236 -0
  420. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_get_v2.rb +84 -0
  421. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_v2.rb +254 -0
  422. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_ebook.rb +95 -0
  423. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_extension_attribute_results.rb +84 -0
  424. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_group.rb +97 -0
  425. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage.rb +137 -0
  426. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name.rb +95 -0
  427. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name_v2.rb +95 -0
  428. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names.rb +119 -0
  429. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names_v2.rb +119 -0
  430. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results.rb +90 -0
  431. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results_v2.rb +90 -0
  432. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_v2.rb +176 -0
  433. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_params.rb +145 -0
  434. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results.rb +90 -0
  435. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results_v2.rb +90 -0
  436. data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_v2.rb +159 -0
  437. data/lib/jamf/api/jamf_pro/oapi_schemas/network.rb +172 -0
  438. data/lib/jamf/api/jamf_pro/oapi_schemas/network_v2.rb +180 -0
  439. data/lib/jamf/api/jamf_pro/oapi_schemas/notification.rb +97 -0
  440. data/lib/jamf/api/jamf_pro/oapi_schemas/notification_type.rb +141 -0
  441. data/lib/jamf/api/jamf_pro/oapi_schemas/notification_v1.rb +97 -0
  442. data/lib/jamf/api/jamf_pro/oapi_schemas/object_history.rb +138 -0
  443. data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_note.rb +138 -0
  444. data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_v1.rb +107 -0
  445. data/lib/jamf/api/jamf_pro/oapi_schemas/order_by.rb +96 -0
  446. data/lib/jamf/api/jamf_pro/oapi_schemas/package_manifest.rb +149 -0
  447. data/lib/jamf/api/jamf_pro/oapi_schemas/parent_app.rb +131 -0
  448. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_ids_on_dashboard.rb +84 -0
  449. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt.rb +103 -0
  450. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt_action.rb +95 -0
  451. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log.rb +125 -0
  452. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log_search_results.rb +90 -0
  453. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_on_dashboard.rb +83 -0
  454. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_summary.rb +147 -0
  455. data/lib/jamf/api/jamf_pro/oapi_schemas/patch_version.rb +97 -0
  456. data/lib/jamf/api/jamf_pro/oapi_schemas/personal_hotspot_setting.rb +88 -0
  457. data/lib/jamf/api/jamf_pro/oapi_schemas/plan_search_results.rb +90 -0
  458. data/lib/jamf/api/jamf_pro/oapi_schemas/plugin_path.rb +91 -0
  459. data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties.rb +92 -0
  460. data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties_v1.rb +92 -0
  461. data/lib/jamf/api/jamf_pro/oapi_schemas/post_computer_prestage_v2.rb +86 -0
  462. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependencies.rb +86 -0
  463. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependency.rb +94 -0
  464. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment.rb +96 -0
  465. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment_v2.rb +96 -0
  466. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information.rb +175 -0
  467. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information_v2.rb +175 -0
  468. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope.rb +85 -0
  469. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment.rb +94 -0
  470. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment_v2.rb +95 -0
  471. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response.rb +110 -0
  472. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response_v2.rb +110 -0
  473. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_update.rb +114 -0
  474. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_v2.rb +85 -0
  475. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status.rb +99 -0
  476. data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status_v2.rb +99 -0
  477. data/lib/jamf/api/jamf_pro/oapi_schemas/process_texts_search_results.rb +92 -0
  478. data/lib/jamf/api/jamf_pro/oapi_schemas/protect_registration_request.rb +99 -0
  479. data/lib/jamf/api/jamf_pro/oapi_schemas/protect_settings_response.rb +142 -0
  480. data/lib/jamf/api/jamf_pro/oapi_schemas/protect_updatable_settings_request.rb +84 -0
  481. data/lib/jamf/api/jamf_pro/oapi_schemas/provisioning_profile.rb +96 -0
  482. data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing.rb +154 -0
  483. data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing_v2.rb +154 -0
  484. data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage.rb +83 -0
  485. data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage_v2.rb +92 -0
  486. data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage.rb +83 -0
  487. data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage_v2.rb +83 -0
  488. data/lib/jamf/api/jamf_pro/oapi_schemas/recalculation_results.rb +93 -0
  489. data/lib/jamf/api/jamf_pro/oapi_schemas/recipient.rb +95 -0
  490. data/lib/jamf/api/jamf_pro/oapi_schemas/recipients.rb +83 -0
  491. data/lib/jamf/api/jamf_pro/oapi_schemas/redeploy_jamf_management_framework_response.rb +89 -0
  492. data/lib/jamf/api/jamf_pro/oapi_schemas/reenrollment.rb +118 -0
  493. data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_response.rb +108 -0
  494. data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_search_results.rb +91 -0
  495. data/lib/jamf/api/jamf_pro/oapi_schemas/renew_mdm_profile_response.rb +83 -0
  496. data/lib/jamf/api/jamf_pro/oapi_schemas/restart_device_command.rb +96 -0
  497. data/lib/jamf/api/jamf_pro/oapi_schemas/retry_patch_policy_params.rb +98 -0
  498. data/lib/jamf/api/jamf_pro/oapi_schemas/safelisted_apps.rb +85 -0
  499. data/lib/jamf/api/jamf_pro/oapi_schemas/script.rb +193 -0
  500. data/lib/jamf/api/jamf_pro/oapi_schemas/scripts_search_results.rb +90 -0
  501. data/lib/jamf/api/jamf_pro/oapi_schemas/search_active_patch_history_params.rb +122 -0
  502. data/lib/jamf/api/jamf_pro/oapi_schemas/search_patch_policy_log_params.rb +122 -0
  503. data/lib/jamf/api/jamf_pro/oapi_schemas/security.rb +131 -0
  504. data/lib/jamf/api/jamf_pro/oapi_schemas/security_v2.rb +130 -0
  505. data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_install_settings.rb +93 -0
  506. data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_interaction_settings.rb +123 -0
  507. data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_login_settings.rb +114 -0
  508. data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_settings.rb +101 -0
  509. data/lib/jamf/api/jamf_pro/oapi_schemas/session.rb +83 -0
  510. data/lib/jamf/api/jamf_pro/oapi_schemas/session_candidate_request.rb +109 -0
  511. data/lib/jamf/api/jamf_pro/oapi_schemas/session_details.rb +176 -0
  512. data/lib/jamf/api/jamf_pro/oapi_schemas/session_details_search_results.rb +91 -0
  513. data/lib/jamf/api/jamf_pro/oapi_schemas/session_status.rb +99 -0
  514. data/lib/jamf/api/jamf_pro/oapi_schemas/set_recovery_lock_command.rb +83 -0
  515. data/lib/jamf/api/jamf_pro/oapi_schemas/settings_command.rb +168 -0
  516. data/lib/jamf/api/jamf_pro/oapi_schemas/shared_device_configuration.rb +88 -0
  517. data/lib/jamf/api/jamf_pro/oapi_schemas/signature.rb +94 -0
  518. data/lib/jamf/api/jamf_pro/oapi_schemas/site.rb +92 -0
  519. data/lib/jamf/api/jamf_pro/oapi_schemas/smart_search_criterion.rb +119 -0
  520. data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_configuration.rb +90 -0
  521. data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_patch_policy_summaries.rb +90 -0
  522. data/lib/jamf/api/jamf_pro/oapi_schemas/software_update_settings.rb +89 -0
  523. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore.rb +129 -0
  524. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_cert_parse_response.rb +131 -0
  525. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_details.rb +108 -0
  526. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_parse.rb +104 -0
  527. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response.rb +121 -0
  528. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response_with_details.rb +94 -0
  529. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_with_details.rb +94 -0
  530. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_metadata_url.rb +84 -0
  531. data/lib/jamf/api/jamf_pro/oapi_schemas/sso_settings.rb +241 -0
  532. data/lib/jamf/api/jamf_pro/oapi_schemas/startup_status.rb +186 -0
  533. data/lib/jamf/api/jamf_pro/oapi_schemas/static_user_group.rb +92 -0
  534. data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity.rb +108 -0
  535. data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_certificate_upload.rb +100 -0
  536. data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_create.rb +91 -0
  537. data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_search_results.rb +90 -0
  538. data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_update.rb +84 -0
  539. data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_features.rb +106 -0
  540. data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_request.rb +108 -0
  541. data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_response.rb +122 -0
  542. data/lib/jamf/api/jamf_pro/oapi_schemas/time_frame.rb +88 -0
  543. data/lib/jamf/api/jamf_pro/oapi_schemas/time_zone.rb +108 -0
  544. data/lib/jamf/api/jamf_pro/oapi_schemas/tv_os_details.rb +133 -0
  545. data/lib/jamf/api/jamf_pro/oapi_schemas/udids.rb +84 -0
  546. data/lib/jamf/api/jamf_pro/oapi_schemas/update_apple_tv.rb +88 -0
  547. data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios.rb +82 -0
  548. data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios_v2.rb +82 -0
  549. data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device.rb +123 -0
  550. data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device_v2.rb +138 -0
  551. data/lib/jamf/api/jamf_pro/oapi_schemas/update_tv_os.rb +88 -0
  552. data/lib/jamf/api/jamf_pro/oapi_schemas/user_attributes.rb +118 -0
  553. data/lib/jamf/api/jamf_pro/oapi_schemas/user_mappings.rb +194 -0
  554. data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search.rb +113 -0
  555. data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_request.rb +86 -0
  556. data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_response.rb +92 -0
  557. data/lib/jamf/api/jamf_pro/oapi_schemas/v1_site.rb +91 -0
  558. data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_ca_record.rb +148 -0
  559. data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record.rb +88 -0
  560. data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record_search_results.rb +90 -0
  561. data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_service_status.rb +84 -0
  562. data/lib/jamf/api/jamf_pro/oapi_schemas/verbose_package_deployment_response.rb +91 -0
  563. data/lib/jamf/api/jamf_pro/oapi_schemas/voice_roaming_setting.rb +88 -0
  564. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_content.rb +154 -0
  565. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location.rb +87 -0
  566. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_list_view.rb +172 -0
  567. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_patch.rb +112 -0
  568. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_post.rb +115 -0
  569. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_locations.rb +90 -0
  570. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription.rb +87 -0
  571. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription_base.rb +128 -0
  572. data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscriptions.rb +90 -0
  573. data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_admin_account.rb +120 -0
  574. data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_token_subscription.rb +124 -0
  575. data/lib/jamf/api/jamf_pro/oapi_schemas/web_link.rb +88 -0
  576. data/lib/jamf/api/jamf_pro/oapi_schemas.rb +35 -0
  577. data/lib/{jss/ruby_extensions/string.rb → jamf/api/jamf_pro/other_classes/change_log_entry.rb} +12 -10
  578. data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/ip_address.rb +2 -8
  579. data/lib/jamf/api/jamf_pro/other_classes/pager.rb +257 -0
  580. data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/timestamp.rb +18 -14
  581. data/lib/jamf/{api/mixins/base_class.rb → base_class.rb} +8 -8
  582. data/lib/jamf/client/jamf_binary.rb +104 -98
  583. data/lib/jamf/client/jamf_helper.rb +263 -255
  584. data/lib/jamf/client/management_action.rb +71 -72
  585. data/lib/jamf/client.rb +15 -86
  586. data/lib/jamf/composer.rb +5 -5
  587. data/lib/jamf/configuration.rb +219 -196
  588. data/lib/jamf/{api/json_objects/prestage_sync_status.rb → constants.rb} +15 -32
  589. data/lib/{jss → jamf}/db_connection.rb +23 -31
  590. data/lib/{jpapi.rb → jamf/deprecations/deprecated_api_constant.rb} +3 -4
  591. data/lib/jamf/deprecations/deprecated_config_constant.rb +25 -0
  592. data/lib/jamf/exceptions.rb +14 -15
  593. data/lib/jamf/oapi_validate.rb +502 -0
  594. data/lib/jamf/ruby_extensions/array/predicates.rb +3 -1
  595. data/lib/jamf/ruby_extensions/array/utils.rb +2 -11
  596. data/lib/jamf/ruby_extensions/array.rb +1 -1
  597. data/lib/jamf/ruby_extensions/filetest/predicates.rb +2 -1
  598. data/lib/jamf/ruby_extensions/filetest.rb +1 -1
  599. data/lib/jamf/ruby_extensions/hash/{backports.rb → utils.rb} +53 -34
  600. data/lib/jamf/ruby_extensions/hash.rb +3 -3
  601. data/lib/jamf/ruby_extensions/ipaddr/utils.rb +7 -4
  602. data/lib/jamf/ruby_extensions/ipaddr.rb +2 -2
  603. data/lib/jamf/ruby_extensions/object/predicates.rb +3 -1
  604. data/lib/jamf/ruby_extensions/object.rb +1 -1
  605. data/lib/jamf/ruby_extensions/pathname/predicates.rb +3 -1
  606. data/lib/jamf/ruby_extensions/pathname/utils.rb +11 -5
  607. data/lib/jamf/ruby_extensions/pathname.rb +1 -1
  608. data/lib/jamf/ruby_extensions/string/conversions.rb +16 -1
  609. data/lib/jamf/ruby_extensions/string/predicates.rb +3 -1
  610. data/lib/jamf/ruby_extensions/string.rb +1 -3
  611. data/lib/{jss/ruby_extensions/time.rb → jamf/ruby_extensions/time/utils.rb} +40 -25
  612. data/lib/{jss/version.rb → jamf/ruby_extensions/time.rb} +7 -6
  613. data/lib/jamf/ruby_extensions.rb +9 -9
  614. data/lib/jamf/utility.rb +626 -410
  615. data/lib/jamf/validate.rb +86 -125
  616. data/lib/jamf/version.rb +3 -3
  617. data/lib/jamf.rb +76 -131
  618. data/lib/jss-api.rb +2 -2
  619. data/lib/jss.rb +3 -215
  620. data/lib/ruby-jss.rb +2 -2
  621. data/lib/zeitwerk_config.rb +162 -0
  622. data/test/README.md +27 -112
  623. data/test/bin/runtests +57 -130
  624. data/test/lib/jamf_test/APITest.rb +80 -0
  625. data/test/lib/jamf_test/auth.rb +267 -0
  626. data/test/lib/jamf_test/collection_tests.rb +393 -0
  627. data/test/lib/{testhelper.rb → jamf_test.rb} +8 -11
  628. data/{lib/jss/ruby_extensions/filetest.rb → test/tests/category.rb} +17 -20
  629. data/test/tests/device_enrollment.rb +101 -0
  630. data/test/tests/inventory_preload_record.rb +131 -0
  631. data/{lib/jss/ruby_extensions.rb → test/tests/jp_building.rb} +16 -12
  632. data/test/tests/policy.rb +163 -0
  633. metadata +646 -204
  634. data/lib/jamf/api/base_classes/collection_resource.rb +0 -612
  635. data/lib/jamf/api/base_classes/json_object.rb +0 -1103
  636. data/lib/jamf/api/base_classes/prestage.rb +0 -503
  637. data/lib/jamf/api/base_classes/resource.rb +0 -259
  638. data/lib/jamf/api/base_classes/singleton_resource.rb +0 -88
  639. data/lib/jamf/api/connection/api_error.rb +0 -111
  640. data/lib/jamf/api/connection/api_error_styleguide.rb +0 -96
  641. data/lib/jamf/api/json_objects/change_log_entry.rb +0 -77
  642. data/lib/jamf/api/json_objects/country.rb +0 -51
  643. data/lib/jamf/api/json_objects/device_enrollment_device.rb +0 -165
  644. data/lib/jamf/api/json_objects/device_enrollment_device_sync_state.rb +0 -81
  645. data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +0 -71
  646. data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +0 -57
  647. data/lib/jamf/api/json_objects/locale.rb +0 -59
  648. data/lib/jamf/api/json_objects/md_prestage_name.rb +0 -57
  649. data/lib/jamf/api/json_objects/md_prestage_names.rb +0 -82
  650. data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +0 -214
  651. data/lib/jamf/api/json_objects/prestage_assignment.rb +0 -76
  652. data/lib/jamf/api/json_objects/prestage_location.rb +0 -104
  653. data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +0 -132
  654. data/lib/jamf/api/json_objects/prestage_scope.rb +0 -57
  655. data/lib/jamf/api/json_objects/time_zone.rb +0 -105
  656. data/lib/jamf/api/mixins/change_log.rb +0 -288
  657. data/lib/jamf/api/mixins/extendable.rb +0 -75
  658. data/lib/jamf/api/mixins/pageable.rb +0 -208
  659. data/lib/jamf/api/mixins/searchable.rb +0 -202
  660. data/lib/jamf/api/resources/collection_resources/building.rb +0 -121
  661. data/lib/jamf/api/resources/collection_resources/category.rb +0 -83
  662. data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +0 -89
  663. data/lib/jamf/api/resources/collection_resources/department.rb +0 -78
  664. data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +0 -384
  665. data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +0 -289
  666. data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +0 -143
  667. data/lib/jamf/api/resources/collection_resources/script.rb +0 -226
  668. data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +0 -141
  669. data/lib/jamf/api/resources/singleton_resources/locales.rb +0 -155
  670. data/lib/jamf/api/resources/singleton_resources/time_zones.rb +0 -213
  671. data/lib/jamf/compatibility.rb +0 -88
  672. data/lib/jamf/ruby_extensions/dig.rb +0 -52
  673. data/lib/jamf/ruby_extensions/string/backports.rb +0 -66
  674. data/lib/jss/api_connection.rb +0 -1029
  675. data/lib/jss/api_object/app_store_country_codes.rb +0 -298
  676. data/lib/jss/api_object/computer/application_installs.rb +0 -118
  677. data/lib/jss/client/jamf_binary.rb +0 -132
  678. data/lib/jss/client/jamf_helper.rb +0 -298
  679. data/lib/jss/client/management_action.rb +0 -113
  680. data/lib/jss/client.rb +0 -301
  681. data/lib/jss/compatibility.rb +0 -88
  682. data/lib/jss/composer.rb +0 -190
  683. data/lib/jss/configuration.rb +0 -319
  684. data/lib/jss/exceptions.rb +0 -115
  685. data/lib/jss/ruby_extensions/array.rb +0 -52
  686. data/lib/jss/ruby_extensions/hash.rb +0 -140
  687. data/lib/jss/ruby_extensions/ipaddr.rb +0 -92
  688. data/lib/jss/ruby_extensions/object.rb +0 -19
  689. data/lib/jss/ruby_extensions/pathname.rb +0 -78
  690. data/lib/jss/ruby_extensions/string/backports.rb +0 -68
  691. data/lib/jss/ruby_extensions/string/conversions.rb +0 -69
  692. data/lib/jss/ruby_extensions/string/predicates.rb +0 -57
  693. data/lib/jss/server.rb +0 -146
  694. data/lib/jss/utility.rb +0 -672
  695. data/lib/jss/validate.rb +0 -248
  696. data/test/lib/testhelper/auth.rb +0 -275
  697. data/test/lib/testhelper/patch_mgmt.rb +0 -123
  698. data/test/specs/api_connection_spec.rb +0 -57
  699. data/test/specs/patch01_source_spec.rb +0 -54
  700. data/test/specs/patch02_internal_source_spec.rb +0 -88
  701. data/test/specs/patch03_external_source_spec.rb +0 -120
  702. data/test/specs/patch04_titles_spec.rb +0 -207
  703. data/test/specs/patch05_policies_spec.rb +0 -119
  704. data/test/specs/patch06_cleanup_spec.rb +0 -52
  705. data/test/specs/policy_spec.rb +0 -112
@@ -1,4 +1,4 @@
1
- ### Copyright 2020 Pixar
1
+ ### Copyright 2022 Pixar
2
2
 
3
3
  ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
@@ -24,7 +24,7 @@
24
24
  ###
25
25
 
26
26
  ###
27
- module JSS
27
+ module Jamf
28
28
 
29
29
  # Classes
30
30
  #####################################
@@ -33,7 +33,7 @@ module JSS
33
33
  # methods and constants that apply to all API resouces.
34
34
  #
35
35
  # See the README.md file for general info about using subclasses of
36
- # JSS::APIObject
36
+ # Jamf::APIObject
37
37
  #
38
38
  # == Subclassing
39
39
  #
@@ -56,15 +56,15 @@ module JSS
56
56
  # === Object Creation
57
57
  #
58
58
  # If a subclass should be able to be created in the JSS be sure to include
59
- # {JSS::Creatable}
59
+ # {Jamf::Creatable}
60
60
  #
61
61
  # The constructor should verify any extra required data in the args
62
62
  #
63
- # See {JSS::Creatable} for more details.
63
+ # See {Jamf::Creatable} for more details.
64
64
  #
65
65
  # === Object Modification
66
66
  #
67
- # If a subclass should be modifiable in the JSS, include {JSS::Updatable},
67
+ # If a subclass should be modifiable in the JSS, include {Jamf::Updatable},
68
68
  # q.v. for details.
69
69
  #
70
70
  # === Object Deletion
@@ -156,7 +156,7 @@ module JSS
156
156
  #
157
157
  # For example, here's a summary-hash for a single MobileDevice from the
158
158
  # list-resource '...JSSResource/mobiledevices', which you might get in the
159
- # Array returned by JSS::MobileDevice.all:
159
+ # Array returned by Jamf::MobileDevice.all:
160
160
  #
161
161
  # {
162
162
  # :id=>3964,
@@ -255,7 +255,7 @@ module JSS
255
255
  # no way to guarantee which object you get back.
256
256
  #
257
257
  # In those subclasses, set NON_UNIQUE_NAMES to any value, and a
258
- # JSS::AmbiguousError exception will be raised when trying to fetch by name
258
+ # Jamf::AmbiguousError exception will be raised when trying to fetch by name
259
259
  # and the name isn't unique.
260
260
  #
261
261
  # Because of the extra processing, the check for this state will only happen
@@ -265,21 +265,80 @@ module JSS
265
265
  #
266
266
  # When that's the case, fetching explicitly by name, or when fetching with a
267
267
  # plain search term that matches a non-unique name, will raise a
268
- # JSS::AmbiguousError exception,when the name isn't unique. If that happens,
268
+ # Jamf::AmbiguousError exception,when the name isn't unique. If that happens,
269
269
  # you'll have to use some other identifier to fetch the desired object.
270
270
  #
271
271
  # Note: Fetching, finding valid id, and name collisions are case-insensitive.
272
272
  #
273
273
  class APIObject
274
274
 
275
+ include Comparable
276
+
277
+ # COMPARABLE
278
+ # APIobjects are == if all of their lookup key values are the same
279
+ #
280
+ def <=>(other)
281
+ idents_combined <=> other.idents_combined
282
+ end
283
+
284
+ def idents_combined
285
+ my_keys = self.class.lookup_keys.values.uniq
286
+ my_keys.map { |k| send(k).to_s }.sort.join
287
+ end
288
+
289
+ # Meta Programming
290
+ ####################################################
291
+
292
+ # Loop through the defined lookup keys and make
293
+ # .all_<key>s methods for each one, with alises as needed.
294
+ #
295
+ # This is called automatically when subclasses are loaded by zeitwerk
296
+ #
297
+ def self.define_identifier_list_methods
298
+ Jamf.load_msg "defining list-methods for APIObject subclass #{self}"
299
+
300
+ lookup_keys.each do |als, key|
301
+ meth_name = key.to_s.end_with?('s') ? "all_#{key}es" : "all_#{key}s"
302
+
303
+ if als == key
304
+ # the all_ method - skip if defined in the class
305
+ next if singleton_methods.include? meth_name
306
+
307
+ define_singleton_method meth_name do |refresh = false, cached_list: nil, api: nil, cnx: Jamf.cnx|
308
+ cnx = api if api
309
+ list = cached_list || all(refresh, cnx: cnx)
310
+ list.map { |i| i[key] }
311
+ end
312
+ Jamf.load_msg "Defined method #{self}##{meth_name}"
313
+
314
+ else
315
+ # an alias - skip if defined in the class
316
+ als_name = als.to_s.end_with?('s') ? "all_#{als}es" : "all_#{als}s"
317
+ next if singleton_methods.include? als_name
318
+
319
+ define_singleton_method als_name do |refresh = false, api: nil, cnx: Jamf.cnx|
320
+ cnx = api if api
321
+ send meth_name, refresh, cnx: cnx
322
+ end
323
+ Jamf.load_msg "Defined alias '#{als_name}' of #{self}##{meth_name}"
324
+
325
+ end # if
326
+ end # lookup_keys.eachs
327
+ true
328
+ end # self.define_identifier_list_methods
329
+
275
330
  # Constants
276
331
  ####################################
277
332
 
333
+ # which API do APIObjects come from?
334
+ # The JPAPI equivalent is in Jamf::JPAPIResource
335
+ API_SOURCE = :classic
336
+
278
337
  # '.new' can only be called from these methods:
279
- OK_INSTANTIATORS = ['make', 'fetch', 'block in fetch'].freeze
338
+ OK_INSTANTIATORS = ['make', 'create', 'fetch', 'block in fetch'].freeze
280
339
 
281
340
  # See the discussion of 'Lookup Keys' in the comments/docs
282
- # for {JSS::APIObject}
341
+ # for {Jamf::APIObject}
283
342
  #
284
343
  DEFAULT_LOOKUP_KEYS = {
285
344
  id: { fetch_rsrc_key: :id },
@@ -397,11 +456,11 @@ module JSS
397
456
 
398
457
  # Return an Array of Hashes for all objects of this subclass in the JSS.
399
458
  #
400
- # This method is only valid in subclasses of JSS::APIObject, and is
459
+ # This method is only valid in subclasses of Jamf::APIObject, and is
401
460
  # the parsed JSON output of an API query for the resource defined in the
402
461
  # subclass's RSRC_BASE
403
462
  #
404
- # e.g. for JSS::Computer, with the RSRC_BASE of :computers,
463
+ # e.g. for Jamf::Computer, with the RSRC_BASE of :computers,
405
464
  # This method retuens the output of the 'JSSResource/computers' resource,
406
465
  # which is a list of all computers in the JSS.
407
466
  #
@@ -420,12 +479,12 @@ module JSS
420
479
  # in the class comments/docs above)
421
480
  #
422
481
  # Subclasses should provide appropriate .all_xxx class methods for accessing
423
- # any other other values as Arrays, e.g. JSS::Computer.all_managed
482
+ # any other other values as Arrays, e.g. Jamf::Computer.all_managed
424
483
  #
425
484
  # -- Caching
426
485
  #
427
486
  # The results of the first call to .all for each subclass is cached in the
428
- # .object_list_cache of the given {JSS::APIConnection} and that cache is
487
+ # .c_object_list_cache of the given {Jamf::Connection} and that cache is
429
488
  # used for all future calls, so as to not requery the server every time.
430
489
  #
431
490
  # To force requerying to get updated data, provided a truthy argument.
@@ -438,60 +497,96 @@ module JSS
438
497
  # -- Alternate API connections
439
498
  #
440
499
  # To query an APIConnection other than the currently active one,
441
- # provide one via the api: named parameter.
500
+ # provide one via the cnx: named parameter.
442
501
  #
443
502
  # @param refresh[Boolean] should the data be re-queried from the API?
444
503
  #
445
- # @param api[JSS::APIConnection] an API connection to use for the query.
446
- # Defaults to the corrently active API. See {JSS::APIConnection}
504
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
505
+ # Defaults to the corrently active API. See {Jamf::Connection}
447
506
  #
448
507
  # @return [Array<Hash{:name=>String, :id=> Integer}>]
449
508
  #
450
- def self.all(refresh = false, api: JSS.api)
509
+ def self.all(refresh = false, api: nil, cnx: Jamf.cnx)
510
+ cnx = api if api
511
+
451
512
  validate_not_metaclass(self)
452
513
 
453
- cache = api.object_list_cache
514
+ cache = cnx.c_object_list_cache
454
515
  cache_key = self::RSRC_LIST_KEY
455
- api.flushcache(cache_key) if refresh
516
+ cnx.flushcache(cache_key) if refresh
456
517
  return cache[cache_key] if cache[cache_key]
457
518
 
458
- cache[cache_key] = api.get_rsrc(self::RSRC_BASE)[cache_key]
519
+ cache[cache_key] = cnx.c_get(self::RSRC_BASE)[cache_key]
459
520
  end
460
521
 
461
522
  # @return [Hash {String => Integer}] name => number of occurances
462
523
  #
463
- def self.duplicate_names(refresh = false, api: JSS.api)
524
+ def self.duplicate_names(refresh = false, api: nil, cnx: Jamf.cnx)
525
+ cnx = api if api
526
+
464
527
  return {} unless defined? self::NON_UNIQUE_NAMES
465
528
 
466
529
  dups = {}
467
- all(refresh, api: api).each do |obj|
530
+ all(refresh, cnx: cnx).each do |obj|
468
531
  if dups[obj[:name]]
469
532
  dups[obj[:name]] += 1
470
533
  else
471
534
  dups[obj[:name]] = 1
472
535
  end # if
473
- end # all(refresh, api: api).each
536
+ end # all(refresh, cnx: cnx).each
474
537
  dups.delete_if { |k,v| v == 1 }
475
538
  dups
476
539
  end
477
540
 
541
+ # A Hash of all members of this collection where the keys are some
542
+ # identifier and values are any other attribute.
543
+ #
544
+ # @param ident [Symbol] An identifier of this Class, used as the key
545
+ # for the mapping Hash. Aliases are acceptable, e.g. :sn for :serialNumber
546
+ #
547
+ # @param to [Symbol] The attribute to which the ident will be mapped.
548
+ # Aliases are acceptable, e.g. :name for :displayName
549
+ #
550
+ # @param refresh [Boolean] Re-read the 'all' data from the API? otherwise
551
+ # use the cached data if available.
552
+ #
553
+ # @param cnx (see .all)
554
+ #
555
+ # @return [Hash {Symbol: Object}] A Hash of identifier mapped to attribute
556
+ #
557
+ ######################################
558
+ def self.map_all(ident, to:, cnx: Jamf.cnx, refresh: false, cached_list: nil)
559
+ ident = lookup_keys[ident]
560
+ raise Jamf::InvalidDataError, "No identifier :#{ident} for class #{self}" unless ident
561
+
562
+ list = cached_list ? cached_list : all(refresh, cnx: cnx)
563
+ mapped = list.map do |i|
564
+ [
565
+ i[ident],
566
+ i[to]
567
+ ]
568
+ end # do i
569
+
570
+ mapped.to_h
571
+ end
572
+
478
573
  # Return a hash of all objects of this subclass
479
574
  # in the JSS where the key is the id, and the value
480
- # is some other key in the data items returned by the JSS::APIObject.all.
575
+ # is some other key in the data items returned by the Jamf::APIObject.all.
481
576
  #
482
577
  # If the other key doesn't exist in the API summary data from .all
483
- # (eg :udid for JSS::Department) the values will be nil.
578
+ # (eg :udid for Jamf::Department) the values will be nil.
484
579
  #
485
580
  # Use this method to map ID numbers to other identifiers returned
486
581
  # by the API list resources. Invert its result to map the other
487
582
  # identfier to ids.
488
583
  #
489
584
  # @example
490
- # JSS::Computer.map_all_ids_to(:serial_number)
585
+ # Jamf::Computer.map_all_ids_to(:serial_number)
491
586
  #
492
587
  # # Returns, eg {2 => "C02YD3U8JHD3", 5 => "VMMz7xgg8lYZ"}
493
588
  #
494
- # JSS::Computer.map_all_ids_to(:serial_number).invert
589
+ # Jamf::Computer.map_all_ids_to(:serial_number).invert
495
590
  #
496
591
  # # Returns, eg {"C02YD3U8JHD3" => 2, "VMMz7xgg8lYZ" => 5}
497
592
  #
@@ -511,29 +606,33 @@ module JSS
511
606
  #
512
607
  # @param refresh[Boolean] should the data re-queried from the API?
513
608
  #
514
- # @param api[JSS::APIConnection] an API connection to use for the query.
515
- # Defaults to the corrently active API. See {JSS::APIConnection}
609
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
610
+ # Defaults to the corrently active API. See {Jamf::Connection}
516
611
  #
517
612
  # @return [Hash{Integer => Oject}] the associated ids and data
518
613
  #
519
- def self.map_all_ids_to(other_key, refresh = false, api: JSS.api)
520
- # we will accept any key, it'll just return nil if not in the
521
- # .all hashes. However if we're given an alias of a lookup key
522
- # we need to convert it to its real name.
523
- other_key = lookup_keys[other_key] if lookup_keys[other_key]
524
-
525
- cache_key = "#{self::RSRC_LIST_KEY}_map_#{other_key}".to_sym
526
- cache = api.object_list_cache
527
- cache[cache_key] = nil if refresh
528
- return cache[cache_key] if cache[cache_key]
529
-
530
- map = {}
531
- all(refresh, api: api).each { |i| map[i[:id]] = i[other_key] }
532
- cache[cache_key] = map
614
+ def self.map_all_ids_to(other_key, refresh = false, cached_list: nil, api: nil, cnx: Jamf.cnx)
615
+ cnx = api if api
616
+
617
+ map_all :id, to: other_key, refresh: refresh, cnx: cnx, cached_list: cached_list
618
+
619
+ # # we will accept any key, it'll just return nil if not in the
620
+ # # .all hashes. However if we're given an alias of a lookup key
621
+ # # we need to convert it to its real name.
622
+ # other_key = lookup_keys[other_key] if lookup_keys[other_key]
623
+ #
624
+ # cache_key = "#{self::RSRC_LIST_KEY}_map_#{other_key}".to_sym
625
+ # cache = cnx.c_object_list_cache
626
+ # cache[cache_key] = nil if refresh
627
+ # return cache[cache_key] if cache[cache_key]
628
+ #
629
+ # map = {}
630
+ # all(refresh, cnx: cnx).each { |i| map[i[:id]] = i[other_key] }
631
+ # cache[cache_key] = map
533
632
  end
534
633
 
535
- # Return an Array of JSS::APIObject subclass instances
536
- # e.g when called on JSS::Package, return a hash of JSS::Package instancesa
634
+ # Return an Array of Jamf::APIObject subclass instances
635
+ # e.g when called on Jamf::Package, return a hash of Jamf::Package instancesa
537
636
  # for every package in the JSS.
538
637
  #
539
638
  # WARNING: This may be slow as it has to look up each object individually!
@@ -541,20 +640,23 @@ module JSS
541
640
  #
542
641
  # @param refresh[Boolean] should the data re-queried from the API?
543
642
  #
544
- # @param api[JSS::APIConnection] an API connection to use for the query.
545
- # Defaults to the corrently active API. See {JSS::APIConnection}
643
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
644
+ # Defaults to the corrently active API. See {Jamf::Connection}
546
645
  #
547
646
  # @return [Array<APIObject>] the objects requested
548
647
  #
549
- def self.all_objects(refresh = false, api: JSS.api)
648
+ def self.all_objects(refresh = false, api: nil, cnx: Jamf.cnx)
649
+ cnx = api if api
650
+
550
651
  objects_cache_key ||= "#{self::RSRC_LIST_KEY}_objects".to_sym
551
- api_cache = api.object_list_cache
652
+ api_cache = cnx.c_object_list_cache
552
653
  api_cache[objects_cache_key] = nil if refresh
553
654
 
554
655
  return api_cache[objects_cache_key] if api_cache[objects_cache_key]
555
- all = all(refresh, api: api)
556
- api_cache[objects_cache_key] = all.map do |o|
557
- fetch id: o[:id], api: api, refresh: false
656
+
657
+ all_result = all(refresh, cnx: cnx)
658
+ api_cache[objects_cache_key] = all_result.map do |o|
659
+ fetch id: o[:id], cnx: cnx, refresh: false
558
660
  end
559
661
  end
560
662
 
@@ -576,24 +678,25 @@ module JSS
576
678
  #
577
679
  # @param refresh [Boolean] Should the data be re-read from the server
578
680
  #
579
- # @param api[JSS::APIConnection] an API connection to use for the query.
580
- # Defaults to the corrently active API. See {JSS::APIConnection}
681
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
682
+ # Defaults to the corrently active API. See {Jamf::Connection}
581
683
  #
582
684
  # @return [Integer, nil] the id of the matching object, or nil if it doesn't exist
583
685
  #
584
- def self.valid_id(identifier, refresh = false, api: JSS.api)
686
+ def self.valid_id(identifier, refresh = false, api: nil, cnx: Jamf.cnx)
687
+ cnx = api if api
585
688
 
586
689
  # refresh if needed
587
- all(refresh, api: api) if refresh
690
+ all(refresh, cnx: cnx) if refresh
588
691
 
589
692
  # it its a valid id, return it
590
- return identifier if all_ids(api: api).include? identifier
693
+ return identifier if all_ids(cnx: cnx).include? identifier
591
694
 
592
695
  keys_to_check = lookup_keys(no_aliases: true)
593
696
  keys_to_check.delete :id # we've already checked :id
594
697
 
595
698
  keys_to_check.each do |key|
596
- mapped_ids = map_all_ids_to key, api: api
699
+ mapped_ids = map_all_ids_to key, cnx: cnx
597
700
  matches = mapped_ids.select { |_id, ident| ident.casecmp? identifier }
598
701
  # If exactly one match, return the id
599
702
  return matches.keys.first if matches.size == 1
@@ -609,11 +712,11 @@ module JSS
609
712
  #
610
713
  # @example
611
714
  # # get the id for the computer with serialnum 'xyxyxyxy'
612
- # JSS::Computer.id_for_identifier :serial_number, 'xyxyxyxy'
715
+ # Jamf::Computer.id_for_identifier :serial_number, 'xyxyxyxy'
613
716
  #
614
717
  # # => the Integer id, or nil if no such serial number
615
718
  #
616
- # Raises a JSS::Ambiguous error if there's more than one matching value
719
+ # Raises a Jamf::Ambiguous error if there's more than one matching value
617
720
  # for any key, which might be true of names for Computers and Devices
618
721
  #
619
722
  # This is similar to .valid_id, except only one key is searched
@@ -627,25 +730,27 @@ module JSS
627
730
  # @param refresh [Boolean] Should the cached summary data be re-read from
628
731
  # the server first?
629
732
  #
630
- # @param api[JSS::APIConnection] an API connection to use for the query.
631
- # Defaults to the corrently active API. See {JSS::APIConnection}
733
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
734
+ # Defaults to the corrently active API. See {Jamf::Connection}
632
735
  #
633
736
  # @return [Integer, nil] the id of the matching object, or nil if it
634
737
  # doesn't exist
635
738
  #
636
- def self.id_for_identifier(key, val, refresh = false, api: JSS.api)
739
+ def self.id_for_identifier(key, val, refresh = false, api: nil, cnx: Jamf.cnx)
740
+ cnx = api if api
741
+
637
742
  # refresh if needed
638
- all(refresh, api: api) if refresh
743
+ all(refresh, cnx: cnx) if refresh
639
744
 
640
745
  # get the real key if an alias was used
641
746
  key = real_lookup_key key
642
747
 
643
748
  # do id's expicitly, they are integers
644
- return all_ids.include?(val) ? val : nil if key == :id
749
+ return all_ids(cnx: cnx).include?(val) ? val : nil if key == :id
645
750
 
646
- mapped_ids = map_all_ids_to key, api: api
751
+ mapped_ids = map_all_ids_to key, cnx: cnx
647
752
  matches = mapped_ids.select { |_id, map_val| val.casecmp? map_val }
648
- raise JSS::AmbiguousError, "Key #{key}: value '#{val}' is not unique for #{self}" if matches.size > 1
753
+ raise Jamf::AmbiguousError, "Key #{key}: value '#{val}' is not unique for #{self}" if matches.size > 1
649
754
 
650
755
  return nil if matches.size.zero?
651
756
 
@@ -660,13 +765,15 @@ module JSS
660
765
  #
661
766
  # @param refresh [Boolean] Should the data be re-read from the server
662
767
  #
663
- # @param api[JSS::APIConnection] an API connection to use for the query.
664
- # Defaults to the corrently active API. See {JSS::APIConnection}
768
+ # @param cnx [Jamf::Connection] an API connection to use for the query.
769
+ # Defaults to the corrently active API. See {Jamf::Connection}
665
770
  #
666
771
  # @return [Boolean] does an object with the given identifier exist?
667
772
  #
668
- def self.exist?(identifier, refresh = false, api: JSS.api)
669
- !valid_id(identifier, refresh, api: api).nil?
773
+ def self.exist?(identifier, refresh = false, api: nil, cnx: Jamf.cnx)
774
+ cnx = api if api
775
+
776
+ !valid_id(identifier, refresh, cnx: cnx).nil?
670
777
  end
671
778
 
672
779
  # Convert an Array of Hashes of API object data to a
@@ -679,9 +786,9 @@ module JSS
679
786
  # with one <class> element per Hash member.
680
787
  #
681
788
  # @example
682
- # # for class JSS::Computer
789
+ # # for class Jamf::Computer
683
790
  # some_comps = [{:id=>2, :name=>"kimchi"},{:id=>5, :name=>"mantis"}]
684
- # xml_names = JSS::Computer.xml_list some_comps
791
+ # xml_names = Jamf::Computer.xml_list some_comps
685
792
  # puts xml_names # output manually formatted for clarity, xml.to_s has no newlines between elements
686
793
  #
687
794
  # <computers>
@@ -693,7 +800,7 @@ module JSS
693
800
  # </computer>
694
801
  # </computers>
695
802
  #
696
- # xml_ids = JSS::Computer.xml_list some_comps, :id
803
+ # xml_ids = Jamf::Computer.xml_list some_comps, :id
697
804
  # puts xml_names # output manually formatted for clarity, xml.to_s has no newlines between elements
698
805
  #
699
806
  # <computers>
@@ -756,10 +863,10 @@ module JSS
756
863
  #
757
864
  # @example
758
865
  # # computer where 'xyxyxyxy' is in any of the lookup key fields
759
- # JSS::Computer.fetch 'xyxyxyxy'
866
+ # Jamf::Computer.fetch 'xyxyxyxy'
760
867
  #
761
868
  # # computer where 'xyxyxyxy' is the serial number
762
- # JSS::Computer.fetch serial_number: 'xyxyxyxy'
869
+ # Jamf::Computer.fetch serial_number: 'xyxyxyxy'
763
870
  #
764
871
  # Fetching is faster when specifying a lookup key, and that key has a
765
872
  # fetch_rsrc_key defined in its OTHER_LOOKUP_KEYS constant, as in the second
@@ -785,8 +892,8 @@ module JSS
785
892
  # If no searchterm is provided, one of the args must be a valid
786
893
  # lookup key and value to find in that key, e.g. `serial_number: '1234567'`
787
894
  #
788
- # @option args api[JSS::APIConnection] an API connection to use for the query.
789
- # Defaults to the corrently active API. See {JSS::APIConnection}
895
+ # @option args cnx[Jamf::Connection] an API connection to use for the query.
896
+ # Defaults to the corrently active API. See {Jamf::Connection}
790
897
  #
791
898
  # @option args refresh[Boolean] should the summary list of all objects be
792
899
  # reloaded from the API before being used to look for this object.
@@ -797,35 +904,34 @@ module JSS
797
904
  validate_not_metaclass(self)
798
905
 
799
906
  # which connection?
800
- api = args.delete :api
801
- api ||= JSS.api
907
+ cnx = args.delete :cnx
908
+ cnx ||= args.delete :api
909
+ cnx ||= Jamf.cnx
802
910
 
803
911
  # refresh the .all list if needed
804
912
  if args.delete(:refresh) || searchterm == :random
805
- all(:refresh, api: api)
913
+ all(:refresh, cnx: cnx)
806
914
  just_refreshed = true
807
915
  else
808
916
  just_refreshed = false
809
917
  end
810
918
 
811
919
  # a random object?
812
- if searchterm == :random
813
- rnd_thing = all.sample
814
- raise JSS::NoSuchItemError, "No #{self::RSRC_LIST_KEY} found" unless rnd_thing
920
+ if searchterm == :random || args[:random]
921
+ rnd_thing = all(cnx: cnx).sample
922
+ raise Jamf::NoSuchItemError, "No #{self::RSRC_LIST_KEY} found" unless rnd_thing
815
923
 
816
- return new id: rnd_thing[:id], api: api
924
+ return new id: rnd_thing[:id], cnx: cnx
817
925
  end
818
926
 
819
927
  # get the lookup key and value, if given
820
928
  fetch_key, fetch_val = args.to_a.first
821
929
  fetch_rsrc_key = fetch_rsrc_key(fetch_key)
822
930
 
823
- err_detail = "where #{fetch_key} = #{fetch_val}"
824
-
825
931
  # names should raise an error if more than one exists,
826
932
  # so we always have to do id_for_identifier, which will do so.
827
933
  if fetch_rsrc_key == :name
828
- id = id_for_identifier fetch_key, fetch_val, !just_refreshed, api: api
934
+ id = id_for_identifier fetch_key, fetch_val, !just_refreshed, cnx: cnx
829
935
  fetch_rsrc = id ? "#{self::RSRC_BASE}/name/#{CGI.escape fetch_val.to_s}" : nil
830
936
 
831
937
  # if the fetch rsrc key exists, it can be used directly in an endpoint path
@@ -836,20 +942,19 @@ module JSS
836
942
  # it has an OTHER_LOOKUP_KEY but that key doesn't have a fetch_rsrc
837
943
  # so we look in the .map_all_ids_to_* hash for it.
838
944
  elsif fetch_key
839
- id = id_for_identifier fetch_key, fetch_val, !just_refreshed, api: api
945
+ id = id_for_identifier fetch_key, fetch_val, !just_refreshed, cnx: cnx
840
946
  fetch_rsrc = id ? "#{self::RSRC_BASE}/id/#{id}" : nil
841
947
 
842
948
  # no fetch key was given in the args, so try a search term
843
949
  elsif searchterm
844
- id = valid_id searchterm, api: api
950
+ id = valid_id searchterm, cnx: cnx
845
951
  fetch_rsrc = id ? "#{self::RSRC_BASE}/id/#{id}" : nil
846
- err_detail = "matching #{searchterm}"
847
952
 
848
953
  else
849
954
  raise ArgumentError, 'Missing searchterm or fetch key'
850
955
  end
851
956
 
852
- new fetch_rsrc: fetch_rsrc, api: api
957
+ new fetch_rsrc: fetch_rsrc, cnx: cnx
853
958
  end # fetch
854
959
 
855
960
  # Fetch the mostly- or fully-raw JSON or XML data for an object of this
@@ -869,7 +974,7 @@ module JSS
869
974
  # all the ruby goodness of a full instance, but just want a few values for
870
975
  # an object that aren't available in the `all` data
871
976
  #
872
- # This is really just a wrapper around {APIConnection.get_rsrc} that
977
+ # This is really just a wrapper around {APIConnection.c_get} that
873
978
  # automatically fills in the RSRC::BASE value for you.
874
979
  #
875
980
  # @param id [Integer] the id of the object to fetch
@@ -879,18 +984,20 @@ module JSS
879
984
  # @param as_string[Boolean] return the raw JSON or XML string as it comes
880
985
  # from the API, do not parse into a Hash or REXML::Document
881
986
  #
882
- # @param api[JSS::APIConnection] the connection thru which to fetch this
883
- # object. Defaults to the deault API connection in JSS.api
987
+ # @param cnx [Jamf::Connection] the connection thru which to fetch this
988
+ # object. Defaults to the deault API connection in Jamf.cnx
884
989
  #
885
990
  # @return [Hash, REXML::Document, String] the raw data for the object
886
991
  #
887
- def self.get_raw(id, format: :json, as_string: false, api: JSS.api)
992
+ def self.get_raw(id, format: :json, as_string: false, api: nil, cnx: Jamf.cnx)
993
+ cnx = api if api
994
+
888
995
  validate_not_metaclass(self)
889
996
  rsrc = "#{self::RSRC_BASE}/id/#{id}"
890
- data = api.get_rsrc rsrc, format, raw_json: as_string
997
+ data = cnx.c_get rsrc, format, raw_json: as_string
891
998
  return data if format == :json || as_string
892
999
 
893
- REXML::Document.new(data)
1000
+ REXML::Document.new(**data)
894
1001
  end
895
1002
 
896
1003
  # PUT some raw XML to the API for a given id in this subclass.
@@ -903,22 +1010,24 @@ module JSS
903
1010
  # In some cases, where you're making simple changes to simple XML,
904
1011
  # this can be faster than fetching a full instance and the re-saving it.
905
1012
  #
906
- # This is really just a wrapper around {APIConnection.put_rsrc} that
1013
+ # This is really just a wrapper around {APIConnection.c_put} that
907
1014
  # automatically fills in the RSRC::BASE value for you.
908
1015
  #
909
1016
  # @param id [Integer] the id of the object to PUT
910
1017
  #
911
1018
  # @param xml [String, #to_s] The XML to send
912
1019
  #
913
- # @param api[JSS::APIConnection] the connection thru which to fetch this
914
- # object. Defaults to the deault API connection in JSS.api
1020
+ # @param cnx [Jamf::Connection] the connection thru which to fetch this
1021
+ # object. Defaults to the deault API connection in Jamf.cnx
915
1022
  #
916
1023
  # @return [REXML::Document] the XML response from the API
917
1024
  #
918
- def self.put_raw(id, xml, api: JSS.api)
1025
+ def self.put_raw(id, xml, api: nil, cnx: Jamf.cnx)
1026
+ cnx = api if api
1027
+
919
1028
  validate_not_metaclass(self)
920
1029
  rsrc = "#{self::RSRC_BASE}/id/#{id}"
921
- REXML::Document.new(api.put_rsrc rsrc, xml.to_s)
1030
+ REXML::Document.new(cnx.c_put rsrc, xml.to_s)
922
1031
  end
923
1032
 
924
1033
  # POST some raw XML to the API for a given id in this subclass.
@@ -931,20 +1040,22 @@ module JSS
931
1040
  # This probably isn't as much of a speed gain as get_raw or put_raw, as
932
1041
  # opposed to instantiating a ruby object, but might still be useful.
933
1042
  #
934
- # This is really just a wrapper around {APIConnection.post_rsrc} that
1043
+ # This is really just a wrapper around {APIConnection.c_post} that
935
1044
  # automatically fills in the RSRC::BASE value for you.
936
1045
  #
937
1046
  # @param xml [String, #to_s] The XML to send
938
1047
  #
939
- # @param api[JSS::APIConnection] the connection thru which to fetch this
940
- # object. Defaults to the deault API connection in JSS.api
1048
+ # @param cnx [Jamf::Connection] the connection thru which to fetch this
1049
+ # object. Defaults to the deault API connection in Jamf.cnx
941
1050
  #
942
1051
  # @return [REXML::Document] the XML response from the API
943
1052
  #
944
- def self.post_raw( xml, api: JSS.api)
1053
+ def self.post_raw(xml, api: nil, cnx: Jamf.cnx)
1054
+ cnx = api if api
1055
+
945
1056
  validate_not_metaclass(self)
946
1057
  rsrc = "#{self::RSRC_BASE}/id/-1"
947
- REXML::Document.new(api.post_rsrc rsrc, xml.to_s)
1058
+ REXML::Document.new(cnx.c_post rsrc, xml.to_s)
948
1059
  end
949
1060
 
950
1061
  # Make a ruby instance of a not-yet-existing APIObject.
@@ -959,24 +1070,30 @@ module JSS
959
1070
  #
960
1071
  # @param name[String] The name of this object, generally must be uniqie
961
1072
  #
962
- # @param api[JSS::APIConnection] the connection thru which to make this
963
- # object. Defaults to the deault API connection in JSS.api
1073
+ # @param cnx [Jamf::Connection] the connection thru which to make this
1074
+ # object. Defaults to the deault API connection in Jamf.cnx
964
1075
  #
965
1076
  # @param args[Hash] The data for creating an object, such as name:
966
1077
  # See {APIObject#initialize}
967
1078
  #
968
1079
  # @return [APIObject] The un-created ruby-instance of a JSS object
969
1080
  #
970
- def self.make(**args)
1081
+ def self.create(**args)
971
1082
  validate_not_metaclass(self)
972
1083
  unless constants.include?(:CREATABLE)
973
- raise JSS::UnsupportedError, "Creating #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows."
1084
+ raise Jamf::UnsupportedError, "Creating #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows."
974
1085
  end
975
1086
  raise ArgumentError, "Use '#{self.class}.fetch id: xx' to retrieve existing JSS objects" if args[:id]
976
1087
 
977
- args[:api] ||= JSS.api
1088
+ args[:api] ||= Jamf.cnx
978
1089
  args[:id] = :new
979
- new args
1090
+ new **args
1091
+ end
1092
+
1093
+ # backward compatability
1094
+ # @deprecated use .create instead
1095
+ def self.make(**args)
1096
+ create **args
980
1097
  end
981
1098
 
982
1099
  # Disallow direct use of ruby's .new class method for creating instances.
@@ -986,7 +1103,7 @@ module JSS
986
1103
 
987
1104
  calling_method = caller_locations(1..1).first.label
988
1105
  unless OK_INSTANTIATORS.include? calling_method
989
- raise JSS::UnsupportedError, 'Use .fetch or .make to instantiate APIObject classes'
1106
+ raise Jamf::UnsupportedError, 'Use .fetch or .create to instantiate APIObject classes'
990
1107
  end
991
1108
 
992
1109
  super
@@ -1000,16 +1117,18 @@ module JSS
1000
1117
  # @param victims[Integer,Array<Integer>] An object id or an array of them
1001
1118
  # to be deleted
1002
1119
  #
1003
- # @param api[JSS::APIConnection] the API connection to use.
1004
- # Defaults to the corrently active API. See {JSS::APIConnection}
1120
+ # @param cnx [Jamf::Connection] the API connection to use.
1121
+ # Defaults to the corrently active API. See {Jamf::Connection}
1005
1122
  #
1006
1123
  # @return [Array<Integer>] The id's that didn't exist when we tried to
1007
1124
  # delete them.
1008
1125
  #
1009
- def self.delete(victims, refresh = true, api: JSS.api)
1126
+ def self.delete(victims, refresh = true, api: nil, cnx: Jamf.cnx)
1127
+ cnx = api if api
1128
+
1010
1129
  validate_not_metaclass(self)
1011
1130
 
1012
- raise JSS::InvalidDataError, 'Parameter must be an Integer ID or an Array of them' unless victims.is_a?(Integer) || victims.is_a?(Array)
1131
+ raise Jamf::InvalidDataError, 'Parameter must be an Integer ID or an Array of them' unless victims.is_a?(Integer) || victims.is_a?(Array)
1013
1132
 
1014
1133
  case victims
1015
1134
  when Integer
@@ -1019,10 +1138,10 @@ module JSS
1019
1138
  end
1020
1139
 
1021
1140
  skipped = []
1022
- current_ids = all_ids refresh, api: api
1141
+ current_ids = all_ids refresh, cnx: cnx
1023
1142
  victims.each do |vid|
1024
1143
  if current_ids.include? vid
1025
- api.delete_rsrc "#{self::RSRC_BASE}/id/#{vid}"
1144
+ cnx.c_delete "#{self::RSRC_BASE}/id/#{vid}"
1026
1145
  else
1027
1146
  skipped << vid
1028
1147
  end # if current_ids include vid
@@ -1030,23 +1149,25 @@ module JSS
1030
1149
 
1031
1150
  # clear any cached all-lists or id-maps for this class
1032
1151
  # so they'll re-cache as needed
1033
- api.flushcache self::RSRC_LIST_KEY
1034
- # all :refresh, api: api
1152
+ cnx.flushcache self::RSRC_LIST_KEY
1153
+ # all :refresh, cnx: cnx
1035
1154
 
1036
1155
  skipped
1037
1156
  end # self.delete
1038
1157
 
1039
1158
  # Can't use APIObject directly.
1040
1159
  def self.validate_not_metaclass(klass)
1041
- raise JSS::UnsupportedError, 'JSS::APIObject is a metaclass. Do not use it directly' if klass == JSS::APIObject
1160
+ raise Jamf::UnsupportedError, 'Jamf::APIObject is a metaclass. Do not use it directly' if klass == Jamf::APIObject
1042
1161
  end
1043
1162
 
1044
1163
  # Attributes
1045
1164
  #####################################
1046
1165
 
1047
- # @return [JSS::APIConnection] the API connection thru which we deal with
1166
+ # @return [Jamf::Connection] the API connection thru which we deal with
1048
1167
  # this object.
1049
- attr_reader :api
1168
+ attr_reader :cnx
1169
+ # @deprecated 'api' to refer to connection objects will be removed eventually
1170
+ alias api cnx
1050
1171
 
1051
1172
  # @return the parsed JSON data retrieved from the API when this object was
1052
1173
  # fetched
@@ -1074,9 +1195,9 @@ module JSS
1074
1195
 
1075
1196
  # The args hash must include :id, :name, or :data.
1076
1197
  # * :id or :name will be looked up via the API
1077
- # * * if the subclass includes JSS::Creatable, :id can be :new, to create a new object in the JSS.
1198
+ # * * if the subclass includes Jamf::Creatable, :id can be :new, to create a new object in the JSS.
1078
1199
  # and :name is required
1079
- # * :data must be the JSON output of a separate {JSS::APIConnection} query (a Hash of valid object data)
1200
+ # * :data must be the JSON output of a separate {Jamf::Connection} query (a Hash of valid object data)
1080
1201
  #
1081
1202
  # Some subclasses can accept other options, by pasing their keys in a final Array
1082
1203
  #
@@ -1091,8 +1212,9 @@ module JSS
1091
1212
  #
1092
1213
  #
1093
1214
  def initialize(**args)
1094
- @api = args[:api]
1095
- @api ||= JSS.api
1215
+ @cnx = args[:cnx]
1216
+ @cnx ||= args[:api]
1217
+ @cnx ||= Jamf.cnx
1096
1218
 
1097
1219
  # we're making a new one in the JSS
1098
1220
  if args[:id] == :new
@@ -1112,6 +1234,18 @@ module JSS
1112
1234
  # Public Instance Methods
1113
1235
  #####################################
1114
1236
 
1237
+ # Ruby 3's default behavior when raising exceptions will include the output
1238
+ # of #inspect, recursively for all data in an object.
1239
+ # For many OAPIObjects, esp JPAPI Resources, this includes the embedded
1240
+ # Connection object and all the caches is might hold, which might be
1241
+ # thousands of lines.
1242
+ # we override that here to prevent that. I've heard rumor this will be
1243
+ # fixed in ruby 3.2
1244
+ # def inspect
1245
+ # #<Jamf::Policy:0x0000000110138df8
1246
+ # "<#{self.class}:#{object_id}>"
1247
+ # end
1248
+
1115
1249
  # Either Create or Update this object in the JSS
1116
1250
  #
1117
1251
  # If this item is creatable or updatable, then
@@ -1121,83 +1255,93 @@ module JSS
1121
1255
  #
1122
1256
  def save
1123
1257
  if @in_jss
1124
- raise JSS::UnsupportedError, 'Updating this object in the JSS is currently not supported by ruby-jss' unless updatable?
1258
+ raise Jamf::UnsupportedError, 'Updating this object in the JSS is currently not supported by ruby-jss' unless updatable?
1125
1259
 
1126
- update
1260
+ update_in_jamf
1127
1261
  else
1128
- raise JSS::UnsupportedError, 'Creating this object in the JSS is currently not supported by ruby-jss' unless creatable?
1262
+ raise Jamf::UnsupportedError, 'Creating this object in the JSS is currently not supported by ruby-jss' unless creatable?
1129
1263
 
1130
- create
1264
+ create_in_jamf
1131
1265
  end
1132
1266
  end
1133
1267
 
1268
+ # @deprecated, use #save
1269
+ def create
1270
+ save
1271
+ end
1272
+
1273
+ # @deprecated, use #save
1274
+ def update
1275
+ save
1276
+ end
1277
+
1134
1278
  # Mix-in Modules.
1135
1279
  # Each module made for mixing in to APIObject subclasses
1136
1280
  # sets an appropriate constant to true.
1137
1281
  # These methods provide a simple way to programattically determine
1138
1282
  # if an object has one of the mixed-in modules available.
1139
1283
 
1140
- # @return [Boolean] See {JSS::Creatable}
1284
+ # @return [Boolean] See {Jamf::Creatable}
1141
1285
  def creatable?
1142
1286
  defined? self.class::CREATABLE
1143
1287
  end
1144
1288
 
1145
- # @return [Boolean] See {JSS::Updatable}
1289
+ # @return [Boolean] See {Jamf::Updatable}
1146
1290
  def updatable?
1147
1291
  defined? self.class::UPDATABLE
1148
1292
  end
1149
1293
 
1150
- # @return [Boolean] See {JSS::Categorizable}
1294
+ # @return [Boolean] See {Jamf::Categorizable}
1151
1295
  def categorizable?
1152
1296
  defined? self.class::CATEGORIZABLE
1153
1297
  end
1154
1298
 
1155
- # @return [Boolean] See {JSS::VPPable}
1299
+ # @return [Boolean] See {Jamf::VPPable}
1156
1300
  def vppable?
1157
1301
  defined? self.class::VPPABLE
1158
1302
  end
1159
1303
 
1160
- # @return [Boolean] See {JSS::SelfServable}
1304
+ # @return [Boolean] See {Jamf::SelfServable}
1161
1305
  def self_servable?
1162
1306
  defined? self.class::SELF_SERVABLE
1163
1307
  end
1164
1308
 
1165
- # @return [Boolean] See {JSS::Criteriable}
1309
+ # @return [Boolean] See {Jamf::Criteriable}
1166
1310
  def criterable?
1167
1311
  defined? self.class::CRITERIABLE
1168
1312
  end
1169
1313
 
1170
- # @return [Boolean] See {JSS::Sitable}
1314
+ # @return [Boolean] See {Jamf::Sitable}
1171
1315
  def sitable?
1172
1316
  defined? self.class::SITABLE
1173
1317
  end
1174
1318
 
1175
- # @return [Boolean] See {JSS::extendable}
1319
+ # @return [Boolean] See {Jamf::extendable}
1176
1320
  def extendable?
1177
1321
  defined? self.class::EXTENDABLE
1178
1322
  end
1179
1323
 
1180
- # @return [Boolean] See {JSS::Matchable}
1324
+ # @return [Boolean] See {Jamf::Matchable}
1181
1325
  def matchable?
1182
1326
  defined? self.class::MATCHABLE
1183
1327
  end
1184
1328
 
1185
- # @return [Boolean] See {JSS::Locatable}
1329
+ # @return [Boolean] See {Jamf::Locatable}
1186
1330
  def locatable?
1187
1331
  defined? self.class::LOCATABLE
1188
1332
  end
1189
1333
 
1190
- # @return [Boolean] See {JSS::Purchasable}
1334
+ # @return [Boolean] See {Jamf::Purchasable}
1191
1335
  def purchasable?
1192
1336
  defined? self.class::PURCHASABLE
1193
1337
  end
1194
1338
 
1195
- # @return [Boolean] See {JSS::Scopable}
1339
+ # @return [Boolean] See {Jamf::Scopable}
1196
1340
  def scopable?
1197
1341
  defined? self.class::SCOPABLE
1198
1342
  end
1199
1343
 
1200
- # @return [Boolean] See {JSS::Uploadable}
1344
+ # @return [Boolean] See {Jamf::Uploadable}
1201
1345
  def uploadable?
1202
1346
  defined? self.class::UPLOADABLE
1203
1347
  end
@@ -1216,7 +1360,7 @@ module JSS
1216
1360
  def delete
1217
1361
  return unless @in_jss
1218
1362
 
1219
- @api.delete_rsrc @rest_rsrc
1363
+ @cnx.c_delete @rest_rsrc
1220
1364
 
1221
1365
  @rest_rsrc = "#{self.class::RSRC_BASE}/name/#{CGI.escape @name.to_s}"
1222
1366
  @id = nil
@@ -1225,8 +1369,8 @@ module JSS
1225
1369
 
1226
1370
  # clear any cached all-lists or id-maps for this class
1227
1371
  # so they'll re-cache as needed
1228
- @api.flushcache self.class::RSRC_LIST_KEY
1229
- # self.class.all :refresh, api: @api
1372
+ @cnx.flushcache self.class::RSRC_LIST_KEY
1373
+ # self.class.all :refresh, cnx: @cnx
1230
1374
 
1231
1375
  :deleted
1232
1376
  end # delete
@@ -1236,7 +1380,7 @@ module JSS
1236
1380
  # @return [String]
1237
1381
  #
1238
1382
  def to_s
1239
- "#{self.class}, name: #{@name}, id: #{@id}"
1383
+ "#{self.class}@#{cnx.host}, id: #{@id}"
1240
1384
  end
1241
1385
 
1242
1386
  # Remove the init_data and api object from
@@ -1247,7 +1391,7 @@ module JSS
1247
1391
  #
1248
1392
  def pretty_print_instance_variables
1249
1393
  vars = instance_variables.sort
1250
- vars.delete :@api
1394
+ vars.delete :@cnx
1251
1395
  vars.delete :@init_data
1252
1396
  vars.delete :@main_subset
1253
1397
  vars
@@ -1259,7 +1403,7 @@ module JSS
1259
1403
  # object type in the OBJECT_HISTORY_TABLE in the database
1260
1404
  # (e.g. for computers, the object type is 1)
1261
1405
  #
1262
- # NOTE: Object history is not available via the API,
1406
+ # NOTE: Object history is not available via the Classic API,
1263
1407
  # so access is only available through direct MySQL
1264
1408
  # connections
1265
1409
  #
@@ -1281,9 +1425,9 @@ module JSS
1281
1425
  def add_object_history_entry(user: nil, notes: nil, details: nil)
1282
1426
  validate_object_history_available
1283
1427
 
1284
- raise JSS::MissingDataError, 'A user: must be provided to make the entry' unless user
1428
+ raise Jamf::MissingDataError, 'A user: must be provided to make the entry' unless user
1285
1429
 
1286
- raise JSS::MissingDataError, 'Either notes: must be provided to make the entry' unless notes
1430
+ raise Jamf::MissingDataError, 'notes: must be provided to make the entry' unless notes
1287
1431
 
1288
1432
  user = "'#{Mysql.quote user.to_s}'"
1289
1433
  notes = "'#{Mysql.quote notes.to_s}'"
@@ -1302,7 +1446,7 @@ module JSS
1302
1446
  VALUES
1303
1447
  (#{value_list})"
1304
1448
 
1305
- JSS::DB_CNX.db.query q
1449
+ Jamf::DB_CNX.db.query q
1306
1450
  end
1307
1451
 
1308
1452
  # the object history for this object, an array of hashes
@@ -1324,7 +1468,7 @@ module JSS
1324
1468
  AND object_id = #{@id}
1325
1469
  ORDER BY object_history_id ASC"
1326
1470
 
1327
- result = JSS::DB_CNX.db.query q
1471
+ result = Jamf::DB_CNX.db.query q
1328
1472
  history = []
1329
1473
  result.each do |entry|
1330
1474
  history << {
@@ -1362,11 +1506,11 @@ module JSS
1362
1506
  # @return [void]
1363
1507
  #
1364
1508
  def validate_object_history_available
1365
- raise JSS::NoSuchItemError, 'Object not yet created' unless @id && @in_jss
1509
+ raise Jamf::NoSuchItemError, 'Object not yet created' unless @id && @in_jss
1366
1510
 
1367
- raise JSS::InvalidConnectionError, 'Not connected to MySQL' unless JSS::DB_CNX.connected?
1511
+ raise Jamf::InvalidConnectionError, 'Not connected to MySQL' unless Jamf::DB_CNX.connected?
1368
1512
 
1369
- raise JSS::UnsupportedError, "Object History access is not supported for #{self.class} objects at this time" unless defined? self.class::OBJECT_HISTORY_OBJECT_TYPE
1513
+ raise Jamf::UnsupportedError, "Object History access is not supported for #{self.class} objects at this time" unless defined? self.class::OBJECT_HISTORY_OBJECT_TYPE
1370
1514
  end
1371
1515
 
1372
1516
 
@@ -1382,15 +1526,15 @@ module JSS
1382
1526
  # @return [void]
1383
1527
  #
1384
1528
  def validate_init_for_creation(args)
1385
- raise JSS::UnsupportedError, "Creating #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless creatable?
1529
+ raise Jamf::UnsupportedError, "Creating #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless creatable?
1386
1530
 
1387
- raise JSS::MissingDataError, "You must provide a :name to create a #{self.class::RSRC_OBJECT_KEY}." unless args[:name]
1531
+ raise Jamf::MissingDataError, "You must provide a :name to create a #{self.class::RSRC_OBJECT_KEY}." unless args[:name]
1388
1532
 
1389
1533
  return if defined? self.class::NON_UNIQUE_NAMES
1390
1534
 
1391
- matches = self.class.all_names(:refresh, api: @api).select { |n| n.casecmp? args[:name] }
1535
+ matches = self.class.all_names(:refresh, cnx: @cnx).select { |n| n.casecmp? args[:name] }
1392
1536
 
1393
- raise JSS::AlreadyExistsError, "A #{self.class::RSRC_OBJECT_KEY} already exists with the name '#{args[:name]}'" unless matches.empty?
1537
+ raise Jamf::AlreadyExistsError, "A #{self.class::RSRC_OBJECT_KEY} already exists with the name '#{args[:name]}'" unless matches.empty?
1394
1538
 
1395
1539
  end
1396
1540
 
@@ -1412,10 +1556,10 @@ module JSS
1412
1556
  raw_json =
1413
1557
  if defined? self.class::USE_XML_WORKAROUND
1414
1558
  # if we're here, the API JSON is borked, so use the XML
1415
- JSS::XMLWorkaround.data_via_xml rsrc, self.class::USE_XML_WORKAROUND, @api
1559
+ Jamf::XMLWorkaround.data_via_xml rsrc, self.class::USE_XML_WORKAROUND, @cnx
1416
1560
  else
1417
1561
  # otherwise
1418
- @api.get_rsrc(rsrc)
1562
+ @cnx.c_get(rsrc)
1419
1563
  end
1420
1564
 
1421
1565
  raw_json[args[:rsrc_object_key]]
@@ -1569,116 +1713,12 @@ module JSS
1569
1713
  # Most classes will redefine this method.
1570
1714
  #
1571
1715
  def rest_xml
1572
- doc = REXML::Document.new JSS::APIConnection::XML_HEADER
1716
+ doc = REXML::Document.new Jamf::Connection::XML_HEADER
1573
1717
  tmpl = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
1574
1718
  tmpl.add_element('name').text = @name
1575
1719
  doc.to_s
1576
1720
  end
1577
1721
 
1578
- # Meta Programming
1579
- ####################################################
1580
-
1581
- # Loop through the defined lookup keys and make
1582
- # .all_<key>s methods for each one, with
1583
- # alises as needed.
1584
- #
1585
- # This is called automatically in api_object.rb
1586
- # after all subclasses are loaded.
1587
- #
1588
- def self.define_identifier_list_methods
1589
- return unless @subclasses
1590
-
1591
- @subclasses.each do |subclass|
1592
- subclass.lookup_keys.each do |als, key|
1593
- meth_name = "all_#{key}s"
1594
-
1595
- if als == key
1596
- # the all_ method - skip if defined in the class
1597
- next if subclass.instance_methods.include? meth_name
1598
-
1599
- subclass.define_singleton_method meth_name do |refresh = false, api: JSS.api|
1600
- all(refresh, api: api).map { |i| i[key] }
1601
- end
1602
-
1603
- else
1604
- # an alias - skip if defined in the class
1605
- als_name = "all_#{als}s"
1606
- next if subclass.instance_methods.include? als_name
1607
-
1608
- subclass.define_singleton_method als_name do |refresh = false, api: JSS.api|
1609
- send meth_name, refresh, api: api
1610
- end
1611
- end # if
1612
- end # lookup_keys.each
1613
- end # @subclasses.each
1614
- end # self.define_identifier_list_methods
1615
-
1616
1722
  end # class APIObject
1617
1723
 
1618
- end # module JSS
1619
-
1620
- ### Mix-in Sub Modules
1621
- require 'jss/api_object/creatable'
1622
- require 'jss/api_object/uploadable'
1623
- require 'jss/api_object/locatable'
1624
- require 'jss/api_object/matchable'
1625
- require 'jss/api_object/purchasable'
1626
- require 'jss/api_object/updatable'
1627
- require 'jss/api_object/extendable'
1628
- require 'jss/api_object/self_servable'
1629
- require 'jss/api_object/categorizable'
1630
- require 'jss/api_object/vppable'
1631
- require 'jss/api_object/sitable'
1632
- require 'jss/api_object/mdm'
1633
- require 'jss/api_object/management_history'
1634
-
1635
- ### Mix-in Sub Modules with Classes
1636
- require 'jss/api_object/criteriable'
1637
- require 'jss/api_object/scopable'
1638
-
1639
- ### APIObject SubClasses with SubClasses
1640
- require 'jss/api_object/advanced_search'
1641
- require 'jss/api_object/configuration_profile'
1642
- require 'jss/api_object/extension_attribute'
1643
- require 'jss/api_object/group'
1644
- require 'jss/api_object/patch_source'
1645
-
1646
- ### APIObject SubClasses without SubClasses
1647
- require 'jss/api_object/account'
1648
- require 'jss/api_object/building'
1649
- require 'jss/api_object/category'
1650
- require 'jss/api_object/computer'
1651
- require 'jss/api_object/computer_invitation'
1652
- require 'jss/api_object/department'
1653
- require 'jss/api_object/disk_encryption_configurations'
1654
- require "jss/api_object/directory_binding_type"
1655
- require 'jss/api_object/directory_binding'
1656
- require 'jss/api_object/distribution_point'
1657
- require 'jss/api_object/ebook'
1658
- require 'jss/api_object/ibeacon'
1659
- require 'jss/api_object/dock_item'
1660
- require 'jss/api_object/ldap_server'
1661
- require 'jss/api_object/mac_application'
1662
- require 'jss/api_object/mobile_device'
1663
- require 'jss/api_object/mobile_device_application'
1664
- require 'jss/api_object/netboot_server'
1665
- require 'jss/api_object/network_segment'
1666
- require 'jss/api_object/package'
1667
- require 'jss/api_object/patch_title'
1668
- require 'jss/api_object/patch_policy'
1669
- require 'jss/api_object/peripheral_type'
1670
- require 'jss/api_object/peripheral'
1671
- require 'jss/api_object/policy'
1672
- require 'jss/api_object/removable_macaddr'
1673
- require 'jss/api_object/restricted_software'
1674
- require 'jss/api_object/script'
1675
- require 'jss/api_object/site'
1676
- require 'jss/api_object/software_update_server'
1677
- require 'jss/api_object/user'
1678
- require 'jss/api_object/webhook'
1679
- require 'jss/api_object/printer'
1680
-
1681
- ### Other
1682
- require 'jss/api_object/app_store_country_codes'
1683
-
1684
- JSS::APIObject.define_identifier_list_methods
1724
+ end # module Jamf