babelforce-manager-sdk 0.42.2

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};

/// Campaign : An outbound dialer campaign — the container for the leads to be dialled.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Campaign {
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// The campaign's name.
    #[serde(rename = "name")]
    pub name: String,
    /// Number shown to leads as the caller ID.
    #[serde(rename = "displayNumber", skip_serializing_if = "Option::is_none")]
    pub display_number: Option<String>,
    /// Whether the campaign is active.
    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
    pub active: Option<bool>,
    /// Whether the campaign runs in test mode (no real dials).
    #[serde(rename = "testMode", skip_serializing_if = "Option::is_none")]
    pub test_mode: Option<bool>,
    #[serde(
        rename = "leadList",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub lead_list: Option<Option<Box<models::CampaignLeadList>>>,
    #[serde(rename = "listOrder", skip_serializing_if = "Option::is_none")]
    pub list_order: Option<models::CampaignListOrder>,
    #[serde(rename = "recording", skip_serializing_if = "Option::is_none")]
    pub recording: Option<models::CampaignRecording>,
    /// Ratio of simultaneous dials to available agents.
    #[serde(rename = "callRatio", skip_serializing_if = "Option::is_none")]
    pub call_ratio: Option<f64>,
}

impl Campaign {
    /// An outbound dialer campaign — the container for the leads to be dialled.
    pub fn new(id: uuid::Uuid, name: String) -> Campaign {
        Campaign {
            id,
            name,
            display_number: None,
            active: None,
            test_mode: None,
            lead_list: None,
            list_order: None,
            recording: None,
            call_ratio: None,
        }
    }
}