1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* 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
}
}