Class: Cadenya::Types::CreateToolRequest

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(workspace_id: nil, tool_set_id: nil, metadata: nil, spec: nil) ⇒ CreateToolRequest

Returns a new instance of CreateToolRequest.



1828
1829
1830
1831
1832
1833
# File 'lib/cadenya/types.rb', line 1828

def initialize(workspace_id: nil, tool_set_id: nil, metadata: nil, spec: nil)
  @workspace_id = workspace_id
  @tool_set_id = tool_set_id
  @metadata = 
  @spec = spec
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



1826
1827
1828
# File 'lib/cadenya/types.rb', line 1826

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1826
1827
1828
# File 'lib/cadenya/types.rb', line 1826

def spec
  @spec
end

#tool_set_idObject (readonly)

Returns the value of attribute tool_set_id.



1826
1827
1828
# File 'lib/cadenya/types.rb', line 1826

def tool_set_id
  @tool_set_id
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1826
1827
1828
# File 'lib/cadenya/types.rb', line 1826

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1835
1836
1837
1838
1839
1840
1841
1842
# File 'lib/cadenya/types.rb', line 1835

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    tool_set_id: data["toolSetId"],
    metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::ToolSpec.from_json(data["spec"]),
  )
end

Instance Method Details

#to_hObject



1844
1845
1846
1847
1848
1849
1850
1851
# File 'lib/cadenya/types.rb', line 1844

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