comet_backup_ruby_sdk 0.2.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -66,76 +66,100 @@ module Comet
|
|
66
66
|
attr_accessor :unknown_json_fields
|
67
67
|
|
68
68
|
def initialize
|
69
|
+
clear
|
70
|
+
end
|
71
|
+
|
72
|
+
def clear
|
73
|
+
@path_ico_file = ''
|
74
|
+
@path_icns_file = ''
|
75
|
+
@path_eula_rtf = ''
|
76
|
+
@path_tile_png = ''
|
77
|
+
@path_header_image = ''
|
78
|
+
@package_identifier = ''
|
79
|
+
@windows_code_sign_pkcs12file_path = ''
|
80
|
+
@windows_code_sign_pkcs12password_format = 0
|
81
|
+
@windows_code_sign_pkcs12password = ''
|
82
|
+
@windows_code_sign_pkcs11engine = ''
|
83
|
+
@windows_code_sign_pkcs11module = ''
|
84
|
+
@windows_code_sign_pkcs11certfile = ''
|
85
|
+
@windows_code_sign_pkcs11key_id = ''
|
86
|
+
@windows_code_sign_pkcs11password_format = 0
|
87
|
+
@windows_code_sign_pkcs11password = ''
|
88
|
+
@mac_oscode_sign = Comet::MacOSCodeSignProperties.new
|
69
89
|
@unknown_json_fields = {}
|
70
90
|
end
|
71
91
|
|
72
92
|
# @param [String] json_string The complete object in JSON format
|
73
93
|
def from_json(json_string)
|
74
|
-
raise TypeError 'expected
|
94
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
75
95
|
|
76
96
|
from_hash(JSON.parse(json_string))
|
77
97
|
end
|
78
98
|
|
79
99
|
# @param [Hash] obj The complete object as a Ruby hash
|
80
100
|
def from_hash(obj)
|
81
|
-
raise TypeError 'expected
|
101
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
82
102
|
|
83
103
|
obj.each do |k, v|
|
84
104
|
case k
|
85
105
|
when 'PathIcoFile'
|
86
|
-
raise TypeError 'expected
|
106
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
87
107
|
|
88
108
|
@path_ico_file = v
|
89
109
|
when 'PathIcnsFile'
|
90
|
-
raise TypeError 'expected
|
110
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
91
111
|
|
92
112
|
@path_icns_file = v
|
93
113
|
when 'PathEulaRtf'
|
94
|
-
raise TypeError 'expected
|
114
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
95
115
|
|
96
116
|
@path_eula_rtf = v
|
97
117
|
when 'PathTilePng'
|
98
|
-
raise TypeError 'expected
|
118
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
99
119
|
|
100
120
|
@path_tile_png = v
|
101
121
|
when 'PathHeaderImage'
|
102
|
-
raise TypeError 'expected
|
122
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
103
123
|
|
104
124
|
@path_header_image = v
|
105
125
|
when 'PackageIdentifier'
|
106
|
-
raise TypeError 'expected
|
126
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
107
127
|
|
108
128
|
@package_identifier = v
|
109
129
|
when 'WindowsCodeSignPKCS12FilePath'
|
110
|
-
raise TypeError 'expected
|
130
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
111
131
|
|
112
132
|
@windows_code_sign_pkcs12file_path = v
|
113
133
|
when 'WindowsCodeSignPKCS12PasswordFormat'
|
134
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
135
|
+
|
114
136
|
@windows_code_sign_pkcs12password_format = v
|
115
137
|
when 'WindowsCodeSignPKCS12Password'
|
116
|
-
raise TypeError 'expected
|
138
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
117
139
|
|
118
140
|
@windows_code_sign_pkcs12password = v
|
119
141
|
when 'WindowsCodeSignPKCS11Engine'
|
120
|
-
raise TypeError 'expected
|
142
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
121
143
|
|
122
144
|
@windows_code_sign_pkcs11engine = v
|
123
145
|
when 'WindowsCodeSignPKCS11Module'
|
124
|
-
raise TypeError 'expected
|
146
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
125
147
|
|
126
148
|
@windows_code_sign_pkcs11module = v
|
127
149
|
when 'WindowsCodeSignPKCS11Certfile'
|
128
|
-
raise TypeError 'expected
|
150
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
129
151
|
|
130
152
|
@windows_code_sign_pkcs11certfile = v
|
131
153
|
when 'WindowsCodeSignPKCS11KeyID'
|
132
|
-
raise TypeError 'expected
|
154
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
133
155
|
|
134
156
|
@windows_code_sign_pkcs11key_id = v
|
135
157
|
when 'WindowsCodeSignPKCS11PasswordFormat'
|
158
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
159
|
+
|
136
160
|
@windows_code_sign_pkcs11password_format = v
|
137
161
|
when 'WindowsCodeSignPKCS11Password'
|
138
|
-
raise TypeError 'expected
|
162
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
139
163
|
|
140
164
|
@windows_code_sign_pkcs11password = v
|
141
165
|
when 'MacOSCodeSign'
|
@@ -24,20 +24,24 @@ module Comet
|
|
24
24
|
attr_accessor :unknown_json_fields
|
25
25
|
|
26
26
|
def initialize
|
27
|
+
clear
|
28
|
+
end
|
29
|
+
|
30
|
+
def clear
|
27
31
|
@allowed_engine_type_when_restricted = []
|
28
32
|
@unknown_json_fields = {}
|
29
33
|
end
|
30
34
|
|
31
35
|
# @param [String] json_string The complete object in JSON format
|
32
36
|
def from_json(json_string)
|
33
|
-
raise TypeError 'expected
|
37
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
34
38
|
|
35
39
|
from_hash(JSON.parse(json_string))
|
36
40
|
end
|
37
41
|
|
38
42
|
# @param [Hash] obj The complete object as a Ruby hash
|
39
43
|
def from_hash(obj)
|
40
|
-
raise TypeError 'expected
|
44
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
41
45
|
|
42
46
|
obj.each do |k, v|
|
43
47
|
case k
|
@@ -49,7 +53,7 @@ module Comet
|
|
49
53
|
else
|
50
54
|
@allowed_engine_type_when_restricted = Array.new(v.length)
|
51
55
|
v.each_with_index do |v1, i1|
|
52
|
-
raise TypeError 'expected
|
56
|
+
raise TypeError "'v1' expected String, got #{v1.class}" unless v1.is_a? String
|
53
57
|
|
54
58
|
@allowed_engine_type_when_restricted[i1] = v1
|
55
59
|
end
|
@@ -42,46 +42,56 @@ module Comet
|
|
42
42
|
attr_accessor :unknown_json_fields
|
43
43
|
|
44
44
|
def initialize
|
45
|
+
clear
|
46
|
+
end
|
47
|
+
|
48
|
+
def clear
|
49
|
+
@product_name = ''
|
50
|
+
@company_name = ''
|
51
|
+
@help_url = ''
|
52
|
+
@default_login_server_url = ''
|
53
|
+
@tile_background_color = ''
|
54
|
+
@account_register_url = ''
|
45
55
|
@unknown_json_fields = {}
|
46
56
|
end
|
47
57
|
|
48
58
|
# @param [String] json_string The complete object in JSON format
|
49
59
|
def from_json(json_string)
|
50
|
-
raise TypeError 'expected
|
60
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
51
61
|
|
52
62
|
from_hash(JSON.parse(json_string))
|
53
63
|
end
|
54
64
|
|
55
65
|
# @param [Hash] obj The complete object as a Ruby hash
|
56
66
|
def from_hash(obj)
|
57
|
-
raise TypeError 'expected
|
67
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
58
68
|
|
59
69
|
obj.each do |k, v|
|
60
70
|
case k
|
61
71
|
when 'ProductName'
|
62
|
-
raise TypeError 'expected
|
72
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
63
73
|
|
64
74
|
@product_name = v
|
65
75
|
when 'CompanyName'
|
66
|
-
raise TypeError 'expected
|
76
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
67
77
|
|
68
78
|
@company_name = v
|
69
79
|
when 'HelpURL'
|
70
|
-
raise TypeError 'expected
|
80
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
71
81
|
|
72
82
|
@help_url = v
|
73
83
|
when 'HelpIsPopup'
|
74
84
|
@help_is_popup = v
|
75
85
|
when 'DefaultLoginServerURL'
|
76
|
-
raise TypeError 'expected
|
86
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
77
87
|
|
78
88
|
@default_login_server_url = v
|
79
89
|
when 'TileBackgroundColor'
|
80
|
-
raise TypeError 'expected
|
90
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
81
91
|
|
82
92
|
@tile_background_color = v
|
83
93
|
when 'AccountRegisterURL'
|
84
|
-
raise TypeError 'expected
|
94
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
85
95
|
|
86
96
|
@account_register_url = v
|
87
97
|
when 'HideBackgroundLogo'
|
@@ -42,40 +42,52 @@ module Comet
|
|
42
42
|
attr_accessor :unknown_json_fields
|
43
43
|
|
44
44
|
def initialize
|
45
|
+
clear
|
46
|
+
end
|
47
|
+
|
48
|
+
def clear
|
49
|
+
@type = ''
|
50
|
+
@description = ''
|
51
|
+
@remote_address = ''
|
52
|
+
@username = ''
|
53
|
+
@password = ''
|
54
|
+
@ldap = Comet::ExternalLDAPAuthenticationSourceSettings.new
|
55
|
+
@b2 = Comet::B2VirtualStorageRoleSettings.new
|
56
|
+
@wasabi = Comet::WasabiVirtualStorageRoleSettings.new
|
45
57
|
@unknown_json_fields = {}
|
46
58
|
end
|
47
59
|
|
48
60
|
# @param [String] json_string The complete object in JSON format
|
49
61
|
def from_json(json_string)
|
50
|
-
raise TypeError 'expected
|
62
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
51
63
|
|
52
64
|
from_hash(JSON.parse(json_string))
|
53
65
|
end
|
54
66
|
|
55
67
|
# @param [Hash] obj The complete object as a Ruby hash
|
56
68
|
def from_hash(obj)
|
57
|
-
raise TypeError 'expected
|
69
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
58
70
|
|
59
71
|
obj.each do |k, v|
|
60
72
|
case k
|
61
73
|
when 'Type'
|
62
|
-
raise TypeError 'expected
|
74
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
63
75
|
|
64
76
|
@type = v
|
65
77
|
when 'Description'
|
66
|
-
raise TypeError 'expected
|
78
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
67
79
|
|
68
80
|
@description = v
|
69
81
|
when 'RemoteAddress'
|
70
|
-
raise TypeError 'expected
|
82
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
71
83
|
|
72
84
|
@remote_address = v
|
73
85
|
when 'Username'
|
74
|
-
raise TypeError 'expected
|
86
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
75
87
|
|
76
88
|
@username = v
|
77
89
|
when 'Password'
|
78
|
-
raise TypeError 'expected
|
90
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
79
91
|
|
80
92
|
@password = v
|
81
93
|
when 'LDAP'
|
@@ -44,44 +44,60 @@ module Comet
|
|
44
44
|
# @type [Number] storage_limit_bytes
|
45
45
|
attr_accessor :storage_limit_bytes
|
46
46
|
|
47
|
+
# @type [Boolean] rebrand_storage
|
48
|
+
attr_accessor :rebrand_storage
|
49
|
+
|
47
50
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
48
51
|
attr_accessor :unknown_json_fields
|
49
52
|
|
50
53
|
def initialize
|
54
|
+
clear
|
55
|
+
end
|
56
|
+
|
57
|
+
def clear
|
58
|
+
@type = ''
|
59
|
+
@description = ''
|
60
|
+
@remote_address = ''
|
61
|
+
@username = ''
|
62
|
+
@password = ''
|
63
|
+
@ldap = Comet::ExternalLDAPAuthenticationSourceSettings.new
|
64
|
+
@b2 = Comet::B2VirtualStorageRoleSettings.new
|
65
|
+
@wasabi = Comet::WasabiVirtualStorageRoleSettings.new
|
66
|
+
@storage_limit_bytes = 0
|
51
67
|
@unknown_json_fields = {}
|
52
68
|
end
|
53
69
|
|
54
70
|
# @param [String] json_string The complete object in JSON format
|
55
71
|
def from_json(json_string)
|
56
|
-
raise TypeError 'expected
|
72
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
57
73
|
|
58
74
|
from_hash(JSON.parse(json_string))
|
59
75
|
end
|
60
76
|
|
61
77
|
# @param [Hash] obj The complete object as a Ruby hash
|
62
78
|
def from_hash(obj)
|
63
|
-
raise TypeError 'expected
|
79
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
64
80
|
|
65
81
|
obj.each do |k, v|
|
66
82
|
case k
|
67
83
|
when 'Type'
|
68
|
-
raise TypeError 'expected
|
84
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
69
85
|
|
70
86
|
@type = v
|
71
87
|
when 'Description'
|
72
|
-
raise TypeError 'expected
|
88
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
73
89
|
|
74
90
|
@description = v
|
75
91
|
when 'RemoteAddress'
|
76
|
-
raise TypeError 'expected
|
92
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
77
93
|
|
78
94
|
@remote_address = v
|
79
95
|
when 'Username'
|
80
|
-
raise TypeError 'expected
|
96
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
81
97
|
|
82
98
|
@username = v
|
83
99
|
when 'Password'
|
84
|
-
raise TypeError 'expected
|
100
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
85
101
|
|
86
102
|
@password = v
|
87
103
|
when 'LDAP'
|
@@ -96,7 +112,11 @@ module Comet
|
|
96
112
|
when 'StorageLimitEnabled'
|
97
113
|
@storage_limit_enabled = v
|
98
114
|
when 'StorageLimitBytes'
|
115
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
116
|
+
|
99
117
|
@storage_limit_bytes = v
|
118
|
+
when 'RebrandStorage'
|
119
|
+
@rebrand_storage = v
|
100
120
|
else
|
101
121
|
@unknown_json_fields[k] = v
|
102
122
|
end
|
@@ -128,6 +148,7 @@ module Comet
|
|
128
148
|
end
|
129
149
|
ret['StorageLimitEnabled'] = @storage_limit_enabled
|
130
150
|
ret['StorageLimitBytes'] = @storage_limit_bytes
|
151
|
+
ret['RebrandStorage'] = @rebrand_storage
|
131
152
|
@unknown_json_fields.each do |k, v|
|
132
153
|
ret[k] = v
|
133
154
|
end
|
@@ -54,49 +54,85 @@ module Comet
|
|
54
54
|
attr_accessor :unknown_json_fields
|
55
55
|
|
56
56
|
def initialize
|
57
|
+
clear
|
58
|
+
end
|
59
|
+
|
60
|
+
def clear
|
61
|
+
@description = ''
|
62
|
+
@remote_server_id = ''
|
63
|
+
@display_class = 0
|
64
|
+
@active_workers = 0
|
65
|
+
@total_workers = 0
|
66
|
+
@state = 0
|
67
|
+
@items_queued = 0
|
68
|
+
@bytes_queued = 0
|
69
|
+
@last_worker_submit_time = 0
|
70
|
+
@current_time = 0
|
71
|
+
@items_replicated = 0
|
72
|
+
@bytes_replicated = 0
|
57
73
|
@unknown_json_fields = {}
|
58
74
|
end
|
59
75
|
|
60
76
|
# @param [String] json_string The complete object in JSON format
|
61
77
|
def from_json(json_string)
|
62
|
-
raise TypeError 'expected
|
78
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
63
79
|
|
64
80
|
from_hash(JSON.parse(json_string))
|
65
81
|
end
|
66
82
|
|
67
83
|
# @param [Hash] obj The complete object as a Ruby hash
|
68
84
|
def from_hash(obj)
|
69
|
-
raise TypeError 'expected
|
85
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
70
86
|
|
71
87
|
obj.each do |k, v|
|
72
88
|
case k
|
73
89
|
when 'Description'
|
74
|
-
raise TypeError 'expected
|
90
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
75
91
|
|
76
92
|
@description = v
|
77
93
|
when 'RemoteServerID'
|
78
|
-
raise TypeError 'expected
|
94
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
79
95
|
|
80
96
|
@remote_server_id = v
|
81
97
|
when 'DisplayClass'
|
98
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
99
|
+
|
82
100
|
@display_class = v
|
83
101
|
when 'ActiveWorkers'
|
102
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
103
|
+
|
84
104
|
@active_workers = v
|
85
105
|
when 'TotalWorkers'
|
106
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
107
|
+
|
86
108
|
@total_workers = v
|
87
109
|
when 'State'
|
110
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
111
|
+
|
88
112
|
@state = v
|
89
113
|
when 'ItemsQueued'
|
114
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
115
|
+
|
90
116
|
@items_queued = v
|
91
117
|
when 'BytesQueued'
|
118
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
119
|
+
|
92
120
|
@bytes_queued = v
|
93
121
|
when 'LastWorkerSubmitTime'
|
122
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
123
|
+
|
94
124
|
@last_worker_submit_time = v
|
95
125
|
when 'CurrentTime'
|
126
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
127
|
+
|
96
128
|
@current_time = v
|
97
129
|
when 'ItemsReplicated'
|
130
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
131
|
+
|
98
132
|
@items_replicated = v
|
99
133
|
when 'BytesReplicated'
|
134
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
135
|
+
|
100
136
|
@bytes_replicated = v
|
101
137
|
else
|
102
138
|
@unknown_json_fields[k] = v
|