Class: Cadenya::Types::ObjectiveContextWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: nil, data: nil, info: nil) ⇒ ObjectiveContextWindow

Returns a new instance of ObjectiveContextWindow.



3592
3593
3594
3595
3596
# File 'lib/cadenya/types.rb', line 3592

def initialize(metadata: nil, data: nil, info: nil)
  @metadata = 
  @data = data
  @info = info
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3590
3591
3592
# File 'lib/cadenya/types.rb', line 3590

def data
  @data
end

#infoObject (readonly)

Returns the value of attribute info.



3590
3591
3592
# File 'lib/cadenya/types.rb', line 3590

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



3590
3591
3592
# File 'lib/cadenya/types.rb', line 3590

def 
  @metadata
end

Class Method Details

.from_json(data) ⇒ Object



3598
3599
3600
3601
3602
3603
3604
# File 'lib/cadenya/types.rb', line 3598

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::OperationMetadata.from_json(data["metadata"]),
    data: data["data"].nil? ? nil : Types::ObjectiveContextWindowData.from_json(data["data"]),
    info: data["info"].nil? ? nil : Types::ObjectiveContextWindowInfo.from_json(data["info"]),
  )
end

Instance Method Details

#to_hObject



3606
3607
3608
3609
3610
3611
3612
# File 'lib/cadenya/types.rb', line 3606

def to_h
  {
    metadata: Util.plain(@metadata),
    data: Util.plain(@data),
    info: Util.plain(@info),
  }.reject { |_k, v| v.nil? }
end