Class: Vapi::CreateOutboundCallDto
- Inherits:
-
Object
- Object
- Vapi::CreateOutboundCallDto
- Defined in:
- lib/vapi_server_sdk/types/create_outbound_call_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#assistant ⇒ Vapi::CreateAssistantDto
readonly
This is the assistant that will be used for the call.
-
#assistant_id ⇒ String
readonly
This is the assistant ID that will be used for the call.
-
#assistant_overrides ⇒ Vapi::AssistantOverrides
readonly
These are the overrides for the
assistantorassistantId‘s settings and template variables. -
#customer ⇒ Vapi::CreateCustomerDto
readonly
This is the customer that will be called.
-
#customer_id ⇒ String
readonly
This is the customer that will be called.
-
#customers ⇒ Array<Vapi::CreateCustomerDto>
readonly
This is used to issue batch calls to multiple customers.
-
#name ⇒ String
readonly
This is the name of the call.
-
#phone_number ⇒ Vapi::ImportTwilioPhoneNumberDto
readonly
This is the phone number that will be used for the call.
-
#phone_number_id ⇒ String
readonly
This is the phone number that will be used for the call.
-
#schedule_plan ⇒ Vapi::SchedulePlan
readonly
This is the schedule plan of the call.
-
#squad ⇒ Vapi::CreateSquadDto
readonly
This is a squad that will be used for the call.
-
#squad_id ⇒ String
readonly
This is the squad that will be used for the call.
-
#transport ⇒ Hash{String => Object}
readonly
This is the transport of the call.
-
#workflow ⇒ Vapi::CreateWorkflowDto
readonly
This is a workflow that will be used for the call.
-
#workflow_id ⇒ String
readonly
This is the workflow that will be used for the call.
-
#workflow_overrides ⇒ Vapi::WorkflowOverrides
readonly
These are the overrides for the
workfloworworkflowId‘s settings and template variables.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateOutboundCallDto
Deserialize a JSON object to an instance of CreateOutboundCallDto.
-
.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(customers: OMIT, name: OMIT, schedule_plan: OMIT, transport: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, workflow_id: OMIT, workflow: OMIT, workflow_overrides: OMIT, phone_number_id: OMIT, phone_number: OMIT, customer_id: OMIT, customer: OMIT, additional_properties: nil) ⇒ Vapi::CreateOutboundCallDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateOutboundCallDto to a JSON object.
Constructor Details
#initialize(customers: OMIT, name: OMIT, schedule_plan: OMIT, transport: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, workflow_id: OMIT, workflow: OMIT, workflow_overrides: OMIT, phone_number_id: OMIT, phone_number: OMIT, customer_id: OMIT, customer: OMIT, additional_properties: nil) ⇒ Vapi::CreateOutboundCallDto
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 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 158 def initialize(customers: OMIT, name: OMIT, schedule_plan: OMIT, transport: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, workflow_id: OMIT, workflow: OMIT, workflow_overrides: OMIT, phone_number_id: OMIT, phone_number: OMIT, customer_id: OMIT, customer: OMIT, additional_properties: nil) @customers = customers if customers != OMIT @name = name if name != OMIT @schedule_plan = schedule_plan if schedule_plan != OMIT @transport = transport if transport != OMIT @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 @phone_number_id = phone_number_id if phone_number_id != OMIT @phone_number = phone_number if phone_number != OMIT @customer_id = customer_id if customer_id != OMIT @customer = customer if customer != OMIT @additional_properties = additional_properties @_field_set = { "customers": customers, "name": name, "schedulePlan": schedule_plan, "transport": transport, "assistantId": assistant_id, "assistant": assistant, "assistantOverrides": assistant_overrides, "squadId": squad_id, "squad": squad, "workflowId": workflow_id, "workflow": workflow, "workflowOverrides": workflow_overrides, "phoneNumberId": phone_number_id, "phoneNumber": phone_number, "customerId": customer_id, "customer": customer }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
91 92 93 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 91 def additional_properties @additional_properties end |
#assistant ⇒ Vapi::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.
39 40 41 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 39 def assistant @assistant end |
#assistant_id ⇒ String (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
assistantIdorassistant -
Squad, use
squadIdorsquad -
Workflow, use
workflowIdorworkflow.
32 33 34 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 32 def assistant_id @assistant_id end |
#assistant_overrides ⇒ Vapi::AssistantOverrides (readonly)
Returns These are the overrides for the assistant or assistantId‘s settings and template variables.
42 43 44 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 42 def assistant_overrides @assistant_overrides end |
#customer ⇒ Vapi::CreateCustomerDto (readonly)
Returns This is the customer that will be called. To call an existing customer, use customerId instead. Only relevant for outboundPhoneCall and inboundPhoneCall type.
89 90 91 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 89 def customer @customer end |
#customer_id ⇒ String (readonly)
Returns This is the customer that will be called. To call a transient customer , use customer instead. Only relevant for outboundPhoneCall and inboundPhoneCall type.
85 86 87 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 85 def customer_id @customer_id end |
#customers ⇒ Array<Vapi::CreateCustomerDto> (readonly)
Returns This is used to issue batch calls to multiple customers. Only relevant for outboundPhoneCall. To call a single customer, use customer instead.
19 20 21 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 19 def customers @customers end |
#name ⇒ String (readonly)
Returns This is the name of the call. This is just for your own reference.
21 22 23 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 21 def name @name end |
#phone_number ⇒ Vapi::ImportTwilioPhoneNumberDto (readonly)
Returns This is the phone number that will be used for the call. To use an existing number, use phoneNumberId instead. Only relevant for outboundPhoneCall and inboundPhoneCall type.
81 82 83 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 81 def phone_number @phone_number end |
#phone_number_id ⇒ String (readonly)
Returns This is the phone number that will be used for the call. To use a transient number, use phoneNumber instead. Only relevant for outboundPhoneCall and inboundPhoneCall type.
77 78 79 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 77 def phone_number_id @phone_number_id end |
#schedule_plan ⇒ Vapi::SchedulePlan (readonly)
Returns This is the schedule plan of the call.
23 24 25 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 23 def schedule_plan @schedule_plan end |
#squad ⇒ Vapi::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
assistantorassistantId -
Squad, use
squadorsquadId -
Workflow, use
workfloworworkflowId.
56 57 58 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 56 def squad @squad end |
#squad_id ⇒ String (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
assistantorassistantId -
Squad, use
squadorsquadId -
Workflow, use
workfloworworkflowId.
49 50 51 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 49 def squad_id @squad_id end |
#transport ⇒ Hash{String => Object} (readonly)
Returns This is the transport of the call.
25 26 27 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 25 def transport @transport end |
#workflow ⇒ Vapi::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
assistantorassistantId -
Squad, use
squadorsquadId -
Workflow, use
workfloworworkflowId.
70 71 72 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 70 def workflow @workflow end |
#workflow_id ⇒ String (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
assistantorassistantId -
Squad, use
squadorsquadId -
Workflow, use
workfloworworkflowId.
63 64 65 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 63 def workflow_id @workflow_id end |
#workflow_overrides ⇒ Vapi::WorkflowOverrides (readonly)
Returns These are the overrides for the workflow or workflowId‘s settings and template variables.
73 74 75 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 73 def workflow_overrides @workflow_overrides end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateOutboundCallDto
Deserialize a JSON object to an instance of CreateOutboundCallDto
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 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 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 203 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) customers = parsed_json["customers"]&.map do |item| item = item.to_json Vapi::CreateCustomerDto.from_json(json_object: item) end name = parsed_json["name"] if parsed_json["schedulePlan"].nil? schedule_plan = nil else schedule_plan = parsed_json["schedulePlan"].to_json schedule_plan = Vapi::SchedulePlan.from_json(json_object: schedule_plan) end transport = parsed_json["transport"] 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 phone_number_id = parsed_json["phoneNumberId"] if parsed_json["phoneNumber"].nil? phone_number = nil else phone_number = parsed_json["phoneNumber"].to_json phone_number = Vapi::ImportTwilioPhoneNumberDto.from_json(json_object: phone_number) end customer_id = parsed_json["customerId"] if parsed_json["customer"].nil? customer = nil else customer = parsed_json["customer"].to_json customer = Vapi::CreateCustomerDto.from_json(json_object: customer) end new( customers: customers, name: name, schedule_plan: schedule_plan, transport: transport, 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, phone_number_id: phone_number_id, phone_number: phone_number, customer_id: customer_id, customer: customer, 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.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 299 def self.validate_raw(obj:) obj.customers&.is_a?(Array) != false || raise("Passed value for field obj.customers 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.schedule_plan.nil? || Vapi::SchedulePlan.validate_raw(obj: obj.schedule_plan) obj.transport&.is_a?(Hash) != false || raise("Passed value for field obj.transport is not the expected type, validation failed.") 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) obj.phone_number_id&.is_a?(String) != false || raise("Passed value for field obj.phone_number_id is not the expected type, validation failed.") obj.phone_number.nil? || Vapi::ImportTwilioPhoneNumberDto.validate_raw(obj: obj.phone_number) obj.customer_id&.is_a?(String) != false || raise("Passed value for field obj.customer_id is not the expected type, validation failed.") obj.customer.nil? || Vapi::CreateCustomerDto.validate_raw(obj: obj.customer) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateOutboundCallDto to a JSON object
289 290 291 |
# File 'lib/vapi_server_sdk/types/create_outbound_call_dto.rb', line 289 def to_json(*_args) @_field_set&.to_json end |