Class: Cadenya::Types::ToolSetAdapter_MCP

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(url: nil, headers: nil, include_tools: nil, exclude_tools: nil, tool_approvals: nil, just_in_time: nil) ⇒ ToolSetAdapter_MCP

Returns a new instance of ToolSetAdapter_MCP.



6083
6084
6085
6086
6087
6088
6089
6090
# File 'lib/cadenya/types.rb', line 6083

def initialize(url: nil, headers: nil, include_tools: nil, exclude_tools: nil, tool_approvals: nil, just_in_time: nil)
  @url = url
  @headers = headers
  @include_tools = include_tools
  @exclude_tools = exclude_tools
  @tool_approvals = tool_approvals
  @just_in_time = just_in_time
end

Instance Attribute Details

#exclude_toolsObject (readonly)

Returns the value of attribute exclude_tools.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def exclude_tools
  @exclude_tools
end

#headersObject (readonly)

Returns the value of attribute headers.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def headers
  @headers
end

#include_toolsObject (readonly)

Returns the value of attribute include_tools.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def include_tools
  @include_tools
end

#just_in_timeObject (readonly)

Returns the value of attribute just_in_time.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def just_in_time
  @just_in_time
end

#tool_approvalsObject (readonly)

Returns the value of attribute tool_approvals.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def tool_approvals
  @tool_approvals
end

#urlObject (readonly)

Returns the value of attribute url.



6081
6082
6083
# File 'lib/cadenya/types.rb', line 6081

def url
  @url
end

Class Method Details

.from_json(data) ⇒ Object



6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
# File 'lib/cadenya/types.rb', line 6092

def self.from_json(data)
  new(
    url: data["url"],
    headers: data["headers"],
    include_tools: data["includeTools"].nil? ? nil : Types::ToolSetAdapter_ToolFilter.from_json(data["includeTools"]),
    exclude_tools: data["excludeTools"].nil? ? nil : Types::ToolSetAdapter_ToolFilter.from_json(data["excludeTools"]),
    tool_approvals: data["toolApprovals"].nil? ? nil : Types.decode_ToolSetAdapter_ApprovalRequirementFilter(data["toolApprovals"]),
    just_in_time: data["justInTime"].nil? ? nil : Types::ToolSetAdapter_JustInTime.from_json(data["justInTime"]),
  )
end

Instance Method Details

#to_hObject



6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
# File 'lib/cadenya/types.rb', line 6103

def to_h
  {
    url: Util.plain(@url),
    headers: Util.plain(@headers),
    include_tools: Util.plain(@include_tools),
    exclude_tools: Util.plain(@exclude_tools),
    tool_approvals: Util.plain(@tool_approvals),
    just_in_time: Util.plain(@just_in_time),
  }.reject { |_k, v| v.nil? }
end