comet_backup_ruby_sdk 2.40.0 → 2.41.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile.lock +1 -1
  4. data/comet_backup_ruby_sdk.gemspec +1 -1
  5. data/lib/comet/comet_server.rb +169 -2
  6. data/lib/comet/definitions.rb +6 -2
  7. data/lib/comet/models/admin_options.rb +72 -0
  8. data/lib/comet/models/browse_vmware_datacenters_response.rb +100 -0
  9. data/lib/comet/models/browse_vmware_datastores_response.rb +100 -0
  10. data/lib/comet/models/browse_vmware_hosts_response.rb +100 -0
  11. data/lib/comet/models/browse_vmware_networks_response.rb +100 -0
  12. data/lib/comet/models/browse_vmware_response.rb +2 -0
  13. data/lib/comet/models/disk_drive.rb +16 -0
  14. data/lib/comet/models/dispatcher_list_snapshot_virtual_machines_response.rb +99 -0
  15. data/lib/comet/models/hyper_vmachine_info.rb +57 -0
  16. data/lib/comet/models/hyper_vrestore_target_options.rb +73 -0
  17. data/lib/comet/models/office_365custom_setting_v2.rb +53 -6
  18. data/lib/comet/models/office_365mixed_virtual_account.rb +8 -8
  19. data/lib/comet/models/partition_conflict.rb +91 -0
  20. data/lib/comet/models/policy_options.rb +80 -0
  21. data/lib/comet/models/restore_job_advanced_options.rb +24 -0
  22. data/lib/comet/models/vmdisk_info.rb +105 -0
  23. data/lib/comet/models/vminfo.rb +137 -0
  24. data/lib/comet/models/vminfo_list.rb +80 -0
  25. data/lib/comet/models/vmware_datacenter_info.rb +74 -0
  26. data/lib/comet/models/vmware_datastore_info.rb +74 -0
  27. data/lib/comet/models/vmware_host_info.rb +74 -0
  28. data/lib/comet/models/vmware_machine_info.rb +1 -0
  29. data/lib/comet/models/vmware_network_info.rb +74 -0
  30. data/lib/comet/models/vmware_restore_target_options.rb +119 -0
  31. data/lib/comet_backup_ruby_sdk.rb +17 -0
  32. metadata +19 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8de6d34a1a34e2fef7d5b970bfc33cc451106ca28c7a292060ebbee262bb7ed3
4
- data.tar.gz: 9e0bde4efe6c21153d91881efbf6f8b74ea7b4881a21ff85cda2f7675297e516
3
+ metadata.gz: c972fed511fa56a76cf96c42f8559faddcc003fc4378616bb5b91ec0d45ef210
4
+ data.tar.gz: 945063cd41af3fb4b56728e2374e99c4463c18e7ca68ee6a916829d31c406959
5
5
  SHA512:
6
- metadata.gz: c47886f036adebb1cd44c44e5bd371cefe470e3cd569925d451f0a8c5d4983a97d70db58afc6ec89d82cab2e34ce6cb2ac75a68394ac2440bd94a98bb47609bf
7
- data.tar.gz: 2ce781adab00183ab1533cbf0f207cb976be7f590df60b2147fc54384670abe6bd6047067d78047f407bcc1137fb10eeb135934a4f47027aa40bddd5d2ea2e78
6
+ metadata.gz: 4d84b541b325ded6b7f1ee7b111a2ef8110b2774b3097c1e1aa26d282543ece740fc6ec5eefaa14a6393f737c3525f4bc316f65b9ddbd135a3b664b3d3890d56
7
+ data.tar.gz: d5e8829fe4a04d7f792f4a982f9fe2ae4296de440845d494ccae9d644c8c3743bf7300db0460ba7015355cc821b862b7a28de7ce75d124822923e77b5624cb42
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2025-02-17 v2.41.0
4
+ Update to 24.12.5
5
+
6
+ - Based on Comet 24.12.5
7
+
3
8
  ## 2025-01-29 v2.40.0
