Class: Vapi::Recording

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/recording.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stereo_url: OMIT, video_url: OMIT, video_recording_start_delay_seconds: OMIT, mono: OMIT, additional_properties: nil) ⇒ Vapi::Recording

Parameters:

  • stereo_url (String) (defaults to: OMIT)

    This is the stereo recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

  • video_url (String) (defaults to: OMIT)

    This is the video recording url for the call. To enable, set ‘assistant.artifactPlan.videoRecordingEnabled`.

  • video_recording_start_delay_seconds (Float) (defaults to: OMIT)

    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.

  • mono (Vapi::Mono) (defaults to: OMIT)

    This is the mono recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#monoVapi::Mono (readonly)

Returns This is the mono recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

Returns:

  • (Vapi::Mono)

    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_urlString (readonly)

Returns This is the stereo recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

Returns:

  • (String)

    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_secondsFloat (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.

Returns:

  • (Float)

    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_urlString (readonly)

Returns This is the video recording url for the call. To enable, set ‘assistant.artifactPlan.videoRecordingEnabled`.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


88
89
90
# File 'lib/vapi_server_sdk/types/recording.rb', line 88

def to_json(*_args)
  @_field_set&.to_json
end