Class: Vapi::ArtifactPlan

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recording_enabled: OMIT, recording_format: OMIT, video_recording_enabled: OMIT, pcap_enabled: OMIT, pcap_s_3_path_prefix: OMIT, transcript_plan: OMIT, recording_path: OMIT, additional_properties: nil) ⇒ Vapi::ArtifactPlan

Parameters:

  • recording_enabled (Boolean) (defaults to: OMIT)

    This determines whether assistant’s calls are recorded. Defaults to true. Usage:

    • If you don’t want to record the calls, set this to false.

    • If you want to record the calls when ‘assistant.hipaaEnabled` (deprecated) or

    ‘assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true

  • recording_format (Vapi::ArtifactPlanRecordingFormat) (defaults to: OMIT)

    This determines the format of the recording. Defaults to ‘wav;l16`. @default ’wav;l16’

  • video_recording_enabled (Boolean) (defaults to: OMIT)

    This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false

  • pcap_enabled (Boolean) (defaults to: OMIT)

    This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for ‘phone` type calls where phone number’s provider is ‘vapi` or `byo-phone-number`. You can find the packet capture at `call.artifact.pcapUrl` after the call is ended. @default true

  • pcap_s_3_path_prefix (String) (defaults to: OMIT)

    This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the packet capture to a specific path, set this to the

    path. Example: ‘/my-assistant-captures`.

    • If you want to upload the packet capture to the root of the bucket, set this

    to ‘/`. @default ’/‘

  • transcript_plan (Vapi::TranscriptPlan) (defaults to: OMIT)

    This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.

  • recording_path (String) (defaults to: OMIT)

    This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the recording to a specific path, set this to the path.

    Example: ‘/my-assistant-recordings`.

    • If you want to upload the recording to the root of the bucket, set this to

    ‘/`. @default ’/‘

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 121

def initialize(recording_enabled: OMIT, recording_format: OMIT, video_recording_enabled: OMIT, pcap_enabled: OMIT,
               pcap_s_3_path_prefix: OMIT, transcript_plan: OMIT, recording_path: OMIT, additional_properties: nil)
  @recording_enabled = recording_enabled if recording_enabled != OMIT
  @recording_format = recording_format if recording_format != OMIT
  @video_recording_enabled = video_recording_enabled if video_recording_enabled != OMIT
  @pcap_enabled = pcap_enabled if pcap_enabled != OMIT
  @pcap_s_3_path_prefix = pcap_s_3_path_prefix if pcap_s_3_path_prefix != OMIT
  @transcript_plan = transcript_plan if transcript_plan != OMIT
  @recording_path = recording_path if recording_path != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "recordingEnabled": recording_enabled,
    "recordingFormat": recording_format,
    "videoRecordingEnabled": video_recording_enabled,
    "pcapEnabled": pcap_enabled,
    "pcapS3PathPrefix": pcap_s_3_path_prefix,
    "transcriptPlan": transcript_plan,
    "recordingPath": recording_path
  }.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



65
66
67
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 65

def additional_properties
  @additional_properties
end

#pcap_enabledBoolean (readonly)

Returns This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for ‘phone` type calls where phone number’s provider is ‘vapi` or `byo-phone-number`. You can find the packet capture at `call.artifact.pcapUrl` after the call is ended. @default true.

Returns:

  • (Boolean)

    This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for ‘phone` type calls where phone number’s provider is ‘vapi` or `byo-phone-number`. You can find the packet capture at `call.artifact.pcapUrl` after the call is ended. @default true



36
37
38
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 36

def pcap_enabled
  @pcap_enabled
end

#pcap_s_3_path_prefixString (readonly)

Returns This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

  • If you want to upload the packet capture to a specific path, set this to the

path. Example: ‘/my-assistant-captures`.

  • If you want to upload the packet capture to the root of the bucket, set this

to ‘/`. @default ’/‘.

Returns:

  • (String)

    This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the packet capture to a specific path, set this to the

    path. Example: ‘/my-assistant-captures`.

    • If you want to upload the packet capture to the root of the bucket, set this

    to ‘/`. @default ’/‘



