vapi_client/models/
test_suite_test_voice.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct TestSuiteTestVoice {
19    /// These are the scorers used to evaluate the test.
20    #[serde(rename = "scorers")]
21    pub scorers: Vec<models::TestSuiteTestVoiceScorersInner>,
22    /// This is the type of the test, which must be voice.
23    #[serde(rename = "type")]
24    pub r#type: Type,
25    /// This is the unique identifier for the test.
26    #[serde(rename = "id")]
27    pub id: String,
28    /// This is the unique identifier for the test suite this test belongs to.
29    #[serde(rename = "testSuiteId")]
30    pub test_suite_id: String,
31    /// This is the unique identifier for the organization this test belongs to.
32    #[serde(rename = "orgId")]
33    pub org_id: String,
34    /// This is the ISO 8601 date-time string of when the test was created.
35    #[serde(rename = "createdAt")]
36    pub created_at: String,
37    /// This is the ISO 8601 date-time string of when the test was last updated.
38    #[serde(rename = "updatedAt")]
39    pub updated_at: String,
40    /// This is the name of the test.
41    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
42    pub name: Option<String>,
43    /// This is the script to be used for the voice test.
44    #[serde(rename = "script")]
45    pub script: String,
46    /// This is the number of attempts allowed for the test.
47    #[serde(rename = "numAttempts", skip_serializing_if = "Option::is_none")]
48    pub num_attempts: Option<f64>,
49}
50
51impl TestSuiteTestVoice {
52    pub fn new(
53        scorers: Vec<models::TestSuiteTestVoiceScorersInner>,
54        r#type: Type,
55        id: String,
56        test_suite_id: String,
57        org_id: String,
58        created_at: String,
59        updated_at: String,
60        script: String,
61    ) -> TestSuiteTestVoice {
62        TestSuiteTestVoice {
63            scorers,
64            r#type,
65            id,
66            test_suite_id,
67            org_id,
68            created_at,
69            updated_at,
70            name: None,
71            script,
72            num_attempts: None,
73        }
74    }
75}
76/// This is the type of the test, which must be voice.
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
78pub enum Type {
79    #[serde(rename = "voice")]
80    Voice,
81}
82
83impl Default for Type {
84    fn default() -> Type {
85        Self::Voice
86    }
87}