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 ⇒ Object
readonly
details.
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
41 42 43 44 45 46 47 48 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 41 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.
21 22 23 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 21 def additional_properties @additional_properties end |
#metadata ⇒ Hash{String => Object} (readonly)
19 20 21 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 19 def @metadata end |
#src ⇒ Object (readonly)
details.
17 18 19 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 17 def src @src end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::VellumVideo
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 53 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
76 77 78 79 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 76 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
67 68 69 |
# File 'lib/vellum_ai/types/vellum_video.rb', line 67 def to_json @_field_set&.to_json end |