ruby-jss 1.4.1 → 1.6.0

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +95 -0
  3. data/THANKS.md +3 -2
  4. data/lib/jamf.rb +18 -17
  5. data/lib/jamf/api/base_classes/collection_resource.rb +613 -0
  6. data/lib/jamf/api/{abstract_classes → base_classes}/json_object.rb +109 -101
  7. data/lib/jamf/api/{abstract_classes → base_classes}/prestage.rb +55 -30
  8. data/lib/jamf/api/{abstract_classes → base_classes}/resource.rb +10 -6
  9. data/lib/jamf/api/{abstract_classes → base_classes}/singleton_resource.rb +4 -3
  10. data/lib/jamf/api/connection.rb +13 -9
  11. data/lib/jamf/api/connection/api_error.rb +8 -8
  12. data/lib/jamf/api/connection/token.rb +16 -15
  13. data/lib/jamf/api/json_objects/device_enrollment_device.rb +14 -7
  14. data/lib/jamf/api/json_objects/{location.rb → device_enrollment_device_sync_state.rb} +27 -41
  15. data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +1 -1
  16. data/lib/jamf/api/json_objects/{attachment.rb → locale.rb} +14 -23
  17. data/lib/jamf/api/json_objects/md_prestage_name.rb +1 -1
  18. data/lib/jamf/api/json_objects/md_prestage_names.rb +2 -2
  19. data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +50 -1
  20. data/lib/jamf/api/json_objects/prestage_assignment.rb +2 -2
  21. data/lib/jamf/api/json_objects/prestage_location.rb +3 -3
  22. data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +7 -7
  23. data/lib/jamf/api/json_objects/prestage_scope.rb +1 -1
  24. data/lib/jamf/api/{resources/collection_resources → json_objects}/time_zone.rb +9 -23
  25. data/lib/jamf/api/mixins/{abstract.rb → base_class.rb} +34 -16
  26. data/lib/jamf/api/mixins/bulk_deletable.rb +27 -6
  27. data/lib/jamf/api/mixins/change_log.rb +201 -51
  28. data/lib/jamf/api/{resources/collection_resources/computer.rb → mixins/filterable.rb} +19 -17
  29. data/lib/jamf/api/mixins/pageable.rb +208 -0
  30. data/lib/jamf/api/{json_objects/installed_application.rb → mixins/sortable.rb} +33 -33
  31. data/lib/jamf/api/resources/collection_resources/building.rb +16 -9
  32. data/lib/jamf/api/resources/collection_resources/category.rb +5 -4
  33. data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +12 -5
  34. data/lib/jamf/api/resources/collection_resources/department.rb +0 -2
  35. data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +10 -10
  36. data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +11 -3
  37. data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +25 -23
  38. data/lib/jamf/api/resources/collection_resources/script.rb +61 -25
  39. data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +15 -5
  40. data/lib/jamf/api/resources/singleton_resources/locales.rb +155 -0
  41. data/lib/jamf/api/resources/singleton_resources/time_zones.rb +213 -0
  42. data/lib/jamf/client.rb +3 -3
  43. data/lib/jamf/client/management_action.rb +2 -3
  44. data/lib/jamf/composer.rb +2 -2
  45. data/lib/jamf/utility.rb +35 -7
  46. data/lib/jamf/validate.rb +63 -24
  47. data/lib/jamf/version.rb +1 -1
  48. data/lib/jss.rb +2 -2
  49. data/lib/jss/api_connection.rb +114 -406
  50. data/lib/jss/api_object.rb +3 -19
  51. data/lib/jss/api_object/categorizable.rb +1 -1
  52. data/lib/jss/api_object/computer.rb +13 -0
  53. data/lib/jss/api_object/configuration_profile.rb +61 -5
  54. data/lib/jss/api_object/directory_binding_type.rb +66 -60
  55. data/lib/jss/api_object/directory_binding_type/active_directory.rb +71 -34
  56. data/lib/jss/api_object/directory_binding_type/admitmac.rb +536 -467
  57. data/lib/jss/api_object/directory_binding_type/centrify.rb +21 -7
  58. data/lib/jss/api_object/directory_binding_type/open_directory.rb +4 -4
  59. data/lib/jss/api_object/distribution_point.rb +2 -2
  60. data/lib/jss/api_object/dock_item.rb +102 -96
  61. data/lib/jss/api_object/extendable.rb +1 -1
  62. data/lib/jss/api_object/group.rb +33 -2
  63. data/lib/jss/api_object/network_segment.rb +45 -13
  64. data/lib/jss/api_object/patch_source.rb +10 -9
  65. data/lib/jss/api_object/policy.rb +155 -25
  66. data/lib/jss/api_object/printer.rb +10 -4
  67. data/lib/jss/api_object/scopable.rb +10 -15
  68. data/lib/jss/api_object/scopable/scope.rb +31 -30
  69. data/lib/jss/api_object/script.rb +242 -352
  70. data/lib/jss/api_object/user.rb +1 -1
  71. data/lib/jss/client/management_action.rb +1 -2
  72. data/lib/jss/composer.rb +2 -2
  73. data/lib/jss/exceptions.rb +3 -0
  74. data/lib/jss/server.rb +15 -0
  75. data/lib/jss/utility.rb +213 -45
  76. data/lib/jss/version.rb +1 -1
  77. metadata +46 -64
  78. data/lib/jamf/api/abstract_classes/advanced_search.rb +0 -86
  79. data/lib/jamf/api/abstract_classes/collection_resource.rb +0 -433
  80. data/lib/jamf/api/abstract_classes/generic_reference.rb +0 -145
  81. data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +0 -126
  82. data/lib/jamf/api/json_objects/account_prefs.rb +0 -79
  83. data/lib/jamf/api/json_objects/android_details.rb +0 -139
  84. data/lib/jamf/api/json_objects/appletv_details.rb +0 -110
  85. data/lib/jamf/api/json_objects/cellular_network.rb +0 -151
  86. data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +0 -67
  87. data/lib/jamf/api/json_objects/criterion.rb +0 -152
  88. data/lib/jamf/api/json_objects/extension_attribute_value.rb +0 -128
  89. data/lib/jamf/api/json_objects/installed_certificate.rb +0 -53
  90. data/lib/jamf/api/json_objects/installed_configuration_profile.rb +0 -67
  91. data/lib/jamf/api/json_objects/installed_ebook.rb +0 -58
  92. data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +0 -59
  93. data/lib/jamf/api/json_objects/ios_details.rb +0 -244
  94. data/lib/jamf/api/json_objects/mobile_device_details.rb +0 -219
  95. data/lib/jamf/api/json_objects/mobile_device_security.rb +0 -101
  96. data/lib/jamf/api/json_objects/purchasing_data.rb +0 -125
  97. data/lib/jamf/api/mixins/locatable.rb +0 -124
  98. data/lib/jamf/api/mixins/referable.rb +0 -92
  99. data/lib/jamf/api/resources/collection_resources/account.rb +0 -163
  100. data/lib/jamf/api/resources/collection_resources/advanced_mobile_device_search.rb +0 -52
  101. data/lib/jamf/api/resources/collection_resources/advanced_user_search.rb +0 -52
  102. data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +0 -45
  103. data/lib/jamf/api/resources/collection_resources/mobile_device.rb +0 -315
  104. data/lib/jamf/api/resources/collection_resources/site.rb +0 -77
  105. data/lib/jamf/api/resources/singleton_resources/authorization.rb +0 -88
  106. data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +0 -139
  107. data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +0 -95
