comet_backup_ruby_sdk 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +25 -0
- data/Gemfile +15 -0
- data/LICENSE +7 -0
- data/README.md +81 -0
- data/Rakefile +22 -0
- data/comet_backup_ruby_sdk.gemspec +35 -0
- data/lib/comet/api_response_error.rb +27 -0
- data/lib/comet/comet_server.rb +2926 -0
- data/lib/comet/definitions.rb +550 -0
- data/lib/comet/models/add_bucket_response_message.rb +92 -0
- data/lib/comet/models/admin_account_properties_response.rb +76 -0
- data/lib/comet/models/admin_resource_response.rb +84 -0
- data/lib/comet/models/admin_security_options.rb +139 -0
- data/lib/comet/models/admin_u2fregistration.rb +84 -0
- data/lib/comet/models/admin_user_permissions.rb +102 -0
- data/lib/comet/models/available_download.rb +84 -0
- data/lib/comet/models/azure_destination_location.rb +102 -0
- data/lib/comet/models/b2destination_location.rb +110 -0
- data/lib/comet/models/b2storage_extra_info.rb +77 -0
- data/lib/comet/models/b2transaction_totals.rb +80 -0
- data/lib/comet/models/backup_job_advanced_options.rb +98 -0
- data/lib/comet/models/backup_job_detail.rb +199 -0
- data/lib/comet/models/backup_job_progress.rb +92 -0
- data/lib/comet/models/backup_rule_config.rb +188 -0
- data/lib/comet/models/backup_rule_event_triggers.rb +78 -0
- data/lib/comet/models/branding_options.rb +283 -0
- data/lib/comet/models/branding_properties.rb +245 -0
- data/lib/comet/models/browse_disk_drives_response.rb +91 -0
- data/lib/comet/models/browse_edbresponse.rb +91 -0
- data/lib/comet/models/browse_hvresponse.rb +91 -0
- data/lib/comet/models/browse_vssresponse.rb +91 -0
- data/lib/comet/models/bucket_properties.rb +89 -0
- data/lib/comet/models/bucket_usage_info.rb +91 -0
- data/lib/comet/models/comet_apiresponse_message.rb +76 -0
- data/lib/comet/models/comet_destination_location.rb +86 -0
- data/lib/comet/models/constellation_check_report.rb +89 -0
- data/lib/comet/models/constellation_stats.rb +86 -0
- data/lib/comet/models/constellation_status_apiresponse.rb +109 -0
- data/lib/comet/models/content_measurement.rb +89 -0
- data/lib/comet/models/content_measurement_component.rb +84 -0
- data/lib/comet/models/create_group_policy_response.rb +84 -0
- data/lib/comet/models/default_email_report_policy.rb +83 -0
- data/lib/comet/models/destination_config.rb +465 -0
- data/lib/comet/models/destination_location.rb +365 -0
- data/lib/comet/models/destination_statistics.rb +102 -0
- data/lib/comet/models/device_config.rb +96 -0
- data/lib/comet/models/disk_drive.rb +153 -0
- data/lib/comet/models/dispatcher_admin_sources_response.rb +92 -0
- data/lib/comet/models/dispatcher_stored_objects_response.rb +91 -0
- data/lib/comet/models/dispatcher_vault_snapshots_response.rb +91 -0
- data/lib/comet/models/edbfile_info.rb +92 -0
- data/lib/comet/models/email_options.rb +140 -0
- data/lib/comet/models/email_report_config.rb +90 -0
- data/lib/comet/models/email_report_generated_preview.rb +100 -0
- data/lib/comet/models/extra_file_exclusion.rb +82 -0
- data/lib/comet/models/ftpdestination_location.rb +124 -0
- data/lib/comet/models/get_group_policy_response.rb +91 -0
- data/lib/comet/models/get_profile_and_hash_response_message.rb +91 -0
- data/lib/comet/models/get_profile_hash_response_message.rb +84 -0
- data/lib/comet/models/group_policy.rb +83 -0
- data/lib/comet/models/hyper_vmachine_info.rb +78 -0
- data/lib/comet/models/live_user_connection.rb +125 -0
- data/lib/comet/models/local_destination_location.rb +92 -0
- data/lib/comet/models/mac_oscode_sign_properties.rb +113 -0
- data/lib/comet/models/mongo_dbconnection.rb +211 -0
- data/lib/comet/models/new_bucket_detail.rb +78 -0
- data/lib/comet/models/news_entry.rb +76 -0
- data/lib/comet/models/osinfo.rb +92 -0
- data/lib/comet/models/partition.rb +148 -0
- data/lib/comet/models/private_branding_properties.rb +185 -0
- data/lib/comet/models/protected_item_engine_type_policy.rb +84 -0
- data/lib/comet/models/public_branding_properties.rb +122 -0
- data/lib/comet/models/remote_server_address.rb +135 -0
- data/lib/comet/models/remote_storage_option.rb +147 -0
- data/lib/comet/models/replicator_state_apiresponse.rb +138 -0
- data/lib/comet/models/request_storage_vault_response_message.rb +84 -0
- data/lib/comet/models/restore_job_advanced_options.rb +104 -0
- data/lib/comet/models/retention_policy.rb +83 -0
- data/lib/comet/models/retention_range.rb +110 -0
- data/lib/comet/models/s3destination_location.rb +114 -0
- data/lib/comet/models/schedule_config.rb +82 -0
- data/lib/comet/models/search_clause.rb +111 -0
- data/lib/comet/models/server_config_options_branding_fragment.rb +69 -0
- data/lib/comet/models/server_config_options_software_build_role_fragment.rb +69 -0
- data/lib/comet/models/server_meta_version_info.rb +208 -0
- data/lib/comet/models/session_key_regenerated_response.rb +92 -0
- data/lib/comet/models/sftpdestination_location.rb +122 -0
- data/lib/comet/models/size_measurement.rb +80 -0
- data/lib/comet/models/software_build_role_options.rb +74 -0
- data/lib/comet/models/software_update_news_response.rb +102 -0
- data/lib/comet/models/source_basic_info.rb +93 -0
- data/lib/comet/models/source_config.rb +172 -0
- data/lib/comet/models/source_statistics.rb +69 -0
- data/lib/comet/models/spanned_destination_location.rb +77 -0
- data/lib/comet/models/spanned_storage_extra_info.rb +77 -0
- data/lib/comet/models/sshconnection.rb +114 -0
- data/lib/comet/models/stat_result.rb +86 -0
- data/lib/comet/models/storage_free_space_info.rb +98 -0
- data/lib/comet/models/storage_vault_provider_policy.rb +82 -0
- data/lib/comet/models/stored_object.rb +130 -0
- data/lib/comet/models/streamable_event.rb +74 -0
- data/lib/comet/models/swift_destination_location.rb +192 -0
- data/lib/comet/models/test_response.rb +82 -0
- data/lib/comet/models/totp_regenerated_response.rb +100 -0
- data/lib/comet/models/u2fregister_request.rb +78 -0
- data/lib/comet/models/u2fregistered_key.rb +86 -0
- data/lib/comet/models/u2fregistration_challenge_response.rb +122 -0
- data/lib/comet/models/u2fsign_request.rb +101 -0
- data/lib/comet/models/u2fsign_response.rb +94 -0
- data/lib/comet/models/uninstall_config.rb +74 -0
- data/lib/comet/models/update_campaign_device_status.rb +68 -0
- data/lib/comet/models/update_campaign_options.rb +86 -0
- data/lib/comet/models/update_campaign_properties.rb +100 -0
- data/lib/comet/models/update_campaign_status.rb +115 -0
- data/lib/comet/models/update_campaign_status_device_entry.rb +84 -0
- data/lib/comet/models/user_custom_email_settings.rb +77 -0
- data/lib/comet/models/user_on_server.rb +76 -0
- data/lib/comet/models/user_policy.rb +304 -0
- data/lib/comet/models/user_profile_config.rb +300 -0
- data/lib/comet/models/user_profile_fragment.rb +70 -0
- data/lib/comet/models/vault_snapshot.rb +84 -0
- data/lib/comet/models/vsscomponent.rb +92 -0
- data/lib/comet/models/vsswriter_info.rb +85 -0
- data/lib/comet/models/web_interface_branding_properties.rb +100 -0
- data/lib/comet/models/webhook_option.rb +84 -0
- data/lib/comet/models/win_smbauth.rb +92 -0
- data/lib/comet/models/windows_code_sign_properties.rb +130 -0
- data/lib/comet_backup_ruby_sdk.rb +130 -0
- metadata +227 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# U2FSignRequest is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class U2FSignRequest
|
16
|
+
|
17
|
+
# @type [String] challenge_id
|
18
|
+
attr_accessor :challenge_id
|
19
|
+
|
20
|
+
# @type [String] challenge_data
|
21
|
+
attr_accessor :challenge_data
|
22
|
+
|
23
|
+
# @type [String] app_id
|
24
|
+
attr_accessor :app_id
|
25
|
+
|
26
|
+
# @type [Array<Comet::U2FRegisteredKey>] registered_keys
|
27
|
+
attr_accessor :registered_keys
|
28
|
+
|
29
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
30
|
+
attr_accessor :unknown_json_fields
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
@registered_keys = []
|
34
|
+
@unknown_json_fields = {}
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param [String] json_string The complete object in JSON format
|
38
|
+
def from_json(json_string)
|
39
|
+
raise TypeError 'expected string' unless json_string.is_a? String
|
40
|
+
|
41
|
+
from_hash(JSON.parse(json_string))
|
42
|
+
end
|
43
|
+
|
44
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
45
|
+
def from_hash(obj)
|
46
|
+
raise TypeError 'expected hash' unless obj.is_a? Hash
|
47
|
+
|
48
|
+
obj.each do |k, v|
|
49
|
+
case k
|
50
|
+
when 'ChallengeID'
|
51
|
+
raise TypeError 'expected string' unless v.is_a? String
|
52
|
+
|
53
|
+
@challenge_id = v
|
54
|
+
when 'ChallengeData'
|
55
|
+
raise TypeError 'expected string' unless v.is_a? String
|
56
|
+
|
57
|
+
@challenge_data = v
|
58
|
+
when 'AppID'
|
59
|
+
raise TypeError 'expected string' unless v.is_a? String
|
60
|
+
|
61
|
+
@app_id = v
|
62
|
+
when 'RegisteredKeys'
|
63
|
+
if v.nil?
|
64
|
+
@registered_keys = []
|
65
|
+
else
|
66
|
+
@registered_keys = Array.new(v.length)
|
67
|
+
v.each_with_index do |v1, i1|
|
68
|
+
@registered_keys[i1] = Comet::U2FRegisteredKey.new
|
69
|
+
@registered_keys[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['ChallengeID'] = @challenge_id
|
82
|
+
ret['ChallengeData'] = @challenge_data
|
83
|
+
ret['AppID'] = @app_id
|
84
|
+
ret['RegisteredKeys'] = @registered_keys
|
85
|
+
@unknown_json_fields.each do |k, v|
|
86
|
+
ret[k] = v
|
87
|
+
end
|
88
|
+
ret
|
89
|
+
end
|
90
|
+
|
91
|
+
# @return [Hash] The complete object as a Ruby hash
|
92
|
+
def to_h
|
93
|
+
to_hash
|
94
|
+
end
|
95
|
+
|
96
|
+
# @return [String] The complete object as a JSON string
|
97
|
+
def to_json(options = {})
|
98
|
+
to_hash.to_json(options)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# U2FSignResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class U2FSignResponse
|
16
|
+
|
17
|
+
# @type [String] challenge_id
|
18
|
+
attr_accessor :challenge_id
|
19
|
+
|
20
|
+
# @type [String] key_handle
|
21
|
+
attr_accessor :key_handle
|
22
|
+
|
23
|
+
# @type [String] signature
|
24
|
+
attr_accessor :signature
|
25
|
+
|
26
|
+
# @type [String] client_data
|
27
|
+
attr_accessor :client_data
|
28
|
+
|
29
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
30
|
+
attr_accessor :unknown_json_fields
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
@unknown_json_fields = {}
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param [String] json_string The complete object in JSON format
|
37
|
+
def from_json(json_string)
|
38
|
+
raise TypeError 'expected string' unless json_string.is_a? String
|
39
|
+
|
40
|
+
from_hash(JSON.parse(json_string))
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
44
|
+
def from_hash(obj)
|
45
|
+
raise TypeError 'expected hash' unless obj.is_a? Hash
|
46
|
+
|
47
|
+
obj.each do |k, v|
|
48
|
+
case k
|
49
|
+
when 'ChallengeID'
|
50
|
+
raise TypeError 'expected string' unless v.is_a? String
|
51
|
+
|
52
|
+
@challenge_id = v
|
53
|
+
when 'KeyHandle'
|
54
|
+
raise TypeError 'expected string' unless v.is_a? String
|
55
|
+
|
56
|
+
@key_handle = v
|
57
|
+
when 'Signature'
|
58
|
+
raise TypeError 'expected string' unless v.is_a? String
|
59
|
+
|
60
|
+
@signature = v
|
61
|
+
when 'ClientData'
|
62
|
+
raise TypeError 'expected string' unless v.is_a? String
|
63
|
+
|
64
|
+
@client_data = v
|
65
|
+
else
|
66
|
+
@unknown_json_fields[k] = v
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# @return [Hash] The complete object as a Ruby hash
|
72
|
+
def to_hash
|
73
|
+
ret = {}
|
74
|
+
ret['ChallengeID'] = @challenge_id
|
75
|
+
ret['KeyHandle'] = @key_handle
|
76
|
+
ret['Signature'] = @signature
|
77
|
+
ret['ClientData'] = @client_data
|
78
|
+
@unknown_json_fields.each do |k, v|
|
79
|
+
ret[k] = v
|
80
|
+
end
|
81
|
+
ret
|
82
|
+
end
|
83
|
+
|
84
|
+
# @return [Hash] The complete object as a Ruby hash
|
85
|
+
def to_h
|
86
|
+
to_hash
|
87
|
+
end
|
88
|
+
|
89
|
+
# @return [String] The complete object as a JSON string
|
90
|
+
def to_json(options = {})
|
91
|
+
to_hash.to_json(options)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# UninstallConfig is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class UninstallConfig
|
16
|
+
|
17
|
+
# @type [Boolean] uninstall_flag
|
18
|
+
attr_accessor :uninstall_flag
|
19
|
+
|
20
|
+
# @type [Boolean] remove_config_file
|
21
|
+
attr_accessor :remove_config_file
|
22
|
+
|
23
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
24
|
+
attr_accessor :unknown_json_fields
|
25
|
+
|
26
|
+
def initialize
|
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 'expected string' 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 'expected hash' unless obj.is_a? Hash
|
40
|
+
|
41
|
+
obj.each do |k, v|
|
42
|
+
case k
|
43
|
+
when 'UninstallFlag'
|
44
|
+
@uninstall_flag = v
|
45
|
+
when 'RemoveConfigFile'
|
46
|
+
@remove_config_file = v
|
47
|
+
else
|
48
|
+
@unknown_json_fields[k] = v
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [Hash] The complete object as a Ruby hash
|
54
|
+
def to_hash
|
55
|
+
ret = {}
|
56
|
+
ret['UninstallFlag'] = @uninstall_flag
|
57
|
+
ret['RemoveConfigFile'] = @remove_config_file
|
58
|
+
@unknown_json_fields.each do |k, v|
|
59
|
+
ret[k] = v
|
60
|
+
end
|
61
|
+
ret
|
62
|
+
end
|
63
|
+
|
64
|
+
# @return [Hash] The complete object as a Ruby hash
|
65
|
+
def to_h
|
66
|
+
to_hash
|
67
|
+
end
|
68
|
+
|
69
|
+
# @return [String] The complete object as a JSON string
|
70
|
+
def to_json(options = {})
|
71
|
+
to_hash.to_json(options)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# UpdateCampaignDeviceStatus is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class UpdateCampaignDeviceStatus
|
16
|
+
|
17
|
+
# @type [Number] status
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
21
|
+
attr_accessor :unknown_json_fields
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
@unknown_json_fields = {}
|
25
|
+
end
|
26
|
+
|
27
|
+
# @param [String] json_string The complete object in JSON format
|
28
|
+
def from_json(json_string)
|
29
|
+
raise TypeError 'expected string' unless json_string.is_a? String
|
30
|
+
|
31
|
+
from_hash(JSON.parse(json_string))
|
32
|
+
end
|
33
|
+
|
34
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
35
|
+
def from_hash(obj)
|
36
|
+
raise TypeError 'expected hash' unless obj.is_a? Hash
|
37
|
+
|
38
|
+
obj.each do |k, v|
|
39
|
+
case k
|
40
|
+
when 'Status'
|
41
|
+
@status = v
|
42
|
+
else
|
43
|
+
@unknown_json_fields[k] = v
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Hash] The complete object as a Ruby hash
|
49
|
+
def to_hash
|
50
|
+
ret = {}
|
51
|
+
ret['Status'] = @status
|
52
|
+
@unknown_json_fields.each do |k, v|
|
53
|
+
ret[k] = v
|
54
|
+
end
|
55
|
+
ret
|
56
|
+
end
|
57
|
+
|
58
|
+
# @return [Hash] The complete object as a Ruby hash
|
59
|
+
def to_h
|
60
|
+
to_hash
|
61
|
+
end
|
62
|
+
|
63
|
+
# @return [String] The complete object as a JSON string
|
64
|
+
def to_json(options = {})
|
65
|
+
to_hash.to_json(options)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# UpdateCampaignOptions is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class UpdateCampaignOptions
|
16
|
+
|
17
|
+
# @type [Boolean] active
|
18
|
+
attr_accessor :active
|
19
|
+
|
20
|
+
# @type [Boolean] upgrade_older
|
21
|
+
attr_accessor :upgrade_older
|
22
|
+
|
23
|
+
# @type [Boolean] reinstall_current_ver
|
24
|
+
attr_accessor :reinstall_current_ver
|
25
|
+
|
26
|
+
# @type [Boolean] downgrade_newer
|
27
|
+
attr_accessor :downgrade_newer
|
28
|
+
|
29
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
30
|
+
attr_accessor :unknown_json_fields
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
@unknown_json_fields = {}
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param [String] json_string The complete object in JSON format
|
37
|
+
def from_json(json_string)
|
38
|
+
raise TypeError 'expected string' unless json_string.is_a? String
|
39
|
+
|
40
|
+
from_hash(JSON.parse(json_string))
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
44
|
+
def from_hash(obj)
|
45
|
+
raise TypeError 'expected hash' unless obj.is_a? Hash
|
46
|
+
|
47
|
+
obj.each do |k, v|
|
48
|
+
case k
|
49
|
+
when 'Active'
|
50
|
+
@active = v
|
51
|
+
when 'UpgradeOlder'
|
52
|
+
@upgrade_older = v
|
53
|
+
when 'ReinstallCurrentVer'
|
54
|
+
@reinstall_current_ver = v
|
55
|
+
when 'DowngradeNewer'
|
56
|
+
@downgrade_newer = v
|
57
|
+
else
|
58
|
+
@unknown_json_fields[k] = v
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# @return [Hash] The complete object as a Ruby hash
|
64
|
+
def to_hash
|
65
|
+
ret = {}
|
66
|
+
ret['Active'] = @active
|
67
|
+
ret['UpgradeOlder'] = @upgrade_older
|
68
|
+
ret['ReinstallCurrentVer'] = @reinstall_current_ver
|
69
|
+
ret['DowngradeNewer'] = @downgrade_newer
|
70
|
+
@unknown_json_fields.each do |k, v|
|
71
|
+
ret[k] = v
|
72
|
+
end
|
73
|
+
ret
|
74
|
+
end
|
75
|
+
|
76
|
+
# @return [Hash] The complete object as a Ruby hash
|
77
|
+
def to_h
|
78
|
+
to_hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# @return [String] The complete object as a JSON string
|
82
|
+
def to_json(options = {})
|
83
|
+
to_hash.to_json(options)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# UpdateCampaignProperties is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class UpdateCampaignProperties
|
16
|
+
|
17
|
+
# @type [Boolean] active
|
18
|
+
attr_accessor :active
|
19
|
+
|
20
|
+
# @type [Boolean] upgrade_older
|
21
|
+
attr_accessor :upgrade_older
|
22
|
+
|
23
|
+
# @type [Boolean] reinstall_current_ver
|
24
|
+
attr_accessor :reinstall_current_ver
|
25
|
+
|
26
|
+
# @type [Boolean] downgrade_newer
|
27
|
+
attr_accessor :downgrade_newer
|
28
|
+
|
29
|
+
# @type [Number] start_time
|
30
|
+
attr_accessor :start_time
|
31
|
+
|
32
|
+
# @type [String] target_version
|
33
|
+
attr_accessor :target_version
|
34
|
+
|
35
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
36
|
+
attr_accessor :unknown_json_fields
|
37
|
+
|
38
|
+
def initialize
|
39
|
+
@unknown_json_fields = {}
|
40
|
+
end
|
41
|
+
|
42
|
+
# @param [String] json_string The complete object in JSON format
|
43
|
+
def from_json(json_string)
|
44
|
+
raise TypeError 'expected string' unless json_string.is_a? String
|
45
|
+
|
46
|
+
from_hash(JSON.parse(json_string))
|
47
|
+
end
|
48
|
+
|
49
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
50
|
+
def from_hash(obj)
|
51
|
+
raise TypeError 'expected hash' unless obj.is_a? Hash
|
52
|
+
|
53
|
+
obj.each do |k, v|
|
54
|
+
case k
|
55
|
+
when 'Active'
|
56
|
+
@active = v
|
57
|
+
when 'UpgradeOlder'
|
58
|
+
@upgrade_older = v
|
59
|
+
when 'ReinstallCurrentVer'
|
60
|
+
@reinstall_current_ver = v
|
61
|
+
when 'DowngradeNewer'
|
62
|
+
@downgrade_newer = v
|
63
|
+
when 'StartTime'
|
64
|
+
@start_time = v
|
65
|
+
when 'TargetVersion'
|
66
|
+
raise TypeError 'expected string' unless v.is_a? String
|
67
|
+
|
68
|
+
@target_version = v
|
69
|
+
else
|
70
|
+
@unknown_json_fields[k] = v
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# @return [Hash] The complete object as a Ruby hash
|
76
|
+
def to_hash
|
77
|
+
ret = {}
|
78
|
+
ret['Active'] = @active
|
79
|
+
ret['UpgradeOlder'] = @upgrade_older
|
80
|
+
ret['ReinstallCurrentVer'] = @reinstall_current_ver
|
81
|
+
ret['DowngradeNewer'] = @downgrade_newer
|
82
|
+
ret['StartTime'] = @start_time
|
83
|
+
ret['TargetVersion'] = @target_version
|
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
|