Class: Vapi::Workflow

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/workflow.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_voice.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_nodes_item.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_transcriber.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_background_sound.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_credentials_item.rb,
lib/vapi_server_sdk/workflow/types/update_workflow_dto_background_sound_zero.rb

Defined Under Namespace

Classes: UpdateWorkflowDtoBackgroundSound, UpdateWorkflowDtoBackgroundSoundZero, UpdateWorkflowDtoCredentialsItem, UpdateWorkflowDtoNodesItem, UpdateWorkflowDtoTranscriber, UpdateWorkflowDtoVoice

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nodes:, id:, org_id:, created_at:, updated_at:, name:, edges:, transcriber: OMIT, voice: OMIT, observability_plan: OMIT, background_sound: OMIT, credentials: OMIT, global_prompt: OMIT, server: OMIT, compliance_plan: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, background_speech_denoising_plan: OMIT, credential_ids: OMIT, additional_properties: nil) ⇒ Vapi::Workflow

Parameters:

  • nodes (Array<Vapi::WorkflowNodesItem>)
  • transcriber (Vapi::WorkflowTranscriber) (defaults to: OMIT)

    This is the transcriber for the workflow. This can be overridden at node level using ‘nodes.transcriber`.

  • voice (Vapi::WorkflowVoice) (defaults to: OMIT)

    This is the voice for the workflow. This can be overridden at node level using ‘nodes.voice`.

  • observability_plan (Vapi::LangfuseObservabilityPlan) (defaults to: OMIT)

    This is the plan for observability of workflow’s calls. Currently, only Langfuse is supported.

  • background_sound (Vapi::WorkflowBackgroundSound) (defaults to: OMIT)

    This is the background sound in the call. Default for phone calls is ‘office’ and default for web calls is ‘off’. You can also provide a custom sound by providing a URL to an audio file.

  • credentials (Array<Vapi::WorkflowCredentialsItem>) (defaults to: OMIT)

    These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.

  • id (String)
  • org_id (String)
  • created_at (DateTime)
  • updated_at (DateTime)
  • name (String)
  • edges (Array<Vapi::Edge>)
  • global_prompt (String) (defaults to: OMIT)
  • server (Vapi::Server) (defaults to: OMIT)

    This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. The order of precedence is:

    1. tool.server

    2. workflow.server / assistant.server

    3. phoneNumber.server

    4. org.server

  • compliance_plan (Vapi::CompliancePlan) (defaults to: OMIT)

    This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.

  • analysis_plan (Vapi::AnalysisPlan) (defaults to: OMIT)

    This is the plan for analysis of workflow’s calls. Stored in ‘call.analysis`.

  • artifact_plan (Vapi::ArtifactPlan) (defaults to: OMIT)

    This is the plan for artifacts generated during workflow’s calls. Stored in ‘call.artifact`.

  • start_speaking_plan (Vapi::StartSpeakingPlan) (defaults to: OMIT)

    This is the plan for when the workflow nodes should start talking. You should configure this if you’re running into these issues:

    • The assistant is too slow to start talking after the customer is done

    speaking.

    • The assistant is too fast to start talking after the customer is done

    speaking.

    • The assistant is so fast that it’s actually interrupting the customer.

  • stop_speaking_plan (Vapi::StopSpeakingPlan) (defaults to: OMIT)

    This is the plan for when workflow nodes should stop talking on customer interruption. You should configure this if you’re running into these issues:

    • The assistant is too slow to recognize customer’s interruption.

    • The assistant is too fast to recognize customer’s interruption.

    • The assistant is getting interrupted by phrases that are just acknowledgments.

    • The assistant is getting interrupted by background noises.

    • The assistant is not properly stopping – it starts talking right after

    getting interrupted.

  • monitor_plan (Vapi::MonitorPlan) (defaults to: OMIT)

    This is the plan for real-time monitoring of the workflow’s calls. Usage:

    • To enable live listening of the workflow’s calls, set

    ‘monitorPlan.listenEnabled` to `true`.

    • To enable live control of the workflow’s calls, set

    ‘monitorPlan.controlEnabled` to `true`.

  • background_speech_denoising_plan (Vapi::BackgroundSpeechDenoisingPlan) (defaults to: OMIT)

    This enables filtering of noise and background speech while the user is talking. Features:

    • Smart denoising using Krisp

    • Fourier denoising

    Both can be used together. Order of precedence:

    • Smart denoising

    • Fourier denoising

  • credential_ids (Array<String>) (defaults to: OMIT)

    These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/vapi_server_sdk/types/workflow.rb', line 186

