comet_backup_ruby_sdk 0.2.0 → 1.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -0
- data/Gemfile.lock +43 -0
- data/README.md +20 -4
- data/RELEASING.md +10 -0
- data/comet_backup_ruby_sdk.gemspec +1 -1
- data/lib/comet/comet_server.rb +562 -254
- data/lib/comet/definitions.rb +19 -4
- data/lib/comet/models/add_bucket_response_message.rb +15 -5
- data/lib/comet/models/admin_account_properties_response.rb +17 -2
- data/lib/comet/models/admin_email_options.rb +84 -0
- data/lib/comet/models/admin_resource_response.rb +13 -4
- data/lib/comet/models/admin_security_options.rb +18 -5
- data/lib/comet/models/admin_u2fregistration.rb +11 -3
- data/lib/comet/models/admin_user_permissions.rb +6 -2
- data/lib/comet/models/available_download.rb +10 -4
- data/lib/comet/models/azure_destination_location.rb +16 -7
- data/lib/comet/models/b2destination_location.rb +17 -6
- data/lib/comet/models/b2storage_extra_info.rb +6 -2
- data/lib/comet/models/b2transaction_totals.rb +15 -2
- data/lib/comet/models/b2virtual_storage_role_settings.rb +93 -0
- data/lib/comet/models/backup_job_advanced_options.rb +12 -2
- data/lib/comet/models/backup_job_detail.rb +53 -10
- data/lib/comet/models/backup_job_progress.rb +21 -2
- data/lib/comet/models/backup_rule_config.rb +43 -7
- data/lib/comet/models/backup_rule_event_triggers.rb +6 -2
- data/lib/comet/models/branding_options.rb +59 -25
- data/lib/comet/models/branding_properties.rb +51 -21
- data/lib/comet/models/browse_disk_drives_response.rb +11 -3
- data/lib/comet/models/browse_edbresponse.rb +11 -3
- data/lib/comet/models/browse_hvresponse.rb +11 -3
- data/lib/comet/models/browse_vssresponse.rb +11 -3
- data/lib/comet/models/bucket_properties.rb +24 -3
- data/lib/comet/models/bucket_usage_info.rb +8 -2
- data/lib/comet/models/comet_apiresponse_message.rb +11 -3
- data/lib/comet/models/comet_destination_location.rb +12 -5
- data/lib/comet/models/constellation_check_report.rb +12 -2
- data/lib/comet/models/constellation_stats.rb +18 -2
- data/lib/comet/models/constellation_status_apiresponse.rb +9 -4
- data/lib/comet/models/content_measurement.rb +12 -2
- data/lib/comet/models/content_measurement_component.rb +10 -3
- data/lib/comet/models/create_group_policy_response.rb +13 -4
- data/lib/comet/models/default_email_report_policy.rb +6 -2
- data/lib/comet/models/destination_config.rb +123 -32
- data/lib/comet/models/destination_location.rb +78 -28
- data/lib/comet/models/destination_statistics.rb +16 -3
- data/lib/comet/models/device_config.rb +9 -3
- data/lib/comet/models/disk_drive.rb +34 -7
- data/lib/comet/models/dispatcher_admin_sources_response.rb +12 -4
- data/lib/comet/models/dispatcher_stored_objects_response.rb +11 -3
- data/lib/comet/models/dispatcher_vault_snapshots_response.rb +11 -3
- data/lib/comet/models/edbfile_info.rb +12 -5
- data/lib/comet/models/email_options.rb +21 -8
- data/lib/comet/models/email_report_config.rb +10 -2
- data/lib/comet/models/email_report_generated_preview.rb +17 -6
- data/lib/comet/models/external_ldapauthentication_source_settings.rb +102 -0
- data/lib/comet/models/extra_file_exclusion.rb +11 -3
- data/lib/comet/models/ftpdestination_location.rb +23 -6
- data/lib/comet/models/get_group_policy_response.rb +14 -4
- data/lib/comet/models/get_profile_and_hash_response_message.rb +14 -4
- data/lib/comet/models/get_profile_hash_response_message.rb +13 -4
- data/lib/comet/models/group_policy.rb +18 -3
- data/lib/comet/models/hyper_vmachine_info.rb +10 -4
- data/lib/comet/models/install_creds.rb +99 -0
- data/lib/comet/models/install_token.rb +117 -0
- data/lib/comet/models/install_token_response.rb +92 -0
- data/lib/comet/models/job_entry.rb +93 -0
- data/lib/comet/models/live_user_connection.rb +20 -7
- data/lib/comet/models/local_destination_location.rb +15 -5
- data/lib/comet/models/mac_oscode_sign_properties.rb +21 -6
- data/lib/comet/models/mongo_dbconnection.rb +33 -14
- data/lib/comet/models/new_bucket_detail.rb +10 -4
- data/lib/comet/models/news_entry.rb +20 -3
- data/lib/comet/models/organization.rb +145 -0
- data/lib/comet/models/organization_response.rb +101 -0
- data/lib/comet/models/osinfo.rb +12 -5
- data/lib/comet/models/partition.rb +32 -8
- data/lib/comet/models/private_branding_properties.rb +39 -15
- data/lib/comet/models/protected_item_engine_type_policy.rb +7 -3
- data/lib/comet/models/public_branding_properties.rb +18 -8
- data/lib/comet/models/remote_server_address.rb +19 -7
- data/lib/comet/models/remote_storage_option.rb +28 -7
- data/lib/comet/models/replicator_state_apiresponse.rb +40 -4
- data/lib/comet/models/request_storage_vault_response_message.rb +13 -4
- data/lib/comet/models/restore_job_advanced_options.rb +15 -4
- data/lib/comet/models/retention_policy.rb +9 -2
- data/lib/comet/models/retention_range.rb +30 -2
- data/lib/comet/models/s3destination_location.rb +16 -7
- data/lib/comet/models/schedule_config.rb +15 -2
- data/lib/comet/models/search_clause.rb +14 -6
- data/lib/comet/models/server_config_options_branding_fragment.rb +7 -2
- data/lib/comet/models/server_config_options_software_build_role_fragment.rb +7 -2
- data/lib/comet/models/server_meta_version_info.rb +45 -7
- data/lib/comet/models/session_key_regenerated_response.rb +15 -5
- data/lib/comet/models/sftpdestination_location.rb +21 -8
- data/lib/comet/models/size_measurement.rb +15 -2
- data/lib/comet/models/software_build_role_options.rb +6 -2
- data/lib/comet/models/software_update_news_response.rb +13 -6
- data/lib/comet/models/source_basic_info.rb +11 -3
- data/lib/comet/models/source_config.rb +38 -8
- data/lib/comet/models/source_statistics.rb +7 -2
- data/lib/comet/models/spanned_destination_location.rb +6 -2
- data/lib/comet/models/spanned_storage_extra_info.rb +6 -2
- data/lib/comet/models/sshconnection.rb +19 -7
- data/lib/comet/models/stat_result.rb +18 -2
- data/lib/comet/models/storage_free_space_info.rb +14 -2
- data/lib/comet/models/storage_vault_provider_policy.rb +8 -2
- data/lib/comet/models/stored_object.rb +27 -5
- data/lib/comet/models/streamable_event.rb +18 -2
- data/lib/comet/models/swift_destination_location.rb +32 -15
- data/lib/comet/models/test_response.rb +11 -3
- data/lib/comet/models/totp_regenerated_response.rb +17 -6
- data/lib/comet/models/u2fregister_request.rb +10 -4
- data/lib/comet/models/u2fregistered_key.rb +12 -5
- data/lib/comet/models/u2fregistration_challenge_response.rb +15 -5
- data/lib/comet/models/u2fsign_request.rb +12 -5
- data/lib/comet/models/u2fsign_response.rb +14 -6
- data/lib/comet/models/uninstall_config.rb +6 -2
- data/lib/comet/models/update_campaign_device_status.rb +9 -2
- data/lib/comet/models/update_campaign_options.rb +6 -2
- data/lib/comet/models/update_campaign_properties.rb +11 -3
- data/lib/comet/models/update_campaign_status.rb +11 -3
- data/lib/comet/models/update_campaign_status_device_entry.rb +13 -4
- data/lib/comet/models/user_custom_email_settings.rb +6 -2
- data/lib/comet/models/user_on_server.rb +11 -3
- data/lib/comet/models/user_policy.rb +22 -2
- data/lib/comet/models/user_profile_config.rb +52 -12
- data/lib/comet/models/user_profile_fragment.rb +8 -3
- data/lib/comet/models/vault_snapshot.rb +13 -4
- data/lib/comet/models/vsscomponent.rb +12 -5
- data/lib/comet/models/vsswriter_info.rb +8 -3
- data/lib/comet/models/wasabi_virtual_storage_role_settings.rb +93 -0
- data/lib/comet/models/web_interface_branding_properties.rb +14 -6
- data/lib/comet/models/webhook_option.rb +10 -3
- data/lib/comet/models/win_smbauth.rb +15 -5
- data/lib/comet/models/windows_code_sign_properties.rb +26 -9
- data/lib/comet_backup_ruby_sdk.rb +10 -0
- metadata +15 -2
|
@@ -138,148 +138,198 @@ module Comet
|
|
|
138
138
|
attr_accessor :unknown_json_fields
|
|
139
139
|
|
|
140
140
|
def initialize
|
|
141
|
+
clear
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def clear
|
|
145
|
+
@destination_type = 0
|
|
146
|
+
@comet_server = ''
|
|
147
|
+
@comet_bucket = ''
|
|
148
|
+
@comet_bucket_key = ''
|
|
149
|
+
@s3server = ''
|
|
150
|
+
@s3access_key = ''
|
|
151
|
+
@s3secret_key = ''
|
|
152
|
+
@s3bucket_name = ''
|
|
153
|
+
@s3subdir = ''
|
|
154
|
+
@sftpserver = ''
|
|
155
|
+
@sftpusername = ''
|
|
156
|
+
@sftpremote_path = ''
|
|
157
|
+
@sftpauth_mode = 0
|
|
158
|
+
@sftppassword = ''
|
|
159
|
+
@sftpprivate_key = ''
|
|
160
|
+
@sftpcustom_auth__known_hosts_file = ''
|
|
161
|
+
@ftpserver = ''
|
|
162
|
+
@ftpusername = ''
|
|
163
|
+
@ftppassword = ''
|
|
164
|
+
@ftpcustom_base_directory = ''
|
|
165
|
+
@ftpsmode = 0
|
|
166
|
+
@ftpport = 0
|
|
167
|
+
@ftpmax_connections = 0
|
|
168
|
+
@azbaccount_name = ''
|
|
169
|
+
@azbaccount_key = ''
|
|
170
|
+
@azbcontainer = ''
|
|
171
|
+
@azbrealm = ''
|
|
172
|
+
@azbprefix = ''
|
|
173
|
+
@localcopy_path = ''
|
|
174
|
+
@localcopy_win_smbusername = ''
|
|
175
|
+
@localcopy_win_smbpassword = ''
|
|
176
|
+
@localcopy_win_smbpassword_format = 0
|
|
177
|
+
@swift = Comet::SwiftDestinationLocation.new
|
|
178
|
+
@b2 = Comet::B2DestinationLocation.new
|
|
141
179
|
@span_targets = []
|
|
142
180
|
@unknown_json_fields = {}
|
|
143
181
|
end
|
|
144
182
|
|
|
145
183
|
# @param [String] json_string The complete object in JSON format
|
|
146
184
|
def from_json(json_string)
|
|
147
|
-
raise TypeError 'expected
|
|
185
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
148
186
|
|
|
149
187
|
from_hash(JSON.parse(json_string))
|
|
150
188
|
end
|
|
151
189
|
|
|
152
190
|
# @param [Hash] obj The complete object as a Ruby hash
|
|
153
191
|
def from_hash(obj)
|
|
154
|
-
raise TypeError 'expected
|
|
192
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
155
193
|
|
|
156
194
|
obj.each do |k, v|
|
|
157
195
|
case k
|
|
158
196
|
when 'DestinationType'
|
|
197
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
198
|
+
|
|
159
199
|
@destination_type = v
|
|
160
200
|
when 'CometServer'
|
|
161
|
-
raise TypeError 'expected
|
|
201
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
162
202
|
|
|
163
203
|
@comet_server = v
|
|
164
204
|
when 'CometBucket'
|
|
165
|
-
raise TypeError 'expected
|
|
205
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
166
206
|
|
|
167
207
|
@comet_bucket = v
|
|
168
208
|
when 'CometBucketKey'
|
|
169
|
-
raise TypeError 'expected
|
|
209
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
170
210
|
|
|
171
211
|
@comet_bucket_key = v
|
|
172
212
|
when 'S3Server'
|
|
173
|
-
raise TypeError 'expected
|
|
213
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
174
214
|
|
|
175
215
|
@s3server = v
|
|
176
216
|
when 'S3UsesTLS'
|
|
177
217
|
@s3uses_tls = v
|
|
178
218
|
when 'S3AccessKey'
|
|
179
|
-
raise TypeError 'expected
|
|
219
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
180
220
|
|
|
181
221
|
@s3access_key = v
|
|
182
222
|
when 'S3SecretKey'
|
|
183
|
-
raise TypeError 'expected
|
|
223
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
184
224
|
|
|
185
225
|
@s3secret_key = v
|
|
186
226
|
when 'S3BucketName'
|
|
187
|
-
raise TypeError 'expected
|
|
227
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
188
228
|
|
|
189
229
|
@s3bucket_name = v
|
|
190
230
|
when 'S3Subdir'
|
|
191
|
-
raise TypeError 'expected
|
|
231
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
192
232
|
|
|
193
233
|
@s3subdir = v
|
|
194
234
|
when 'S3UsesV2Signing'
|
|
195
235
|
@s3uses_v2signing = v
|
|
196
236
|
when 'SFTPServer'
|
|
197
|
-
raise TypeError 'expected
|
|
237
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
198
238
|
|
|
199
239
|
@sftpserver = v
|
|
200
240
|
when 'SFTPUsername'
|
|
201
|
-
raise TypeError 'expected
|
|
241
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
202
242
|
|
|
203
243
|
@sftpusername = v
|
|
204
244
|
when 'SFTPRemotePath'
|
|
205
|
-
raise TypeError 'expected
|
|
245
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
206
246
|
|
|
207
247
|
@sftpremote_path = v
|
|
208
248
|
when 'SFTPAuthMode'
|
|
249
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
250
|
+
|
|
209
251
|
@sftpauth_mode = v
|
|
210
252
|
when 'SFTPPassword'
|
|
211
|
-
raise TypeError 'expected
|
|
253
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
212
254
|
|
|
213
255
|
@sftppassword = v
|
|
214
256
|
when 'SFTPPrivateKey'
|
|
215
|
-
raise TypeError 'expected
|
|
257
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
216
258
|
|
|
217
259
|
@sftpprivate_key = v
|
|
218
260
|
when 'SFTPCustomAuth_UseKnownHostsFile'
|
|
219
261
|
@sftpcustom_auth__use_known_hosts_file = v
|
|
220
262
|
when 'SFTPCustomAuth_KnownHostsFile'
|
|
221
|
-
raise TypeError 'expected
|
|
263
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
222
264
|
|
|
223
265
|
@sftpcustom_auth__known_hosts_file = v
|
|
224
266
|
when 'FTPServer'
|
|
225
|
-
raise TypeError 'expected
|
|
267
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
226
268
|
|
|
227
269
|
@ftpserver = v
|
|
228
270
|
when 'FTPUsername'
|
|
229
|
-
raise TypeError 'expected
|
|
271
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
230
272
|
|
|
231
273
|
@ftpusername = v
|
|
232
274
|
when 'FTPPassword'
|
|
233
|
-
raise TypeError 'expected
|
|
275
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
234
276
|
|
|
235
277
|
@ftppassword = v
|
|
236
278
|
when 'FTPBaseUseHomeDirectory'
|
|
237
279
|
@ftpbase_use_home_directory = v
|
|
238
280
|
when 'FTPCustomBaseDirectory'
|
|
239
|
-
raise TypeError 'expected
|
|
281
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
240
282
|
|
|
241
283
|
@ftpcustom_base_directory = v
|
|
242
284
|
when 'FTPSMode'
|
|
285
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
286
|
+
|
|
243
287
|
@ftpsmode = v
|
|
244
288
|
when 'FTPPort'
|
|
289
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
290
|
+
|
|
245
291
|
@ftpport = v
|
|
246
292
|
when 'FTPMaxConnections'
|
|
293
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
294
|
+
|
|
247
295
|
@ftpmax_connections = v
|
|
248
296
|
when 'FTPAcceptInvalidSSL'
|
|
249
297
|
@ftpaccept_invalid_ssl = v
|
|
250
298
|
when 'AZBAccountName'
|
|
251
|
-
raise TypeError 'expected
|
|
299
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
252
300
|
|
|
253
301
|
@azbaccount_name = v
|
|
254
302
|
when 'AZBAccountKey'
|
|
255
|
-
raise TypeError 'expected
|
|
303
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
256
304
|
|
|
257
305
|
@azbaccount_key = v
|
|
258
306
|
when 'AZBContainer'
|
|
259
|
-
raise TypeError 'expected
|
|
307
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
260
308
|
|
|
261
309
|
@azbcontainer = v
|
|
262
310
|
when 'AZBRealm'
|
|
263
|
-
raise TypeError 'expected
|
|
311
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
264
312
|
|
|
265
313
|
@azbrealm = v
|
|
266
314
|
when 'AZBPrefix'
|
|
267
|
-
raise TypeError 'expected
|
|
315
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
268
316
|
|
|
269
317
|
@azbprefix = v
|
|
270
318
|
when 'LocalcopyPath'
|
|
271
|
-
raise TypeError 'expected
|
|
319
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
272
320
|
|
|
273
321
|
@localcopy_path = v
|
|
274
322
|
when 'LocalcopyWinSMBUsername'
|
|
275
|
-
raise TypeError 'expected
|
|
323
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
276
324
|
|
|
277
325
|
@localcopy_win_smbusername = v
|
|
278
326
|
when 'LocalcopyWinSMBPassword'
|
|
279
|
-
raise TypeError 'expected
|
|
327
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
280
328
|
|
|
281
329
|
@localcopy_win_smbpassword = v
|
|
282
330
|
when 'LocalcopyWinSMBPasswordFormat'
|
|
331
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
332
|
+
|
|
283
333
|
@localcopy_win_smbpassword_format = v
|
|
284
334
|
when 'Swift'
|
|
285
335
|
@swift = Comet::SwiftDestinationLocation.new
|
|
@@ -33,19 +33,28 @@ module Comet
|
|
|
33
33
|
attr_accessor :unknown_json_fields
|
|
34
34
|
|
|
35
35
|
def initialize
|
|
36
|
+
clear
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def clear
|
|
40
|
+
@client_provided_size = Comet::SizeMeasurement.new
|
|
41
|
+
@client_provided_content = Comet::ContentMeasurement.new
|
|
42
|
+
@last_successful_deep_verify__guid = ''
|
|
43
|
+
@last_successful_deep_verify__start_time = 0
|
|
44
|
+
@last_successful_deep_verify__end_time = 0
|
|
36
45
|
@unknown_json_fields = {}
|
|
37
46
|
end
|
|
38
47
|
|
|
39
48
|
# @param [String] json_string The complete object in JSON format
|
|
40
49
|
def from_json(json_string)
|
|
41
|
-
raise TypeError 'expected
|
|
50
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
42
51
|
|
|
43
52
|
from_hash(JSON.parse(json_string))
|
|
44
53
|
end
|
|
45
54
|
|
|
46
55
|
# @param [Hash] obj The complete object as a Ruby hash
|
|
47
56
|
def from_hash(obj)
|
|
48
|
-
raise TypeError 'expected
|
|
57
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
49
58
|
|
|
50
59
|
obj.each do |k, v|
|
|
51
60
|
case k
|
|
@@ -56,12 +65,16 @@ module Comet
|
|
|
56
65
|
@client_provided_content = Comet::ContentMeasurement.new
|
|
57
66
|
@client_provided_content.from_hash(v)
|
|
58
67
|
when 'LastSuccessfulDeepVerify_GUID'
|
|
59
|
-
raise TypeError 'expected
|
|
68
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
60
69
|
|
|
61
70
|
@last_successful_deep_verify__guid = v
|
|
62
71
|
when 'LastSuccessfulDeepVerify_StartTime'
|
|
72
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
73
|
+
|
|
63
74
|
@last_successful_deep_verify__start_time = v
|
|
64
75
|
when 'LastSuccessfulDeepVerify_EndTime'
|
|
76
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
77
|
+
|
|
65
78
|
@last_successful_deep_verify__end_time = v
|
|
66
79
|
else
|
|
67
80
|
@unknown_json_fields[k] = v
|
|
@@ -27,25 +27,31 @@ module Comet
|
|
|
27
27
|
attr_accessor :unknown_json_fields
|
|
28
28
|
|
|
29
29
|
def initialize
|
|
30
|
+
clear
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def clear
|
|
34
|
+
@friendly_name = ''
|
|
35
|
+
@platform_version = Comet::OSInfo.new
|
|
30
36
|
@sources = {}
|
|
31
37
|
@unknown_json_fields = {}
|
|
32
38
|
end
|
|
33
39
|
|
|
34
40
|
# @param [String] json_string The complete object in JSON format
|
|
35
41
|
def from_json(json_string)
|
|
36
|
-
raise TypeError 'expected
|
|
42
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
37
43
|
|
|
38
44
|
from_hash(JSON.parse(json_string))
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
# @param [Hash] obj The complete object as a Ruby hash
|
|
42
48
|
def from_hash(obj)
|
|
43
|
-
raise TypeError 'expected
|
|
49
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
44
50
|
|
|
45
51
|
obj.each do |k, v|
|
|
46
52
|
case k
|
|
47
53
|
when 'FriendlyName'
|
|
48
|
-
raise TypeError 'expected
|
|
54
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
49
55
|
|
|
50
56
|
@friendly_name = v
|
|
51
57
|
when 'PlatformVersion'
|
|
@@ -54,44 +54,61 @@ module Comet
|
|
|
54
54
|
attr_accessor :unknown_json_fields
|
|
55
55
|
|
|
56
56
|
def initialize
|
|
57
|
+
clear
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def clear
|
|
61
|
+
@id = ''
|
|
62
|
+
@device_name = ''
|
|
63
|
+
@caption = ''
|
|
64
|
+
@model = ''
|
|
65
|
+
@serial_number = ''
|
|
66
|
+
@size = 0
|
|
57
67
|
@partitions = []
|
|
68
|
+
@flags = 0
|
|
69
|
+
@cylinders = 0
|
|
70
|
+
@heads = 0
|
|
71
|
+
@sectors = 0
|
|
72
|
+
@sector_size = 0
|
|
58
73
|
@unknown_json_fields = {}
|
|
59
74
|
end
|
|
60
75
|
|
|
61
76
|
# @param [String] json_string The complete object in JSON format
|
|
62
77
|
def from_json(json_string)
|
|
63
|
-
raise TypeError 'expected
|
|
78
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
64
79
|
|
|
65
80
|
from_hash(JSON.parse(json_string))
|
|
66
81
|
end
|
|
67
82
|
|
|
68
83
|
# @param [Hash] obj The complete object as a Ruby hash
|
|
69
84
|
def from_hash(obj)
|
|
70
|
-
raise TypeError 'expected
|
|
85
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
71
86
|
|
|
72
87
|
obj.each do |k, v|
|
|
73
88
|
case k
|
|
74
89
|
when 'ID'
|
|
75
|
-
raise TypeError 'expected
|
|
90
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
76
91
|
|
|
77
92
|
@id = v
|
|
78
93
|
when 'DeviceName'
|
|
79
|
-
raise TypeError 'expected
|
|
94
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
80
95
|
|
|
81
96
|
@device_name = v
|
|
82
97
|
when 'Caption'
|
|
83
|
-
raise TypeError 'expected
|
|
98
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
84
99
|
|
|
85
100
|
@caption = v
|
|
86
101
|
when 'Model'
|
|
87
|
-
raise TypeError 'expected
|
|
102
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
88
103
|
|
|
89
104
|
@model = v
|
|
90
105
|
when 'SerialNumber'
|
|
91
|
-
raise TypeError 'expected
|
|
106
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
92
107
|
|
|
93
108
|
@serial_number = v
|
|
94
109
|
when 'Size'
|
|
110
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
111
|
+
|
|
95
112
|
@size = v
|
|
96
113
|
when 'Partitions'
|
|
97
114
|
if v.nil?
|
|
@@ -104,14 +121,24 @@ module Comet
|
|
|
104
121
|
end
|
|
105
122
|
end
|
|
106
123
|
when 'Flags'
|
|
124
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
125
|
+
|
|
107
126
|
@flags = v
|
|
108
127
|
when 'Cylinders'
|
|
128
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
129
|
+
|
|
109
130
|
@cylinders = v
|
|
110
131
|
when 'Heads'
|
|
132
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
133
|
+
|
|
111
134
|
@heads = v
|
|
112
135
|
when 'Sectors'
|
|
136
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
137
|
+
|
|
113
138
|
@sectors = v
|
|
114
139
|
when 'SectorSize'
|
|
140
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
141
|
+
|
|
115
142
|
@sector_size = v
|
|
116
143
|
else
|
|
117
144
|
@unknown_json_fields[k] = v
|
|
@@ -27,27 +27,35 @@ module Comet
|
|
|
27
27
|
attr_accessor :unknown_json_fields
|
|
28
28
|
|
|
29
29
|
def initialize
|
|
30
|
+
clear
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def clear
|
|
34
|
+
@status = 0
|
|
35
|
+
@message = ''
|
|
30
36
|
@import_sources = {}
|
|
31
37
|
@unknown_json_fields = {}
|
|
32
38
|
end
|
|
33
39
|
|
|
34
40
|
# @param [String] json_string The complete object in JSON format
|
|
35
41
|
def from_json(json_string)
|
|
36
|
-
raise TypeError 'expected
|
|
42
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
37
43
|
|
|
38
44
|
from_hash(JSON.parse(json_string))
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
# @param [Hash] obj The complete object as a Ruby hash
|
|
42
48
|
def from_hash(obj)
|
|
43
|
-
raise TypeError 'expected
|
|
49
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
44
50
|
|
|
45
51
|
obj.each do |k, v|
|
|
46
52
|
case k
|
|
47
53
|
when 'Status'
|
|
54
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
55
|
+
|
|
48
56
|
@status = v
|
|
49
57
|
when 'Message'
|
|
50
|
-
raise TypeError 'expected
|
|
58
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
51
59
|
|
|
52
60
|
@message = v
|
|
53
61
|
when 'ImportSources'
|
|
@@ -56,7 +64,7 @@ module Comet
|
|
|
56
64
|
@import_sources = {}
|
|
57
65
|
else
|
|
58
66
|
v.each do |k1, v1|
|
|
59
|
-
raise TypeError 'expected
|
|
67
|
+
raise TypeError "'v1' expected String, got #{v1.class}" unless v1.is_a? String
|
|
60
68
|
|
|
61
69
|
@import_sources[k1] = v1
|
|
62
70
|
end
|