Class: Cadenya::Types::ToolSpec_Config_Openapi

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) ⇒ ToolSpec_Config_Openapi

Returns a new instance of ToolSpec_Config_Openapi.



8504
8505
8506
8507
# File 'lib/cadenya/types.rb', line 8504

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

Instance Attribute Details

#openapiObject (readonly)

Returns the value of attribute openapi.



8502
8503
8504
# File 'lib/cadenya/types.rb', line 8502

def openapi
  @openapi
end

#typeObject (readonly)

Returns the value of attribute type.



8502
8503
8504
# File 'lib/cadenya/types.rb', line 8502

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8509
8510
8511
8512
8513
8514
# File 'lib/cadenya/types.rb', line 8509

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

Instance Method Details

#to_hObject



8516
8517
8518
8519
8520
8521
# File 'lib/cadenya/types.rb', line 8516

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