Class: Falcon::ClientQueryResultMetadata
- Inherits:
-
Object
- Object
- Falcon::ClientQueryResultMetadata
- Defined in:
- lib/crimson-falcon/models/client_query_result_metadata.rb
Instance Attribute Summary collapse
-
#costs ⇒ Object
Returns the value of attribute costs.
-
#digest_flow ⇒ Object
Returns the value of attribute digest_flow.
-
#event_count ⇒ Object
Returns the value of attribute event_count.
-
#extra_data ⇒ Object
Returns the value of attribute extra_data.
-
#field_order ⇒ Object
Returns the value of attribute field_order.
-
#is_aggregate ⇒ Object
Returns the value of attribute is_aggregate.
-
#poll_after ⇒ Object
Returns the value of attribute poll_after.
-
#processed_bytes ⇒ Object
Returns the value of attribute processed_bytes.
-
#processed_events ⇒ Object
Returns the value of attribute processed_events.
-
#query_end ⇒ Object
Returns the value of attribute query_end.
-
#query_spent ⇒ Object
Returns the value of attribute query_spent.
-
#query_start ⇒ Object
Returns the value of attribute query_start.
-
#quota_total_spent ⇒ Object
Returns the value of attribute quota_total_spent.
-
#responder_v_host ⇒ Object
Returns the value of attribute responder_v_host.
-
#result_buffer_size ⇒ Object
Returns the value of attribute result_buffer_size.
-
#time_millis ⇒ Object
Returns the value of attribute time_millis.
-
#total_work ⇒ Object
Returns the value of attribute total_work.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
-
#work_done ⇒ Object
Returns the value of attribute work_done.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ClientQueryResultMetadata
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ClientQueryResultMetadata
Initializes the object
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 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 135 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
#costs ⇒ Object
Returns the value of attribute costs.
34 35 36 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 34 def costs @costs end |
#digest_flow ⇒ Object
Returns the value of attribute digest_flow.
36 37 38 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 36 def digest_flow @digest_flow end |
#event_count ⇒ Object
Returns the value of attribute event_count.
38 39 40 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 38 def event_count @event_count end |
#extra_data ⇒ Object
Returns the value of attribute extra_data.
40 41 42 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 40 def extra_data @extra_data end |
#field_order ⇒ Object
Returns the value of attribute field_order.
42 43 44 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 42 def field_order @field_order end |
#is_aggregate ⇒ Object
Returns the value of attribute is_aggregate.
44 45 46 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 44 def is_aggregate @is_aggregate end |
#poll_after ⇒ Object
Returns the value of attribute poll_after.
46 47 48 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 46 def poll_after @poll_after end |
#processed_bytes ⇒ Object
Returns the value of attribute processed_bytes.
48 49 50 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 48 def processed_bytes @processed_bytes end |
#processed_events ⇒ Object
Returns the value of attribute processed_events.
50 51 52 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 50 def processed_events @processed_events end |
#query_end ⇒ Object
Returns the value of attribute query_end.
52 53 54 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 52 def query_end @query_end end |
#query_spent ⇒ Object
Returns the value of attribute query_spent.
54 55 56 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 54 def query_spent @query_spent end |
#query_start ⇒ Object
Returns the value of attribute query_start.
56 57 58 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 56 def query_start @query_start end |
#quota_total_spent ⇒ Object
Returns the value of attribute quota_total_spent.
58 59 60 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 58 def quota_total_spent @quota_total_spent end |
#responder_v_host ⇒ Object
Returns the value of attribute responder_v_host.
60 61 62 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 60 def responder_v_host @responder_v_host end |
#result_buffer_size ⇒ Object
Returns the value of attribute result_buffer_size.
62 63 64 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 62 def result_buffer_size @result_buffer_size end |
#time_millis ⇒ Object
Returns the value of attribute time_millis.
64 65 66 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 64 def time_millis @time_millis end |
#total_work ⇒ Object
Returns the value of attribute total_work.
66 67 68 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 66 def total_work @total_work end |
#warnings ⇒ Object
Returns the value of attribute warnings.
68 69 70 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 68 def warnings @warnings end |
#work_done ⇒ Object
Returns the value of attribute work_done.
70 71 72 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 70 def work_done @work_done end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
98 99 100 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 98 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 73 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
378 379 380 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 378 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
128 129 130 131 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 128 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 103 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.
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 339 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
409 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 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 409 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
480 481 482 483 484 485 486 487 488 489 490 491 492 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 480 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
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 385 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
365 366 367 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 365 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
371 372 373 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 371 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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 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 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 231 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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
456 457 458 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 456 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 462 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_s ⇒ String
Returns the string representation of the object
450 451 452 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 450 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/crimson-falcon/models/client_query_result_metadata.rb', line 314 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 |