ruby-jss 0.10.0 → 0.10.1a2

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.

Potentially problematic release.


This version of ruby-jss might be problematic. Click here for more details.

Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jss/api_object.rb +102 -0
  3. data/lib/jss/api_object/advanced_search/advanced_computer_search.rb +4 -0
  4. data/lib/jss/api_object/advanced_search/advanced_mobile_device_search.rb +5 -0
  5. data/lib/jss/api_object/advanced_search/advanced_user_search.rb +5 -0
  6. data/lib/jss/api_object/building.rb +5 -0
  7. data/lib/jss/api_object/category.rb +5 -0
  8. data/lib/jss/api_object/computer.rb +7 -2
  9. data/lib/jss/api_object/computer_invitation.rb +5 -0
  10. data/lib/jss/api_object/department.rb +26 -21
  11. data/lib/jss/api_object/distribution_point.rb +5 -0
  12. data/lib/jss/api_object/ebook.rb +5 -0
  13. data/lib/jss/api_object/extendable.rb +123 -148
  14. data/lib/jss/api_object/extension_attribute.rb +242 -301
  15. data/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb +5 -0
  16. data/lib/jss/api_object/extension_attribute/mobile_device_extension_attribute.rb +14 -9
  17. data/lib/jss/api_object/extension_attribute/user_extension_attribute.rb +40 -35
  18. data/lib/jss/api_object/group/computer_group.rb +11 -6
  19. data/lib/jss/api_object/group/mobile_device_group.rb +11 -6
  20. data/lib/jss/api_object/group/user_group.rb +16 -11
  21. data/lib/jss/api_object/ldap_server.rb +5 -0
  22. data/lib/jss/api_object/mac_application.rb +5 -0
  23. data/lib/jss/api_object/mobile_device.rb +5 -0
  24. data/lib/jss/api_object/mobile_device_application.rb +5 -0
  25. data/lib/jss/api_object/mobile_device_configuration_profile.rb +5 -0
  26. data/lib/jss/api_object/netboot_server.rb +11 -6
  27. data/lib/jss/api_object/network_segment.rb +5 -0
  28. data/lib/jss/api_object/osx_configuration_profile.rb +4 -0
  29. data/lib/jss/api_object/package.rb +5 -0
  30. data/lib/jss/api_object/peripheral.rb +4 -0
  31. data/lib/jss/api_object/peripheral_type.rb +11 -6
  32. data/lib/jss/api_object/policy.rb +5 -0
  33. data/lib/jss/api_object/removable_macaddr.rb +28 -23
  34. data/lib/jss/api_object/restricted_software.rb +5 -0
  35. data/lib/jss/api_object/script.rb +5 -0
  36. data/lib/jss/api_object/site.rb +29 -24
  37. data/lib/jss/api_object/software_update_server.rb +11 -6
  38. data/lib/jss/api_object/user.rb +5 -0
  39. data/lib/jss/api_object/webhook.rb +5 -0
  40. data/lib/jss/version.rb +1 -1
  41. metadata +4 -4
@@ -101,6 +101,11 @@ module JSS
101
101
 
102
102
  DEFAULT_RECON_DISPLAY_CHOICE = "Extension Attributes"
103
103
 
104
+ # the object type for this object in
105
+ # the object history table.
106
+ # See {APIObject#add_object_history_entry}
107
+ OBJECT_HISTORY_OBJECT_TYPE = 73
108
+
104
109
  ######################
105
110
  ### Attributes
106
111
  ######################
@@ -1,26 +1,26 @@
1
1
  ### Copyright 2017 Pixar
2
2
 
3
- ###
3
+ ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
5
  ### with the following modification; you may not use this file except in
6
6
  ### compliance with the Apache License and the following modification to it:
7
7
  ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
8
+ ###
9
9
  ### 6. Trademarks. This License does not grant permission to use the trade
10
10
  ### names, trademarks, service marks, or product names of the Licensor
11
11
  ### and its affiliates, except as required to comply with Section 4(c) of
12
12
  ### the License and to reproduce the content of the NOTICE file.
13
- ###
13
+ ###
14
14
  ### You may obtain a copy of the Apache License at
15
- ###
15
+ ###
16
16
  ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
17
+ ###
18
18
  ### Unless required by applicable law or agreed to in writing, software
19
19
  ### distributed under the Apache License with the above modification is
20
20
  ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
21
  ### KIND, either express or implied. See the Apache License for the specific
22
22
  ### language governing permissions and limitations under the Apache License.