def initialize(nodes:, id:, org_id:, created_at:, updated_at:, name:, edges:, transcriber: OMIT, voice: OMIT, observability_plan: OMIT, background_sound: OMIT,
               credentials: OMIT, global_prompt: OMIT, server: OMIT, compliance_plan: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, background_speech_denoising_plan: OMIT, credential_ids: OMIT, additional_properties: nil)
  @nodes = nodes
  @transcriber = transcriber if transcriber != OMIT
  @voice = voice if voice != OMIT
  @observability_plan = observability_plan if observability_plan != OMIT
  @background_sound = background_sound if background_sound != OMIT
  @credentials = credentials if credentials != OMIT
  @id = id
  @org_id = org_id
  @created_at = created_at
  @updated_at = updated_at
  @name = name
  @edges = edges
  @global_prompt = global_prompt if global_prompt != OMIT
  @server = server if server != OMIT
  @compliance_plan = compliance_plan if compliance_plan != OMIT
  @analysis_plan = analysis_plan if analysis_plan != OMIT
  @artifact_plan = artifact_plan if artifact_plan != OMIT
  @start_speaking_plan = start_speaking_plan if start_speaking_plan != OMIT
  @stop_speaking_plan = stop_speaking_plan if stop_speaking_plan != OMIT
  @monitor_plan = monitor_plan if monitor_plan != OMIT
  @background_speech_denoising_plan = background_speech_denoising_plan if background_speech_denoising_plan != OMIT
  @credential_ids = credential_ids if credential_ids != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "nodes": nodes,
    "transcriber": transcriber,
    "voice": voice,
    "observabilityPlan": observability_plan,
    "backgroundSound": background_sound,
    "credentials": credentials,
    "id": id,
    "orgId": org_id,
    "createdAt": created_at,
    "updatedAt": updated_at,
    "name": name,
    "edges": edges,
    "globalPrompt": global_prompt,
    "server": server,
    "compliancePlan": compliance_plan,
    "analysisPlan": analysis_plan,
    "artifactPlan": artifact_plan,
    "startSpeakingPlan": start_speaking_plan,
    "stopSpeakingPlan": stop_speaking_plan,
    "monitorPlan": monitor_plan,
    "backgroundSpeechDenoisingPlan": background_speech_denoising_plan,
    "credentialIds": credential_ids
  }.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



112
113
114
# File 'lib/vapi_server_sdk/types/workflow.rb', line 112

def additional_properties
  @additional_properties
end

#analysis_planVapi::AnalysisPlan (readonly)

Returns This is the plan for analysis of workflow’s calls. Stored in ‘call.analysis`.

Returns:

  • (Vapi::AnalysisPlan)

    This is the plan for analysis of workflow’s calls. Stored in ‘call.analysis`.



70
71
72
# File 'lib/vapi_server_sdk/types/workflow.rb', line 70

def analysis_plan
  @analysis_plan
end

#artifact_planVapi::ArtifactPlan (readonly)

Returns This is the plan for artifacts generated during workflow’s calls. Stored in ‘call.artifact`.

Returns:

  • (Vapi::ArtifactPlan)

    This is the plan for artifacts generated during workflow’s calls. Stored in ‘call.artifact`.



73
74
75
# File 'lib/vapi_server_sdk/types/workflow.rb', line 73

def artifact_plan
  @artifact_plan
end

#background_soundVapi::WorkflowBackgroundSound (readonly)

Returns This is the background sound in the call. Default for phone calls is ‘office’ and default for web calls is ‘off’. You can also provide a custom sound by providing a URL to an audio file.

Returns:

  • (Vapi::WorkflowBackgroundSound)

    This is the background sound in the call. Default for phone calls is ‘office’ and default for web calls is ‘off’. You can also provide a custom sound by providing a URL to an audio file.



38
39
40
# File 'lib/vapi_server_sdk/types/workflow.rb', line 38

def background_sound
  @background_sound
end

#background_speech_denoising_planVapi::BackgroundSpeechDenoisingPlan (readonly)

Returns This enables filtering of noise and background speech while the user is talking. Features:

  • Smart denoising using Krisp

  • Fourier denoising

Both can be used together. Order of precedence:

  • Smart denoising

  • Fourier denoising.

Returns:

  • (Vapi::BackgroundSpeechDenoisingPlan)

    This enables filtering of noise and background speech while the user is talking. Features:

    • Smart denoising using Krisp

    • Fourier denoising

    Both can be used together. Order of precedence:

    • Smart denoising

    • Fourier denoising



