Class: Copilot::CanvasDeclaration

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

Overview

Declarative metadata for a canvas.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionsObject

Returns the value of attribute actions

Returns:

  • (Object)

    the current value of actions



88
89
90
# File 'lib/copilot/types.rb', line 88

def actions
  @actions
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



88
89
90
# File 'lib/copilot/types.rb', line 88

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name

Returns:

  • (Object)

    the current value of display_name



88
89
90
# File 'lib/copilot/types.rb', line 88

def display_name
  @display_name
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



88
89
90
# File 'lib/copilot/types.rb', line 88

def id
  @id
end

#input_schemaObject

Returns the value of attribute input_schema

Returns:

  • (Object)

    the current value of input_schema



88
89
90
# File 'lib/copilot/types.rb', line 88

def input_schema
  @input_schema
end

Instance Method Details

#to_hObject



92
93
94
95
96
97
# File 'lib/copilot/types.rb', line 92

def to_h
  h = { id: id, displayName: display_name, description: description }
  h[:inputSchema] = input_schema unless input_schema.nil?
  h[:actions] = actions.map { |action| action.respond_to?(:to_h) ? action.to_h : action } unless actions.nil?
  h
end