ruby-jss 4.2.0b2 → 4.2.1
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.
- checksums.yaml +4 -4
- data/CHANGES.md +44 -7
- data/README-2.0.0.md +19 -8
- data/README.md +43 -30
- data/lib/jamf/api/classic/api_objects/patch_title.rb +0 -2
- data/lib/jamf/api/jamf_pro/api_objects/api_client.rb +3 -0
- data/lib/jamf/api/jamf_pro/api_objects/api_role.rb +3 -0
- data/lib/jamf/api/jamf_pro/api_objects/j_package.rb +333 -119
- data/lib/jamf/api/jamf_pro/api_objects/managed_software_updates/plan.rb +237 -0
- data/lib/jamf/api/jamf_pro/api_objects/managed_software_updates.rb +291 -0
- data/lib/jamf/api/jamf_pro/base_classes/oapi_object.rb +24 -3
- data/lib/jamf/api/jamf_pro/mixins/collection_resource.rb +23 -3
- data/lib/jamf/api/jamf_pro/mixins/filterable.rb +8 -0
- data/lib/jamf/api/jamf_pro/mixins/jpapi_resource.rb +17 -3
- data/lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb +2 -0
- data/lib/jamf/api/jamf_pro/mixins/prestage.rb +3 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_group.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v1.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/assign_remove_profile_response_sync_state.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account_v1.rb +159 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/authentication_type.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/{device_enrollment_disown_body.rb → available_updates.rb} +14 -10
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_application.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_attachment.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_certificate.rb +151 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_configuration_profile.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching.rb +372 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_alert.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_cache_detail.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error_user_info.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_alert.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_capabilities.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_details.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_local_network.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk.rb +143 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk_encryption.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_extension_attribute.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_font.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general.rb +244 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware.rb +264 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_ibeacon.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory.rb +276 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_file_vault.rb +127 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_licensed_software.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_local_user_account.rb +196 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_mdm_capability.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_package_receipts.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition.rb +145 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_encryption.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_file_vault2_state.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_plugin.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_v3.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_printer.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_purchase.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_remote_management.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_section.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_security.rb +193 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_service.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_software_update.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_storage.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_user_and_location.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/dss_declaration.rb +111 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/dss_declarations.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_method.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_membership.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_information.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/{package_manifest.rb → location_information_v2.rb} +35 -37
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan.rb +181 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_event_store.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_group_post.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_post.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_post_response.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_toggle.rb +115 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_toggle_status.rb +169 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plan_toggle_status_wrapper.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_plans.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_status.rb +173 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/managed_software_update_statuses.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names_v2.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_configuration_post.rb +142 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_device.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_device_post.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_device_response.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_group_post.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_status.rb +127 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/{device_enrollment_prestage.rb → prestage_purchasing_information.rb} +51 -88
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information_v2.rb +174 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/v1_site.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas.rb +24 -1
- data/lib/jamf/api/jamf_pro/other_classes/pager.rb +7 -1
- data/lib/jamf/composer.rb +114 -107
- data/lib/jamf/oapi_validate.rb +1 -0
- data/lib/jamf/utility.rb +20 -14
- data/lib/jamf/version.rb +1 -1
- data/test/bin/runtests +2 -2
- data/test/lib/jamf_test/collection_tests.rb +10 -2
- data/test/tests/computer_group.rb +29 -12
- data/test/tests/{jp_building.rb → j_building.rb} +2 -2
- data/test/tests/j_package.rb +47 -0
- metadata +87 -8
@@ -0,0 +1,174 @@
|
|
1
|
+
# Copyright 2025 Pixar
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
# with the following modification; you may not use this file except in
|
5
|
+
# compliance with the Apache License and the following modification to it:
|
6
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
#
|
8
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
# names, trademarks, service marks, or product names of the Licensor
|
10
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
# the License and to reproduce the content of the NOTICE file.
|
12
|
+
#
|
13
|
+
# You may obtain a copy of the Apache License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the Apache License with the above modification is
|
19
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
# KIND, either express or implied. See the Apache License for the specific
|
21
|
+
# language governing permissions and limitations under the Apache License.
|
22
|
+
#
|
23
|
+
|
24
|
+
|
25
|
+
module Jamf
|
26
|
+
|
27
|
+
# This module is the namespace for all objects defined
|
28
|
+
# in the OAPI JSON schema under the components => schemas key
|
29
|
+
#
|
30
|
+
module OAPISchemas
|
31
|
+
|
32
|
+
|
33
|
+
# OAPI Object Model and Enums for: PrestagePurchasingInformationV2
|
34
|
+
#
|
35
|
+
#
|
36
|
+
#
|
37
|
+
# This class was automatically generated from the api/schema
|
38
|
+
# URL path on a Jamf Pro server version 11.6.1-t1718634702
|
39
|
+
#
|
40
|
+
# This class may be used directly, e.g instances of other classes may
|
41
|
+
# use instances of this class as one of their own properties/attributes.
|
42
|
+
#
|
43
|
+
# It may also be used as a superclass when implementing Jamf Pro API
|
44
|
+
# Resources in ruby-jss. The subclasses include appropriate mixins, and
|
45
|
+
# should expand on the basic functionality provided here.
|
46
|
+
#
|
47
|
+
#
|
48
|
+
# Container Objects:
|
49
|
+
# Other object models that use this model as the value in one
|
50
|
+
# of their attributes.
|
51
|
+
# - Jamf::OAPISchemas::DeviceEnrollmentPrestageV2
|
52
|
+
#
|
53
|
+
# Sub Objects:
|
54
|
+
# Other object models used by this model's attributes.
|
55
|
+
#
|
56
|
+
#
|
57
|
+
# Endpoints and Privileges:
|
58
|
+
# API endpoints and HTTP operations that use this object
|
59
|
+
# model, and the Jamf Pro privileges needed to access them.
|
60
|
+
#
|
61
|
+
#
|
62
|
+
#
|
63
|
+
class PrestagePurchasingInformationV2 < Jamf::OAPIObject
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
OAPI_PROPERTIES = {
|
68
|
+
|
69
|
+
# @!attribute id
|
70
|
+
# @return [String]
|
71
|
+
id: {
|
72
|
+
class: :j_id,
|
73
|
+
required: true,
|
74
|
+
identifier: :primary
|
75
|
+
},
|
76
|
+
|
77
|
+
# @!attribute leased
|
78
|
+
# @return [Boolean]
|
79
|
+
leased: {
|
80
|
+
class: :boolean,
|
81
|
+
required: true
|
82
|
+
},
|
83
|
+
|
84
|
+
# @!attribute purchased
|
85
|
+
# @return [Boolean]
|
86
|
+
purchased: {
|
87
|
+
class: :boolean,
|
88
|
+
required: true
|
89
|
+
},
|
90
|
+
|
91
|
+
# @!attribute appleCareId
|
92
|
+
# @return [String]
|
93
|
+
appleCareId: {
|
94
|
+
class: :string,
|
95
|
+
required: true
|
96
|
+
},
|
97
|
+
|
98
|
+
# @!attribute poNumber
|
99
|
+
# @return [String]
|
100
|
+
poNumber: {
|
101
|
+
class: :string,
|
102
|
+
required: true
|
103
|
+
},
|
104
|
+
|
105
|
+
# @!attribute vendor
|
106
|
+
# @return [String]
|
107
|
+
vendor: {
|
108
|
+
class: :string,
|
109
|
+
required: true
|
110
|
+
},
|
111
|
+
|
112
|
+
# @!attribute purchasePrice
|
113
|
+
# @return [String]
|
114
|
+
purchasePrice: {
|
115
|
+
class: :string,
|
116
|
+
required: true
|
117
|
+
},
|
118
|
+
|
119
|
+
# @!attribute lifeExpectancy
|
120
|
+
# @return [Integer]
|
121
|
+
lifeExpectancy: {
|
122
|
+
class: :integer,
|
123
|
+
required: true
|
124
|
+
},
|
125
|
+
|
126
|
+
# @!attribute purchasingAccount
|
127
|
+
# @return [String]
|
128
|
+
purchasingAccount: {
|
129
|
+
class: :string,
|
130
|
+
required: true
|
131
|
+
},
|
132
|
+
|
133
|
+
# @!attribute purchasingContact
|
134
|
+
# @return [String]
|
135
|
+
purchasingContact: {
|
136
|
+
class: :string,
|
137
|
+
required: true
|
138
|
+
},
|
139
|
+
|
140
|
+
# @!attribute leaseDate
|
141
|
+
# @return [String]
|
142
|
+
leaseDate: {
|
143
|
+
class: :string,
|
144
|
+
required: true
|
145
|
+
},
|
146
|
+
|
147
|
+
# @!attribute poDate
|
148
|
+
# @return [String]
|
149
|
+
poDate: {
|
150
|
+
class: :string,
|
151
|
+
required: true
|
152
|
+
},
|
153
|
+
|
154
|
+
# @!attribute warrantyDate
|
155
|
+
# @return [String]
|
156
|
+
warrantyDate: {
|
157
|
+
class: :string,
|
158
|
+
required: true
|
159
|
+
},
|
160
|
+
|
161
|
+
# @!attribute versionLock
|
162
|
+
# @return [Integer]
|
163
|
+
versionLock: {
|
164
|
+
class: :integer,
|
165
|
+
required: true
|
166
|
+
}
|
167
|
+
|
168
|
+
} # end OAPI_PROPERTIES
|
169
|
+
|
170
|
+
end # class PrestagePurchasingInformationV2
|
171
|
+
|
172
|
+
end # module OAPISchemas
|
173
|
+
|
174
|
+
end # module Jamf
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# Copyright 2025 Pixar
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
# with the following modification; you may not use this file except in
|
5
|
+
# compliance with the Apache License and the following modification to it:
|
6
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
#
|
8
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
# names, trademarks, service marks, or product names of the Licensor
|
10
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
# the License and to reproduce the content of the NOTICE file.
|
12
|
+
#
|
13
|
+
# You may obtain a copy of the Apache License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the Apache License with the above modification is
|
19
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
# KIND, either express or implied. See the Apache License for the specific
|
21
|
+
# language governing permissions and limitations under the Apache License.
|
22
|
+
#
|
23
|
+
|
24
|
+
|
25
|
+
module Jamf
|
26
|
+
|
27
|
+
# This module is the namespace for all objects defined
|
28
|
+
# in the OAPI JSON schema under the components => schemas key
|
29
|
+
#
|
30
|
+
module OAPISchemas
|
31
|
+
|
32
|
+
|
33
|
+
# OAPI Object Model and Enums for: PrestageScopeAssignmentV2
|
34
|
+
#
|
35
|
+
#
|
36
|
+
#
|
37
|
+
# This class was automatically generated from the api/schema
|
38
|
+
# URL path on a Jamf Pro server version 11.6.1-t1718634702
|
39
|
+
#
|
40
|
+
# This class may be used directly, e.g instances of other classes may
|
41
|
+
# use instances of this class as one of their own properties/attributes.
|
42
|
+
#
|
43
|
+
# It may also be used as a superclass when implementing Jamf Pro API
|
44
|
+
# Resources in ruby-jss. The subclasses include appropriate mixins, and
|
45
|
+
# should expand on the basic functionality provided here.
|
46
|
+
#
|
47
|
+
#
|
48
|
+
# Container Objects:
|
49
|
+
# Other object models that use this model as the value in one
|
50
|
+
# of their attributes.
|
51
|
+
# - Jamf::OAPISchemas::PrestageScopeResponseV2
|
52
|
+
#
|
53
|
+
# Sub Objects:
|
54
|
+
# Other object models used by this model's attributes.
|
55
|
+
#
|
56
|
+
#
|
57
|
+
# Endpoints and Privileges:
|
58
|
+
# API endpoints and HTTP operations that use this object
|
59
|
+
# model, and the Jamf Pro privileges needed to access them.
|
60
|
+
#
|
61
|
+
#
|
62
|
+
#
|
63
|
+
class PrestageScopeAssignmentV2 < Jamf::OAPIObject
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
OAPI_PROPERTIES = {
|
68
|
+
|
69
|
+
# @!attribute serialNumber
|
70
|
+
# @return [String]
|
71
|
+
serialNumber: {
|
72
|
+
class: :string
|
73
|
+
},
|
74
|
+
|
75
|
+
# @!attribute assignmentDate
|
76
|
+
# @return [Jamf::Timestamp]
|
77
|
+
assignmentDate: {
|
78
|
+
class: Jamf::Timestamp,
|
79
|
+
format: 'date-time'
|
80
|
+
},
|
81
|
+
|
82
|
+
# @!attribute userAssigned
|
83
|
+
# @return [String]
|
84
|
+
userAssigned: {
|
85
|
+
class: :string
|
86
|
+
}
|
87
|
+
|
88
|
+
} # end OAPI_PROPERTIES
|
89
|
+
|
90
|
+
end # class PrestageScopeAssignmentV2
|
91
|
+
|
92
|
+
end # module OAPISchemas
|
93
|
+
|
94
|
+
end # module Jamf
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# Copyright 2025 Pixar
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
# with the following modification; you may not use this file except in
|
5
|
+
# compliance with the Apache License and the following modification to it:
|
6
|
+
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
#
|
8
|
+
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
# names, trademarks, service marks, or product names of the Licensor
|
10
|
+
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
# the License and to reproduce the content of the NOTICE file.
|
12
|
+
#
|
13
|
+
# You may obtain a copy of the Apache License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the Apache License with the above modification is
|
19
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
# KIND, either express or implied. See the Apache License for the specific
|
21
|
+
# language governing permissions and limitations under the Apache License.
|
22
|
+
#
|
23
|
+
|
24
|
+
|
25
|
+
module Jamf
|
26
|
+
|
27
|
+
# This module is the namespace for all objects defined
|
28
|
+
# in the OAPI JSON schema under the components => schemas key
|
29
|
+
#
|
30
|
+
module OAPISchemas
|
31
|
+
|
32
|
+
|
33
|
+
# OAPI Object Model and Enums for: V1Site
|
34
|
+
#
|
35
|
+
#
|
36
|
+
#
|
37
|
+
# This class was automatically generated from the api/schema
|
38
|
+
# URL path on a Jamf Pro server version 11.6.1-t1718634702
|
39
|
+
#
|
40
|
+
# This class may be used directly, e.g instances of other classes may
|
41
|
+
# use instances of this class as one of their own properties/attributes.
|
42
|
+
#
|
43
|
+
# It may also be used as a superclass when implementing Jamf Pro API
|
44
|
+
# Resources in ruby-jss. The subclasses include appropriate mixins, and
|
45
|
+
# should expand on the basic functionality provided here.
|
46
|
+
#
|
47
|
+
#
|
48
|
+
# Container Objects:
|
49
|
+
# Other object models that use this model as the value in one
|
50
|
+
# of their attributes.
|
51
|
+
# - Jamf::OAPISchemas::AuthorizationV1
|
52
|
+
# - Jamf::OAPISchemas::ComputerGeneral
|
53
|
+
# - Jamf::OAPISchemas::MobileDeviceDetailsV2
|
54
|
+
#
|
55
|
+
# Sub Objects:
|
56
|
+
# Other object models used by this model's attributes.
|
57
|
+
#
|
58
|
+
#
|
59
|
+
# Endpoints and Privileges:
|
60
|
+
# API endpoints and HTTP operations that use this object
|
61
|
+
# model, and the Jamf Pro privileges needed to access them.
|
62
|
+
# - '/v1/sites:GET' needs permissions:
|
63
|
+
# - Read Sites
|
64
|
+
#
|
65
|
+
#
|
66
|
+
class V1Site < Jamf::OAPIObject
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
OAPI_PROPERTIES = {
|
71
|
+
|
72
|
+
# @!attribute id
|
73
|
+
# @return [String]
|
74
|
+
id: {
|
75
|
+
class: :j_id,
|
76
|
+
identifier: :primary
|
77
|
+
},
|
78
|
+
|
79
|
+
# @!attribute name
|
80
|
+
# @return [String]
|
81
|
+
name: {
|
82
|
+
class: :string
|
83
|
+
}
|
84
|
+
|
85
|
+
} # end OAPI_PROPERTIES
|
86
|
+
|
87
|
+
end # class V1Site
|
88
|
+
|
89
|
+
end # module OAPISchemas
|
90
|
+
|
91
|
+
end # module Jamf
|
@@ -25,8 +25,31 @@
|
|
25
25
|
# The module
|
26
26
|
module Jamf
|
27
27
|
|
28
|
-
# This module is the namespace for all objects defined
|
28
|
+
# This module is the namespace for all JP API objects defined
|
29
29
|
# in the OAPI JSON schema under the components => schemas key
|
30
|
+
#
|
31
|
+
# The classes in this module are the Ruby representations of the
|
32
|
+
# JSON schema objects (Hashes) in the Jamf Pro OAPI schema
|
33
|
+
#
|
34
|
+
# Each class is created from the JSON Object definition and other
|
35
|
+
# schema data, such as required attributes, the class or type of each
|
36
|
+
# attribute (which could be another OAPI object), and any enumurated
|
37
|
+
# values for attributes.
|
38
|
+
# The classes are all subclasses of Jamf::OAPIObject, which defines
|
39
|
+
# common methods for all OAPI objects, such as converting to and from
|
40
|
+
# JSON, and validating attribute values.
|
41
|
+
#
|
42
|
+
# These clases are used in various ways in ruby-jss:
|
43
|
+
# - As the value of an attribute in another OAPI object
|
44
|
+
# - As the parent class for a Jamf Pro API Resource class
|
45
|
+
# - As a representation of a JSON objects sent to or received from the API
|
46
|
+
# (e.g. in a POST or PUT request)
|
47
|
+
#
|
48
|
+
# They are mostly generated automatically using the 'generate_object_models'
|
49
|
+
# executable in the 'bin' directory of ruby-jss. After generation the files needed
|
50
|
+
# are manually edited to add any needed functionality or clarifications of names
|
51
|
+
# etc, and then they are moved into the 'jamf/api/jamf_pro/oapi_schemas' directory.
|
52
|
+
#
|
30
53
|
#####################################
|
31
54
|
module OAPISchemas
|
32
55
|
|
@@ -226,7 +226,13 @@ module Jamf
|
|
226
226
|
|
227
227
|
data = @cnx.jp_get "#{@query_path}&page=#{page_number}"
|
228
228
|
data = data[:results]
|
229
|
-
|
229
|
+
|
230
|
+
if @instantiate
|
231
|
+
data.map! do |r|
|
232
|
+
r[:cnx] = @cnx
|
233
|
+
@instantiate.new(**r)
|
234
|
+
end
|
235
|
+
end
|
230
236
|
|
231
237
|
if increment_next
|
232
238
|
@last_fetched_page = page_number
|