class Comet::ServerMetaVersionInfo
ServerMetaVersionInfo is a typed class wrapper around the underlying Comet Server API data structure.
def clear
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 @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
def from_hash(obj)
-
obj
(Hash
) -- The complete object as a Ruby hash
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 '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
def from_json(json_string)
-
json_string
(String
) -- The complete object in JSON format
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
def initialize
def initialize clear end
def to_h
-
(Hash)
- The complete object as a Ruby hash
def to_h to_hash end
def to_hash
-
(Hash)
- The complete object as a Ruby hash
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['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
def to_json(options = {})
-
(String)
- The complete object as a JSON string
def to_json(options = {}) to_hash.to_json(options) end