Class: Falcon::ApiQueryMetadataJSON

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ApiQueryMetadataJSON

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 164

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ApiQueryMetadataJSON` 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::ApiQueryMetadataJSON`. 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?(:'filter_query')
    self.filter_query = attributes[:'filter_query']
  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?(:'queued_millis')
    self.queued_millis = attributes[:'queued_millis']
  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?(:'warning')
    self.warning = attributes[:'warning']
  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/api_query_metadata_json.rb', line 35

def costs
  @costs
end

#digest_flowObject

Returns the value of attribute digest_flow.



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

def digest_flow
  @digest_flow
end

#event_countObject

Number of events in the result set



40
41
42
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 40

def event_count
  @event_count
end

#extra_dataObject

Returns the value of attribute extra_data.



42
43
44
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 42

def extra_data
  @extra_data
end

#field_orderObject

Order of the returned fields



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

def field_order
  @field_order
end

#filter_queryObject

Returns the value of attribute filter_query.



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

def filter_query
  @filter_query
end

#is_aggregateObject

True if this is an aggregate query



50
51
52
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 50

def is_aggregate
  @is_aggregate
end

#poll_afterObject

How soon to poll the query after it has been submitted to expected results



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

def poll_after
  @poll_after
end

#processed_bytesObject

Number of bytes processed to return results



56
57
58
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 56

def processed_bytes
  @processed_bytes
end

#processed_eventsObject

Number of events processed in result set



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

def processed_events
  @processed_events
end

#query_endObject

Timestamp of the end of the query



62
63
64
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 62

def query_end
  @query_end
end

#query_spentObject

Returns the value of attribute query_spent.



64
65
66
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 64

def query_spent
  @query_spent
end

#query_startObject

Timestampt of when the query started



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

def query_start
  @query_start
end

#queued_millisObject

Number of milliseconds the query was queued before execution



70
71
72
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 70

def queued_millis
  @queued_millis
end

#quota_total_spentObject

Returns the value of attribute quota_total_spent.



72
73
74
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 72

def quota_total_spent
  @quota_total_spent
end

#responder_v_hostObject

Number of the host returning the response



75
76
77
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 75

def responder_v_host
  @responder_v_host
end

#result_buffer_sizeObject

Size of the buffer used to store the result



78
79
80
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 78

def result_buffer_size
  @result_buffer_size
end

#time_millisObject

Time spent executing the query in milliseconds



81
82
83
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 81

def time_millis
  @time_millis
end

#total_workObject

Total amount of work to execute the query



84
85
86
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 84

def total_work
  @total_work
end

#warningObject

Deprecated: Use warnings in the message root instead



87
88
89
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 87

def warning
  @warning
end

#warningsObject

Use ‘warnings’ in the message root instead



90
91
92
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 90

def warnings
  @warnings
end

#work_doneObject

Estimate of the work done to complete the query



93
94
95
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 93

def work_done
  @work_done
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



124
125
126
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 124

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 96

def self.attribute_map
  {
    :'costs' => :'costs',
    :'digest_flow' => :'digestFlow',
    :'event_count' => :'eventCount',
    :'extra_data' => :'extraData',
    :'field_order' => :'fieldOrder',
    :'filter_query' => :'filterQuery',
    :'is_aggregate' => :'isAggregate',
    :'poll_after' => :'pollAfter',
    :'processed_bytes' => :'processedBytes',
    :'processed_events' => :'processedEvents',
    :'query_end' => :'queryEnd',
    :'query_spent' => :'querySpent',
    :'query_start' => :'queryStart',
    :'queued_millis' => :'queuedMillis',
    :'quota_total_spent' => :'quotaTotalSpent',
    :'responder_v_host' => :'responderVHost',
    :'result_buffer_size' => :'resultBufferSize',
    :'time_millis' => :'timeMillis',
    :'total_work' => :'totalWork',
    :'warning' => :'warning',
    :'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



437
438
439
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 437

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

.openapi_nullableObject

List of attributes with nullable: true



157
158
159
160
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 157

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

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 129

def self.openapi_types
  {
    :'costs' => :'Costs',
    :'digest_flow' => :'DigestFlow',
    :'event_count' => :'Integer',
    :'extra_data' => :'Object',
    :'field_order' => :'Array<String>',
    :'filter_query' => :'Object',
    :'is_aggregate' => :'Boolean',
    :'poll_after' => :'Integer',
    :'processed_bytes' => :'Integer',
    :'processed_events' => :'Integer',
    :'query_end' => :'Integer',
    :'query_spent' => :'QuerySpent',
    :'query_start' => :'Integer',
    :'queued_millis' => :'Integer',
    :'quota_total_spent' => :'QuotaTotalSpent',
    :'responder_v_host' => :'Integer',
    :'result_buffer_size' => :'Integer',
    :'time_millis' => :'Integer',
    :'total_work' => :'Integer',
    :'warning' => :'String',
    :'warnings' => :'Array<String>',
    :'work_done' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 395

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 &&
      filter_query == o.filter_query &&
      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 &&
      queued_millis == o.queued_millis &&
      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 &&
      warning == o.warning &&
      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



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 468

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



539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 539

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



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 444

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


424
425
426
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 424

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



430
431
432
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 430

def hash
  [costs, digest_flow, event_count, extra_data, field_order, filter_query, is_aggregate, poll_after, processed_bytes, processed_events, query_end, query_spent, query_start, queued_millis, quota_total_spent, responder_v_host, result_buffer_size, time_millis, total_work, warning, 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



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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 272

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 @filter_query.nil?
    invalid_properties.push('invalid value for "filter_query", filter_query 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 @queued_millis.nil?
    invalid_properties.push('invalid value for "queued_millis", queued_millis 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 @warning.nil?
    invalid_properties.push('invalid value for "warning", warning 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



515
516
517
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 515

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



521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 521

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



509
510
511
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 509

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



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/crimson-falcon/models/api_query_metadata_json.rb', line 367

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 @filter_query.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 @queued_millis.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 @warning.nil?
  return false if @warnings.nil?
  return false if @work_done.nil?
  true
end