vapi_client/models/
backoff_plan.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 BackoffPlan {
16    /// This is the type of backoff plan to use. Defaults to fixed.  @default fixed
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries).  @default 0
20    #[serde(rename = "maxRetries")]
21    pub max_retries: f64,
22    /// This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay.
23    #[serde(rename = "baseDelaySeconds")]
24    pub base_delay_seconds: f64,
25}
26
27impl BackoffPlan {
28    pub fn new(r#type: TypeTrue, max_retries: f64, base_delay_seconds: f64) -> BackoffPlan {
29        BackoffPlan {
30            r#type,
31            max_retries,
32            base_delay_seconds,
33        }
34    }
35}
36/// This is the type of backoff plan to use. Defaults to fixed.  @default fixed
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum TypeTrue {
39    #[serde(rename = "fixed")]
40    Fixed,
41    #[serde(rename = "exponential")]
42    Exponential,
43}
44
45impl Default for TypeTrue {
46    fn default() -> TypeTrue {
47        Self::Fixed
48    }
49}