Class: Cadenya::Types::ToolSetAdapter_OpenapiVariant

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(type: nil, openapi: nil) ⇒ ToolSetAdapter_OpenapiVariant

Returns a new instance of ToolSetAdapter_OpenapiVariant.



7993
7994
7995
7996
# File 'lib/cadenya/types.rb', line 7993

def initialize(type: nil, openapi: nil)
  @type = type
  @openapi = openapi
end

Instance Attribute Details

#openapiObject (readonly)

Returns the value of attribute openapi.



7991
7992
7993
# File 'lib/cadenya/types.rb', line 7991

def openapi
  @openapi
end

#typeObject (readonly)

Returns the value of attribute type.



7991
7992
7993
# File 'lib/cadenya/types.rb', line 7991

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



7998
7999
8000
8001
8002
8003
# File 'lib/cadenya/types.rb', line 7998

def self.from_json(data)
  new(
    type: data["type"],
    openapi: data["openapi"].nil? ? nil : Types.decode_ToolSetAdapter_OpenAPI(data["openapi"]),
  )
end

Instance Method Details

#to_hObject



8005
8006
8007
8008
8009
8010
# File 'lib/cadenya/types.rb', line 8005

def to_h
  {
    type: Util.plain(@type),
    openapi: Util.plain(@openapi),
  }.reject { |_k, v| v.nil? }
end