ruby-jss 1.3.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +122 -0
  3. data/lib/jamf.rb +18 -16
  4. data/lib/jamf/api/base_classes/collection_resource.rb +613 -0
  5. data/lib/jamf/api/{abstract_classes → base_classes}/json_object.rb +109 -101
  6. data/lib/jamf/api/{abstract_classes → base_classes}/prestage.rb +55 -30
  7. data/lib/jamf/api/{abstract_classes → base_classes}/resource.rb +10 -6
  8. data/lib/jamf/api/{abstract_classes → base_classes}/singleton_resource.rb +4 -3
  9. data/lib/jamf/api/connection.rb +13 -9
  10. data/lib/jamf/api/connection/api_error.rb +8 -8
  11. data/lib/jamf/api/connection/token.rb +36 -15
  12. data/lib/jamf/api/json_objects/device_enrollment_device.rb +14 -7
  13. data/lib/jamf/api/json_objects/{location.rb → device_enrollment_device_sync_state.rb} +27 -41
  14. data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +1 -1
  15. data/lib/jamf/api/json_objects/{attachment.rb → locale.rb} +14 -23
  16. data/lib/jamf/api/json_objects/md_prestage_name.rb +1 -1
  17. data/lib/jamf/api/json_objects/md_prestage_names.rb +2 -2
  18. data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +50 -1
  19. data/lib/jamf/api/json_objects/prestage_assignment.rb +2 -2
  20. data/lib/jamf/api/json_objects/prestage_location.rb +3 -3
  21. data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +7 -7
  22. data/lib/jamf/api/json_objects/prestage_scope.rb +1 -1
  23. data/lib/jamf/api/{resources/collection_resources → json_objects}/time_zone.rb +9 -23
  24. data/lib/jamf/api/mixins/{abstract.rb → base_class.rb} +34 -16
  25. data/lib/jamf/api/mixins/bulk_deletable.rb +27 -6
  26. data/lib/jamf/api/mixins/change_log.rb +201 -51
  27. data/lib/jamf/api/{resources/collection_resources/computer.rb → mixins/filterable.rb} +19 -17
  28. data/lib/jamf/api/mixins/pageable.rb +208 -0
  29. data/lib/jamf/api/{json_objects/installed_application.rb → mixins/sortable.rb} +33 -33
  30. data/lib/jamf/api/resources/collection_resources/building.rb +16 -9
  31. data/lib/jamf/api/resources/collection_resources/category.rb +5 -4
  32. data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +12 -5
  33. data/lib/jamf/api/resources/collection_resources/department.rb +1 -3
  34. data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +13 -13
  35. data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +11 -3
  36. data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +25 -23
  37. data/lib/jamf/api/resources/collection_resources/script.rb +61 -25
  38. data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +15 -5
  39. data/lib/jamf/api/resources/singleton_resources/locales.rb +155 -0
  40. data/lib/jamf/api/resources/singleton_resources/time_zones.rb +213 -0
  41. data/lib/jamf/validate.rb +63 -24
  42. data/lib/jamf/version.rb +1 -1
  43. data/lib/jss.rb +2 -1
  44. data/lib/jss/api_connection.rb +113 -406
  45. data/lib/jss/api_object.rb +10 -20
  46. data/lib/jss/api_object/advanced_search.rb +27 -26
  47. data/lib/jss/api_object/app_store_country_codes.rb +298 -0
  48. data/lib/jss/api_object/categorizable.rb +1 -1
  49. data/lib/jss/api_object/computer.rb +13 -0
  50. data/lib/jss/api_object/configuration_profile.rb +60 -4
  51. data/lib/jss/api_object/directory_binding_type.rb +66 -60
  52. data/lib/jss/api_object/directory_binding_type/active_directory.rb +71 -34
  53. data/lib/jss/api_object/directory_binding_type/admitmac.rb +536 -467
  54. data/lib/jss/api_object/directory_binding_type/centrify.rb +21 -7
  55. data/lib/jss/api_object/directory_binding_type/open_directory.rb +4 -4
  56. data/lib/jss/api_object/distribution_point.rb +2 -2
  57. data/lib/jss/api_object/dock_item.rb +102 -96
  58. data/lib/jss/api_object/ebook.rb +1 -2
  59. data/lib/jss/api_object/extendable.rb +1 -1
  60. data/lib/jss/api_object/extension_attribute.rb +4 -3
  61. data/lib/jss/api_object/group.rb +33 -2
  62. data/lib/jss/api_object/mac_application.rb +107 -8
  63. data/lib/jss/api_object/network_segment.rb +43 -12
  64. data/lib/jss/api_object/package.rb +1 -1
  65. data/lib/jss/api_object/patch_source.rb +10 -9
  66. data/lib/jss/api_object/policy.rb +217 -28
  67. data/lib/jss/api_object/printer.rb +10 -4
  68. data/lib/jss/api_object/scopable.rb +10 -15
  69. data/lib/jss/api_object/scopable/scope.rb +389 -73
  70. data/lib/jss/api_object/self_servable.rb +17 -9
  71. data/lib/jss/api_object/uploadable.rb +1 -1
  72. data/lib/jss/api_object/user.rb +42 -1
  73. data/lib/jss/api_object/vpp_account.rb +209 -0
  74. data/lib/jss/api_object/vppable.rb +169 -13
  75. data/lib/jss/exceptions.rb +3 -0
  76. data/lib/jss/server.rb +15 -0
  77. data/lib/jss/utility.rb +142 -37
  78. data/lib/jss/validate.rb +53 -10
  79. data/lib/jss/version.rb +1 -1
  80. metadata +45 -61
  81. data/lib/jamf/api/abstract_classes/advanced_search.rb +0 -86
  82. data/lib/jamf/api/abstract_classes/collection_resource.rb +0 -433
  83. data/lib/jamf/api/abstract_classes/generic_reference.rb +0 -145
  84. data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +0 -126
  85. data/lib/jamf/api/json_objects/account_prefs.rb +0 -79
  86. data/lib/jamf/api/json_objects/android_details.rb +0 -139
  87. data/lib/jamf/api/json_objects/appletv_details.rb +0 -110
  88. data/lib/jamf/api/json_objects/cellular_network.rb +0 -151
  89. data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +0 -67
  90. data/lib/jamf/api/json_objects/criterion.rb +0 -152
  91. data/lib/jamf/api/json_objects/extension_attribute_value.rb +0 -128
  92. data/lib/jamf/api/json_objects/installed_certificate.rb +0 -53
  93. data/lib/jamf/api/json_objects/installed_configuration_profile.rb +0 -67
  94. data/lib/jamf/api/json_objects/installed_ebook.rb +0 -58
  95. data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +0 -59
  96. data/lib/jamf/api/json_objects/ios_details.rb +0 -244
  97. data/lib/jamf/api/json_objects/mobile_device_details.rb +0 -219
  98. data/lib/jamf/api/json_objects/mobile_device_security.rb +0 -101
  99. data/lib/jamf/api/json_objects/purchasing_data.rb +0 -125
  100. data/lib/jamf/api/mixins/locatable.rb +0 -124
  101. data/lib/jamf/api/mixins/referable.rb +0 -92
  102. data/lib/jamf/api/resources/collection_resources/account.rb +0 -163
  103. data/lib/jamf/api/resources/collection_resources/advanced_mobile_device_search.rb +0 -52
  104. data/lib/jamf/api/resources/collection_resources/advanced_user_search.rb +0 -52
  105. data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +0 -45
  106. data/lib/jamf/api/resources/collection_resources/mobile_device.rb +0 -315
  107. data/lib/jamf/api/resources/collection_resources/site.rb +0 -77
  108. data/lib/jamf/api/resources/singleton_resources/authorization.rb +0 -88
  109. data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +0 -139
  110. data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +0 -95
