comet_backup_ruby_sdk 1.3.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/CHANGELOG.md +42 -0
  4. data/Gemfile +0 -0
  5. data/Gemfile.lock +2 -2
  6. data/LICENSE +1 -1
  7. data/README.md +0 -0
  8. data/RELEASING.md +6 -4
  9. data/Rakefile +0 -0
  10. data/comet_backup_ruby_sdk.gemspec +1 -1
  11. data/lib/comet/api_response_error.rb +1 -1
  12. data/lib/comet/comet_server.rb +231 -13
  13. data/lib/comet/definitions.rb +67 -7
  14. data/lib/comet/models/add_bucket_response_message.rb +1 -1
  15. data/lib/comet/models/admin_account_properties_response.rb +1 -1
  16. data/lib/comet/models/admin_email_options.rb +1 -1
  17. data/lib/comet/models/admin_resource_response.rb +1 -1
  18. data/lib/comet/models/admin_security_options.rb +1 -1
  19. data/lib/comet/models/admin_u2fregistration.rb +1 -1
  20. data/lib/comet/models/admin_user_permissions.rb +1 -1
  21. data/lib/comet/models/available_download.rb +1 -1
  22. data/lib/comet/models/azure_destination_location.rb +1 -1
  23. data/lib/comet/models/b2destination_location.rb +1 -1
  24. data/lib/comet/models/b2storage_extra_info.rb +1 -1
  25. data/lib/comet/models/b2transaction_totals.rb +1 -1
  26. data/lib/comet/models/b2virtual_storage_role_settings.rb +1 -1
  27. data/lib/comet/models/backup_job_advanced_options.rb +1 -1
  28. data/lib/comet/models/backup_job_detail.rb +34 -1
  29. data/lib/comet/models/backup_job_progress.rb +1 -1
  30. data/lib/comet/models/backup_rule_config.rb +1 -1
  31. data/lib/comet/models/backup_rule_event_triggers.rb +1 -1
  32. data/lib/comet/models/branding_options.rb +10 -1
  33. data/lib/comet/models/branding_properties.rb +10 -1
  34. data/lib/comet/models/browse_disk_drives_response.rb +1 -1
  35. data/lib/comet/models/browse_edbresponse.rb +1 -1
  36. data/lib/comet/models/browse_hvresponse.rb +1 -1
  37. data/lib/comet/models/browse_office_365objects_response.rb +99 -0
  38. data/lib/comet/models/browse_sqlserver_response.rb +100 -0
  39. data/lib/comet/models/browse_vssresponse.rb +1 -1
  40. data/lib/comet/models/bucket_properties.rb +1 -1
  41. data/lib/comet/models/bucket_usage_info.rb +1 -1
  42. data/lib/comet/models/comet_apiresponse_message.rb +1 -1
  43. data/lib/comet/models/comet_destination_location.rb +1 -1
  44. data/lib/comet/models/constellation_check_report.rb +1 -1
  45. data/lib/comet/models/constellation_stats.rb +1 -1
  46. data/lib/comet/models/constellation_status_apiresponse.rb +1 -1
  47. data/lib/comet/models/content_measurement.rb +1 -1
  48. data/lib/comet/models/content_measurement_component.rb +1 -1
  49. data/lib/comet/models/create_group_policy_response.rb +1 -1
  50. data/lib/comet/models/custom_remote_bucket_settings.rb +75 -0
  51. data/lib/comet/models/default_email_report_policy.rb +1 -1
  52. data/lib/comet/models/default_source_with_osrestriction.rb +83 -0
  53. data/lib/comet/models/destination_config.rb +7 -1
  54. data/lib/comet/models/destination_location.rb +7 -1
  55. data/lib/comet/models/destination_statistics.rb +1 -1
  56. data/lib/comet/models/device_config.rb +12 -1
  57. data/lib/comet/models/disk_drive.rb +1 -1
  58. data/lib/comet/models/dispatcher_admin_sources_response.rb +1 -1
  59. data/lib/comet/models/dispatcher_stored_objects_response.rb +1 -1
  60. data/lib/comet/models/dispatcher_vault_snapshots_response.rb +1 -1
  61. data/lib/comet/models/edbfile_info.rb +1 -1
  62. data/lib/comet/models/email_options.rb +1 -1
  63. data/lib/comet/models/email_report_config.rb +1 -1
  64. data/lib/comet/models/email_report_generated_preview.rb +1 -1
  65. data/lib/comet/models/external_ldapauthentication_source_settings.rb +34 -1
  66. data/lib/comet/models/extra_file_exclusion.rb +1 -1
  67. data/lib/comet/models/ftpdestination_location.rb +1 -1
  68. data/lib/comet/models/get_group_policy_response.rb +1 -1
  69. data/lib/comet/models/get_profile_and_hash_response_message.rb +1 -1
  70. data/lib/comet/models/get_profile_hash_response_message.rb +1 -1
  71. data/lib/comet/models/group_policy.rb +1 -1
  72. data/lib/comet/models/hyper_vmachine_info.rb +1 -1
  73. data/lib/comet/models/install_creds.rb +1 -1
  74. data/lib/comet/models/install_token.rb +1 -1
  75. data/lib/comet/models/install_token_response.rb +1 -1
  76. data/lib/comet/models/job_entry.rb +1 -1
  77. data/lib/comet/models/live_user_connection.rb +12 -1
  78. data/lib/comet/models/local_destination_location.rb +1 -1
  79. data/lib/comet/models/mac_oscode_sign_properties.rb +1 -1
  80. data/lib/comet/models/mongo_dbconnection.rb +1 -1
  81. data/lib/comet/models/mssqlconnection.rb +120 -0
  82. data/lib/comet/models/my_sqlconnection.rb +102 -0
  83. data/lib/comet/models/new_bucket_detail.rb +1 -1
  84. data/lib/comet/models/news_entry.rb +1 -1
  85. data/lib/comet/models/office_365connection.rb +123 -0
  86. data/lib/comet/models/office_365credential.rb +111 -0
  87. data/lib/comet/models/office_365custom_setting.rb +132 -0
  88. data/lib/comet/models/office_365object_info.rb +118 -0
  89. data/lib/comet/models/organization.rb +7 -1
  90. data/lib/comet/models/organization_response.rb +1 -1
  91. data/lib/comet/models/osinfo.rb +1 -1
  92. data/lib/comet/models/partition.rb +1 -1
  93. data/lib/comet/models/private_branding_properties.rb +10 -1
  94. data/lib/comet/models/protected_item_engine_type_policy.rb +1 -1
  95. data/lib/comet/models/public_branding_properties.rb +1 -1
  96. data/lib/comet/models/register_office_application_begin_response.rb +93 -0
  97. data/lib/comet/models/register_office_application_check_response.rb +100 -0
  98. data/lib/comet/models/remote_server_address.rb +11 -1
  99. data/lib/comet/models/remote_storage_option.rb +11 -1
  100. data/lib/comet/models/replicator_state_apiresponse.rb +1 -1
  101. data/lib/comet/models/request_storage_vault_response_message.rb +1 -1
  102. data/lib/comet/models/restore_job_advanced_options.rb +17 -1
  103. data/lib/comet/models/retention_policy.rb +1 -1
  104. data/lib/comet/models/retention_range.rb +1 -1
  105. data/lib/comet/models/s3destination_location.rb +1 -1
  106. data/lib/comet/models/schedule_config.rb +1 -1
  107. data/lib/comet/models/search_clause.rb +1 -1
  108. data/lib/comet/models/self_backup_statistics.rb +108 -0
  109. data/lib/comet/models/server_config_options_branding_fragment.rb +1 -1
  110. data/lib/comet/models/server_config_options_software_build_role_fragment.rb +1 -1
  111. data/lib/comet/models/server_meta_branding_properties.rb +135 -0
  112. data/lib/comet/models/server_meta_version_info.rb +16 -1
  113. data/lib/comet/models/session_key_regenerated_response.rb +1 -1
  114. data/lib/comet/models/sftpdestination_location.rb +1 -1
  115. data/lib/comet/models/size_measurement.rb +1 -1
  116. data/lib/comet/models/software_build_role_options.rb +1 -1
  117. data/lib/comet/models/software_update_news_response.rb +1 -1
  118. data/lib/comet/models/source_basic_info.rb +1 -1
  119. data/lib/comet/models/source_config.rb +1 -1
  120. data/lib/comet/models/source_include_pattern.rb +84 -0
  121. data/lib/comet/models/source_statistics.rb +9 -1
  122. data/lib/comet/models/spanned_destination_location.rb +7 -1
  123. data/lib/comet/models/spanned_storage_extra_info.rb +1 -1
  124. data/lib/comet/models/sshconnection.rb +1 -1
  125. data/lib/comet/models/stat_result.rb +1 -1
  126. data/lib/comet/models/storage_free_space_info.rb +1 -1
  127. data/lib/comet/models/storage_vault_provider_policy.rb +1 -1
  128. data/lib/comet/models/stored_object.rb +86 -1
  129. data/lib/comet/models/streamable_event.rb +4 -2
  130. data/lib/comet/models/swift_destination_location.rb +1 -1
  131. data/lib/comet/models/test_response.rb +1 -1
  132. data/lib/comet/models/totp_regenerated_response.rb +1 -1
  133. data/lib/comet/models/u2fregister_request.rb +1 -1
  134. data/lib/comet/models/u2fregistered_key.rb +1 -1
  135. data/lib/comet/models/u2fregistration_challenge_response.rb +1 -1
  136. data/lib/comet/models/u2fsign_request.rb +1 -1
  137. data/lib/comet/models/u2fsign_response.rb +1 -1
  138. data/lib/comet/models/uninstall_config.rb +1 -1
  139. data/lib/comet/models/update_campaign_device_status.rb +1 -1
  140. data/lib/comet/models/update_campaign_options.rb +1 -1
  141. data/lib/comet/models/update_campaign_properties.rb +1 -1
  142. data/lib/comet/models/update_campaign_status.rb +1 -1
  143. data/lib/comet/models/update_campaign_status_device_entry.rb +1 -1
  144. data/lib/comet/models/user_custom_email_settings.rb +1 -1
  145. data/lib/comet/models/user_on_server.rb +1 -1
  146. data/lib/comet/models/user_policy.rb +16 -1
  147. data/lib/comet/models/user_profile_config.rb +1 -1
  148. data/lib/comet/models/user_profile_fragment.rb +1 -1
  149. data/lib/comet/models/vault_snapshot.rb +7 -1
  150. data/lib/comet/models/vsscomponent.rb +1 -1
  151. data/lib/comet/models/vsswriter_info.rb +1 -1
  152. data/lib/comet/models/wasabi_virtual_storage_role_settings.rb +1 -1
  153. data/lib/comet/models/web_interface_branding_properties.rb +1 -1
  154. data/lib/comet/models/webhook_option.rb +1 -1
  155. data/lib/comet/models/win_smbauth.rb +1 -1
  156. data/lib/comet/models/windows_code_sign_properties.rb +1 -1
  157. data/lib/comet_backup_ruby_sdk.rb +16 -1
  158. metadata +18 -3
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -38,6 +38,9 @@ module Comet
38
38
  # @type [Comet::WasabiVirtualStorageRoleSettings] wasabi
