Class: Vellum::WorkflowSandboxExample

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, label:, description: OMIT, icon_name: OMIT, ui_image_url: OMIT, code_image_url: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowSandboxExample

Parameters:

  • id (String)
  • label (String)
  • description (String) (defaults to: OMIT)
  • icon_name (String) (defaults to: OMIT)
  • ui_image_url (String) (defaults to: OMIT)
  • code_image_url (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 35

def initialize(id:, label:, description: OMIT, icon_name: OMIT, ui_image_url: OMIT, code_image_url: OMIT, additional_properties: nil)
  @id = id
  @label = label
  @description = description if description != OMIT
  @icon_name = icon_name if icon_name != OMIT
  @ui_image_url = ui_image_url if ui_image_url != OMIT
  @code_image_url = code_image_url if code_image_url != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "label": label, "description": description, "icon_name": icon_name, "ui_image_url": ui_image_url, "code_image_url": code_image_url }.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



20
21
22
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 20

def additional_properties
  @additional_properties
end

#code_image_urlString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 18

def code_image_url
  @code_image_url
end

#descriptionString (readonly)

Returns:

  • (String)


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

def description
  @description
end

#icon_nameString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 14

def icon_name
  @icon_name
end

#idString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 8

def id
  @id
end

#labelString (readonly)

Returns:

  • (String)


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

def label
  @label
end

#ui_image_urlString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 16

def ui_image_url
  @ui_image_url
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowSandboxExample

Parameters:

  • json_object (String)

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 51

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  label = parsed_json["label"]
  description = parsed_json["description"]
  icon_name = parsed_json["icon_name"]
  ui_image_url = parsed_json["ui_image_url"]
  code_image_url = parsed_json["code_image_url"]
  new(
    id: id,
    label: label,
    description: description,
    icon_name: icon_name,
    ui_image_url: ui_image_url,
    code_image_url: code_image_url,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


82
83
84
85
86
87
88
89
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 82

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.icon_name&.is_a?(String) != false || raise("Passed value for field obj.icon_name is not the expected type, validation failed.")
  obj.ui_image_url&.is_a?(String) != false || raise("Passed value for field obj.ui_image_url is not the expected type, validation failed.")
  obj.code_image_url&.is_a?(String) != false || raise("Passed value for field obj.code_image_url is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


73
74
75
# File 'lib/vellum_ai/types/workflow_sandbox_example.rb', line 73

def to_json
  @_field_set&.to_json
end