4
9
 
5
10
  - Based on Comet 24.12.4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comet_backup_ruby_sdk (2.40.0)
4
+ comet_backup_ruby_sdk (2.41.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,7 +12,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
12
12
 
13
13
  Gem::Specification.new do |spec|
14
14
  spec.name = 'comet_backup_ruby_sdk'
15
- spec.version = '2.40.0'
15
+ spec.version = '2.41.0'
16
16
  spec.authors = ['Comet Licensing Ltd.']
17
17
  spec.email = ['hello@cometbackup.com']
18
18
 
@@ -1143,6 +1143,37 @@ module Comet
1143
1143
  ret
1144
1144
  end
1145
1145
 
1146
+ # AdminDispatcherBrowseVirtualMachines
1147
+ #
1148
+ # Browse virtual machines in target snapshot.
1149
+ #
1150
+ # You must supply administrator authentication credentials to use this API.
1151
+ # This API requires the Auth Role to be enabled.
1152
+ #
1153
+ # @param [String] target_id The live connection GUID
1154
+ # @param [String] destination_id The Storage Vault GUID
1155
+ # @param [String] snapshot_id Snapshot to search
1156
+ # @return [Comet::DispatcherListSnapshotVirtualMachinesResponse]
1157
+ def admin_dispatcher_browse_virtual_machines(target_id, destination_id, snapshot_id)
1158
+ submit_params = {}
1159
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1160
+
1161
+ submit_params['TargetID'] = target_id
1162
+ raise TypeError, "'destination_id' expected String, got #{destination_id.class}" unless destination_id.is_a? String
1163
+
1164
+ submit_params['DestinationID'] = destination_id
1165
+ raise TypeError, "'snapshot_id' expected String, got #{snapshot_id.class}" unless snapshot_id.is_a? String
1166
+
1167
+ submit_params['SnapshotID'] = snapshot_id
1168
+
1169
+ body = perform_request('api/v1/admin/dispatcher/browse-virtual-machines', submit_params)
1170
+ json_body = JSON.parse body
1171
+ check_status json_body
1172
+ ret = Comet::DispatcherListSnapshotVirtualMachinesResponse.new
1173
+ ret.from_hash(json_body)
1174
+ ret
1175
+ end
1176
+
1146
1177
  # AdminDispatcherDeepverifyStorageVault
1147
1178
  #
1148
1179
  # Instruct a live connected device to deeply verify Storage Vault content.
@@ -1746,6 +1777,130 @@ module Comet
1746
1777
  ret
1747
1778
  end
1748
1779
 
1780
+ # AdminDispatcherRequestBrowseVmwareDatacenters
1781
+ #
1782
+ # Request a list of VMware vSphere Datacenters on a VMware vSphere connection.
1783
+ # The remote device must have given consent for an MSP to browse their files.
1784
+ #
1785
+ # You must supply administrator authentication credentials to use this API.
1786
+ # This API requires the Auth Role to be enabled.
1787
+ #
1788
+ # @param [String] target_id The live connection GUID
1789
+ # @param [Comet::VMwareConnection] credentials The VMware vSphere connection settings
1790
+ # @return [Comet::BrowseVMwareDatacentersResponse]
1791
+ def admin_dispatcher_request_browse_vmware_datacenters(target_id, credentials)
1792
+ submit_params = {}
1793
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1794
+
1795
+ submit_params['TargetID'] = target_id
1796
+ raise TypeError, "'credentials' expected Comet::VMwareConnection, got #{credentials.class}" unless credentials.is_a? Comet::VMwareConnection
1797
+
1798
+ submit_params['Credentials'] = credentials.to_json
1799
+
1800
+ body = perform_request('api/v1/admin/dispatcher/request-browse-vmware/datacenters', submit_params)
1801
+ json_body = JSON.parse body
1802
+ check_status json_body
1803
+ ret = Comet::BrowseVMwareDatacentersResponse.new
1804
+ ret.from_hash(json_body)
1805
+ ret
1806
+ end
1807
+
1808
+ # AdminDispatcherRequestBrowseVmwareDatastores
1809
+ #
1810
+ # Request a list of VMware vSphere Datastores on a VMware vSphere connection, for a specified VMware Datacenter.
1811
+ # The remote device must have given consent for an MSP to browse their files.
1812
+ #
1813
+ # You must supply administrator authentication credentials to use this API.
1814
+ # This API requires the Auth Role to be enabled.
1815
+ #
1816
+ # @param [String] target_id The live connection GUID
1817
+ # @param [Comet::VMwareConnection] credentials The VMware vSphere connection settings
1818
+ # @param [String] filter The name of the target VMware Datacenter
1819
+ # @return [Comet::BrowseVMwareDatastoresResponse]
1820
+ def admin_dispatcher_request_browse_vmware_datastores(target_id, credentials, filter)
1821
+ submit_params = {}
1822
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1823
+
1824
+ submit_params['TargetID'] = target_id
1825
+ raise TypeError, "'credentials' expected Comet::VMwareConnection, got #{credentials.class}" unless credentials.is_a? Comet::VMwareConnection
1826
+
1827
+ submit_params['Credentials'] = credentials.to_json
1828
+ raise TypeError, "'filter' expected String, got #{filter.class}" unless filter.is_a? String
1829
+
1830
+ submit_params['Filter'] = filter
1831
+
1832
+ body = perform_request('api/v1/admin/dispatcher/request-browse-vmware/datastores', submit_params)
1833
+ json_body = JSON.parse body
1834
+ check_status json_body
1835
+ ret = Comet::BrowseVMwareDatastoresResponse.new
1836
+ ret.from_hash(json_body)
1837
+ ret
1838
+ end
1839
+
1840
+ # AdminDispatcherRequestBrowseVmwareHosts
1841
+ #
1842
+ # Request a list of VMware vSphere Hosts on a VMware vSphere connection, for a specified VMware Datacenter.
1843
+ # The remote device must have given consent for an MSP to browse their files.
1844
+ #
1845
+ # You must supply administrator authentication credentials to use this API.
1846
+ # This API requires the Auth Role to be enabled.
1847
+ #
1848
+ # @param [String] target_id The live connection GUID
1849
+ # @param [Comet::VMwareConnection] credentials The VMware vSphere connection settings
1850
+ # @param [String] filter The name of the target VMware Datacenter
1851
+ # @return [Comet::BrowseVMwareHostsResponse]
1852
+ def admin_dispatcher_request_browse_vmware_hosts(target_id, credentials, filter)
1853
+ submit_params = {}
1854
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1855
+
1856
+ submit_params['TargetID'] = target_id
1857
+ raise TypeError, "'credentials' expected Comet::VMwareConnection, got #{credentials.class}" unless credentials.is_a? Comet::VMwareConnection
1858
+
1859
+ submit_params['Credentials'] = credentials.to_json
1860
+ raise TypeError, "'filter' expected String, got #{filter.class}" unless filter.is_a? String
1861
+
1862
+ submit_params['Filter'] = filter
1863
+
1864
+ body = perform_request('api/v1/admin/dispatcher/request-browse-vmware/hosts', submit_params)
1865
+ json_body = JSON.parse body
1866
+ check_status json_body
1867
+ ret = Comet::BrowseVMwareHostsResponse.new
1868
+ ret.from_hash(json_body)
1869
+ ret
1870
+ end
1871
+
1872
+ # AdminDispatcherRequestBrowseVmwareNetworks
1873
+ #
1874
+ # Request a list of VMware vSphere Networks on a VMware vSphere connection, for a specified VMware Datacenter.
1875
+ # The remote device must have given consent for an MSP to browse their files.
1876
+ #
1877
+ # You must supply administrator authentication credentials to use this API.
1878
+ # This API requires the Auth Role to be enabled.
1879
+ #
1880
+ # @param [String] target_id The live connection GUID
1881
+ # @param [Comet::VMwareConnection] credentials The VMware vSphere connection settings
1882
+ # @param [String] filter The name of the target VMware Datacenter
1883
+ # @return [Comet::BrowseVMwareNetworksResponse]
1884
+ def admin_dispatcher_request_browse_vmware_networks(target_id, credentials, filter)
1885
+ submit_params = {}
1886
+ raise TypeError, "'target_id' expected String, got #{target_id.class}" unless target_id.is_a? String
1887
+
1888
+ submit_params['TargetID'] = target_id
1889
+ raise TypeError, "'credentials' expected Comet::VMwareConnection, got #{credentials.class}" unless credentials.is_a? Comet::VMwareConnection
1890
+
1891
+ submit_params['Credentials'] = credentials.to_json
1892
+ raise TypeError, "'filter' expected String, got #{filter.class}" unless filter.is_a? String
1893
+
1894
+ submit_params['Filter'] = filter
1895
+
1896
+ body = perform_request('api/v1/admin/dispatcher/request-browse-vmware/networks', submit_params)
1897
+ json_body = JSON.parse body
1898
+ check_status json_body
1899
+ ret = Comet::BrowseVMwareNetworksResponse.new
1900
+ ret.from_hash(json_body)
1901
+ ret
1902
+ end
1903
+
1749
1904
  # AdminDispatcherRequestBrowseVssAaw
1750
1905
  #
1751
1906
  # Request a list of installed VSS Writers (Application-Aware Writers) from a live connected device.
@@ -3976,8 +4131,9 @@ module Comet
3976
4131
  # @param [String] policy_id The policy ID to update or create
3977
4132
  # @param [Comet::GroupPolicy] policy The policy data
3978
4133
  # @param [String] check_policy_hash (Optional) An atomic verification hash as supplied by the AdminPoliciesGet API
4134
+ # @param [Comet::PolicyOptions] options (Optional) An array of PolicySourceID that will be explicitly deleted.
3979
4135
  # @return [Comet::CometAPIResponseMessage]
3980
- def admin_policies_set(policy_id, policy, check_policy_hash = nil)
4136
+ def admin_policies_set(policy_id, policy, check_policy_hash = nil, options = nil)
3981
4137
  submit_params = {}
3982
4138
  raise TypeError, "'policy_id' expected String, got #{policy_id.class}" unless policy_id.is_a? String
3983
4139
 
@@ -3990,6 +4146,11 @@ module Comet
3990
4146
 
3991
4147
  submit_params['CheckPolicyHash'] = check_policy_hash
3992
4148
  end
4149
+ unless options.nil?
4150
+ raise TypeError, "'options' expected Comet::PolicyOptions, got #{options.class}" unless options.is_a? Comet::PolicyOptions
4151
+
4152
+ submit_params['Options'] = options.to_json
4153
+ end
3993
4154
 
3994
4155
  body = perform_request('api/v1/admin/policies/set', submit_params)
3995
4156
  json_body = JSON.parse body
@@ -4251,8 +4412,9 @@ module Comet
4251
4412
  # @param [String] target_user Selected account username
4252
4413
  # @param [Comet::UserProfileConfig] profile_data Modified user profile
4253
4414
  # @param [String] require_hash Previous hash parameter
4415
+ # @param [Comet::AdminOptions] admin_options (Optional) Instructions for modifying user profile
4254
4416
  # @return [Comet::CometAPIResponseMessage]
4255
- def admin_set_user_profile_hash(target_user, profile_data, require_hash)
4417
+ def admin_set_user_profile_hash(target_user, profile_data, require_hash, admin_options = nil)
4256
4418
  submit_params = {}
4257
4419
  raise TypeError, "'target_user' expected String, got #{target_user.class}" unless target_user.is_a? String
4258
4420
 
@@ -4263,6 +4425,11 @@ module Comet
4263
4425
  raise TypeError, "'require_hash' expected String, got #{require_hash.class}" unless require_hash.is_a? String
4264
4426
 
4265
4427
  submit_params['RequireHash'] = require_hash
4428
+ unless admin_options.nil?
4429
+ raise TypeError, "'admin_options' expected Comet::AdminOptions, got #{admin_options.class}" unless admin_options.is_a? Comet::AdminOptions
4430
+
4431
+ submit_params['AdminOptions'] = admin_options.to_json
4432
+ end
4266
4433
 
4267
4434
  body = perform_request('api/v1/admin/set-user-profile-hash', submit_params)
4268
4435
  json_body = JSON.parse body
@@ -7,13 +7,13 @@
7
7
 
8
8
  module Comet
9
9
 
10
- APPLICATION_VERSION = '24.12.4'
10
+ APPLICATION_VERSION = '24.12.5'
11
11
 
12
12
  APPLICATION_VERSION_MAJOR = 24
13
13
 
14
14
  APPLICATION_VERSION_MINOR = 12
15
15
 
16
- APPLICATION_VERSION_REVISION = 4
16
+ APPLICATION_VERSION_REVISION = 5
17
17
 
18
18
  # AutoRetentionLevel: The system will automatically choose how often to run an automatic Retention Pass after each backup job.
19
19
  BACKUPJOBAUTORETENTION_AUTOMATIC = 0
@@ -597,6 +597,10 @@ New code should explicitly use OBJECT_LOCK_ON / OBJECT_LOCK_OFF instead.
597
597
  # RestoreType: Restore disk image backup as Hyper-V-compatible virtual disks (.vhdx format)
598
598
  RESTORETYPE_WINDISK_VHDX = 13
599
599
 
600
+ # RestoreType: Restore virtual machines directly to hypervisor
601
+ # This const is available in Comet 24.12.x and later.
602
+ RESTORETYPE_VMHOST = 14
603
+
600
604
  # RestoreType: Legacy name alias - Prefer to use RESTORETYPE_PROCESS_ARCHIVE since multiple archive file formats are supported within this single RESTORETYPE_
601
605
  RESTORETYPE_PROCESS_TARBALL = 3
602
606
 
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # AdminOptions is a typed class wrapper around the underlying Comet Server API data structure.
13
+ class AdminOptions
14
+
15
+ # @type [Comet::PolicyOptions] policy
16
+ attr_accessor :policy
17
+
18
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
19
+ attr_accessor :unknown_json_fields
20
+
21
+ def initialize
22
+ clear
23
+ end
24
+
25
+ def clear
26
+ @policy = Comet::PolicyOptions.new
27
+ @unknown_json_fields = {}
28
+ end
29
+
30
+ # @param [String] json_string The complete object in JSON format
31
+ def from_json(json_string)
32
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
33
+
34
+ from_hash(JSON.parse(json_string))
35
+ end
36
+
37
+ # @param [Hash] obj The complete object as a Ruby hash
38
+ def from_hash(obj)
39
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
40
+
41
+ obj.each do |k, v|
42
+ case k
43
+ when 'Policy'
44
+ @policy = Comet::PolicyOptions.new
45
+ @policy.from_hash(v)
46
+ else
47
+ @unknown_json_fields[k] = v
48
+ end
49
+ end
50
+ end
51
+
52
+ # @return [Hash] The complete object as a Ruby hash
53
+ def to_hash
54
+ ret = {}
55
+ ret['Policy'] = @policy
56
+ @unknown_json_fields.each do |k, v|
57
+ ret[k] = v
58
+ end
59
+ ret
60
+ end
61
+
62
+ # @return [Hash] The complete object as a Ruby hash
63
+ def to_h
64
+ to_hash
65
+ end
66
+
67
+ # @return [String] The complete object as a JSON string
68
+ def to_json(options = {})
69
+ to_hash.to_json(options)
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # BrowseVMwareDatacentersResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # BrowseVMwareDatacentersResponse contains a list of VMware Datacenters when remotely browsing a
14
+ # VMware vSphere connection.
15
+ class BrowseVMwareDatacentersResponse
16
+
17
+ # If the operation was successful, the status will be in the 200-299 range.
18
+ # @type [Number] status
19
+ attr_accessor :status
20
+
21
+ # @type [String] message
22
+ attr_accessor :message
23
+
24
+ # @type [Array<Comet::VMwareDatacenterInfo>] datacenters
25
+ attr_accessor :datacenters
26
+
27
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
28
+ attr_accessor :unknown_json_fields
29
+
30
+ def initialize
31
+ clear
32
+ end
33
+
34
+ def clear
35
+ @status = 0
36
+ @message = ''
37
+ @datacenters = []
38
+ @unknown_json_fields = {}
39
+ end
40
+
41
+ # @param [String] json_string The complete object in JSON format
42
+ def from_json(json_string)
43
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
44
+
45
+ from_hash(JSON.parse(json_string))
46
+ end
47
+
48
+ # @param [Hash] obj The complete object as a Ruby hash
49
+ def from_hash(obj)
50
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
51
+
52
+ obj.each do |k, v|
53
+ case k
54
+ when 'Status'
55
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
56
+
57
+ @status = v
58
+ when 'Message'
59
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
60
+
61
+ @message = v
62
+ when 'Datacenters'
63
+ if v.nil?
64
+ @datacenters = []
65
+ else
66
+ @datacenters = Array.new(v.length)
67
+ v.each_with_index do |v1, i1|
68
+ @datacenters[i1] = Comet::VMwareDatacenterInfo.new
69
+ @datacenters[i1].from_hash(v1)
70
+ end
71
+ end
72
+ else
73
+ @unknown_json_fields[k] = v
74
+ end
75
+ end
76
+ end
77
+
78
+ # @return [Hash] The complete object as a Ruby hash
79
+ def to_hash
80
+ ret = {}
81
+ ret['Status'] = @status
82
+ ret['Message'] = @message
83
+ ret['Datacenters'] = @datacenters
84
+ @unknown_json_fields.each do |k, v|
85
+ ret[k] = v
86
+ end
87
+ ret
88
+ end
89
+
90
+ # @return [Hash] The complete object as a Ruby hash
91
+ def to_h
92
+ to_hash
93
+ end
94
+
95
+ # @return [String] The complete object as a JSON string
96
+ def to_json(options = {})
97
+ to_hash.to_json(options)
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # BrowseVMwareDatastoresResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # BrowseVMwareHostsResponse contains a list of VMware Datastores for a specific VMware Datacenter,
14
+ # when remotely browsing a VMware vSphere connection.
15
+ class BrowseVMwareDatastoresResponse
16
+
17
+ # If the operation was successful, the status will be in the 200-299 range.
18
+ # @type [Number] status
19
+ attr_accessor :status
20
+
21
+ # @type [String] message
22
+ attr_accessor :message
23
+
24
+ # @type [Array<Comet::VMwareDatastoreInfo>] datastores
25
+ attr_accessor :datastores
26
+
27
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
28
+ attr_accessor :unknown_json_fields
29
+
30
+ def initialize
31
+ clear
32
+ end
33
+
34
+ def clear
35
+ @status = 0
36
+ @message = ''
37
+ @datastores = []
38
+ @unknown_json_fields = {}
39
+ end
40
+
41
+ # @param [String] json_string The complete object in JSON format
42
+ def from_json(json_string)
43
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
44
+
45
+ from_hash(JSON.parse(json_string))
46
+ end
47
+
48
+ # @param [Hash] obj The complete object as a Ruby hash
49
+ def from_hash(obj)
50
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
51
+
52
+ obj.each do |k, v|
53
+ case k
54
+ when 'Status'
55
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
56
+
57
+ @status = v
58
+ when 'Message'
59
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
60
+
61
+ @message = v
62
+ when 'Datastores'
63
+ if v.nil?
64
+ @datastores = []
65
+ else
66
+ @datastores = Array.new(v.length)
67
+ v.each_with_index do |v1, i1|
68
+ @datastores[i1] = Comet::VMwareDatastoreInfo.new
69
+ @datastores[i1].from_hash(v1)
70
+ end
71
+ end
72
+ else
73
+ @unknown_json_fields[k] = v
74
+ end
75
+ end
76
+ end
77
+
78
+ # @return [Hash] The complete object as a Ruby hash
79
+ def to_hash
80
+ ret = {}
81
+ ret['Status'] = @status
82
+ ret['Message'] = @message
83
+ ret['Datastores'] = @datastores
84
+ @unknown_json_fields.each do |k, v|
85
+ ret[k] = v
86
+ end
87
+ ret
88
+ end
89
+
90
+ # @return [Hash] The complete object as a Ruby hash
91
+ def to_h
92
+ to_hash
93
+ end
94
+
95
+ # @return [String] The complete object as a JSON string
96
+ def to_json(options = {})
97
+ to_hash.to_json(options)
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # BrowseVMwareHostsResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # BrowseVMwareHostsResponse contains a list of VMware Hosts for a specific VMware Datacenter, when
14
+ # remotely browsing a VMware vSphere connection.
15
+ class BrowseVMwareHostsResponse
16
+
17
+ # If the operation was successful, the status will be in the 200-299 range.
18
+ # @type [Number] status
19
+ attr_accessor :status
20
+
21
+ # @type [String] message
22
+ attr_accessor :message
23
+
24
+ # @type [Array<Comet::VMwareHostInfo>] hosts
25
+ attr_accessor :hosts
26
+
27
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
28
+ attr_accessor :unknown_json_fields
29
+
30
+ def initialize
31
+ clear
32
+ end
33
+
34
+ def clear
35
+ @status = 0
36
+ @message = ''
37
+ @hosts = []
38
+ @unknown_json_fields = {}
39
+ end
40
+
41
+ # @param [String] json_string The complete object in JSON format
42
+ def from_json(json_string)
43
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
44
+
45
+ from_hash(JSON.parse(json_string))
46
+ end
47
+
48
+ # @param [Hash] obj The complete object as a Ruby hash
49
+ def from_hash(obj)
50
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
51
+
52
+ obj.each do |k, v|
53
+ case k
54
+ when 'Status'
55
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
56
+
57
+ @status = v
58
+ when 'Message'
59
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
60
+
61
+ @message = v
62
+ when 'Hosts'
63
+ if v.nil?
64
+ @hosts = []
65
+ else
66
+ @hosts = Array.new(v.length)
67
+ v.each_with_index do |v1, i1|
68
+ @hosts[i1] = Comet::VMwareHostInfo.new
69
+ @hosts[i1].from_hash(v1)
70
+ end
71
+ end
72
+ else
73
+ @unknown_json_fields[k] = v
74
+ end
75
+ end
76
+ end
77
+
78
+ # @return [Hash] The complete object as a Ruby hash
79
+ def to_hash
80
+ ret = {}
81
+ ret['Status'] = @status
82
+ ret['Message'] = @message
83
+ ret['Hosts'] = @hosts
84
+ @unknown_json_fields.each do |k, v|
85
+ ret[k] = v
86
+ end
87
+ ret
88
+ end
89
+
90
+ # @return [Hash] The complete object as a Ruby hash
91
+ def to_h
92
+ to_hash
93
+ end
94
+
95
+ # @return [String] The complete object as a JSON string
96
+ def to_json(options = {})
97
+ to_hash.to_json(options)
98
+ end
99
+ end
100
+ end