39
39
  attr_accessor :wasabi
40
40
 
41
+ # @type [Comet::CustomRemoteBucketSettings] custom
42
+ attr_accessor :custom
43
+
41
44
  # @type [Boolean] storage_limit_enabled
42
45
  attr_accessor :storage_limit_enabled
43
46
 
@@ -63,6 +66,7 @@ module Comet
63
66
  @ldap = Comet::ExternalLDAPAuthenticationSourceSettings.new
64
67
  @b2 = Comet::B2VirtualStorageRoleSettings.new
65
68
  @wasabi = Comet::WasabiVirtualStorageRoleSettings.new
69
+ @custom = Comet::CustomRemoteBucketSettings.new
66
70
  @storage_limit_bytes = 0
67
71
  @unknown_json_fields = {}
68
72
  end
@@ -109,6 +113,9 @@ module Comet
109
113
  when 'Wasabi'
110
114
  @wasabi = Comet::WasabiVirtualStorageRoleSettings.new
111
115
  @wasabi.from_hash(v)
116
+ when 'Custom'
117
+ @custom = Comet::CustomRemoteBucketSettings.new
118
+ @custom.from_hash(v)
112
119
  when 'StorageLimitEnabled'
113
120
  @storage_limit_enabled = v
114
121
  when 'StorageLimitBytes'
