Class: RunApi::Core::TaskResponse

Inherits:
BaseModel
  • Object
show all
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

Attributes inherited from BaseModel

#response_headers

Method Summary

Methods inherited from BaseModel

#==, #[], coerce, #dig, fields, from_hash, #initialize, optional, required, #response_header, #runapi_task_id, #to_h, #with_response_headers

Constructor Details

This class inherits a constructor from RunApi::Core::BaseModel

Instance Attribute Details

#errorString? (readonly)

Returns Error message if task failed.

Returns:

  • (String, nil)

    Error message if task failed.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/runapi/core/types.rb', line 132

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 :billing, TaskBillingFacts
end

#idString? (readonly)

Returns Task ID for tracking and retrieval.

Returns:

  • (String, nil)

    Task ID for tracking and retrieval.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/runapi/core/types.rb', line 132

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 :billing, TaskBillingFacts
end

#statusString? (readonly)

Returns Current task status.

Returns:

  • (String, nil)

    Current task status.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/runapi/core/types.rb', line 132

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 :billing, TaskBillingFacts
end