@@ -1,110 +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
- class AppleTVDetails < Jamf::JSONObject
30
-
31
- # Class Constants
32
- #####################################
33
-
34
- # Since instances of this class are always embedded in the
35
- # matching MobileDevice instance, duplicated attributes are
36
- # omitted from OBJECT_MODEL
37
- OBJECT_MODEL = {
38
-
39
- # @!attribute [r] model
40
- # @param [String]
41
- # @return [String]
42
- model: {
43
- class: :string,
44
- readonly: true
45
- },
46
-
47
- # @!attribute [r] modelIdentifier
48
- # @param [String]
49
- # @return [String]
50
- modelIdentifier: {
51
- class: :string,
52
- readonly: true
53
- },
54
-
55
- # @!attribute [r] modelNumber
56
- # @param [String]
57
- # @return [String]
58
- modelNumber: {
59
- class: :string,
60
- readonly: true
61
- },
62
-
63
- # @!attribute [r] isSupervised
64
- # @return [Boolean]
65
- isSupervised: {
66
- class: :boolean,
67
- readonly: true
68
- },
69
-
70
- # @!attribute [r] deviceId
71
- # @return [String]
72
- deviceId: {
73
- class: :string,
74
- readonly: true,
75
- aliases: [:ethernet_mac_address]
76
- },
77
-
78
- # @!attribute [r] locales
79
- # @return [String]
80
- locales: {
81
- class: :string,
82
- readonly: true
83
- },
84
-
85
- # @!attribute [r] configurationProfiles
86
- # @return [Jamf::InstalledConfigurationProfile]
87
- configurationProfiles: {
88
- class: Jamf::InstalledConfigurationProfile,
89
- readonly: true,
90
- multi: true
91
- },
92
-
93
- # @!attribute [r] airplayPassword
94
- # @return [String]
95
- airplayPassword: {
96
- class: :string
97
- },
98
-
99
- # @!attribute [r] purchasing
100
- # @return [Jamf::PurchasingData]
101
- purchasing: {
102
- class: Jamf::PurchasingData,
103
- readonly: true
104
- }
105
- }.freeze
106
- parse_object_model
107
-
108
- end # class AppleTVDetails
109
-
110
- end # module
@@ -1,151 +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
- # The collection of security settings for a device
30
- class CellularNetwork < Jamf::JSONObject
31
-
32
- OBJECT_MODEL = {
33
-
34
- # @!attribute [r] cellularTechnology
35
- # @return [String]
36
- cellularTechnology: {
37
- class: :string,
38
- readonly: true
39
- },
40
-
41
- # @!attribute [r] isVoiceRoamingEnabled
42
- # @return [Boolean]
43
- isVoiceRoamingEnabled: {
44
- class: :boolean,
45
- readonly: true
46
- },
47
-
48
- # @!attribute [r] isDataRoamingEnabled
49
- # @return [Boolean]
50
- isDataRoamingEnabled: {
51
- class: :boolean,
52
- readonly: true
53
- },
54
-
55
- # @!attribute [r] isRoaming
56
- # @return [Boolean]
57
- isRoaming: {
58
- class: :boolean,
59
- readonly: true
60
- },
61
-
62
- # @!attribute [r] imei
63
- # @return [String]
64
- imei: {
65
- class: :string,
66
- readonly: true
67
- },
68
-
69
- # @!attribute [r] iccid
70
- # @return [String]
71
- iccid: {
72
- class: :string,
73
- readonly: true
74
- },
75
-
76
- # @!attribute [r] meid
77
- # @return [String]
78
- meid: {
79
- class: :string,
80
- readonly: true
81
- },
82
-
83
- # @!attribute [r] carrierSettingsVersion
84
- # @return [String]
85
- carrierSettingsVersion: {
86
- class: :string,
87
- readonly: true
88
- },
89
-
90
- # @!attribute [r] currentCarrierNetwork
91
- # @return [String]
92
- currentCarrierNetwork: {
93
- class: :string,
94
- readonly: true
95
- },
96
-
97
- # @!attribute [r] currentMobileCountryCode
98
- # @return [String]
99
- currentMobileCountryCode: {
100
- class: :string,
101
- readonly: true
102
- },
103
-
104
- # @!attribute [r] currentMobileNetworkCode
105
- # @return [String]
106
- currentMobileNetworkCode: {
107
- class: :string,
108
- readonly: true
109
- },
110
-
111
- # @!attribute [r] homeCarrierNetwork
112
- # @return [String]
113
- homeCarrierNetwork: {
114
- class: :string,
115
- readonly: true
116
- },
117
-
118
- # @!attribute [r] homeMobileCountryCode
119
- # @return [String]
120
- homeMobileCountryCode: {
121
- class: :string,
122
- readonly: true
123
- },
124
-
125
- # @!attribute [r] homeMobileNetworkCode
126
- # @return [String]
127
- homeMobileNetworkCode: {
128
- class: :string,
129
- readonly: true
130
- },
131
-
132
- # @!attribute [r] phoneNumber
133
- # @return [String]
134
- phoneNumber: {
135
- class: :string,
136
- readonly: true
137
- }
138
-
139
- }.freeze
140
- parse_object_model
141
-
142
- # Setting as a whole always fails.
143
- #
144
- def self.validate(_value, _cnx = nil)
145
- raise Jamf::UnsupportedError, 'Mobile Device CellularNetwork state cannot be changed via API'
146
- end
147
-
148
-
149
- end # class Mobile Device security
150
-
151
- end # module
@@ -1,67 +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
- # A 'location' for a computer prestage in Jamf Pro
30
- class ComputerPrestageSkipSetupItems < Jamf::PrestageSkipSetupItems
31
-
32
- OBJECT_MODEL = superclass::OBJECT_MODEL.merge(
33
-
34
- # @!attribute FileVault
35
- # @return [Boolean]
36
- FileVault: {
37
- class: :boolean,
38
- aliases: %i[filevault]
39
- },
40
-
41
- # @!attribute iCloudDiagnostics
42
- # @return [Boolean]
43
- iCloudDiagnostics: {
44
- class: :boolean,
45
- aliases: %i[iclouddiagnostics icloud_diagnostics]
46
- },
47
-
48
- # @!attribute iCloudStorage
49
- # @return [Boolean]
50
- iCloudStorage: {
51
- class: :boolean,
52
- aliases: %i[icloudstorage icloud_storage]
53
- },
54
-
55
- # @!attribute Registration
56
- # @return [Boolean]
57
- Registration: {
58
- class: :boolean,
59
- aliases: %i[registration]
60
- }
61
- ).freeze
62
-
63
- parse_object_model
64
-
65
- end # class location
66
-
67
- end # module
@@ -1,152 +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
- # A 'location' for a computer prestage in Jamf Pro
30
- class Criterion < Jamf::JSONObject
31
-
32
- # the acceptable strings for and/or
33
- AND = 'and'.freeze
34
- OR = 'or'.freeze
35
-
36
- AND_OR = [
37
- AND,
38
- OR
39
- ].freeze
40
-
41
- # These are the available search-types for building criteria
42
- IS = 'is'.freeze
43
- IS_NOT = 'is not'.freeze
44
- LIKE = 'like'.freeze
45
- NOT_LIKE = 'not like'.freeze
46
- HAS = 'has'.freeze
47
- HAS_NOT = 'does not have'.freeze
48
- MORE_THAN = 'more than'.freeze
49
- GREATER_THAN = 'greater than'.freeze
50
- LESS_THAN = 'less than'.freeze
51
- GREATER_OR_EQUAL = 'greater than or equal'.freeze
52
- LESS_OR_EQUAL = 'less than or equal'.freeze
53
- BEFORE_DATE = 'before (yyyy-mm-dd)'.freeze
54
- AFTER_DATE = 'after (yyyy-mm-dd)'.freeze
55
- MORE_THAN_DAYS_AGO = 'more than x days ago'.freeze
56
- LESS_THAN_DAYS_AGO = 'less than x days ago'.freeze
57
- IN_MORE_THAN_DAYS = 'in more than x days'.freeze
58
- IN_LESS_THAN_DAYS = 'in less than x days'.freeze
59
- MEMBER = 'member of'.freeze
60
- NOT_MEMBER = 'not member of'.freeze
61
- CURRENT = 'current'.freeze
62
- NOT_CURRENT = 'not current'.freeze
63
- REGEX = 'matches regex'.freeze
64
- NOT_REGEX = 'does not match regex'.freeze
65
-
66
- SEARCH_TYPES = [
67
- IS,
68
- IS_NOT,
69
- LIKE,
70
- NOT_LIKE,
71
- HAS,
72
- HAS_NOT,
73
- MORE_THAN,
74
- GREATER_THAN,
75
- LESS_THAN,
76
- GREATER_OR_EQUAL,
77
- LESS_OR_EQUAL,
78
- BEFORE_DATE,
79
- AFTER_DATE,
80
- MORE_THAN_DAYS_AGO,
81
- LESS_THAN_DAYS_AGO,
82
- IN_MORE_THAN_DAYS,
83
- IN_LESS_THAN_DAYS,
84
- MEMBER,
85
- NOT_MEMBER,
86
- CURRENT,
87
- NOT_CURRENT,
88
- REGEX,
89
- NOT_REGEX
90
- ].freeze
91
-
92
- OBJECT_MODEL = {
93
-
94
- # @!attribute name - the attribute name for this criterion
95
- # @return [String]
96
- name: {
97
- class: :string,
98
- required: true
99
- },
100
-
101
- # @!attribute priority - Not used? Seems to always be zero.
102
- # Order is determined by array index, so not really sure,
103
- # possibly a holdover from classic API/XML
104
- # @return [Integer]
105
- priority: {
106
- class: :integer
107
- },
108
-
109
- # @!attribute andOr - How this criterion is joined to the previous:
110
- # 'and' or 'or', defaults to 'and'.
111
- # meaningless for the first criterion in an array
112
- # @return [String]
113
- andOr: {
114
- class: :string,
115
- enum: Jamf::Criterion::AND_OR
116
- },
117
-
118
- # @!attribute searchType - How to compare the attribute value to
119
- # the search value
120
- # @return [String]
121
- searchType: {
122
- class: :string,
123
- enum: Jamf::Criterion::SEARCH_TYPES,
124
- required: true
125
- },
126
-
127
- # @!attribute value - the value to compare to the attribute
128
- # @return [String]
129
- value: {
130
- class: :string,
131
- required: true
132
- },
133
-
134
- # @!attribute isOpeningParen - does this criterion start with an openParen?
135
- # @return [Boolean]
136
- isOpeningParen: {
137
- class: :boolean
138
- },
139
-
140
- # @!attribute isClosingParen - does this criterion end with a closeParen?
141
- # @return [Boolean]
142
- isClosingParen: {
143
- class: :boolean
144
- }
145
-
146
- }.freeze
147
-
148
- parse_object_model
149
-
150
- end # class location
151
-
152
- end # module