Class: Vellum::WorkflowSandboxDisplayData

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/workflow_sandbox_display_data.rb

Overview

Information used to display this Workflow Sandbox.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(icon: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowSandboxDisplayData

Parameters:

  • icon (Vellum::WorkflowDisplayIcon) (defaults to: OMIT)

    The icon associated with this Workflow Sandbox.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



22
23
24
25
26
27
28
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 22

def initialize(icon: OMIT, additional_properties: nil)
  @icon = icon if icon != OMIT
  @additional_properties = additional_properties
  @_field_set = { "icon": icon }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



12
13
14
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 12

def additional_properties
  @additional_properties
end

#iconVellum::WorkflowDisplayIcon (readonly)

Returns The icon associated with this Workflow Sandbox.

Returns:



10
11
12
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 10

def icon
  @icon
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowSandboxDisplayData

Parameters:

  • json_object (String)

Returns:



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 33

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  unless parsed_json["icon"].nil?
    icon = parsed_json["icon"].to_json
    icon = Vellum::WorkflowDisplayIcon.from_json(json_object: icon)
  else
    icon = nil
  end
  new(icon: icon, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


56
57
58
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 56

def self.validate_raw(obj:)
  obj.icon.nil? || Vellum::WorkflowDisplayIcon.validate_raw(obj: obj.icon)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


47
48
49
# File 'lib/vellum_ai/types/workflow_sandbox_display_data.rb', line 47

def to_json
  @_field_set&.to_json
end