Class: Comet::ServerMetaVersionInfo

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeServerMetaVersionInfo

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_roleObject

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_limitObject

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_devicesObject

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_roleObject

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__legacyObject

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.



32
33
34
# File 'lib/comet/models/server_meta_version_info.rb', line 32

def constellation_role__legacy
  @constellation_role__legacy
end

#current_timeObject

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_errorsObject

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_successfullyObject

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_queueObject

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_optionsObject

Returns the value of attribute experimental_options.



38
39
40
# File 'lib/comet/models/server_meta_version_info.rb', line 38

def experimental_options
  @experimental_options
end

#license_valid_untilObject

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_stateObject

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_nanosObject

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_emailsObject

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_timeObject

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_untilObject

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_backupObject

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_setObject

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_allObject

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_hashObject

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_limitObject

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_hashObject

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_timeObject

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_roleObject

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_roleObject

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_fieldsObject

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

#versionObject

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_codenameObject

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

#clearObject



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

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


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

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


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_hHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    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_hashHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    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.

Returns:

  • (String)

    The complete object as a JSON string



319
320
321
# File 'lib/comet/models/server_meta_version_info.rb', line 319

def to_json(options = {})
  to_hash.to_json(options)
end