23
- ###
23
+ ###
24
24
  ###
25
25
 
26
26
  ###
@@ -81,10 +81,15 @@ module JSS
81
81
 
82
82
  ### these ext attribs are related to these kinds of objects
83
83
  TARGET_CLASS = JSS::MobileDevice
84
-
84
+
85
85
  ### A criterion that will return all members of the TARGET_CLASS
86
86
  ALL_TARGETS_CRITERION = JSS::Criteriable::Criterion.new(:and_or => "and", :name => "Last Inventory Update", :search_type => "after (yyyy-mm-dd)", :value => "2003-01-01")
87
87
 
88
+ # the object type for this object in
89
+ # the object history table.
90
+ # See {APIObject#add_object_history_entry}
91
+ OBJECT_HISTORY_OBJECT_TYPE = 86
92
+
88
93
  ######################
89
94
  ### Attributes
90
95
  ######################
@@ -148,7 +153,7 @@ module JSS
148
153
  @attribute_mapping = nil
149
154
  end
150
155
  end #
151
-
156
+
152
157
  ###
153
158
  ### Set the ldap attribute to use for input_type 'LDAP Attribute Mapping'
154
159
  ###
@@ -161,7 +166,7 @@ module JSS
161
166
  @attribute_mapping = ldap_attrib
162
167
  @need_to_update = true
163
168
  end
164
-
169
+
165
170
  ######################
166
171
  ### Private Instance Methods
167
172
  #####################
@@ -1,58 +1,58 @@
1
1
  ### Copyright 2017 Pixar
2
2
 
3
- ###
3
+ ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
5
  ### with the following modification; you may not use this file except in
6
6
  ### compliance with the Apache License and the following modification to it:
7
7
  ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
8
+ ###
9
9
  ### 6. Trademarks. This License does not grant permission to use the trade
10
10
  ### names, trademarks, service marks, or product names of the Licensor
11
11
  ### and its affiliates, except as required to comply with Section 4(c) of
12
12
  ### the License and to reproduce the content of the NOTICE file.
13
- ###
13
+ ###
14
14
  ### You may obtain a copy of the Apache License at
15
- ###
15
+ ###
16
16
  ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
17
+ ###
18
18
  ### Unless required by applicable law or agreed to in writing, software
19
19
  ### distributed under the Apache License with the above modification is
20
20
  ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
21
  ### KIND, either express or implied. See the Apache License for the specific
22
22
  ### language governing permissions and limitations under the Apache License.
23
- ###
23
+ ###
24
24
  ###
25
25
 
26
26
  ###
27
27
  module JSS
28
28
 
29
29
 
30
-
30
+
31
31
  #####################################
32
32
  ### Constants
33
- #####################################
34
-
33
+ #####################################
34
+
35
35
  #####################################
36
36
  ### Module Variables
37
- #####################################
38
-
37
+ #####################################
38
+
39
39
  #####################################
40
40
  ### Module Methods
41
- #####################################
42
-
41
+ #####################################
42
+
43
43
  ####################################
44
44
  ### Classes
45
- #####################################
46
-
47
-
48
- ###
45
+ #####################################
46
+
47
+
48
+ ###
49
49
  ### A User extension attribute as defined in the JSS
50
50
  ###
51
51
  ### @see JSS::ExtensionAttribute
52
52
  ### @see JSS::APIObject
53
53
  ###
54
54
  class UserExtensionAttribute < JSS::ExtensionAttribute
55
-
55
+
56
56
  #####################################
57
57
  ### Mix-Ins
58
58
  #####################################
@@ -60,59 +60,64 @@ module JSS
60
60
  #####################################
61
61
  ### Class Methods
62
62
  #####################################
63
-
63
+
64
64
  #####################################
65
65
  ### Class Constants
66
66
  #####################################
67
-
67
+
68
68
  ### The base for REST resources of this class
69
69
  RSRC_BASE = "userextensionattributes"
70
-
70
+
71
71
  ### the hash key used for the JSON list output of all objects in the JSS
72
72
  RSRC_LIST_KEY = :user_extension_attributes
73
-
73
+
74
74
  ### The hash key used for the JSON object output.
75
75
  ### It's also used in various error messages
76
76
  RSRC_OBJECT_KEY = :user_extension_attribute
77
-
77
+
78
78
  ### these keys, as well as :id and :name, are present in valid API JSON data for this class
79
79
  VALID_DATA_KEYS = [:description, :data_type, :input_type]
80
-
80
+
81
81
  ### these ext attribs are related to these kinds of objects
