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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Manager API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0-dev
* Contact: support@babelforce.com
* Generated by: https://openapi-generator.tech
*/
use crate::gen::manager::models;
use serde::{Deserialize, Serialize};
/// OutboundLead : An outbound dialer lead as returned when adding or updating a single lead — the number(s) to dial, dial status, attempt counters, and custom data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OutboundLead {
/// The unique Identifier (UUID) of the object
#[serde(rename = "id")]
pub id: uuid::Uuid,
/// The unique Identifier (UUID) of the object
#[serde(rename = "listId")]
pub list_id: uuid::Uuid,
/// Customer-supplied lead identifier, unique within the lead-list.
#[serde(rename = "uid")]
pub uid: String,
/// Primary phone number to dial, in E.164 format.
#[serde(rename = "number")]
pub number: String,
/// First fallback number, tried when the primary is unreachable.
#[serde(rename = "number2", skip_serializing_if = "Option::is_none")]
pub number2: Option<String>,
/// Second fallback number.
#[serde(rename = "number3", skip_serializing_if = "Option::is_none")]
pub number3: Option<String>,
/// Caller ID presented when dialling this lead.
#[serde(rename = "callerId")]
pub caller_id: String,
/// Current dial status of the lead.
#[serde(rename = "status")]
pub status: String,
/// Number of dial attempts made on this lead so far.
#[serde(rename = "callCount")]
pub call_count: i32,
/// Total talk time across all attempts, in seconds.
#[serde(rename = "duration")]
pub duration: i32,
/// Whether the lead has been dialled since the list's call counters were last reset.
#[serde(rename = "calledSinceReset")]
pub called_since_reset: bool,
/// Dial priority within the list; higher-ranked leads are dialled first.
#[serde(rename = "rank")]
pub rank: i32,
#[serde(rename = "dateCreated")]
pub date_created: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "lastUpdated")]
pub last_updated: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "data")]
pub data: serde_json::Value,
}
impl OutboundLead {
/// An outbound dialer lead as returned when adding or updating a single lead — the number(s) to dial, dial status, attempt counters, and custom data.
pub fn new(
id: uuid::Uuid,
list_id: uuid::Uuid,
uid: String,
number: String,
caller_id: String,
status: String,
call_count: i32,
duration: i32,
called_since_reset: bool,
rank: i32,
date_created: chrono::DateTime<chrono::FixedOffset>,
last_updated: chrono::DateTime<chrono::FixedOffset>,
data: serde_json::Value,
) -> OutboundLead {
OutboundLead {
id,
list_id,
uid,
number,
number2: None,
number3: None,
caller_id,
status,
call_count,
duration,
called_since_reset,
rank,
date_created,
last_updated,
data,
}
}
}