vapi_client/models/
create_session_dto.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 CreateSessionDto {
16    /// This is a user-defined name for the session. Maximum length is 40 characters.
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// This is the current status of the session. Can be either 'active' or 'completed'.
20    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
21    pub status: Option<StatusTrue>,
22    /// Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.
23    #[serde(rename = "expirationSeconds", skip_serializing_if = "Option::is_none")]
24    pub expiration_seconds: Option<f64>,
25    /// This is the ID of the assistant associated with this session. Use this when referencing an existing assistant.
26    #[serde(rename = "assistantId", skip_serializing_if = "Option::is_none")]
27    pub assistant_id: Option<String>,
28    /// This is the assistant configuration for this session. Use this when creating a new assistant configuration. If assistantId is provided, this will be ignored.
29    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
30    pub assistant: Option<models::CreateAssistantDto>,
31    /// This is an array of chat messages in the session.
32    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
33    pub messages: Option<Vec<models::MessageArrayInner>>,
34    /// This is the customer information associated with this session.
35    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
36    pub customer: Option<models::CreateCustomerDto>,
37    /// This is the ID of the phone number associated with this session.
38    #[serde(rename = "phoneNumberId", skip_serializing_if = "Option::is_none")]
39    pub phone_number_id: Option<String>,
40    /// This is the phone number configuration for this session.
41    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
42    pub phone_number: Option<models::ImportTwilioPhoneNumberDto>,
43}
44
45impl CreateSessionDto {
46    pub fn new() -> CreateSessionDto {
47        CreateSessionDto {
48            name: None,
49            status: None,
50            expiration_seconds: None,
51            assistant_id: None,
52            assistant: None,
53            messages: None,
54            customer: None,
55            phone_number_id: None,
56            phone_number: None,
57        }
58    }
59}
60/// This is the current status of the session. Can be either 'active' or 'completed'.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum StatusTrue {
63    #[serde(rename = "active")]
64    Active,
65    #[serde(rename = "completed")]
66    Completed,
67}
68
69impl Default for StatusTrue {
70    fn default() -> StatusTrue {
71        Self::Active
72    }
73}