82
82
  TARGET_CLASS = JSS::User
83
-
83
+
84
84
  ### A criterion that will return all members of the TARGET_CLASS
85
85
  ALL_TARGETS_CRITERION = JSS::Criteriable::Criterion.new(:and_or => "and", :name => "Username", :search_type => "like", :value => '')
86
-
86
+
87
+ # the object type for this object in
88
+ # the object history table.
89
+ # See {APIObject#add_object_history_entry}
90
+ OBJECT_HISTORY_OBJECT_TYPE = 87
91
+
87
92
  ######################
88
93
  ### Attributes
89
94
  ######################
90
-
95
+
91
96
  #####################################
92
- ### Constructor
97
+ ### Constructor
93
98
  #####################################
94
99
 
95
100
  #####################################
96
- ### Public Instance Methods
101
+ ### Public Instance Methods
97
102
  #####################################
98
-
103
+
99
104
  ######################
100
105
  ### Private Instance Methods
101
106
  #####################
102
107
  private
103
-
108
+
104
109
  ###
105
110
  ### Return the REST XML for this item, with the current values,
106
111
  ### for saving or updating
107
112
  ###
108
113
  def rest_xml
109
- uea = rest_rexml
114
+ uea = rest_rexml
110
115
  doc = REXML::Document.new APIConnection::XML_HEADER
111
116
  doc << uea
112
117
  return doc.to_s
113
118
  end # rest xml
114
-
119
+
115
120
  end # class ExtAttrib
116
-
117
-
121
+
122
+
118
123
  end # module
@@ -1,26 +1,26 @@
1
1
  ### Copyright 2017 Pixar
2
2
 
3
- ###
3
+ ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
5
  ### with the following modification; you may not use this file except in
6
6
  ### compliance with the Apache License and the following modification to it:
7
7
  ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
8
+ ###
9
9
  ### 6. Trademarks. This License does not grant permission to use the trade
10
10
  ### names, trademarks, service marks, or product names of the Licensor
11
11
  ### and its affiliates, except as required to comply with Section 4(c) of
12
12
  ### the License and to reproduce the content of the NOTICE file.
13
- ###
13
+ ###
14
14
  ### You may obtain a copy of the Apache License at
15
- ###
15
+ ###
16
16
  ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
17
+ ###
18
18
  ### Unless required by applicable law or agreed to in writing, software
19
19
  ### distributed under the Apache License with the above modification is
20
20
  ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
21
  ### KIND, either express or implied. See the Apache License for the specific
22
22
  ### language governing permissions and limitations under the Apache License.
23
- ###
23
+ ###
24
24
  ###
25
25
 
26
26
  ###
@@ -81,6 +81,11 @@ module JSS
81
81
  ### this allows the parent Group class to do things right
82
82
  MEMBER_CLASS = JSS::Computer
83
83
 
84
+ # the object type for this object in
85
+ # the object history table.
86
+ # See {APIObject#add_object_history_entry}
87
+ OBJECT_HISTORY_OBJECT_TYPE = 7
88
+
84
89
  #####################################
85
90
  ### Class Variables
86
91
  #####################################
@@ -1,26 +1,26 @@
1
1
  ### Copyright 2017 Pixar
2
2
 
3
- ###
3
+ ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
5
  ### with the following modification; you may not use this file except in
6
6
  ### compliance with the Apache License and the following modification to it:
7
7
  ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
8
+ ###
9
9
  ### 6. Trademarks. This License does not grant permission to use the trade
10
10
  ### names, trademarks, service marks, or product names of the Licensor
11
11
  ### and its affiliates, except as required to comply with Section 4(c) of
12
12
  ### the License and to reproduce the content of the NOTICE file.
13
- ###
13
+ ###
14
14
  ### You may obtain a copy of the Apache License at
15
- ###
15
+ ###
16
16
  ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
17
+ ###
18
18
  ### Unless required by applicable law or agreed to in writing, software
19
19
  ### distributed under the Apache License with the above modification is
20
20
  ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
21
  ### KIND, either express or implied. See the Apache License for the specific
22
22
  ### language governing permissions and limitations under the Apache License.
23
- ###
23
+ ###
24
24
  ###
25
25
 
26
26
  ###
@@ -78,6 +78,11 @@ module JSS
78
78
  ### this allows the parent Group class to do things right
79
79
  MEMBER_CLASS = JSS::MobileDevice
80
80
 
