Class: Vapi::ServerMessageResponseAssistantRequest
- Inherits:
-
Object
- Object
- Vapi::ServerMessageResponseAssistantRequest
- Defined in:
- lib/vapi_server_sdk/types/server_message_response_assistant_request.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 that will be used for the call.
-
#assistant_overrides ⇒ Vapi::AssistantOverrides
readonly
These are the overrides for the ‘assistant` or `assistantId`’s settings and template variables.
-
#destination ⇒ Vapi::ServerMessageResponseAssistantRequestDestination
readonly
This is the destination to transfer the inbound call to.
-
#error ⇒ String
readonly
This is the error if the call shouldn’t be accepted.
-
#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.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::ServerMessageResponseAssistantRequest
Deserialize a JSON object to an instance of ServerMessageResponseAssistantRequest.
-
.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(destination: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, error: OMIT, additional_properties: nil) ⇒ Vapi::ServerMessageResponseAssistantRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ServerMessageResponseAssistantRequest to a JSON object.
Constructor Details
#initialize(destination: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, error: OMIT, additional_properties: nil) ⇒ Vapi::ServerMessageResponseAssistantRequest
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 69 def initialize(destination: OMIT, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, squad_id: OMIT, squad: OMIT, error: OMIT, additional_properties: nil) @destination = destination if destination != 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 @error = error if error != OMIT @additional_properties = additional_properties @_field_set = { "destination": destination, "assistantId": assistant_id, "assistant": assistant, "assistantOverrides": assistant_overrides, "squadId": squad_id, "squad": squad, "error": error }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
40 41 42 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 40 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. If you’re unsure why you’re getting an invalid assistant, try logging your response and send the JSON blob to POST /assistant which will return the validation errors.
24 25 26 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 24 def assistant @assistant end |
#assistant_id ⇒ String (readonly)
Returns This is the assistant that will be used for the call. To use a transient assistant, use ‘assistant` instead.
18 19 20 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 18 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.
27 28 29 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 27 def assistant_overrides @assistant_overrides end |
#destination ⇒ Vapi::ServerMessageResponseAssistantRequestDestination (readonly)
Returns This is the destination to transfer the inbound call to. This will immediately transfer without using any assistants. If this is sent, ‘assistantId`, `assistant`, `squadId`, and `squad` are ignored.
15 16 17 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 15 def destination @destination end |
#error ⇒ String (readonly)
Returns This is the error if the call shouldn’t be accepted. This is spoken to the customer. If this is sent, ‘assistantId`, `assistant`, `squadId`, `squad`, and `destination` are ignored.
38 39 40 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 38 def error @error 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.
33 34 35 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 33 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.
30 31 32 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 30 def squad_id @squad_id end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::ServerMessageResponseAssistantRequest
Deserialize a JSON object to an instance of
ServerMessageResponseAssistantRequest
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 97 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["destination"].nil? destination = nil else destination = parsed_json["destination"].to_json destination = Vapi::ServerMessageResponseAssistantRequestDestination.from_json(json_object: destination) end 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 error = parsed_json["error"] new( destination: destination, assistant_id: assistant_id, assistant: assistant, assistant_overrides: assistant_overrides, squad_id: squad_id, squad: squad, error: error, 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.
152 153 154 155 156 157 158 159 160 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 152 def self.validate_raw(obj:) obj.destination.nil? || Vapi::ServerMessageResponseAssistantRequestDestination.validate_raw(obj: obj.destination) 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.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ServerMessageResponseAssistantRequest to a JSON object
142 143 144 |
# File 'lib/vapi_server_sdk/types/server_message_response_assistant_request.rb', line 142 def to_json(*_args) @_field_set&.to_json end |