Class: Vapi::CreateWebCallDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, workflow_id: OMIT, workflow: OMIT, workflow_overrides: OMIT, additional_properties: nil) ⇒ Vapi::CreateWebCallDto

Parameters:

  • assistant_id (String) (defaults to: OMIT)

    This is the assistant ID that will be used for the call. To use a transient assistant, use ‘assistant` instead. To start a call with:

    • Assistant, use ‘assistantId` or `assistant`

    • Squad, use ‘squadId` or `squad`

    • Workflow, use ‘workflowId` or `workflow`

  • assistant (Vapi::CreateAssistantDto) (defaults to: OMIT)

    This is the assistant that will be used for the call. To use an existing assistant, use ‘assistantId` instead. To start a call with:

    • Assistant, use ‘assistant`

    • Squad, use ‘squad`

    • Workflow, use ‘workflow`

  • assistant_overrides (Vapi::AssistantOverrides) (defaults to: OMIT)

    These are the overrides for the ‘assistant` or `assistantId`’s settings and template variables.

  • squad_id (String) (defaults to: OMIT)

    This is the squad that will be used for the call. To use a transient squad, use ‘squad` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`

  • squad (Vapi::CreateSquadDto) (defaults to: OMIT)

    This is a squad that will be used for the call. To use an existing squad, use ‘squadId` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`

  • workflow_id (String) (defaults to: OMIT)

    This is the workflow that will be used for the call. To use a transient workflow, use ‘workflow` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`

  • workflow (Vapi::CreateWorkflowDto) (defaults to: OMIT)

    This is a workflow that will be used for the call. To use an existing workflow, use ‘workflowId` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`

  • workflow_overrides (Vapi::WorkflowOverrides) (defaults to: OMIT)

    These are the overrides for the ‘workflow` or `workflowId`’s settings and template variables.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 111

def initialize(assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT,
               workflow_id: OMIT, workflow: OMIT, workflow_overrides: OMIT, additional_properties: nil)
  @assistant_id = assistant_id if assistant_id != OMIT
  @assistant = assistant if assistant != OMIT
  @assistant_overrides = assistant_overrides if assistant_overrides != OMIT
  @squad_id = squad_id if squad_id != OMIT
  @squad = squad if squad != OMIT
  @workflow_id = workflow_id if workflow_id != OMIT
  @workflow = workflow if workflow != OMIT
  @workflow_overrides = workflow_overrides if workflow_overrides != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "assistantId": assistant_id,
    "assistant": assistant,
    "assistantOverrides": assistant_overrides,
    "squadId": squad_id,
    "squad": squad,
    "workflowId": workflow_id,
    "workflow": workflow,
    "workflowOverrides": workflow_overrides
  }.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



62
63
64
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 62

def additional_properties
  @additional_properties
end

#assistantVapi::CreateAssistantDto (readonly)

Returns This is the assistant that will be used for the call. To use an existing assistant, use ‘assistantId` instead. To start a call with:

  • Assistant, use ‘assistant`

  • Squad, use ‘squad`

  • Workflow, use ‘workflow`.

Returns:

  • (Vapi::CreateAssistantDto)

    This is the assistant that will be used for the call. To use an existing assistant, use ‘assistantId` instead. To start a call with:

    • Assistant, use ‘assistant`

    • Squad, use ‘squad`

    • Workflow, use ‘workflow`



26
27
28
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 26

def assistant
  @assistant
end

#assistant_idString (readonly)

Returns This is the assistant ID that will be used for the call. To use a transient assistant, use ‘assistant` instead. To start a call with:

  • Assistant, use ‘assistantId` or `assistant`

  • Squad, use ‘squadId` or `squad`

  • Workflow, use ‘workflowId` or `workflow`.

Returns:

  • (String)

    This is the assistant ID that will be used for the call. To use a transient assistant, use ‘assistant` instead. To start a call with:

    • Assistant, use ‘assistantId` or `assistant`

    • Squad, use ‘squadId` or `squad`

    • Workflow, use ‘workflowId` or `workflow`



19
20
21
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 19

def assistant_id
  @assistant_id
end

#assistant_overridesVapi::AssistantOverrides (readonly)

Returns These are the overrides for the ‘assistant` or `assistantId`’s settings and template variables.

Returns:

  • (Vapi::AssistantOverrides)

    These are the overrides for the ‘assistant` or `assistantId`’s settings and template variables.



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

def assistant_overrides
  @assistant_overrides
end

#squadVapi::CreateSquadDto (readonly)

Returns This is a squad that will be used for the call. To use an existing squad, use ‘squadId` instead. To start a call with:

  • Assistant, use ‘assistant` or `assistantId`

  • Squad, use ‘squad` or `squadId`

  • Workflow, use ‘workflow` or `workflowId`.

