vapi_client/models/
response_text_done_event.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 ResponseTextDoneEvent {
16    /// Index of the content part
17    #[serde(rename = "content_index")]
18    pub content_index: f64,
19    /// ID of the output item
20    #[serde(rename = "item_id")]
21    pub item_id: String,
22    /// Index of the output item
23    #[serde(rename = "output_index")]
24    pub output_index: f64,
25    /// Complete text content
26    #[serde(rename = "text")]
27    pub text: String,
28    /// Event type
29    #[serde(rename = "type")]
30    pub r#type: TypeTrue,
31}
32
33impl ResponseTextDoneEvent {
34    pub fn new(
35        content_index: f64,
36        item_id: String,
37        output_index: f64,
38        text: String,
39        r#type: TypeTrue,
40    ) -> ResponseTextDoneEvent {
41        ResponseTextDoneEvent {
42            content_index,
43            item_id,
44            output_index,
45            text,
46            r#type,
47        }
48    }
49}
50/// Event type
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum TypeTrue {
53    #[serde(rename = "response.output_text.done")]
54    ResponsePeriodOutputTextPeriodDone,
55}
56
57impl Default for TypeTrue {
58    fn default() -> TypeTrue {
59        Self::ResponsePeriodOutputTextPeriodDone
60    }
61}