@@ -146,6 +153,9 @@ module Comet
146
153
  unless @wasabi.nil?
147
154
  ret['Wasabi'] = @wasabi
148
155
  end
156
+ unless @custom.nil?
157
+ ret['Custom'] = @custom
158
+ end
149
159
  ret['StorageLimitEnabled'] = @storage_limit_enabled
150
160
  ret['StorageLimitBytes'] = @storage_limit_bytes
151
161
  ret['RebrandStorage'] = @rebrand_storage
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -20,6 +20,9 @@ module Comet
20
20
  # @type [Boolean] overwrite_existing_files
21
21
  attr_accessor :overwrite_existing_files
22
22
 
23
+ # @type [Boolean] dest_is_original_location
24
+ attr_accessor :dest_is_original_location
25
+
23
26
  # @type [String] dest_path
24
27
  attr_accessor :dest_path
25
28
 
@@ -29,6 +32,9 @@ module Comet
29
32
  # @type [Number] archive_format
30
33
  attr_accessor :archive_format
31
34
 
35
+ # @type [Comet::Office365Credential] office_365credential
36
+ attr_accessor :office_365credential
37
+
32
38
  # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
33
39
  attr_accessor :unknown_json_fields
34
40
 
@@ -41,6 +47,7 @@ module Comet
41
47
  @dest_path = ''