Returns:

  • (Vapi::CreateSquadDto)

    This is a squad that will be used for the call. To use an existing squad, use ‘squadId` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`



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

def squad
  @squad
end

#squad_idString (readonly)

Returns This is the squad that will be used for the call. To use a transient squad, use ‘squad` instead. To start a call with:

  • Assistant, use ‘assistant` or `assistantId`

  • Squad, use ‘squad` or `squadId`

  • Workflow, use ‘workflow` or `workflowId`.

Returns:

  • (String)

    This is the squad that will be used for the call. To use a transient squad, use ‘squad` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`



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

def squad_id
  @squad_id
end

#workflowVapi::CreateWorkflowDto (readonly)

Returns This is a workflow that will be used for the call. To use an existing workflow, use ‘workflowId` instead. To start a call with:

  • Assistant, use ‘assistant` or `assistantId`

  • Squad, use ‘squad` or `squadId`

  • Workflow, use ‘workflow` or `workflowId`.

Returns:

  • (Vapi::CreateWorkflowDto)

    This is a workflow that will be used for the call. To use an existing workflow, use ‘workflowId` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`



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

def workflow
  @workflow
end

#workflow_idString (readonly)

Returns This is the workflow that will be used for the call. To use a transient workflow, use ‘workflow` instead. To start a call with:

  • Assistant, use ‘assistant` or `assistantId`

  • Squad, use ‘squad` or `squadId`

  • Workflow, use ‘workflow` or `workflowId`.

Returns:

  • (String)

    This is the workflow that will be used for the call. To use a transient workflow, use ‘workflow` instead. To start a call with:

    • Assistant, use ‘assistant` or `assistantId`

    • Squad, use ‘squad` or `squadId`

    • Workflow, use ‘workflow` or `workflowId`



50
51
52
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 50

def workflow_id
  @workflow_id
end

#workflow_overridesVapi::WorkflowOverrides (readonly)

Returns These are the overrides for the ‘workflow` or `workflowId`’s settings and template variables.

Returns:

  • (Vapi::WorkflowOverrides)

    These are the overrides for the ‘workflow` or `workflowId`’s settings and template variables.



60
61
62
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 60

def workflow_overrides
  @workflow_overrides
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CreateWebCallDto

Deserialize a JSON object to an instance of CreateWebCallDto

Parameters:

  • json_object (String)

Returns:



140
141
142
143
144
145
146
147
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 140

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  assistant_id = parsed_json["assistantId"]
  if parsed_json["assistant"].nil?
    assistant = nil
  else
    assistant = parsed_json["assistant"].to_json
    assistant = Vapi::CreateAssistantDto.from_json(json_object: assistant)
  end
  if parsed_json["assistantOverrides"].nil?
    assistant_overrides = nil
  else
    assistant_overrides = parsed_json["assistantOverrides"].to_json
    assistant_overrides = Vapi::AssistantOverrides.from_json(json_object: assistant_overrides)
  end
  squad_id = parsed_json["squadId"]
  if parsed_json["squad"].nil?
    squad = nil
  else
    squad = parsed_json["squad"].to_json
    squad = Vapi::CreateSquadDto.from_json(json_object: squad)
  end
  workflow_id = parsed_json["workflowId"]
  if parsed_json["workflow"].nil?
    workflow = nil
  else
    workflow = parsed_json["workflow"].to_json
    workflow = Vapi::CreateWorkflowDto.from_json(json_object: workflow)
  end
  if parsed_json["workflowOverrides"].nil?
    workflow_overrides = nil
  else
    workflow_overrides = parsed_json["workflowOverrides"].to_json
    workflow_overrides = Vapi::WorkflowOverrides.from_json(json_object: workflow_overrides)
  end
  new(
    assistant_id: assistant_id,
    assistant: assistant,
    assistant_overrides: assistant_overrides,
    squad_id: squad_id,
    squad: squad,
    workflow_id: workflow_id,
    workflow: workflow,
    workflow_overrides: workflow_overrides,
    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)


202
203
204
205
206
207
208
209
210
211
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 202

def self.validate_raw(obj:)
  obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
  obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
  obj.assistant_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.assistant_overrides)
  obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
  obj.squad.nil? || Vapi::CreateSquadDto.validate_raw(obj: obj.squad)
  obj.workflow_id&.is_a?(String) != false || raise("Passed value for field obj.workflow_id is not the expected type, validation failed.")
  obj.workflow.nil? || Vapi::CreateWorkflowDto.validate_raw(obj: obj.workflow)
  obj.workflow_overrides.nil? || Vapi::WorkflowOverrides.validate_raw(obj: obj.workflow_overrides)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CreateWebCallDto to a JSON object

Returns:

  • (String)


192
193
194
# File 'lib/vapi_server_sdk/types/create_web_call_dto.rb', line 192

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