Class: NewStoreApi::ResponseCreatejob
- Defined in:
- lib/new_store_api/models/response_createjob.rb
Overview
ResponseCreatejob Model.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Job creation timestamp (ISO 8601 format).
-
#data ⇒ Array[Object]
Query results data.
-
#format ⇒ String
Data format.
-
#job_id ⇒ String
Unique job identifier.
-
#metadata ⇒ Object
Job metadata including row_count, execution_time, and query_cost.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(created_at = SKIP, job_id = SKIP, data = SKIP, format = SKIP, metadata = SKIP) ⇒ ResponseCreatejob
constructor
A new instance of ResponseCreatejob.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(created_at = SKIP, job_id = SKIP, data = SKIP, format = SKIP, metadata = SKIP) ⇒ ResponseCreatejob
Returns a new instance of ResponseCreatejob.
60 61 62 63 64 65 66 67 |
# File 'lib/new_store_api/models/response_createjob.rb', line 60 def initialize(created_at = SKIP, job_id = SKIP, data = SKIP, format = SKIP, = SKIP) @created_at = created_at unless created_at == SKIP @job_id = job_id unless job_id == SKIP @data = data unless data == SKIP @format = format unless format == SKIP @metadata = unless == SKIP end |
Instance Attribute Details
#created_at ⇒ DateTime
Job creation timestamp (ISO 8601 format)
15 16 17 |
# File 'lib/new_store_api/models/response_createjob.rb', line 15 def created_at @created_at end |
#data ⇒ Array[Object]
Query results data
23 24 25 |
# File 'lib/new_store_api/models/response_createjob.rb', line 23 def data @data end |
#format ⇒ String
Data format
27 28 29 |
# File 'lib/new_store_api/models/response_createjob.rb', line 27 def format @format end |
#job_id ⇒ String
Unique job identifier
19 20 21 |
# File 'lib/new_store_api/models/response_createjob.rb', line 19 def job_id @job_id end |
#metadata ⇒ Object
Job metadata including row_count, execution_time, and query_cost
31 32 33 |
# File 'lib/new_store_api/models/response_createjob.rb', line 31 def @metadata end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/new_store_api/models/response_createjob.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end job_id = hash.key?('job_id') ? hash['job_id'] : SKIP data = hash.key?('data') ? hash['data'] : SKIP format = hash.key?('format') ? hash['format'] : SKIP = hash.key?('metadata') ? hash['metadata'] : SKIP # Create object from extracted values. ResponseCreatejob.new(created_at, job_id, data, format, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/new_store_api/models/response_createjob.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'created_at' @_hash['job_id'] = 'job_id' @_hash['data'] = 'data' @_hash['format'] = 'format' @_hash['metadata'] = 'metadata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/new_store_api/models/response_createjob.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/new_store_api/models/response_createjob.rb', line 45 def self.optionals %w[ created_at job_id data format metadata ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 |
# File 'lib/new_store_api/models/response_createjob.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, job_id: #{@job_id.inspect}, data:"\ " #{@data.inspect}, format: #{@format.inspect}, metadata: #{@metadata.inspect}>" end |
#to_custom_created_at ⇒ Object
92 93 94 |
# File 'lib/new_store_api/models/response_createjob.rb', line 92 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/new_store_api/models/response_createjob.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, job_id: #{@job_id}, data: #{@data}, format:"\ " #{@format}, metadata: #{@metadata}>" end |