Class: Vellum::VellumVideo
- Inherits:
-
Object
- Object
- Vellum::VellumVideo
- Defined in:
- lib/vellum_ai/types/vellum_video.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #metadata ⇒ Hash{String => Object} readonly
-
#src ⇒ String
readonly
A valid data URL containing the video data.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(src:, metadata: OMIT, additional_properties: nil) ⇒ Vellum::VellumVideo constructor
- #to_json ⇒ String
Constructor Details
#initialize(src:, metadata: OMIT, additional_properties: nil) ⇒ Vellum::VellumVideo
23 24 25 26 27 28 29 30 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 23 def initialize(src:, metadata: OMIT, additional_properties: nil) @src = src @metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "src": src, "metadata": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 12 def additional_properties @additional_properties end |
#metadata ⇒ Hash{String => Object} (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 10 def @metadata end |
#src ⇒ String (readonly)
Returns A valid data URL containing the video data.
8 9 10 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 8 def src @src end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::VellumVideo
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 35 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) src = parsed_json["src"] = parsed_json["metadata"] new( src: src, metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
58 59 60 61 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 58 def self.validate_raw(obj:) obj.src.is_a?(String) != false || raise("Passed value for field obj.src is not the expected type, validation failed.") obj.&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
49 50 51 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 49 def to_json @_field_set&.to_json end |