48
49
50
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 48

def pcap_s_3_path_prefix
  @pcap_s_3_path_prefix
end

#recording_enabledBoolean (readonly)

Returns This determines whether assistant’s calls are recorded. Defaults to true. Usage:

  • If you don’t want to record the calls, set this to false.

  • If you want to record the calls when ‘assistant.hipaaEnabled` (deprecated) or

‘assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true.

Returns:

  • (Boolean)

    This determines whether assistant’s calls are recorded. Defaults to true. Usage:

    • If you don’t want to record the calls, set this to false.

    • If you want to record the calls when ‘assistant.hipaaEnabled` (deprecated) or

    ‘assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true



20
21
22
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 20

def recording_enabled
  @recording_enabled
end

#recording_formatVapi::ArtifactPlanRecordingFormat (readonly)

Returns This determines the format of the recording. Defaults to ‘wav;l16`. @default ’wav;l16’.

Returns:



23
24
25
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 23

def recording_format
  @recording_format
end

#recording_pathString (readonly)

Returns This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

  • If you want to upload the recording to a specific path, set this to the path.

Example: ‘/my-assistant-recordings`.

  • If you want to upload the recording to the root of the bucket, set this to

‘/`. @default ’/‘.

Returns:

  • (String)

    This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the recording to a specific path, set this to the path.

    Example: ‘/my-assistant-recordings`.

    • If you want to upload the recording to the root of the bucket, set this to

    ‘/`. @default ’/‘



63
64
65
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 63

def recording_path
  @recording_path
end

#transcript_planVapi::TranscriptPlan (readonly)

Returns This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.

Returns:

  • (Vapi::TranscriptPlan)

    This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.



51
52
53
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 51

def transcript_plan
  @transcript_plan
end

#video_recording_enabledBoolean (readonly)

Returns This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false.

Returns:

  • (Boolean)

    This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false



29
30
31
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 29

def video_recording_enabled
  @video_recording_enabled
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::ArtifactPlan

Deserialize a JSON object to an instance of ArtifactPlan

Parameters:

  • json_object (String)

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 148

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  recording_enabled = parsed_json["recordingEnabled"]
  recording_format = parsed_json["recordingFormat"]
  video_recording_enabled = parsed_json["videoRecordingEnabled"]
  pcap_enabled = parsed_json["pcapEnabled"]
  pcap_s_3_path_prefix = parsed_json["pcapS3PathPrefix"]
  if parsed_json["transcriptPlan"].nil?
    transcript_plan = nil
  else
    transcript_plan = parsed_json["transcriptPlan"].to_json
    transcript_plan = Vapi::TranscriptPlan.from_json(json_object: transcript_plan)
  end
  recording_path = parsed_json["recordingPath"]
  new(
    recording_enabled: recording_enabled,
    recording_format: recording_format,
    video_recording_enabled: video_recording_enabled,
    pcap_enabled: pcap_enabled,
    pcap_s_3_path_prefix: pcap_s_3_path_prefix,
    transcript_plan: transcript_plan,
    recording_path: recording_path,
    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)


188
189
190
191
192
193
194
195
196
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 188

def self.validate_raw(obj:)
  obj.recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.recording_enabled is not the expected type, validation failed.")
  obj.recording_format&.is_a?(Vapi::ArtifactPlanRecordingFormat) != false || raise("Passed value for field obj.recording_format is not the expected type, validation failed.")
  obj.video_recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.video_recording_enabled is not the expected type, validation failed.")
  obj.pcap_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.pcap_enabled is not the expected type, validation failed.")
  obj.pcap_s_3_path_prefix&.is_a?(String) != false || raise("Passed value for field obj.pcap_s_3_path_prefix is not the expected type, validation failed.")
  obj.transcript_plan.nil? || Vapi::TranscriptPlan.validate_raw(obj: obj.transcript_plan)
  obj.recording_path&.is_a?(String) != false || raise("Passed value for field obj.recording_path is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ArtifactPlan to a JSON object

Returns:

  • (String)


178
179
180
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 178

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