42
48
  @exact_dest_paths = []
43
49
  @archive_format = 0
50
+ @office_365credential = Comet::Office365Credential.new
44
51
  @unknown_json_fields = {}
45
52
  end
46
53
 
@@ -63,6 +70,8 @@ module Comet
63
70
  @type = v
64
71
  when 'OverwriteExistingFiles'
65
72
  @overwrite_existing_files = v
73
+ when 'DestIsOriginalLocation'
74
+ @dest_is_original_location = v
66
75
  when 'DestPath'
67
76
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
68
77
 
@@ -82,6 +91,9 @@ module Comet
82
91
  raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
83
92
 
84
93
  @archive_format = v
94
+ when 'Office365Credential'
95
+ @office_365credential = Comet::Office365Credential.new
96
+ @office_365credential.from_hash(v)
85
97
  else
86
98
  @unknown_json_fields[k] = v
87
99
  end
@@ -93,9 +105,13 @@ module Comet
93
105
  ret = {}
94
106
  ret['Type'] = @type
95
107
  ret['OverwriteExistingFiles'] = @overwrite_existing_files
108
+ ret['DestIsOriginalLocation'] = @dest_is_original_location
96
109
  ret['DestPath'] = @dest_path
97
110
  ret['ExactDestPaths'] = @exact_dest_paths
98
111
  ret['ArchiveFormat'] = @archive_format
112
+ unless @office_365credential.nil?
113
+ ret['Office365Credential'] = @office_365credential
114
+ end
99
115
  @unknown_json_fields.each do |k, v|
100
116
  ret[k] = v
