babelforce-manager-sdk 0.42.3

Rust SDK for the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations.
Documentation
/*
 * 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,
        }
    }
}