Class: Vellum::PaginatedWorkflowSandboxExampleList

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil) ⇒ Vellum::PaginatedWorkflowSandboxExampleList

Parameters:

  • count (Integer) (defaults to: OMIT)
  • next_ (String) (defaults to: OMIT)
  • previous (String) (defaults to: OMIT)
  • results (Array<Vellum::WorkflowSandboxExample>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
38
39
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 30

def initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil)
  @count = count if count != OMIT
  @next_ = next_ if next_ != OMIT
  @previous = previous if previous != OMIT
  @results = results if results != OMIT
  @additional_properties = additional_properties
  @_field_set = { "count": count, "next": next_, "previous": previous, "results": results }.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



17
18
19
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 17

def additional_properties
  @additional_properties
end

#countInteger (readonly)

Returns:

  • (Integer)


9
10
11
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 9

def count
  @count
end

#next_String (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 11

def next_
  @next_
end

#previousString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 13

def previous
  @previous
end

#resultsArray<Vellum::WorkflowSandboxExample> (readonly)

Returns:



15
16
17
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 15

def results
  @results
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::PaginatedWorkflowSandboxExampleList

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  count = parsed_json["count"]
  next_ = parsed_json["next"]
  previous = parsed_json["previous"]
  results = parsed_json["results"]&.map do | item |
  item = item.to_json
  Vellum::WorkflowSandboxExample.from_json(json_object: item)
end
  new(
    count: count,
    next_: next_,
    previous: previous,
    results: results,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


74
75
76
77
78
79
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 74

def self.validate_raw(obj:)
  obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
  obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
  obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
  obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


65
66
67
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 65

def to_json
  @_field_set&.to_json
end