106
107
108
# File 'lib/vapi_server_sdk/types/workflow.rb', line 106

def background_speech_denoising_plan
  @background_speech_denoising_plan
end

#compliance_planVapi::CompliancePlan (readonly)

Returns This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.

Returns:

  • (Vapi::CompliancePlan)

    This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.



68
69
70
# File 'lib/vapi_server_sdk/types/workflow.rb', line 68

def compliance_plan
  @compliance_plan
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


49
50
51
# File 'lib/vapi_server_sdk/types/workflow.rb', line 49

def created_at
  @created_at
end

#credential_idsArray<String> (readonly)

Returns These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.

Returns:

  • (Array<String>)

    These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.



110
111
112
# File 'lib/vapi_server_sdk/types/workflow.rb', line 110

def credential_ids
  @credential_ids
end

#credentialsArray<Vapi::WorkflowCredentialsItem> (readonly)

Returns These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.

Returns:

  • (Array<Vapi::WorkflowCredentialsItem>)

    These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.



43
44
45
# File 'lib/vapi_server_sdk/types/workflow.rb', line 43

def credentials
  @credentials
end

#edgesArray<Vapi::Edge> (readonly)

Returns:



55
56
57
# File 'lib/vapi_server_sdk/types/workflow.rb', line 55

def edges
  @edges
end

#global_promptString (readonly)

Returns:

  • (String)


57
58
59
# File 'lib/vapi_server_sdk/types/workflow.rb', line 57

def global_prompt
  @global_prompt
end

#idString (readonly)

Returns:

  • (String)


45
46
47
# File 'lib/vapi_server_sdk/types/workflow.rb', line 45

def id
  @id
end

#monitor_planVapi::MonitorPlan (readonly)

Returns This is the plan for real-time monitoring of the workflow’s calls. Usage:

  • To enable live listening of the workflow’s calls, set

‘monitorPlan.listenEnabled` to `true`.

  • To enable live control of the workflow’s calls, set

‘monitorPlan.controlEnabled` to `true`.

Returns:

  • (Vapi::MonitorPlan)

    This is the plan for real-time monitoring of the workflow’s calls. Usage:

    • To enable live listening of the workflow’s calls, set

    ‘monitorPlan.listenEnabled` to `true`.

    • To enable live control of the workflow’s calls, set

    ‘monitorPlan.controlEnabled` to `true`.



98
99
100
# File 'lib/vapi_server_sdk/types/workflow.rb', line 98

def monitor_plan
  @monitor_plan
end

#nameString (readonly)

Returns:

  • (String)


53
54
55
# File 'lib/vapi_server_sdk/types/workflow.rb', line 53

def name
  @name
end

#nodesArray<Vapi::WorkflowNodesItem> (readonly)

Returns:



25
26
27
# File 'lib/vapi_server_sdk/types/workflow.rb', line 25

def nodes
  @nodes
end

#observability_planVapi::LangfuseObservabilityPlan (readonly)

Returns This is the plan for observability of workflow’s calls. Currently, only Langfuse is supported.

Returns:



34
35
36
# File 'lib/vapi_server_sdk/types/workflow.rb', line 34

def observability_plan
  @observability_plan
end

#org_idString (readonly)

Returns:

  • (String)


47
48
49
# File 'lib/vapi_server_sdk/types/workflow.rb', line 47

def org_id
  @org_id
end

#serverVapi::Server (readonly)

Returns This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. The order of precedence is:

  1. tool.server

  2. workflow.server / assistant.server

  3. phoneNumber.server

  4. org.server.

Returns:

  • (Vapi::Server)

    This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. The order of precedence is:

    1. tool.server

    2. workflow.server / assistant.server

    3. phoneNumber.server

    4. org.server



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

def server
  @server
end

#start_speaking_planVapi::StartSpeakingPlan (readonly)

Returns This is the plan for when the workflow nodes should start talking. You should configure this if you’re running into these issues:

  • The assistant is too slow to start talking after the customer is done

speaking.

  • The assistant is too fast to start talking after the customer is done

speaking.

  • The assistant is so fast that it’s actually interrupting the customer.

Returns:

  • (Vapi::StartSpeakingPlan)

    This is the plan for when the workflow nodes should start talking. You should configure this if you’re running into these issues:

    • The assistant is too slow to start talking after the customer is done

    speaking.

    • The assistant is too fast to start talking after the customer is done

    speaking.

    • The assistant is so fast that it’s actually interrupting the customer.



