Class: Cadenya::Types::ObjectiveEvent
- Inherits:
-
Object
- Object
- Cadenya::Types::ObjectiveEvent
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#context_window_id ⇒ Object
readonly
Returns the value of attribute context_window_id.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: nil, data: nil, context_window_id: nil, info: nil, duration: nil, started_at: nil) ⇒ ObjectiveEvent
constructor
A new instance of ObjectiveEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(metadata: nil, data: nil, context_window_id: nil, info: nil, duration: nil, started_at: nil) ⇒ ObjectiveEvent
Returns a new instance of ObjectiveEvent.
3745 3746 3747 3748 3749 3750 3751 3752 |
# File 'lib/cadenya/types.rb', line 3745 def initialize(metadata: nil, data: nil, context_window_id: nil, info: nil, duration: nil, started_at: nil) @metadata = @data = data @context_window_id = context_window_id @info = info @duration = duration @started_at = started_at end |
Instance Attribute Details
#context_window_id ⇒ Object (readonly)
Returns the value of attribute context_window_id.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def context_window_id @context_window_id end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def data @data end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def duration @duration end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def info @info end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def @metadata end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
3743 3744 3745 |
# File 'lib/cadenya/types.rb', line 3743 def started_at @started_at end |
Class Method Details
.from_json(data) ⇒ Object
3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 |
# File 'lib/cadenya/types.rb', line 3754 def self.from_json(data) new( metadata: data["metadata"].nil? ? nil : Types::OperationMetadata.from_json(data["metadata"]), data: data["data"].nil? ? nil : Types.decode_ObjectiveEventData(data["data"]), context_window_id: data["contextWindowId"], info: data["info"].nil? ? nil : Types::ObjectiveEventInfo.from_json(data["info"]), duration: data["duration"], started_at: data["startedAt"].nil? ? nil : Time.iso8601(data["startedAt"]), ) end |
Instance Method Details
#to_h ⇒ Object
3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 |
# File 'lib/cadenya/types.rb', line 3765 def to_h { metadata: Util.plain(@metadata), data: Util.plain(@data), context_window_id: Util.plain(@context_window_id), info: Util.plain(@info), duration: Util.plain(@duration), started_at: Util.plain(@started_at), }.reject { |_k, v| v.nil? } end |