Class: Vellum::CodeExecutionPackage
- Inherits:
-
Object
- Object
- Vellum::CodeExecutionPackage
- Defined in:
- lib/vellum_ai/types/code_execution_package.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #name ⇒ String readonly
- #repository ⇒ String readonly
- #version ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(version:, name:, repository: OMIT, additional_properties: nil) ⇒ Vellum::CodeExecutionPackage constructor
- #to_json ⇒ String
Constructor Details
#initialize(version:, name:, repository: OMIT, additional_properties: nil) ⇒ Vellum::CodeExecutionPackage
26 27 28 29 30 31 32 33 34 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 26 def initialize(version:, name:, repository: OMIT, additional_properties: nil) @version = version @name = name @repository = repository if repository != OMIT @additional_properties = additional_properties @_field_set = { "version": version, "name": name, "repository": repository }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 14 def additional_properties @additional_properties end |
#name ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 10 def name @name end |
#repository ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 12 def repository @repository end |
#version ⇒ String (readonly)
8 9 10 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 8 def version @version end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::CodeExecutionPackage
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) version = parsed_json["version"] name = parsed_json["name"] repository = parsed_json["repository"] new( version: version, name: name, repository: repository, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 68 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 64 def self.validate_raw(obj:) obj.version.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.repository&.is_a?(String) != false || raise("Passed value for field obj.repository is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/vellum_ai/types/code_execution_package.rb', line 55 def to_json @_field_set&.to_json end |