Class: AgUiProtocol::Core::Events::RunFinishedSuccessOutcome

Inherits:
Types::Model
  • Object
show all
Defined in:
lib/ag_ui_protocol/core/events.rb

Overview

Represents a successful outcome for a run.

The ‘type` discriminator is enforced — only “success” is accepted (or nil for default). The optional `type:` kwarg exists to support round-trip deserialization from `to_h` output (which emits `type: “success”`); supplying any other value raises ArgumentError.

“‘ruby outcome = AgUiProtocol::Core::Events::RunFinishedSuccessOutcome.new “`

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Types::Model

#as_json, #to_json

Constructor Details

#initialize(type: nil) ⇒ RunFinishedSuccessOutcome

Returns a new instance of RunFinishedSuccessOutcome.



943
944
945
946
947
948
949
# File 'lib/ag_ui_protocol/core/events.rb', line 943

def initialize(type: nil)
  if !type.nil? && type != "success"
    raise ArgumentError, "RunFinishedSuccessOutcome.type must be \"success\""
  end

  @type = "success"
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



939
940
941
# File 'lib/ag_ui_protocol/core/events.rb', line 939

def type
  @type
end

Instance Method Details

#to_hObject



952
953
954
# File 'lib/ag_ui_protocol/core/events.rb', line 952

def to_h
  { type: @type }
end