Class: Falcon::ClientQueryResultMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/client_query_result_metadata.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ClientQueryResultMetadata

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 136

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ClientQueryResultMetadata` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::ClientQueryResultMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'costs')
    self.costs = attributes[:'costs']
  end

  if attributes.key?(:'digest_flow')
    self.digest_flow = attributes[:'digest_flow']
  end

  if attributes.key?(:'event_count')
    self.event_count = attributes[:'event_count']
  end

  if attributes.key?(:'extra_data')
    self.extra_data = attributes[:'extra_data']
  end

  if attributes.key?(:'field_order')
    if (value = attributes[:'field_order']).is_a?(Array)
      self.field_order = value
    end
  end

  if attributes.key?(:'is_aggregate')
    self.is_aggregate = attributes[:'is_aggregate']
  end

  if attributes.key?(:'poll_after')
    self.poll_after = attributes[:'poll_after']
  end

  if attributes.key?(:'processed_bytes')
    self.processed_bytes = attributes[:'processed_bytes']
  end

  if attributes.key?(:'processed_events')
    self.processed_events = attributes[:'processed_events']
  end

  if attributes.key?(:'query_end')
    self.query_end = attributes[:'query_end']
  end

  if attributes.key?(:'query_spent')
    self.query_spent = attributes[:'query_spent']
  end

  if attributes.key?(:'query_start')
    self.query_start = attributes[:'query_start']
  end

  if attributes.key?(:'quota_total_spent')
    self.quota_total_spent = attributes[:'quota_total_spent']
  end

  if attributes.key?(:'responder_v_host')
    self.responder_v_host = attributes[:'responder_v_host']
  end

  if attributes.key?(:'result_buffer_size')
    self.result_buffer_size = attributes[:'result_buffer_size']
  end

  if attributes.key?(:'time_millis')
    self.time_millis = attributes[:'time_millis']
  end

  if attributes.key?(:'total_work')
    self.total_work = attributes[:'total_work']
  end

  if attributes.key?(:'warnings')
    if (value = attributes[:'warnings']).is_a?(Array)
      self.warnings = value
    end
  end

  if attributes.key?(:'work_done')
    self.work_done = attributes[:'work_done']
  end
end

Instance Attribute Details

#costsObject

Returns the value of attribute costs.



35
36
37
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 35

def costs
  @costs
end

#digest_flowObject

Returns the value of attribute digest_flow.



37
38
39
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 37

def digest_flow
  @digest_flow
end

#event_countObject

Returns the value of attribute event_count.



39
40
41
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 39

def event_count
  @event_count
end

#extra_dataObject

Returns the value of attribute extra_data.



41
42
43
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 41

def extra_data
  @extra_data
end

#field_orderObject

Returns the value of attribute field_order.



43
44
45
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 43

def field_order
  @field_order
end

#is_aggregateObject

Returns the value of attribute is_aggregate.



45
46
47
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 45

def is_aggregate
  @is_aggregate
end

#poll_afterObject

Returns the value of attribute poll_after.



47
48
49
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 47

def poll_after
  @poll_after
end

#processed_bytesObject

Returns the value of attribute processed_bytes.



49
50
51
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 49

def processed_bytes
  @processed_bytes
end

#processed_eventsObject

Returns the value of attribute processed_events.



51
52
53
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 51

def processed_events
  @processed_events
end

#query_endObject

Returns the value of attribute query_end.



53
54
55
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 53

def query_end
  @query_end
end

#query_spentObject

Returns the value of attribute query_spent.



55
56
57
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 55

def query_spent
  @query_spent
end

#query_startObject

Returns the value of attribute query_start.



57
58
59
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 57

def query_start
  @query_start
end

#quota_total_spentObject

Returns the value of attribute quota_total_spent.



59
60
61
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 59

def quota_total_spent
  @quota_total_spent
end

#responder_v_hostObject

Returns the value of attribute responder_v_host.



61
62
63
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 61

def responder_v_host
  @responder_v_host
end

#result_buffer_sizeObject

Returns the value of attribute result_buffer_size.



63
64
65
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 63

def result_buffer_size
  @result_buffer_size
end

#time_millisObject

Returns the value of attribute time_millis.



65
66
67
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 65

def time_millis
  @time_millis
end

#total_workObject

Returns the value of attribute total_work.



67
68
69
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 67

def total_work
  @total_work
end

#warningsObject

Returns the value of attribute warnings.



69
70
71
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 69

def warnings
  @warnings
end

#work_doneObject

Returns the value of attribute work_done.



71
72
73
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 71

def work_done
  @work_done
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



99
100
101
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 99

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 74

def self.attribute_map
  {
    :'costs' => :'costs',
    :'digest_flow' => :'digestFlow',
    :'event_count' => :'eventCount',
    :'extra_data' => :'extraData',
    :'field_order' => :'fieldOrder',
    :'is_aggregate' => :'isAggregate',
    :'poll_after' => :'pollAfter',
    :'processed_bytes' => :'processedBytes',
    :'processed_events' => :'processedEvents',
    :'query_end' => :'queryEnd',
    :'query_spent' => :'querySpent',
    :'query_start' => :'queryStart',
    :'quota_total_spent' => :'quotaTotalSpent',
    :'responder_v_host' => :'responderVHost',
    :'result_buffer_size' => :'resultBufferSize',
    :'time_millis' => :'timeMillis',
    :'total_work' => :'totalWork',
    :'warnings' => :'warnings',
    :'work_done' => :'workDone'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



379
380
381
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 379

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



129
130
131
132
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 129

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 104

def self.openapi_types
  {
    :'costs' => :'ClientCosts',
    :'digest_flow' => :'ClientDigestFlow',
    :'event_count' => :'Integer',
    :'extra_data' => :'Object',
    :'field_order' => :'Array<String>',
    :'is_aggregate' => :'Boolean',
    :'poll_after' => :'Integer',
    :'processed_bytes' => :'Integer',
    :'processed_events' => :'Integer',
    :'query_end' => :'Integer',
    :'query_spent' => :'ClientSpent',
    :'query_start' => :'Integer',
    :'quota_total_spent' => :'ClientSpent',
    :'responder_v_host' => :'Integer',
    :'result_buffer_size' => :'Integer',
    :'time_millis' => :'Integer',
    :'total_work' => :'Integer',
    :'warnings' => :'Array<Object>',
    :'work_done' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 340

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      costs == o.costs &&
      digest_flow == o.digest_flow &&
      event_count == o.event_count &&
      extra_data == o.extra_data &&
      field_order == o.field_order &&
      is_aggregate == o.is_aggregate &&
      poll_after == o.poll_after &&
      processed_bytes == o.processed_bytes &&
      processed_events == o.processed_events &&
      query_end == o.query_end &&
      query_spent == o.query_spent &&
      query_start == o.query_start &&
      quota_total_spent == o.quota_total_spent &&
      responder_v_host == o.responder_v_host &&
      result_buffer_size == o.result_buffer_size &&
      time_millis == o.time_millis &&
      total_work == o.total_work &&
      warnings == o.warnings &&
      work_done == o.work_done
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 410

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Falcon.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 481

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 386

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


366
367
368
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 366

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



372
373
374
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 372

def hash
  [costs, digest_flow, event_count, extra_data, field_order, is_aggregate, poll_after, processed_bytes, processed_events, query_end, query_spent, query_start, quota_total_spent, responder_v_host, result_buffer_size, time_millis, total_work, warnings, work_done].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
274
275
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/crimson-falcon/models/client_query_result_metadata.rb', line 232

def list_invalid_properties
  invalid_properties = Array.new
  if @costs.nil?
    invalid_properties.push('invalid value for "costs", costs cannot be nil.')
  end

  if @digest_flow.nil?
    invalid_properties.push('invalid value for "digest_flow", digest_flow cannot be nil.')
  end

  if @event_count.nil?
    invalid_properties.push('invalid value for "event_count", event_count cannot be nil.')
  end

  if @extra_data.nil?
    invalid_properties.push('invalid value for "extra_data", extra_data cannot be nil.')
  end

  if @field_order.nil?
    invalid_properties.push('invalid value for "field_order", field_order cannot be nil.')
  end

  if @is_aggregate.nil?
    invalid_properties.push('invalid value for "is_aggregate", is_aggregate cannot be nil.')
  end

  if @poll_after.nil?
    invalid_properties.push('invalid value for "poll_after", poll_after cannot be nil.')
  end

  if @processed_bytes.nil?
    invalid_properties.push('invalid value for "processed_bytes", processed_bytes cannot be nil.')
  end

  if @processed_events.nil?
    invalid_properties.push('invalid value for "processed_events", processed_events cannot be nil.')
  end

  if @query_end.nil?
    invalid_properties.push('invalid value for "query_end", query_end cannot be nil.')
  end

  if @query_spent.nil?
    invalid_properties.push('invalid value for "query_spent", query_spent cannot be nil.')
  end

  if @query_start.nil?
    invalid_properties.push('invalid value for "query_start", query_start cannot be nil.')
  end

  if @quota_total_spent.nil?
    invalid_properties.push('invalid value for "quota_total_spent", quota_total_spent cannot be nil.')
  end

  if @responder_v_host.nil?
    invalid_properties.push('invalid value for "responder_v_host", responder_v_host cannot be nil.')
  end

  if @result_buffer_size.nil?
    invalid_properties.push('invalid value for "result_buffer_size", result_buffer_size cannot be nil.')
  end

  if @time_millis.nil?
    invalid_properties.push('invalid value for "time_millis", time_millis cannot be nil.')
  end

  if @total_work.nil?
    invalid_properties.push('invalid value for "total_work", total_work cannot be nil.')
  end

  if @warnings.nil?
    invalid_properties.push('invalid value for "warnings", warnings cannot be nil.')
  end

  if @work_done.nil?
    invalid_properties.push('invalid value for "work_done", work_done cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



457
458
459
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 457

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 463

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



451
452
453
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 451

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 315

def valid?
  return false if @costs.nil?
  return false if @digest_flow.nil?
  return false if @event_count.nil?
  return false if @extra_data.nil?
  return false if @field_order.nil?
  return false if @is_aggregate.nil?
  return false if @poll_after.nil?
  return false if @processed_bytes.nil?
  return false if @processed_events.nil?
  return false if @query_end.nil?
  return false if @query_spent.nil?
  return false if @query_start.nil?
  return false if @quota_total_spent.nil?
  return false if @responder_v_host.nil?
  return false if @result_buffer_size.nil?
  return false if @time_millis.nil?
  return false if @total_work.nil?
  return false if @warnings.nil?
  return false if @work_done.nil?
  true
end