Class: Vellum::PaginatedWorkflowSandboxExampleList
- Inherits:
-
Object
- Object
- Vellum::PaginatedWorkflowSandboxExampleList
- Defined in:
- lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #count ⇒ Integer readonly
- #next_ ⇒ String readonly
- #previous ⇒ String readonly
- #results ⇒ Array<Vellum::WorkflowSandboxExample> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil) ⇒ Vellum::PaginatedWorkflowSandboxExampleList constructor
- #to_json ⇒ String
Constructor Details
#initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil) ⇒ Vellum::PaginatedWorkflowSandboxExampleList
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#count ⇒ Integer (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 9 def count @count end |
#next_ ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 11 def next_ @next_ end |
#previous ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb', line 13 def previous @previous end |
#results ⇒ Array<Vellum::WorkflowSandboxExample> (readonly)
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
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
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_json ⇒ 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 |