101
117
  end
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env ruby --enable-frozen-string-literal
2
+ #
3
+ # Copyright (c) 2020-2021 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
+ # SelfBackupStatistics is a typed class wrapper around the underlying Comet Server API data structure.
15
+ class SelfBackupStatistics
16
+
17
+ # @type [Number] current_run_start
18
+ attr_accessor :current_run_start
19
+
20
+ # @type [Number] last_run_start
21
+ attr_accessor :last_run_start
22
+
23
+ # @type [Number] last_run_end
24
+ attr_accessor :last_run_end
25
+
26
+ # @type [Boolean] last_run_success
27
+ attr_accessor :last_run_success
28
+
29
+ # @type [Number] last_run_size
30
+ attr_accessor :last_run_size
31
+
32
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
33
+ attr_accessor :unknown_json_fields
34
+
35
+ def initialize
36
+ clear
37
+ end
38
+
39
+ def clear
40
+ @current_run_start = 0
41
+ @last_run_start = 0
42
+ @last_run_end = 0
43
+ @last_run_size = 0
44
+ @unknown_json_fields = {}
45
+ end
46
+
47
+ # @param [String] json_string The complete object in JSON format
48
+ def from_json(json_string)
49
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
50
+
51
+ from_hash(JSON.parse(json_string))
52
+ end
53
+
54
+ # @param [Hash] obj The complete object as a Ruby hash
55
+ def from_hash(obj)
56
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
57
+
58
+ obj.each do |k, v|
59
+ case k
60
+ when 'CurrentRunStart'
61
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
62
+
63
+ @current_run_start = v
64
+ when 'LastRunStart'
65
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
66
+
67
+ @last_run_start = v
68
+ when 'LastRunEnd'
69
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
70
+
71
+ @last_run_end = v
72
+ when 'LastRunSuccess'
73
+ @last_run_success = v
74
+ when 'LastRunSize'
75
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
76
+
77
+ @last_run_size = v
78
+ else
79
+ @unknown_json_fields[k] = v
80
+ end
81
+ end
82
+ end
83
+
84
+ # @return [Hash] The complete object as a Ruby hash
85
+ def to_hash
86
+ ret = {}
87
+ ret['CurrentRunStart'] = @current_run_start
88
+ ret['LastRunStart'] = @last_run_start
89
+ ret['LastRunEnd'] = @last_run_end
90
+ ret['LastRunSuccess'] = @last_run_success
91
+ ret['LastRunSize'] = @last_run_size
92
+ @unknown_json_fields.each do |k, v|
93
+ ret[k] = v
94
+ end
95
+ ret
96
+ end
97
+
98
+ # @return [Hash] The complete object as a Ruby hash
99
+ def to_h
100
+ to_hash
101
+ end
102
+
103
+ # @return [String] The complete object as a JSON string
104
+ def to_json(options = {})
105
+ to_hash.to_json(options)
106
+ end
107
+ end
108
+ end
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env ruby --enable-frozen-string-literal
2
+ #
3
+ # Copyright (c) 2020-2021 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
+ # ServerMetaBrandingProperties is a typed class wrapper around the underlying Comet Server API data structure.
15
+ class ServerMetaBrandingProperties
16
+
17
+ # @type [String] brand_name
18
+ attr_accessor :brand_name
19
+
20
+ # @type [String] product_name
21
+ attr_accessor :product_name
22
+
23
+ # @type [Boolean] has_image
24
+ attr_accessor :has_image
25
+
26
+ # @type [String] top_color
27
+ attr_accessor :top_color
28
+
29
+ # @type [Boolean] hide_news_area
30
+ attr_accessor :hide_news_area
31
+
32
+ # @type [Boolean] allow_unauthenticated_downloads
33
+ attr_accessor :allow_unauthenticated_downloads
34
+
35
+ # @type [Boolean] allow_authenticated_downloads
36
+ attr_accessor :allow_authenticated_downloads
37
+
38
+ # @type [Number] prune_logs_after_days
39
+ attr_accessor :prune_logs_after_days
40
+
41
+ # @type [Number] expired_in_seconds
42
+ attr_accessor :expired_in_seconds
43
+
44
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
45
+ attr_accessor :unknown_json_fields
46
+
47
+ def initialize
48
+ clear
49
+ end
50
+
51
+ def clear
52
+ @brand_name = ''
53
+ @product_name = ''
54
+ @top_color = ''
55
+ @prune_logs_after_days = 0
56
+ @expired_in_seconds = 0
57
+ @unknown_json_fields = {}
58
+ end
59
+
60
+ # @param [String] json_string The complete object in JSON format
61
+ def from_json(json_string)
62
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
63
+
64
+ from_hash(JSON.parse(json_string))
65
+ end
66
+
67
+ # @param [Hash] obj The complete object as a Ruby hash
68
+ def from_hash(obj)
69
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
70
+
71
+ obj.each do |k, v|
72
+ case k
73
+ when 'BrandName'
74
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
75
+
76
+ @brand_name = v
77
+ when 'ProductName'
78
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
79
+
80
+ @product_name = v
81
+ when 'HasImage'
82
+ @has_image = v
83
+ when 'TopColor'
84
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
85
+
86
+ @top_color = v
87
+ when 'HideNewsArea'
88
+ @hide_news_area = v
89
+ when 'AllowUnauthenticatedDownloads'
90
+ @allow_unauthenticated_downloads = v
91
+ when 'AllowAuthenticatedDownloads'
92
+ @allow_authenticated_downloads = v
93
+ when 'PruneLogsAfterDays'
94
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
95
+
96
+ @prune_logs_after_days = v
97
+ when 'ExpiredInSeconds'
98
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
99
+
100
+ @expired_in_seconds = v
101
+ else
102
+ @unknown_json_fields[k] = v
103
+ end
104
+ end
105
+ end
106
+
107
+ # @return [Hash] The complete object as a Ruby hash
108
+ def to_hash
109
+ ret = {}
110
+ ret['BrandName'] = @brand_name
111
+ ret['ProductName'] = @product_name
112
+ ret['HasImage'] = @has_image
113
+ ret['TopColor'] = @top_color
114
+ ret['HideNewsArea'] = @hide_news_area
115
+ ret['AllowUnauthenticatedDownloads'] = @allow_unauthenticated_downloads
116
+ ret['AllowAuthenticatedDownloads'] = @allow_authenticated_downloads
117
+ ret['PruneLogsAfterDays'] = @prune_logs_after_days
118
+ ret['ExpiredInSeconds'] = @expired_in_seconds
119
+ @unknown_json_fields.each do |k, v|
120
+ ret[k] = v
121
+ end
122
+ ret
123
+ end
124
+
125
+ # @return [Hash] The complete object as a Ruby hash
126
+ def to_h
127
+ to_hash
128
+ end
129
+
130
+ # @return [String] The complete object as a JSON string
131
+ def to_json(options = {})
132
+ to_hash.to_json(options)
133
+ end
134
+ end
135
+ end
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby --enable-frozen-string-literal
2
2
  #