@@ -1,77 +0,0 @@
1
- # Copyright 2020 Pixar
2
-
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "Apache License")
5
- # with the following modification; you may not use this file except in
6
- # compliance with the Apache License and the following modification to it:
7
- # Section 6. Trademarks. is deleted and replaced with:
8
- #
9
- # 6. Trademarks. This License does not grant permission to use the trade
10
- # names, trademarks, service marks, or product names of the Licensor
11
- # and its affiliates, except as required to comply with Section 4(c) of
12
- # the License and to reproduce the content of the NOTICE file.
13
- #
14
- # You may obtain a copy of the Apache License at
15
- #
16
- # http://www.apache.org/licenses/LICENSE-2.0
17
- #
18
- # Unless required by applicable law or agreed to in writing, software
19
- # distributed under the Apache License with the above modification is
20
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- # KIND, either express or implied. See the Apache License for the specific
22
- # language governing permissions and limitations under the Apache License.
23
- #
24
- #
25
-
26
- # The Module
27
- module Jamf
28
-
29
- # Classes
30
- #####################################
31
-
32
- # A building defined in the JSS
33
- class Site < Jamf::CollectionResource
34
-
35
- # Mix-Ins
36
- #####################################
37
-
38
- include Jamf::ChangeLog
39
- include Jamf::Referable
40
-
41
- # Constants
42
- #####################################
43
-
44
- RSRC_PATH = 'settings/sites'.freeze
45
-
46
- NO_SITE_ID = -1
47
-
48
- NO_SITE_NAME = 'None'.freeze
49
-
50
- # Object Model / Attributes
51
- # See APIObject class documentation for details
52
- # of how the OBJECT_MODEL hash works.
53
- #####################################
54
- OBJECT_MODEL = {
55
-
56
- # @!attribute [r] id
57
- # @return [Integer]
58
- id: {
59
- class: :integer,
60
- identifier: :primary,
61
- readonly: true
62
- },
63
-
64
- # @!attribute name
65
- # @return [String]
66
- name: {
67
- class: :string,
68
- identifier: true,
69
- validator: :non_empty_string,
70
- required: true
71
- }
72
- }.freeze
73
- parse_object_model
74
-
75
- end # class
76
-
77
- end # module
@@ -1,88 +0,0 @@
1
- # Copyright 2020 Pixar
2
-
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "Apache License")
5
- # with the following modification; you may not use this file except in
6
- # compliance with the Apache License and the following modification to it:
7
- # Section 6. Trademarks. is deleted and replaced with:
8
- #
9
- # 6. Trademarks. This License does not grant permission to use the trade
10
- # names, trademarks, service marks, or product names of the Licensor
11
- # and its affiliates, except as required to comply with Section 4(c) of
12
- # the License and to reproduce the content of the NOTICE file.
13
- #
14
- # You may obtain a copy of the Apache License at
15
- #
16
- # http://www.apache.org/licenses/LICENSE-2.0
17
- #
18
- # Unless required by applicable law or agreed to in writing, software
19
- # distributed under the Apache License with the above modification is
20
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- # KIND, either express or implied. See the Apache License for the specific
22
- # language governing permissions and limitations under the Apache License.
23
- #
24
- #
25
-
26
- module Jamf
27
-
28
- # Authorization Details associated with the current API token
29
- #
30
- class Authorization < Jamf::SingletonResource
31
-
32
- # Constants
33
- #####################################
34
-
35
- RSRC_PATH = 'auth'.freeze
36
-
37
- AUTH_TYPE_JSS = 'JSS'.freeze
38
- AUTH_TYPE_LDAP = 'LDAP'.freeze
39
- AUTH_TYPE_SAML = 'SAML'.freeze
40
- AUTH_TYPE_INVITE = 'INVITE'.freeze
41
- AUTH_TYPE_OAUTH = 'OAUTH'.freeze
42
-
43
- AUTH_TYPES = [
44
- AUTH_TYPE_JSS,
45
- AUTH_TYPE_LDAP,
46
- AUTH_TYPE_SAML,
47
- AUTH_TYPE_INVITE,
48
- AUTH_TYPE_OAUTH
49
- ].freeze
50
-
51
- OBJECT_MODEL = {
52
-
53
- # @!attribute account
54
- # @return [Jamf::Account]
55
- account: {
56
- class: Jamf::Account,
57
- readonly: true
58
- },
59
-
60
- # @!attribute accountGroups
61
- # @return [Array<Jamf::AccountGroup>]
62
- accountGroups: {
63
- class: Jamf::AccountGroup,
64
- multi: true,
65
- readonly: true
66
- },
67
-
68
- # @!attribute sites
69
- # @return [Array<amf::Site>]
70
- sites: {
71
- class: Jamf::Site,
72
- multi: true,
73
- readonly: true
74
- },
75
-
76
- # @!attribute authenticationType
77
- # @return [String]
78
- authenticationType: {
79
- class: :string,
80
- enum: Jamf::Authorization::AUTH_TYPES
81
- }
82
-
83
- }.freeze # end OBJECT_MODEL
84
- parse_object_model
85
-
86
- end # class ReEnrollment
87
-
88
- end # module JAMF
@@ -1,139 +0,0 @@
1
- # Copyright 2020 Pixar
2
-
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "Apache License")
5
- # with the following modification; you may not use this file except in
6
- # compliance with the Apache License and the following modification to it:
7
- # Section 6. Trademarks. is deleted and replaced with:
8
- #
9
- # 6. Trademarks. This License does not grant permission to use the trade
10
- # names, trademarks, service marks, or product names of the Licensor
11
- # and its affiliates, except as required to comply with Section 4(c) of
12
- # the License and to reproduce the content of the NOTICE file.
13
- #
14
- # You may obtain a copy of the Apache License at
15
- #
16
- # http://www.apache.org/licenses/LICENSE-2.0
17
- #
18
- # Unless required by applicable law or agreed to in writing, software
19
- # distributed under the Apache License with the above modification is
20
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- # KIND, either express or implied. See the Apache License for the specific
22
- # language governing permissions and limitations under the Apache License.
23
- #
24
- #
25
-
26
- module Jamf
27
-
28
- # The client checkin settings for the Jamf Pro Server
29
- #
30
- class ClientCheckInSettings < Jamf::SingletonResource
31
-
32
- # Mix-Ins
33
- #####################################
34
-
35
- extend Jamf::ChangeLog
36
- include Jamf::ChangeLog
37
-
38
- # Constants
39
- #####################################
40
-
41
- UPDATABLE = true
42
-
43
- RSRC_VERSION = 'v1'.freeze
44
-
45
- RSRC_PATH = 'check-in'.freeze
46
-
47
- OBJECT_MODEL = {
48
-
49
- # @!attribute checkInFrequency
50
- # @return [integer]
51
- checkInFrequency: {
52
- class: :integer
53
- },
54
-
55
- # @!attribute isCreateHooks
56
- # @return [Boolean]
57
- isCreateHooks: {
58
- class: :boolean
59
- },
60
-
61
- # @!attribute isHookLog
62
- # @return [Boolean]
63
- isHookLog: {
64
- class: :boolean
65
- },
66
-
67
- # @!attribute isHookPolicies
68
- # @return [Boolean]
69
- isHookPolicies: {
70
- class: :boolean
71
- },
72
-
73
- # @!attribute isHookHideRestore
74
- # @return [Boolean]
75
- isHookHideRestore: {
76
- class: :boolean
77
- },
78
-
79
- # @!attribute isHookMCX
80
- # @return [Boolean]
81
- isHookMCX: {
82
- class: :boolean
83
- },
84
-
85
- # @!attribute isBackgroundHooks
86
- # @return [Boolean]
87
- isBackgroundHooks: {
88
- class: :boolean
89
- },
90
-
91
- # @!attribute isHookDisplayStatus
92
- # @return [Boolean]
93
- isHookDisplayStatus: {
94
- class: :boolean
95
- },
96
-
97
- # @!attribute isCreateStartupScript
98
- # @return [Boolean]
99
- isCreateStartupScript: {
100
- class: :boolean
101
- },
102
-
103
- # @!attribute isStartupLog
104
- # @return [Boolean]
105
- isStartupLog: {
106
- class: :boolean
107
- },
108
-
109
- # @!attribute isStartupPolicies
110
- # @return [Boolean]
111
- isStartupPolicies: {
112
- class: :boolean
113
- },
114
-
115
- # @!attribute isStartupSSH
116
- # @return [Boolean]
117
- isStartupSSH: {
118
- class: :boolean
119
- },
120
-
121
- # @!attribute isStartupMCX
122
- # @return [Boolean]
123
- isStartupMCX: {
124
- class: :boolean
125
- },
126
-
127
- # @!attribute isEnableLocalConfigurationProfiles
128
- # @return [Boolean]
129
- isEnableLocalConfigurationProfiles: {
130
- class: :boolean
131
- }
132
-
133
- }.freeze # end OBJECT_MODEL
134
-
135
- parse_object_model
136
-
137
- end # class ClientCheckIn
138
-
139
- end # module JAMF
@@ -1,95 +0,0 @@
1
- # Copyright 2020 Pixar
2
-
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "Apache License")
5
- # with the following modification; you may not use this file except in
6
- # compliance with the Apache License and the following modification to it:
7
- # Section 6. Trademarks. is deleted and replaced with:
8
- #
9
- # 6. Trademarks. This License does not grant permission to use the trade
10
- # names, trademarks, service marks, or product names of the Licensor
11
- # and its affiliates, except as required to comply with Section 4(c) of
12
- # the License and to reproduce the content of the NOTICE file.
13
- #
14
- # You may obtain a copy of the Apache License at
15
- #
16
- # http://www.apache.org/licenses/LICENSE-2.0
17
- #
18
- # Unless required by applicable law or agreed to in writing, software
19
- # distributed under the Apache License with the above modification is
20
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- # KIND, either express or implied. See the Apache License for the specific
22
- # language governing permissions and limitations under the Apache License.
23
- #
24
- #
25
-
26
- module Jamf
27
-
28
- # The device re-enrollment settings for the Jamf Pro Server
29
- #
30
- class ReEnrollmentSettings < Jamf::SingletonResource
31
-
32
- # Mix-Ins
33
- #####################################
34
-
35
- include Jamf::ChangeLog
36
-
37
- # Constants
38
- #####################################
39
-
40
- RSRC_VERSION = 'v1'.freeze
41
-
42
- RSRC_PATH = 'reenrollment'.freeze
43
-
44
- FLUSH_MDM_QUEUE_NOTHING = 'DELETE_NOTHING'.freeze
45
- FLUSH_MDM_QUEUE_ERRORS = 'DELETE_ERRORS'.freeze
46
- FLUSH_MDM_QUEUE_NOT_ACKD = 'DELETE_EVERYTHING_EXCEPT_ACKNOWLEDGED'.freeze
47
- FLUSH_MDM_QUEUE_EVERYTHING = 'DELETE_EVERYTHING'.freeze
48
-
49
- FLUSH_MDM_QUEUE_OPTIONS = [
50
- FLUSH_MDM_QUEUE_NOTHING,
51
- FLUSH_MDM_QUEUE_ERRORS,
52
- FLUSH_MDM_QUEUE_NOT_ACKD,
53
- FLUSH_MDM_QUEUE_EVERYTHING
54
- ].freeze
55
-
56
- OBJECT_MODEL = {
57
-
58
- # @!attribute isFlushPolicyHistoryEnabled
59
- # @return [Boolean]
60
- isFlushPolicyHistoryEnabled: {
61
- class: :boolean
62
- },
63
-
64
- # @!attribute isFlushLocationInformationEnabled
65
- # @return [Boolean]
66
- isFlushLocationInformationEnabled: {
67
- class: :boolean
68
- },
69
-
70
- # @!attribute isFlushLocationInformationHistoryEnabled
71
- # @return [Boolean]
72
- isFlushLocationInformationHistoryEnabled: {
73
- class: :boolean
74
- },
75
-
76
- # @!attribute isFlushExtensionAttributesEnabled
77
- # @return [Boolean]
78
- isFlushExtensionAttributesEnabled: {
79
- class: :boolean
80
- },
81
-
82
- # @!attribute flushMDMQueue
83
- # @param [Symbol] a key from ReEnrollment::FLUSH_MDM_QUEUE_OPTIONS
84
- # @return [Symbol]
85
- flushMDMQueue: {
86
- class: :string,
87
- enum: FLUSH_MDM_QUEUE_OPTIONS
88
- }
89
-
90
- }.freeze # end OBJECT_MODEL
91
- parse_object_model
92
-
93
- end # class ReEnrollment
94
-
95
- end # module JAMF