81
82
83
# File 'lib/vapi_server_sdk/types/workflow.rb', line 81

def start_speaking_plan
  @start_speaking_plan
end

#stop_speaking_planVapi::StopSpeakingPlan (readonly)

Returns This is the plan for when workflow nodes should stop talking on customer interruption. You should configure this if you’re running into these issues:

  • The assistant is too slow to recognize customer’s interruption.

  • The assistant is too fast to recognize customer’s interruption.

  • The assistant is getting interrupted by phrases that are just acknowledgments.

  • The assistant is getting interrupted by background noises.

  • The assistant is not properly stopping – it starts talking right after

getting interrupted.

Returns:

  • (Vapi::StopSpeakingPlan)

    This is the plan for when workflow nodes should stop talking on customer interruption. You should configure this if you’re running into these issues:

    • The assistant is too slow to recognize customer’s interruption.

    • The assistant is too fast to recognize customer’s interruption.

    • The assistant is getting interrupted by phrases that are just acknowledgments.

    • The assistant is getting interrupted by background noises.

    • The assistant is not properly stopping – it starts talking right after

    getting interrupted.



91
92
93
# File 'lib/vapi_server_sdk/types/workflow.rb', line 91

def stop_speaking_plan
  @stop_speaking_plan
end

#transcriberVapi::WorkflowTranscriber (readonly)

Returns This is the transcriber for the workflow. This can be overridden at node level using ‘nodes.transcriber`.

Returns:



28
29
30
# File 'lib/vapi_server_sdk/types/workflow.rb', line 28

def transcriber
  @transcriber
end

#updated_atDateTime (readonly)

Returns:

  • (DateTime)


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

def updated_at
  @updated_at
end

#voiceVapi::WorkflowVoice (readonly)

Returns This is the voice for the workflow. This can be overridden at node level using ‘nodes.voice`.

