vapi_client/models/
client_message_tool_calls_result.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClientMessageToolCallsResult {
16    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
17    pub phone_number: Option<models::ClientMessageWorkflowNodeStartedPhoneNumber>,
18    /// This is the type of the message. \"tool-calls-result\" is sent to forward the result of a tool call to the client.
19    #[serde(rename = "type")]
20    pub r#type: TypeTrue,
21    /// This is the timestamp of the message.
22    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
23    pub timestamp: Option<f64>,
24    /// This is the call that the message is associated with.
25    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
26    pub call: Option<models::Call>,
27    /// This is the customer that the message is associated with.
28    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
29    pub customer: Option<models::CreateCustomerDto>,
30    /// This is the assistant that the message is associated with.
31    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
32    pub assistant: Option<models::CreateAssistantDto>,
33    /// This is the result of the tool call.
34    #[serde(rename = "toolCallResult")]
35    pub tool_call_result: serde_json::Value,
36}
37
38impl ClientMessageToolCallsResult {
39    pub fn new(
40        r#type: TypeTrue,
41        tool_call_result: serde_json::Value,
42    ) -> ClientMessageToolCallsResult {
43        ClientMessageToolCallsResult {
44            phone_number: None,
45            r#type,
46            timestamp: None,
47            call: None,
48            customer: None,
49            assistant: None,
50            tool_call_result,
51        }
52    }
53}
54/// This is the type of the message. \"tool-calls-result\" is sent to forward the result of a tool call to the client.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum TypeTrue {
57    #[serde(rename = "tool-calls-result")]
58    ToolCallsResult,
59}
60
61impl Default for TypeTrue {
62    fn default() -> TypeTrue {
63        Self::ToolCallsResult
64    }
65}