Class: Vellum::ContainerImageBuildConfig
- Inherits:
-
Object
- Object
- Vellum::ContainerImageBuildConfig
- Defined in:
- lib/vellum_ai/types/container_image_build_config.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #hotswappable_version ⇒ String readonly
- #packages ⇒ Array<Vellum::CodeExecutionPackage> readonly
- #user_script ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(packages:, user_script: OMIT, hotswappable_version: OMIT, additional_properties: nil) ⇒ Vellum::ContainerImageBuildConfig constructor
- #to_json ⇒ String
Constructor Details
#initialize(packages:, user_script: OMIT, hotswappable_version: OMIT, additional_properties: nil) ⇒ Vellum::ContainerImageBuildConfig
27 28 29 30 31 32 33 34 35 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 27 def initialize(packages:, user_script: OMIT, hotswappable_version: OMIT, additional_properties: nil) @packages = packages @user_script = user_script if user_script != OMIT @hotswappable_version = hotswappable_version if hotswappable_version != OMIT @additional_properties = additional_properties @_field_set = { "packages": packages, "user_script": user_script, "hotswappable_version": hotswappable_version }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 15 def additional_properties @additional_properties end |
#hotswappable_version ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 13 def hotswappable_version @hotswappable_version end |
#packages ⇒ Array<Vellum::CodeExecutionPackage> (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 9 def packages @packages end |
#user_script ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 11 def user_script @user_script end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::ContainerImageBuildConfig
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 40 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) packages = parsed_json["packages"]&.map do | item | item = item.to_json Vellum::CodeExecutionPackage.from_json(json_object: item) end user_script = parsed_json["user_script"] hotswappable_version = parsed_json["hotswappable_version"] new( packages: packages, user_script: user_script, hotswappable_version: hotswappable_version, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
68 69 70 71 72 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 68 def self.validate_raw(obj:) obj.packages.is_a?(Array) != false || raise("Passed value for field obj.packages is not the expected type, validation failed.") obj.user_script&.is_a?(String) != false || raise("Passed value for field obj.user_script is not the expected type, validation failed.") obj.hotswappable_version&.is_a?(String) != false || raise("Passed value for field obj.hotswappable_version is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
59 60 61 |
# File 'lib/vellum_ai/types/container_image_build_config.rb', line 59 def to_json @_field_set&.to_json end |