vapi_client/models/
server.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};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Server {
17    /// This is the timeout in seconds for the request to your server. Defaults to 20 seconds.  @default 20
18    #[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none")]
19    pub timeout_seconds: Option<f64>,
20    /// API endpoint to send requests to.
21    #[serde(rename = "url")]
22    pub url: String,
23    /// This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.  Same precedence logic as server.
24    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
25    pub secret: Option<String>,
26    /// These are the custom headers to include in the request sent to your server.  Each key-value pair represents a header name and its value.
27    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
28    pub headers: Option<serde_json::Value>,
29    /// This is the backoff plan to use if the request fails.
30    #[serde(rename = "backoffPlan", skip_serializing_if = "Option::is_none")]
31    pub backoff_plan: Option<models::BackoffPlan>,
32}
33
34impl Server {
35    pub fn new(url: String) -> Server {
36        Server {
37            timeout_seconds: None,
38            url,
39            secret: None,
40            headers: None,
41            backoff_plan: None,
42        }
43    }
44}