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 */
1011use crate::models;
12use serde::{Deserialize, Serialize};
1314#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct UserMessage {
16/// The role of the user in the conversation.
17#[serde(rename = "role")]
18pub role: String,
19/// The message content from the user.
20#[serde(rename = "message")]
21pub message: String,
22/// The timestamp when the message was sent.
23#[serde(rename = "time")]
24pub time: f64,
25/// The timestamp when the message ended.
26#[serde(rename = "endTime")]
27pub end_time: f64,
28/// The number of seconds from the start of the conversation.
29#[serde(rename = "secondsFromStart")]
30pub seconds_from_start: f64,
31/// The duration of the message in seconds.
32#[serde(rename = "duration", skip_serializing_if = "Option::is_none")]
33pub duration: Option<f64>,
34}
3536impl UserMessage {
37pub fn new(
38 role: String,
39 message: String,
40 time: f64,
41 end_time: f64,
42 seconds_from_start: f64,
43 ) -> UserMessage {
44 UserMessage {
45 role,
46 message,
47 time,
48 end_time,
49 seconds_from_start,
50 duration: None,
51 }
52 }
53}