Class: RunApi::Core::TaskResponse
- Defined in:
- lib/runapi/core/types.rb
Overview
Typed response structure for async task operations. Additional API-specific fields are preserved and exposed via dot notation.
Defined Under Namespace
Modules: Status
Instance Attribute Summary collapse
-
#data ⇒ RunApi::Core::DynamicModel?
readonly
Task-specific result data.
-
#error ⇒ String?
readonly
Error message if task failed.
-
#id ⇒ String?
readonly
Task ID for tracking and retrieval.
-
#status ⇒ String?
readonly
Current task status.
Method Summary
Methods inherited from BaseModel
#==, #[], coerce, #dig, fields, from_hash, #initialize, optional, required, #to_h
Constructor Details
This class inherits a constructor from RunApi::Core::BaseModel
Instance Attribute Details
#data ⇒ RunApi::Core::DynamicModel? (readonly)
Returns Task-specific result data.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/runapi/core/types.rb', line 112 class TaskResponse < BaseModel module Status PENDING = "pending" PROCESSING = "processing" COMPLETED = "completed" FAILED = "failed" ALL = [ PENDING, PROCESSING, COMPLETED, FAILED ].freeze end optional :id, String optional :status, String optional :error, String optional :data, -> { DynamicModel } end |
#error ⇒ String? (readonly)
Returns Error message if task failed.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/runapi/core/types.rb', line 112 class TaskResponse < BaseModel module Status PENDING = "pending" PROCESSING = "processing" COMPLETED = "completed" FAILED = "failed" ALL = [ PENDING, PROCESSING, COMPLETED, FAILED ].freeze end optional :id, String optional :status, String optional :error, String optional :data, -> { DynamicModel } end |
#id ⇒ String? (readonly)
Returns Task ID for tracking and retrieval.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/runapi/core/types.rb', line 112 class TaskResponse < BaseModel module Status PENDING = "pending" PROCESSING = "processing" COMPLETED = "completed" FAILED = "failed" ALL = [ PENDING, PROCESSING, COMPLETED, FAILED ].freeze end optional :id, String optional :status, String optional :error, String optional :data, -> { DynamicModel } end |
#status ⇒ String? (readonly)
Returns Current task status.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/runapi/core/types.rb', line 112 class TaskResponse < BaseModel module Status PENDING = "pending" PROCESSING = "processing" COMPLETED = "completed" FAILED = "failed" ALL = [ PENDING, PROCESSING, COMPLETED, FAILED ].freeze end optional :id, String optional :status, String optional :error, String optional :data, -> { DynamicModel } end |