vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TestSuiteTestChat {
    /// These are the scorers used to evaluate the test.
    #[serde(rename = "scorers")]
    pub scorers: Vec<models::TestSuiteTestVoiceScorersInner>,
    /// This is the type of the test, which must be chat.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the unique identifier for the test.
    #[serde(rename = "id")]
    pub id: String,
    /// This is the unique identifier for the test suite this test belongs to.
    #[serde(rename = "testSuiteId")]
    pub test_suite_id: String,
    /// This is the unique identifier for the organization this test belongs to.
    #[serde(rename = "orgId")]
    pub org_id: String,
    /// This is the ISO 8601 date-time string of when the test was created.
    #[serde(rename = "createdAt")]
    pub created_at: String,
    /// This is the ISO 8601 date-time string of when the test was last updated.
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
    /// This is the name of the test.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// This is the script to be used for the chat test.
    #[serde(rename = "script")]
    pub script: String,
    /// This is the number of attempts allowed for the test.
    #[serde(rename = "numAttempts", skip_serializing_if = "Option::is_none")]
    pub num_attempts: Option<f64>,
}

impl TestSuiteTestChat {
    pub fn new(
        scorers: Vec<models::TestSuiteTestVoiceScorersInner>,
        r#type: TypeTrue,
        id: String,
        test_suite_id: String,
        org_id: String,
        created_at: String,
        updated_at: String,
        script: String,
    ) -> TestSuiteTestChat {
        TestSuiteTestChat {
            scorers,
            r#type,
            id,
            test_suite_id,
            org_id,
            created_at,
            updated_at,
            name: None,
            script,
            num_attempts: None,
        }
    }
}
/// This is the type of the test, which must be chat.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "chat")]
    Chat,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Chat
    }
}