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.
-
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
-
#constellation_role__legacy ⇒ Object
Returns the value of attribute constellation_role__legacy.
-
#current_time ⇒ Object
Returns the value of attribute current_time.
-
#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
Returns the value of attribute license_valid_until.
-
#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
Returns the value of attribute self_backup.
-
#server_license_hash ⇒ Object
Returns the value of attribute server_license_hash.
-
#server_start_hash ⇒ Object
Returns the value of attribute server_start_hash.
-
#server_start_time ⇒ Object
Returns the value of attribute server_start_time.
-
#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.
86 87 88 |
# File 'lib/comet/models/server_meta_version_info.rb', line 86 def initialize clear end |
Instance Attribute Details
#authentication_role ⇒ Object
Returns the value of attribute authentication_role.
27 28 29 |
# File 'lib/comet/models/server_meta_version_info.rb', line 27 def authentication_role @authentication_role end |
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
36 37 38 |
# File 'lib/comet/models/server_meta_version_info.rb', line 36 def constellation_role @constellation_role end |
#constellation_role__legacy ⇒ Object
Returns the value of attribute constellation_role__legacy.
33 34 35 |
# File 'lib/comet/models/server_meta_version_info.rb', line 33 def constellation_role__legacy @constellation_role__legacy end |
#current_time ⇒ Object
Returns the value of attribute current_time.
48 49 50 |
# File 'lib/comet/models/server_meta_version_info.rb', line 48 def current_time @current_time end |
#emails_sent_errors ⇒ Object
Returns the value of attribute emails_sent_errors.
60 61 62 |
# File 'lib/comet/models/server_meta_version_info.rb', line 60 def emails_sent_errors @emails_sent_errors end |
#emails_sent_successfully ⇒ Object
Returns the value of attribute emails_sent_successfully.
57 58 59 |
# File 'lib/comet/models/server_meta_version_info.rb', line 57 def emails_sent_successfully @emails_sent_successfully end |
#emails_waiting_in_queue ⇒ Object
Returns the value of attribute emails_waiting_in_queue.
63 64 65 |
# File 'lib/comet/models/server_meta_version_info.rb', line 63 def emails_waiting_in_queue @emails_waiting_in_queue end |
#experimental_options ⇒ Object
Returns the value of attribute experimental_options.
39 40 41 |
# File 'lib/comet/models/server_meta_version_info.rb', line 39 def end |
#license_valid_until ⇒ Object
Returns the value of attribute license_valid_until.
54 55 56 |
# File 'lib/comet/models/server_meta_version_info.rb', line 54 def license_valid_until @license_valid_until end |
#scheduled_email_thread_current_state ⇒ Object
Returns the value of attribute scheduled_email_thread_current_state.
66 67 68 |
# File 'lib/comet/models/server_meta_version_info.rb', line 66 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.
69 70 71 |
# File 'lib/comet/models/server_meta_version_info.rb', line 69 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.
78 79 80 |
# File 'lib/comet/models/server_meta_version_info.rb', line 78 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.
75 76 77 |
# File 'lib/comet/models/server_meta_version_info.rb', line 75 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.
72 73 74 |
# File 'lib/comet/models/server_meta_version_info.rb', line 72 def scheduled_email_thread_waiting_until @scheduled_email_thread_waiting_until end |
#self_backup ⇒ Object
Returns the value of attribute self_backup.
81 82 83 |
# File 'lib/comet/models/server_meta_version_info.rb', line 81 def self_backup @self_backup end |
#server_license_hash ⇒ Object
Returns the value of attribute server_license_hash.
51 52 53 |
# File 'lib/comet/models/server_meta_version_info.rb', line 51 def server_license_hash @server_license_hash end |
#server_start_hash ⇒ Object
Returns the value of attribute server_start_hash.
45 46 47 |
# File 'lib/comet/models/server_meta_version_info.rb', line 45 def server_start_hash @server_start_hash end |
#server_start_time ⇒ Object
Returns the value of attribute server_start_time.
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.
30 31 32 |
# File 'lib/comet/models/server_meta_version_info.rb', line 30 def software_build_role @software_build_role end |
#storage_role ⇒ Object
Returns the value of attribute storage_role.
24 25 26 |
# File 'lib/comet/models/server_meta_version_info.rb', line 24 def storage_role @storage_role end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
84 85 86 |
# File 'lib/comet/models/server_meta_version_info.rb', line 84 def unknown_json_fields @unknown_json_fields end |
#version ⇒ Object
Returns the value of attribute version.
18 19 20 |
# File 'lib/comet/models/server_meta_version_info.rb', line 18 def version @version end |
#version_codename ⇒ Object
Returns the value of attribute version_codename.
21 22 23 |
# File 'lib/comet/models/server_meta_version_info.rb', line 21 def version_codename @version_codename end |
Instance Method Details
#clear ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/comet/models/server_meta_version_info.rb', line 90 def clear @version = '' @version_codename = '' = [] @server_start_time = 0 @server_start_hash = '' @current_time = 0 @server_license_hash = '' @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
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 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 |
# File 'lib/comet/models/server_meta_version_info.rb', line 118 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? = [] else = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String [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 '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
111 112 113 114 115 |
# File 'lib/comet/models/server_meta_version_info.rb', line 111 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.
252 253 254 |
# File 'lib/comet/models/server_meta_version_info.rb', line 252 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
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 |
# File 'lib/comet/models/server_meta_version_info.rb', line 219 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 .nil? ret['ExperimentalOptions'] = end ret['ServerStartTime'] = @server_start_time ret['ServerStartHash'] = @server_start_hash ret['CurrentTime'] = @current_time ret['ServerLicenseHash'] = @server_license_hash 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.
257 258 259 |
# File 'lib/comet/models/server_meta_version_info.rb', line 257 def to_json( = {}) to_hash.to_json() end |