vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BackoffPlan {
    /// This is the type of backoff plan to use. Defaults to fixed.  @default fixed
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries).  @default 0
    #[serde(rename = "maxRetries")]
    pub max_retries: f64,
    /// 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.
    #[serde(rename = "baseDelaySeconds")]
    pub base_delay_seconds: f64,
}

impl BackoffPlan {
    pub fn new(r#type: TypeTrue, max_retries: f64, base_delay_seconds: f64) -> BackoffPlan {
        BackoffPlan {
            r#type,
            max_retries,
            base_delay_seconds,
        }
    }
}
/// This is the type of backoff plan to use. Defaults to fixed.  @default fixed
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "fixed")]
    Fixed,
    #[serde(rename = "exponential")]
    Exponential,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Fixed
    }
}