Class: Vapi::CreateWorkflowDto
- Inherits:
-
Object
- Object
- Vapi::CreateWorkflowDto
- Defined in:
- lib/vapi_server_sdk/types/create_workflow_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#analysis_plan ⇒ Vapi::AnalysisPlan
readonly
This is the plan for analysis of workflow’s calls.
-
#artifact_plan ⇒ Vapi::ArtifactPlan
readonly
This is the plan for artifacts generated during workflow’s calls.
-
#background_sound ⇒ Vapi::CreateWorkflowDtoBackgroundSound
readonly
This is the background sound in the call.
-
#background_speech_denoising_plan ⇒ Vapi::BackgroundSpeechDenoisingPlan
readonly
This enables filtering of noise and background speech while the user is talking.
-
#compliance_plan ⇒ Vapi::CompliancePlan
readonly
This is the compliance plan for the workflow.
-
#credential_ids ⇒ Array<String>
readonly
These are the credentials that will be used for the workflow calls.
-
#credentials ⇒ Array<Vapi::CreateWorkflowDtoCredentialsItem>
readonly
These are dynamic credentials that will be used for the workflow calls.
- #edges ⇒ Array<Vapi::Edge> readonly
- #global_prompt ⇒ String readonly
-
#monitor_plan ⇒ Vapi::MonitorPlan
readonly
This is the plan for real-time monitoring of the workflow’s calls.
- #name ⇒ String readonly
- #nodes ⇒ Array<Vapi::CreateWorkflowDtoNodesItem> readonly
-
#observability_plan ⇒ Vapi::LangfuseObservabilityPlan
readonly
This is the plan for observability of workflow’s calls.
-
#server ⇒ Vapi::Server
readonly
This is where Vapi will send webhooks.
-
#start_speaking_plan ⇒ Vapi::StartSpeakingPlan
readonly
This is the plan for when the workflow nodes should start talking.
-
#stop_speaking_plan ⇒ Vapi::StopSpeakingPlan
readonly
This is the plan for when workflow nodes should stop talking on customer interruption.
-
#transcriber ⇒ Vapi::CreateWorkflowDtoTranscriber
readonly
This is the transcriber for the workflow.
-
#voice ⇒ Vapi::CreateWorkflowDtoVoice
readonly
This is the voice for the workflow.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateWorkflowDto
Deserialize a JSON object to an instance of CreateWorkflowDto.
-
.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(nodes:, 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::CreateWorkflowDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateWorkflowDto to a JSON object.
Constructor Details
#initialize(nodes:, 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::CreateWorkflowDto
173 174 175 176 177 178 179 180 181 182 183 184 185 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 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 173 def initialize(nodes:, 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 @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, "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_properties ⇒ OpenStruct (readonly)
103 104 105 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 103 def additional_properties @additional_properties end |
#analysis_plan ⇒ Vapi::AnalysisPlan (readonly)
61 62 63 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 61 def analysis_plan @analysis_plan end |
#artifact_plan ⇒ Vapi::ArtifactPlan (readonly)
64 65 66 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 64 def artifact_plan @artifact_plan end |
#background_sound ⇒ Vapi::CreateWorkflowDtoBackgroundSound (readonly)
37 38 39 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 37 def background_sound @background_sound end |
#background_speech_denoising_plan ⇒ Vapi::BackgroundSpeechDenoisingPlan (readonly)
97 98 99 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 97 def background_speech_denoising_plan @background_speech_denoising_plan end |
#compliance_plan ⇒ Vapi::CompliancePlan (readonly)
59 60 61 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 59 def compliance_plan @compliance_plan end |
#credential_ids ⇒ Array<String> (readonly)
101 102 103 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 101 def credential_ids @credential_ids end |
#credentials ⇒ Array<Vapi::CreateWorkflowDtoCredentialsItem> (readonly)
42 43 44 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 42 def credentials @credentials end |
#edges ⇒ Array<Vapi::Edge> (readonly)
46 47 48 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 46 def edges @edges end |
#global_prompt ⇒ String (readonly)
48 49 50 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 48 def global_prompt @global_prompt end |
#monitor_plan ⇒ Vapi::MonitorPlan (readonly)
89 90 91 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 89 def monitor_plan @monitor_plan end |
#name ⇒ String (readonly)
44 45 46 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 44 def name @name end |
#nodes ⇒ Array<Vapi::CreateWorkflowDtoNodesItem> (readonly)
24 25 26 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 24 def nodes @nodes end |
#observability_plan ⇒ Vapi::LangfuseObservabilityPlan (readonly)
33 34 35 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 33 def observability_plan @observability_plan end |
#server ⇒ Vapi::Server (readonly)
56 57 58 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 56 def server @server end |
#start_speaking_plan ⇒ Vapi::StartSpeakingPlan (readonly)
72 73 74 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 72 def start_speaking_plan @start_speaking_plan end |
#stop_speaking_plan ⇒ Vapi::StopSpeakingPlan (readonly)
82 83 84 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 82 def stop_speaking_plan @stop_speaking_plan end |
#transcriber ⇒ Vapi::CreateWorkflowDtoTranscriber (readonly)
27 28 29 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 27 def transcriber @transcriber end |
#voice ⇒ Vapi::CreateWorkflowDtoVoice (readonly)
30 31 32 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 30 def voice @voice end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateWorkflowDto
Deserialize a JSON object to an instance of CreateWorkflowDto
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 222 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::CreateWorkflowDtoNodesItem.from_json(json_object: item) end if parsed_json["transcriber"].nil? transcriber = nil else transcriber = parsed_json["transcriber"].to_json transcriber = Vapi::CreateWorkflowDtoTranscriber.from_json(json_object: transcriber) end if parsed_json["voice"].nil? voice = nil else voice = parsed_json["voice"].to_json voice = Vapi::CreateWorkflowDtoVoice.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::CreateWorkflowDtoBackgroundSound.from_json(json_object: background_sound) end credentials = parsed_json["credentials"]&.map do |item| item = item.to_json Vapi::CreateWorkflowDtoCredentialsItem.from_json(json_object: item) end 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, 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.
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 348 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::CreateWorkflowDtoTranscriber.validate_raw(obj: obj.transcriber) obj.voice.nil? || Vapi::CreateWorkflowDtoVoice.validate_raw(obj: obj.voice) obj.observability_plan.nil? || Vapi::LangfuseObservabilityPlan.validate_raw(obj: obj.observability_plan) obj.background_sound.nil? || Vapi::CreateWorkflowDtoBackgroundSound.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.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 CreateWorkflowDto to a JSON object
338 339 340 |
# File 'lib/vapi_server_sdk/types/create_workflow_dto.rb', line 338 def to_json(*_args) @_field_set&.to_json end |