Returns:

  • (Vapi::WorkflowVoice)

    This is the voice for the workflow. This can be overridden at node level using ‘nodes.voice`.



31
32
33
# File 'lib/vapi_server_sdk/types/workflow.rb', line 31

def voice
  @voice
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::Workflow

Deserialize a JSON object to an instance of Workflow

Parameters:

  • json_object (String)

Returns:



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/vapi_server_sdk/types/workflow.rb', line 243

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  nodes = parsed_json["nodes"]&.map do |item|
    item = item.to_json
    Vapi::WorkflowNodesItem.from_json(json_object: item)
  end
  if parsed_json["transcriber"].nil?
    transcriber = nil
  else
    transcriber = parsed_json["transcriber"].to_json
    transcriber = Vapi::WorkflowTranscriber.from_json(json_object: transcriber)
  end
  if parsed_json["voice"].nil?
    voice = nil
  else
    voice = parsed_json["voice"].to_json
    voice = Vapi::WorkflowVoice.from_json(json_object: voice)
  end
  if parsed_json["observabilityPlan"].nil?
    observability_plan = nil
  else
    observability_plan = parsed_json["observabilityPlan"].to_json
    observability_plan = Vapi::LangfuseObservabilityPlan.from_json(json_object: observability_plan)
  end
  if parsed_json["backgroundSound"].nil?
    background_sound = nil
  else
    background_sound = parsed_json["backgroundSound"].to_json
    background_sound = Vapi::WorkflowBackgroundSound.from_json(json_object: background_sound)
  end
  credentials = parsed_json["credentials"]&.map do |item|
    item = item.to_json
    Vapi::WorkflowCredentialsItem.from_json(json_object: item)
  end
  id = parsed_json["id"]
  org_id = parsed_json["orgId"]
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
  updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
  name = parsed_json["name"]
  edges = parsed_json["edges"]&.map do |item|
    item = item.to_json
    Vapi::Edge.from_json(json_object: item)
  end
  global_prompt = parsed_json["globalPrompt"]
  if parsed_json["server"].nil?
    server = nil
  else
    server = parsed_json["server"].to_json
    server = Vapi::Server.from_json(json_object: server)
  end
  if parsed_json["compliancePlan"].nil?
    compliance_plan = nil
  else
    compliance_plan = parsed_json["compliancePlan"].to_json
    compliance_plan = Vapi::CompliancePlan.from_json(json_object: compliance_plan)
  end
  if parsed_json["analysisPlan"].nil?
    analysis_plan = nil
  else
    analysis_plan = parsed_json["analysisPlan"].to_json
    analysis_plan = Vapi::AnalysisPlan.from_json(json_object: analysis_plan)
  end
  if parsed_json["artifactPlan"].nil?
    artifact_plan = nil
  else
    artifact_plan = parsed_json["artifactPlan"].to_json
    artifact_plan = Vapi::ArtifactPlan.from_json(json_object: artifact_plan)
  end
  if parsed_json["startSpeakingPlan"].nil?
    start_speaking_plan = nil
  else
    start_speaking_plan = parsed_json["startSpeakingPlan"].to_json
    start_speaking_plan = Vapi::StartSpeakingPlan.from_json(json_object: start_speaking_plan)
  end
  if parsed_json["stopSpeakingPlan"].nil?
    stop_speaking_plan = nil
  else
    stop_speaking_plan = parsed_json["stopSpeakingPlan"].to_json
    stop_speaking_plan = Vapi::StopSpeakingPlan.from_json(json_object: stop_speaking_plan)
  end
  if parsed_json["monitorPlan"].nil?
    monitor_plan = nil
  else
    monitor_plan = parsed_json["monitorPlan"].to_json
    monitor_plan = Vapi::MonitorPlan.from_json(json_object: monitor_plan)
  end
  if parsed_json["backgroundSpeechDenoisingPlan"].nil?
    background_speech_denoising_plan = nil
  else
    background_speech_denoising_plan = parsed_json["backgroundSpeechDenoisingPlan"].to_json
    background_speech_denoising_plan = Vapi::BackgroundSpeechDenoisingPlan.from_json(json_object: background_speech_denoising_plan)
  end
  credential_ids = parsed_json["credentialIds"]
  new(
    nodes: nodes,
    transcriber: transcriber,
    voice: voice,
    observability_plan: observability_plan,
    background_sound: background_sound,
    credentials: credentials,
    id: id,
    org_id: org_id,
    created_at: created_at,
    updated_at: updated_at,
    name: name,
    edges: edges,
    global_prompt: global_prompt,
    server: server,
    compliance_plan: compliance_plan,
    analysis_plan: analysis_plan,
    artifact_plan: artifact_plan,
    start_speaking_plan: start_speaking_plan,
    stop_speaking_plan: stop_speaking_plan,
    monitor_plan: monitor_plan,
    background_speech_denoising_plan: background_speech_denoising_plan,
    credential_ids: credential_ids,
    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)


377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/vapi_server_sdk/types/workflow.rb', line 377

def self.validate_raw(obj:)
  obj.nodes.is_a?(Array) != false || raise("Passed value for field obj.nodes is not the expected type, validation failed.")
  obj.transcriber.nil? || Vapi::WorkflowTranscriber.validate_raw(obj: obj.transcriber)
  obj.voice.nil? || Vapi::WorkflowVoice.validate_raw(obj: obj.voice)
  obj.observability_plan.nil? || Vapi::LangfuseObservabilityPlan.validate_raw(obj: obj.observability_plan)
  obj.background_sound.nil? || Vapi::WorkflowBackgroundSound.validate_raw(obj: obj.background_sound)
  obj.credentials&.is_a?(Array) != false || raise("Passed value for field obj.credentials is not the expected type, validation failed.")
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.edges.is_a?(Array) != false || raise("Passed value for field obj.edges is not the expected type, validation failed.")
  obj.global_prompt&.is_a?(String) != false || raise("Passed value for field obj.global_prompt is not the expected type, validation failed.")
  obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
  obj.compliance_plan.nil? || Vapi::CompliancePlan.validate_raw(obj: obj.compliance_plan)
  obj.analysis_plan.nil? || Vapi::AnalysisPlan.validate_raw(obj: obj.analysis_plan)
  obj.artifact_plan.nil? || Vapi::ArtifactPlan.validate_raw(obj: obj.artifact_plan)
  obj.start_speaking_plan.nil? || Vapi::StartSpeakingPlan.validate_raw(obj: obj.start_speaking_plan)
  obj.stop_speaking_plan.nil? || Vapi::StopSpeakingPlan.validate_raw(obj: obj.stop_speaking_plan)
  obj.monitor_plan.nil? || Vapi::MonitorPlan.validate_raw(obj: obj.monitor_plan)
  obj.background_speech_denoising_plan.nil? || Vapi::BackgroundSpeechDenoisingPlan.validate_raw(obj: obj.background_speech_denoising_plan)
  obj.credential_ids&.is_a?(Array) != false || raise("Passed value for field obj.credential_ids is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Workflow to a JSON object

Returns:

  • (String)


367
368
369
# File 'lib/vapi_server_sdk/types/workflow.rb', line 367

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