Class: Vapi::Recording
- Inherits:
-
Object
- Object
- Vapi::Recording
- Defined in:
- lib/vapi_server_sdk/types/recording.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#mono ⇒ Vapi::Mono
readonly
This is the mono recording url for the call.
-
#stereo_url ⇒ String
readonly
This is the stereo recording url for the call.
-
#video_recording_start_delay_seconds ⇒ Float
readonly
This is video recording start delay in ms.
-
#video_url ⇒ String
readonly
This is the video recording url for the call.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::Recording
Deserialize a JSON object to an instance of Recording.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(stereo_url: OMIT, video_url: OMIT, video_recording_start_delay_seconds: OMIT, mono: OMIT, additional_properties: nil) ⇒ Vapi::Recording constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Recording to a JSON object.
Constructor Details
#initialize(stereo_url: OMIT, video_url: OMIT, video_recording_start_delay_seconds: OMIT, mono: OMIT, additional_properties: nil) ⇒ Vapi::Recording
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 41 def initialize(stereo_url: OMIT, video_url: OMIT, video_recording_start_delay_seconds: OMIT, mono: OMIT, additional_properties: nil) @stereo_url = stereo_url if stereo_url != OMIT @video_url = video_url if video_url != OMIT if video_recording_start_delay_seconds != OMIT @video_recording_start_delay_seconds = video_recording_start_delay_seconds end @mono = mono if mono != OMIT @additional_properties = additional_properties @_field_set = { "stereoUrl": stereo_url, "videoUrl": video_url, "videoRecordingStartDelaySeconds": video_recording_start_delay_seconds, "mono": mono }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 23 def additional_properties @additional_properties end |
#mono ⇒ Vapi::Mono (readonly)
Returns This is the mono recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.
21 22 23 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 21 def mono @mono end |
#stereo_url ⇒ String (readonly)
Returns This is the stereo recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.
11 12 13 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 11 def stereo_url @stereo_url end |
#video_recording_start_delay_seconds ⇒ Float (readonly)
Returns This is video recording start delay in ms. To enable, set ‘assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps.
18 19 20 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 18 def video_recording_start_delay_seconds @video_recording_start_delay_seconds end |
#video_url ⇒ String (readonly)
Returns This is the video recording url for the call. To enable, set ‘assistant.artifactPlan.videoRecordingEnabled`.
14 15 16 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 14 def video_url @video_url end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Recording
Deserialize a JSON object to an instance of Recording
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 64 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) stereo_url = parsed_json["stereoUrl"] video_url = parsed_json["videoUrl"] video_recording_start_delay_seconds = parsed_json["videoRecordingStartDelaySeconds"] if parsed_json["mono"].nil? mono = nil else mono = parsed_json["mono"].to_json mono = Vapi::Mono.from_json(json_object: mono) end new( stereo_url: stereo_url, video_url: video_url, video_recording_start_delay_seconds: video_recording_start_delay_seconds, mono: mono, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
98 99 100 101 102 103 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 98 def self.validate_raw(obj:) obj.stereo_url&.is_a?(String) != false || raise("Passed value for field obj.stereo_url is not the expected type, validation failed.") obj.video_url&.is_a?(String) != false || raise("Passed value for field obj.video_url is not the expected type, validation failed.") obj.video_recording_start_delay_seconds&.is_a?(Float) != false || raise("Passed value for field obj.video_recording_start_delay_seconds is not the expected type, validation failed.") obj.mono.nil? || Vapi::Mono.validate_raw(obj: obj.mono) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Recording to a JSON object
88 89 90 |
# File 'lib/vapi_server_sdk/types/recording.rb', line 88 def to_json(*_args) @_field_set&.to_json end |