Class: Rafflesia::JobData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::JobData
- Defined in:
- lib/rafflesia/foundry/job_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ active_job_id: :active_job_id, attempt: :attempt, canceled_at: :canceled_at, cancelled_at: :cancelled_at, completed_at: :completed_at, created_at: :created_at, error: :error, events: :events, idempotency_key: :idempotency_key, idempotency_reused: :idempotency_reused, input_hash: :input_hash, is_terminal: :is_terminal, job_id: :job_id, last_error: :last_error, max_retries: :max_retries, message: :message, operation: :operation, progress: :progress, record_object: :record_object, result: :result, result_inline_bytes: :result_inline_bytes, result_object: :result_object, started_at: :started_at, status: :status, timed_out_at: :timed_out_at, timeout_ms: :timeout_ms, updated_at: :updated_at, version: :version, worker_id: :worker_id, worker_last_seen_at: :worker_last_seen_at, worker_version: :worker_version }.freeze
Instance Attribute Summary collapse
-
#active_job_id ⇒ Object
Returns the value of attribute active_job_id.
-
#attempt ⇒ Object
Returns the value of attribute attempt.
-
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
-
#cancelled_at ⇒ Object
Returns the value of attribute cancelled_at.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#error ⇒ Object
Returns the value of attribute error.
-
#events ⇒ Object
Returns the value of attribute events.
-
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
-
#idempotency_reused ⇒ Object
Returns the value of attribute idempotency_reused.
-
#input_hash ⇒ Object
Returns the value of attribute input_hash.
-
#is_terminal ⇒ Object
Returns the value of attribute is_terminal.
-
#job_id ⇒ Object
Returns the value of attribute job_id.
-
#last_error ⇒ Object
Returns the value of attribute last_error.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#message ⇒ Object
Returns the value of attribute message.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#record_object ⇒ Object
Returns the value of attribute record_object.
-
#result ⇒ Object
Returns the value of attribute result.
-
#result_inline_bytes ⇒ Object
Returns the value of attribute result_inline_bytes.
-
#result_object ⇒ Object
Returns the value of attribute result_object.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#status ⇒ Object
Returns the value of attribute status.
-
#timed_out_at ⇒ Object
Returns the value of attribute timed_out_at.
-
#timeout_ms ⇒ Object
Returns the value of attribute timeout_ms.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#version ⇒ Object
Returns the value of attribute version.
-
#worker_id ⇒ Object
Returns the value of attribute worker_id.
-
#worker_last_seen_at ⇒ Object
Returns the value of attribute worker_last_seen_at.
-
#worker_version ⇒ Object
Returns the value of attribute worker_version.
Instance Method Summary collapse
-
#initialize(json) ⇒ JobData
constructor
A new instance of JobData.
Constructor Details
#initialize(json) ⇒ JobData
Returns a new instance of JobData.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/rafflesia/foundry/job_data.rb', line 75 def initialize(json) super() hash = self.class.normalize(json) @active_job_id = hash[:active_job_id] @attempt = hash[:attempt] @canceled_at = hash[:canceled_at] @cancelled_at = hash[:cancelled_at] @completed_at = hash[:completed_at] @created_at = hash[:created_at] @error = hash[:error] ? Rafflesia::ApiErrorBody.new(hash[:error]) : nil @events = (hash[:events] || []).map { |item| item ? Rafflesia::JobEvent.new(item) : nil } @idempotency_key = hash[:idempotency_key] @idempotency_reused = hash[:idempotency_reused] @input_hash = hash[:input_hash] @is_terminal = hash[:is_terminal] @job_id = hash[:job_id] @last_error = hash[:last_error] ? Rafflesia::ApiErrorBody.new(hash[:last_error]) : nil @max_retries = hash[:max_retries] @message = hash[:message] @operation = hash[:operation] @progress = hash[:progress] ? Rafflesia::JobProgress.new(hash[:progress]) : nil @record_object = hash[:record_object] ? Rafflesia::ObjectRef.new(hash[:record_object]) : nil @result = hash[:result] @result_inline_bytes = hash[:result_inline_bytes] @result_object = hash[:result_object] ? Rafflesia::ObjectRef.new(hash[:result_object]) : nil @started_at = hash[:started_at] @status = hash[:status] @timed_out_at = hash[:timed_out_at] @timeout_ms = hash[:timeout_ms] @updated_at = hash[:updated_at] @version = hash[:version] @worker_id = hash[:worker_id] @worker_last_seen_at = hash[:worker_last_seen_at] @worker_version = hash[:worker_version] end |
Instance Attribute Details
#active_job_id ⇒ Object
Returns the value of attribute active_job_id.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def active_job_id @active_job_id end |
#attempt ⇒ Object
Returns the value of attribute attempt.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def attempt @attempt end |
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def canceled_at @canceled_at end |
#cancelled_at ⇒ Object
Returns the value of attribute cancelled_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def cancelled_at @cancelled_at end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def completed_at @completed_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def created_at @created_at end |
#error ⇒ Object
Returns the value of attribute error.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def error @error end |
#events ⇒ Object
Returns the value of attribute events.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def events @events end |
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def idempotency_key @idempotency_key end |
#idempotency_reused ⇒ Object
Returns the value of attribute idempotency_reused.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def idempotency_reused @idempotency_reused end |
#input_hash ⇒ Object
Returns the value of attribute input_hash.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def input_hash @input_hash end |
#is_terminal ⇒ Object
Returns the value of attribute is_terminal.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def is_terminal @is_terminal end |
#job_id ⇒ Object
Returns the value of attribute job_id.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def job_id @job_id end |
#last_error ⇒ Object
Returns the value of attribute last_error.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def last_error @last_error end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def max_retries @max_retries end |
#message ⇒ Object
Returns the value of attribute message.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def @message end |
#operation ⇒ Object
Returns the value of attribute operation.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def operation @operation end |
#progress ⇒ Object
Returns the value of attribute progress.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def progress @progress end |
#record_object ⇒ Object
Returns the value of attribute record_object.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def record_object @record_object end |
#result ⇒ Object
Returns the value of attribute result.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def result @result end |
#result_inline_bytes ⇒ Object
Returns the value of attribute result_inline_bytes.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def result_inline_bytes @result_inline_bytes end |
#result_object ⇒ Object
Returns the value of attribute result_object.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def result_object @result_object end |
#started_at ⇒ Object
Returns the value of attribute started_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def started_at @started_at end |
#status ⇒ Object
Returns the value of attribute status.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def status @status end |
#timed_out_at ⇒ Object
Returns the value of attribute timed_out_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def timed_out_at @timed_out_at end |
#timeout_ms ⇒ Object
Returns the value of attribute timeout_ms.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def timeout_ms @timeout_ms end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def updated_at @updated_at end |
#version ⇒ Object
Returns the value of attribute version.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def version @version end |
#worker_id ⇒ Object
Returns the value of attribute worker_id.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def worker_id @worker_id end |
#worker_last_seen_at ⇒ Object
Returns the value of attribute worker_last_seen_at.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def worker_last_seen_at @worker_last_seen_at end |
#worker_version ⇒ Object
Returns the value of attribute worker_version.
42 43 44 |
# File 'lib/rafflesia/foundry/job_data.rb', line 42 def worker_version @worker_version end |