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};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct Server {
19    /// This is the timeout in seconds for the request to your server. Defaults to 20 seconds.  @default 20
20    #[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none")]
21    pub timeout_seconds: Option<f64>,
22    /// API endpoint to send requests to.
23    #[serde(rename = "url")]
24    pub url: String,
25    /// 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.
26    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
27    pub secret: Option<String>,
28    /// 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.
29    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
30    pub headers: Option<serde_json::Value>,
31    /// This is the backoff plan to use if the request fails.
32    #[serde(rename = "backoffPlan", skip_serializing_if = "Option::is_none")]
33    pub backoff_plan: Option<models::BackoffPlan>,
34}
35
36impl Server {
37    pub fn new(url: String) -> Server {
38        Server {
39            timeout_seconds: None,
40            url,
41            secret: None,
42            headers: None,
43            backoff_plan: None,
44        }
45    }
46}