3
- # Copyright (c) 2020-2020 Comet Licensing Ltd.
3
+ # Copyright (c) 2020-2021 Comet Licensing Ltd.
4
4
  # Please see the LICENSE file for usage information.
5
5
  #
6
6
  # SPDX-License-Identifier: MIT
@@ -77,6 +77,9 @@ module Comet
77
77
  # @type [Boolean] scheduled_email_thread_last_wake_sent_emails
78
78
  attr_accessor :scheduled_email_thread_last_wake_sent_emails
79
79
 
80
+ # @type [Array<Comet::SelfBackupStatistics>] self_backup
81
+ attr_accessor :self_backup
82
+
80
83
  # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
81
84
  attr_accessor :unknown_json_fields
82
85
 
@@ -100,6 +103,7 @@ module Comet
100
103
  @scheduled_email_thread_last_calculate_duration_nanos = 0
101
104
  @scheduled_email_thread_waiting_until = 0
102
105
  @scheduled_email_thread_last_wake_time = 0
106
+ @self_backup = []
103
107
  @unknown_json_fields = {}
104
108
  end
105
109
 
@@ -195,6 +199,16 @@ module Comet
195
199
  @scheduled_email_thread_last_wake_time = v
196
200
  when 'ScheduledEmailThreadLastWakeSentEmails'
197
201
  @scheduled_email_thread_last_wake_sent_emails = v
202
+ when 'SelfBackup'
203
+ if v.nil?
204
+ @self_backup = []
205
+ else
206
+ @self_backup = Array.new(v.length)
207
+ v.each_with_index do |v1, i1|
208
+ @self_backup[i1] = Comet::SelfBackupStatistics.new
209
+ @self_backup[i1].from_hash(v1)
210
+ end
211
+ end
198
212
  else
199
213
  @unknown_json_fields[k] = v
200
214
  end
@@ -227,6 +241,7 @@ module Comet
227
241
  ret['ScheduledEmailThreadWaitingUntil'] = @scheduled_email_thread_waiting_until
228
242
  ret['ScheduledEmailThreadLastWakeTime'] = @scheduled_email_thread_last_wake_time
229
243
  ret['ScheduledEmailThreadLastWakeSentEmails'] = @scheduled_email_thread_last_wake_sent_emails
244
+ ret['SelfBackup'] = @self_backup
230
245
  @unknown_json_fields.each do |k, v|
231
246
  ret[k] = v
232
247
  end