81
+ # the object type for this object in
82
+ # the object history table.
83
+ # See {APIObject#add_object_history_entry}
84
+ OBJECT_HISTORY_OBJECT_TYPE = 25
85
+
81
86
  #####################################
82
87
  ### Class Variables
83
88
  #####################################
@@ -1,26 +1,26 @@
1
1
  ### Copyright 2017 Pixar
2
2
 
3
- ###
3
+ ###
4
4
  ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
5
  ### with the following modification; you may not use this file except in
6
6
  ### compliance with the Apache License and the following modification to it:
7
7
  ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
8
+ ###
9
9
  ### 6. Trademarks. This License does not grant permission to use the trade
10
10
  ### names, trademarks, service marks, or product names of the Licensor
11
11
  ### and its affiliates, except as required to comply with Section 4(c) of
12
12
  ### the License and to reproduce the content of the NOTICE file.
13
- ###
13
+ ###
14
14
  ### You may obtain a copy of the Apache License at
15
- ###
15
+ ###
16
16
  ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
17
+ ###
18
18
  ### Unless required by applicable law or agreed to in writing, software
19
19
  ### distributed under the Apache License with the above modification is
20
20
  ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
21
  ### KIND, either express or implied. See the Apache License for the specific
22
22
  ### language governing permissions and limitations under the Apache License.
23
- ###
23
+ ###
24
24
  ###
25
25
 
26
26
  ###
@@ -78,6 +78,11 @@ module JSS
78
78
  ### this allows the parent Group class to do things right
79
79
  MEMBER_CLASS = JSS::User
80
80
 
81
+ # the object type for this object in
82
+ # the object history table.
83
+ # See {APIObject#add_object_history_entry}
84
+ OBJECT_HISTORY_OBJECT_TYPE = 54
85
+
81
86
  #####################################
82
87
  ### Class Variables
83
88
  #####################################
@@ -93,7 +98,7 @@ module JSS
93
98
  #####################################
94
99
  ### Public Instance Methods
95
100
  #####################################
96
-
101
+
97
102
  ###
98
103
  ### Return an array of the usernames of users in this group
99
104
  ###
@@ -102,7 +107,7 @@ module JSS
102
107
  def member_usernames
103
108
  @members.map{|m| m[:username]}
104
109
  end
105
-
110
+
106
111
  ###
107
112
  ### Return an array of the full names of users in this group
108
113
  ###
@@ -111,7 +116,7 @@ module JSS
111
116
  def member_full_names
112
117
  @members.map{|m| m[:full_name]}
113
118
  end
114
-
119
+
115
120
  ###
116
121
  ### Return an array of the phone numbers of users in this group
117
122
  ###
@@ -120,7 +125,7 @@ module JSS
120
125
  def member_phone_numbers
121
126
  @members.map{|m| m[:phone_number]}
122
127
  end
123
-
128
+
124
129
  ###
125
130
  ### Return an array of the email addresses of users in this group
126
131
  ###
@@ -129,7 +134,7 @@ module JSS
129
134
  def member_email_addresses
130
135
  @members.map{|m| m[:email_address]}
131
136
  end
132
-
137
+
133
138
  #####################################
134
139
  ### Private Instance Methods
135
140
  #####################################
@@ -152,6 +152,11 @@ module JSS
152
152
  ### possible objectclass mapping options
153
153
  OBJECT_CLASS_MAPPING_OPTIONS = ["any", "all"]
154
154
 
155
+ # the object type for this object in
156
+ # the object history table.
157
+ # See {APIObject#add_object_history_entry}
158
+ OBJECT_HISTORY_OBJECT_TYPE = 80
159
+
155
160
  #####################################
156
161
  ### Attributes
157
162
  #####################################
@@ -16,6 +16,11 @@ module JSS
16
16
  ### It's also used in various error messages
17
17
  RSRC_OBJECT_KEY = :mac_application
18
18
 
19
+ # the object type for this object in
20
+ # the object history table.
21
+ # See {APIObject#add_object_history_entry}
22
+ OBJECT_HISTORY_OBJECT_TYPE = 350
23
+
19
24
  end
20
25
 
21
26
  end
@@ -187,6 +187,11 @@ module JSS
187
187
  # Available history subsets
188
188
  HISTORY_SUBSETS = %i[management_commands user_location audits applications ebooks].freeze
189
189
 
190
+ # the object type for this object in
191
+ # the object history table.
192
+ # See {APIObject#add_object_history_entry}
193
+ OBJECT_HISTORY_OBJECT_TYPE = 21
194
+
190
195
 
191
196
  # Class Methods
192
197
  #####################################