Class: Comet::ServerMetaVersionInfo
- Inherits:
-
Object
- Object
- Comet::ServerMetaVersionInfo
- Defined in:
- lib/comet/models/server_meta_version_info.rb
Overview
ServerMetaVersionInfo is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#authentication_role ⇒ Object
Returns the value of attribute authentication_role.
-
#booster_limit ⇒ Object
The current number of Protected Item types configured on the server.
-
#configured_devices ⇒ Object
A count of the devices registered on the server that have a configured Protected Item.
-
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
-
#constellation_role__legacy ⇒ Object
deprecated
Deprecated.
This member has been deprecated since Comet version 18.2.0 “Overseer Role” was the old name for the Constellation Role. This field is a duplicate of ConstellationRole for backward compatibility with earlier API consumers.
-
#current_time ⇒ Object
The current time on the Comet Server host machine.
-
#emails_sent_errors ⇒ Object
Returns the value of attribute emails_sent_errors.
-
#emails_sent_successfully ⇒ Object
Returns the value of attribute emails_sent_successfully.
-
#emails_waiting_in_queue ⇒ Object
Returns the value of attribute emails_waiting_in_queue.
-
#experimental_options ⇒ Object
Returns the value of attribute experimental_options.
-
#license_valid_until ⇒ Object
Unix timestamp, in seconds.
-
#scheduled_email_thread_current_state ⇒ Object
Returns the value of attribute scheduled_email_thread_current_state.
-
#scheduled_email_thread_last_calculate_duration_nanos ⇒ Object
Returns the value of attribute scheduled_email_thread_last_calculate_duration_nanos.
-
#scheduled_email_thread_last_wake_sent_emails ⇒ Object
Returns the value of attribute scheduled_email_thread_last_wake_sent_emails.
-
#scheduled_email_thread_last_wake_time ⇒ Object
Returns the value of attribute scheduled_email_thread_last_wake_time.
-
#scheduled_email_thread_waiting_until ⇒ Object
Returns the value of attribute scheduled_email_thread_waiting_until.
-
#self_backup ⇒ Object
This field is available in Comet 21.3.2 and later.
-
#server_license_feature_set ⇒ Object
Returns the value of attribute server_license_feature_set.
-
#server_license_features_all ⇒ Object
Returns the value of attribute server_license_features_all.
-
#server_license_hash ⇒ Object
A hash derived from the Comet Server’s serial number.
-
#server_license_limit ⇒ Object
If non-zero, the maximum numbers of devices and Protected Item types that this server is allowed.
-
#server_start_hash ⇒ Object
A GUID that was randomly generated when this Comet Server started up.
-
#server_start_time ⇒ Object
Unix timestamp, in seconds.
-
#software_build_role ⇒ Object
Returns the value of attribute software_build_role.
-
#storage_role ⇒ Object
Returns the value of attribute storage_role.
-
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
-
#version ⇒ Object
Returns the value of attribute version.
-
#version_codename ⇒ Object
Returns the value of attribute version_codename.
Instance Method Summary collapse
- #clear ⇒ Object
- #from_hash(obj) ⇒ Object
- #from_json(json_string) ⇒ Object
-
#initialize ⇒ ServerMetaVersionInfo
constructor
A new instance of ServerMetaVersionInfo.
-
#to_h ⇒ Hash
The complete object as a Ruby hash.
-
#to_hash ⇒ Hash
The complete object as a Ruby hash.
-
#to_json(options = {}) ⇒ String
The complete object as a JSON string.
Constructor Details
#initialize ⇒ ServerMetaVersionInfo
Returns a new instance of ServerMetaVersionInfo.
115 116 117 |
# File 'lib/comet/models/server_meta_version_info.rb', line 115 def initialize clear end |
Instance Attribute Details
#authentication_role ⇒ Object
Returns the value of attribute authentication_role.
25 26 27 |
# File 'lib/comet/models/server_meta_version_info.rb', line 25 def authentication_role @authentication_role end |
#booster_limit ⇒ Object
The current number of Protected Item types configured on the server. This field is available in Comet 24.6.3 and later.
78 79 80 |
# File 'lib/comet/models/server_meta_version_info.rb', line 78 def booster_limit @booster_limit end |
#configured_devices ⇒ Object
A count of the devices registered on the server that have a configured Protected Item. This field is available in Comet 24.6.3 and later.
73 74 75 |
# File 'lib/comet/models/server_meta_version_info.rb', line 73 def configured_devices @configured_devices end |
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
35 36 37 |
# File 'lib/comet/models/server_meta_version_info.rb', line 35 def constellation_role @constellation_role end |
#constellation_role__legacy ⇒ Object
This member has been deprecated since Comet version 18.2.0 “Overseer Role” was the old name for the Constellation Role. This field is a duplicate of ConstellationRole for backward compatibility with earlier API consumers.
32 33 34 |
# File 'lib/comet/models/server_meta_version_info.rb', line 32 def constellation_role__legacy @constellation_role__legacy end |
#current_time ⇒ Object
The current time on the Comet Server host machine. Unix timestamp, in seconds. You can check this value to see if clock drift is occuring.
52 53 54 |
# File 'lib/comet/models/server_meta_version_info.rb', line 52 def current_time @current_time end |
#emails_sent_errors ⇒ Object
Returns the value of attribute emails_sent_errors.
88 89 90 |
# File 'lib/comet/models/server_meta_version_info.rb', line 88 def emails_sent_errors @emails_sent_errors end |
#emails_sent_successfully ⇒ Object
Returns the value of attribute emails_sent_successfully.
85 86 87 |
# File 'lib/comet/models/server_meta_version_info.rb', line 85 def emails_sent_successfully @emails_sent_successfully end |
#emails_waiting_in_queue ⇒ Object
Returns the value of attribute emails_waiting_in_queue.
91 92 93 |
# File 'lib/comet/models/server_meta_version_info.rb', line 91 def emails_waiting_in_queue @emails_waiting_in_queue end |
#experimental_options ⇒ Object
Returns the value of attribute experimental_options.
38 39 40 |
# File 'lib/comet/models/server_meta_version_info.rb', line 38 def @experimental_options end |
#license_valid_until ⇒ Object
Unix timestamp, in seconds.
82 83 84 |
# File 'lib/comet/models/server_meta_version_info.rb', line 82 def license_valid_until @license_valid_until end |
#scheduled_email_thread_current_state ⇒ Object
Returns the value of attribute scheduled_email_thread_current_state.
94 95 96 |
# File 'lib/comet/models/server_meta_version_info.rb', line 94 def scheduled_email_thread_current_state @scheduled_email_thread_current_state end |
#scheduled_email_thread_last_calculate_duration_nanos ⇒ Object
Returns the value of attribute scheduled_email_thread_last_calculate_duration_nanos.
97 98 99 |
# File 'lib/comet/models/server_meta_version_info.rb', line 97 def scheduled_email_thread_last_calculate_duration_nanos @scheduled_email_thread_last_calculate_duration_nanos end |
#scheduled_email_thread_last_wake_sent_emails ⇒ Object
Returns the value of attribute scheduled_email_thread_last_wake_sent_emails.
106 107 108 |
# File 'lib/comet/models/server_meta_version_info.rb', line 106 def scheduled_email_thread_last_wake_sent_emails @scheduled_email_thread_last_wake_sent_emails end |
#scheduled_email_thread_last_wake_time ⇒ Object
Returns the value of attribute scheduled_email_thread_last_wake_time.
103 104 105 |
# File 'lib/comet/models/server_meta_version_info.rb', line 103 def scheduled_email_thread_last_wake_time @scheduled_email_thread_last_wake_time end |
#scheduled_email_thread_waiting_until ⇒ Object
Returns the value of attribute scheduled_email_thread_waiting_until.
100 101 102 |
# File 'lib/comet/models/server_meta_version_info.rb', line 100 def scheduled_email_thread_waiting_until @scheduled_email_thread_waiting_until end |
#self_backup ⇒ Object
This field is available in Comet 21.3.2 and later.
110 111 112 |
# File 'lib/comet/models/server_meta_version_info.rb', line 110 def self_backup @self_backup end |
#server_license_feature_set ⇒ Object
Returns the value of attribute server_license_feature_set.
63 64 65 |
# File 'lib/comet/models/server_meta_version_info.rb', line 63 def server_license_feature_set @server_license_feature_set end |
#server_license_features_all ⇒ Object
Returns the value of attribute server_license_features_all.
60 61 62 |
# File 'lib/comet/models/server_meta_version_info.rb', line 60 def server_license_features_all @server_license_features_all end |
#server_license_hash ⇒ Object
A hash derived from the Comet Server’s serial number. You can check this value to see if two Comet Server endpoints point to an identical server.
57 58 59 |
# File 'lib/comet/models/server_meta_version_info.rb', line 57 def server_license_hash @server_license_hash end |
#server_license_limit ⇒ Object
If non-zero, the maximum numbers of devices and Protected Item types that this server is allowed. This field is available in Comet 24.6.3 and later.
68 69 70 |
# File 'lib/comet/models/server_meta_version_info.rb', line 68 def server_license_limit @server_license_limit end |
#server_start_hash ⇒ Object
A GUID that was randomly generated when this Comet Server started up. You can check this value to see if the Comet Server has restarted.
47 48 49 |
# File 'lib/comet/models/server_meta_version_info.rb', line 47 def server_start_hash @server_start_hash end |
#server_start_time ⇒ Object
Unix timestamp, in seconds.
42 43 44 |
# File 'lib/comet/models/server_meta_version_info.rb', line 42 def server_start_time @server_start_time end |
#software_build_role ⇒ Object
Returns the value of attribute software_build_role.
28 29 30 |
# File 'lib/comet/models/server_meta_version_info.rb', line 28 def software_build_role @software_build_role end |
#storage_role ⇒ Object
Returns the value of attribute storage_role.
22 23 24 |
# File 'lib/comet/models/server_meta_version_info.rb', line 22 def storage_role @storage_role end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
113 114 115 |
# File 'lib/comet/models/server_meta_version_info.rb', line 113 def unknown_json_fields @unknown_json_fields end |
#version ⇒ Object
Returns the value of attribute version.
16 17 18 |
# File 'lib/comet/models/server_meta_version_info.rb', line 16 def version @version end |
#version_codename ⇒ Object
Returns the value of attribute version_codename.
19 20 21 |
# File 'lib/comet/models/server_meta_version_info.rb', line 19 def version_codename @version_codename end |
Instance Method Details
#clear ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/comet/models/server_meta_version_info.rb', line 119 def clear @version = '' @version_codename = '' @experimental_options = [] @server_start_time = 0 @server_start_hash = '' @current_time = 0 @server_license_hash = '' @server_license_feature_set = 0 @server_license_limit = Comet::LicenseLimits.new @configured_devices = 0 @booster_limit = {} @license_valid_until = 0 @emails_sent_successfully = 0 @emails_sent_errors = 0 @emails_waiting_in_queue = 0 @scheduled_email_thread_current_state = 0 @scheduled_email_thread_last_calculate_duration_nanos = 0 @scheduled_email_thread_waiting_until = 0 @scheduled_email_thread_last_wake_time = 0 @self_backup = [] @unknown_json_fields = {} end |
#from_hash(obj) ⇒ Object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/comet/models/server_meta_version_info.rb', line 151 def from_hash(obj) raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash obj.each do |k, v| case k when 'Version' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @version = v when 'VersionCodename' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @version_codename = v when 'StorageRole' @storage_role = v when 'AuthenticationRole' @authentication_role = v when 'SoftwareBuildRole' @software_build_role = v when 'OverseerRole' @constellation_role__legacy = v when 'ConstellationRole' @constellation_role = v when 'ExperimentalOptions' if v.nil? @experimental_options = [] else @experimental_options = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String @experimental_options[i1] = v1 end end when 'ServerStartTime' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @server_start_time = v when 'ServerStartHash' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @server_start_hash = v when 'CurrentTime' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @current_time = v when 'ServerLicenseHash' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @server_license_hash = v when 'ServerLicenseFeaturesAll' @server_license_features_all = v when 'ServerLicenseFeatureSet' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @server_license_feature_set = v when 'ServerLicenseLimit' @server_license_limit = Comet::LicenseLimits.new @server_license_limit.from_hash(v) when 'ConfiguredDevices' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @configured_devices = v when 'BoosterLimit' @booster_limit = {} if v.nil? @booster_limit = {} else v.each do |k1, v1| raise TypeError, "'v1' expected Numeric, got #{v1.class}" unless v1.is_a? Numeric @booster_limit[k1] = v1 end end when 'LicenseValidUntil' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @license_valid_until = v when 'EmailsSentSuccessfully' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @emails_sent_successfully = v when 'EmailsSentErrors' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @emails_sent_errors = v when 'EmailsWaitingInQueue' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @emails_waiting_in_queue = v when 'ScheduledEmailThreadCurrentState' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @scheduled_email_thread_current_state = v when 'ScheduledEmailThreadLastCalculateDurationNanos' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @scheduled_email_thread_last_calculate_duration_nanos = v when 'ScheduledEmailThreadWaitingUntil' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @scheduled_email_thread_waiting_until = v when 'ScheduledEmailThreadLastWakeTime' raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric @scheduled_email_thread_last_wake_time = v when 'ScheduledEmailThreadLastWakeSentEmails' @scheduled_email_thread_last_wake_sent_emails = v when 'SelfBackup' if v.nil? @self_backup = [] else @self_backup = Array.new(v.length) v.each_with_index do |v1, i1| @self_backup[i1] = Comet::SelfBackupStatistics.new @self_backup[i1].from_hash(v1) end end else @unknown_json_fields[k] = v end end end |
#from_json(json_string) ⇒ Object
144 145 146 147 148 |
# File 'lib/comet/models/server_meta_version_info.rb', line 144 def from_json(json_string) raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String from_hash(JSON.parse(json_string)) end |
#to_h ⇒ Hash
Returns The complete object as a Ruby hash.
314 315 316 |
# File 'lib/comet/models/server_meta_version_info.rb', line 314 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/comet/models/server_meta_version_info.rb', line 276 def to_hash ret = {} ret['Version'] = @version ret['VersionCodename'] = @version_codename ret['StorageRole'] = @storage_role ret['AuthenticationRole'] = @authentication_role ret['SoftwareBuildRole'] = @software_build_role ret['OverseerRole'] = @constellation_role__legacy ret['ConstellationRole'] = @constellation_role unless @experimental_options.nil? ret['ExperimentalOptions'] = @experimental_options end ret['ServerStartTime'] = @server_start_time ret['ServerStartHash'] = @server_start_hash ret['CurrentTime'] = @current_time ret['ServerLicenseHash'] = @server_license_hash ret['ServerLicenseFeaturesAll'] = @server_license_features_all ret['ServerLicenseFeatureSet'] = @server_license_feature_set ret['ServerLicenseLimit'] = @server_license_limit ret['ConfiguredDevices'] = @configured_devices ret['BoosterLimit'] = @booster_limit ret['LicenseValidUntil'] = @license_valid_until ret['EmailsSentSuccessfully'] = @emails_sent_successfully ret['EmailsSentErrors'] = @emails_sent_errors ret['EmailsWaitingInQueue'] = @emails_waiting_in_queue ret['ScheduledEmailThreadCurrentState'] = @scheduled_email_thread_current_state ret['ScheduledEmailThreadLastCalculateDurationNanos'] = @scheduled_email_thread_last_calculate_duration_nanos ret['ScheduledEmailThreadWaitingUntil'] = @scheduled_email_thread_waiting_until ret['ScheduledEmailThreadLastWakeTime'] = @scheduled_email_thread_last_wake_time ret['ScheduledEmailThreadLastWakeSentEmails'] = @scheduled_email_thread_last_wake_sent_emails ret['SelfBackup'] = @self_backup @unknown_json_fields.each do |k, v| ret[k] = v end ret end |
#to_json(options = {}) ⇒ String
Returns The complete object as a JSON string.
319 320 321 |
# File 'lib/comet/models/server_meta_version_info.rb', line 319 def to_json( = {}) to_hash.to_json() end |