babelforce-manager-sdk 0.42.1

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

/// ReportingCall : A call in the condensed reporting shape, carrying the per-call timing metrics (wait, queue, bridge, talk, hold, wrap-up and handle time) alongside the handling agent and queue. All durations are in seconds.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReportingCall {
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "sessionId")]
    pub session_id: uuid::Uuid,
    /// When the call started.
    #[serde(rename = "dateCreated")]
    pub date_created: chrono::DateTime<chrono::FixedOffset>,
    /// When the reporting record was last updated.
    #[serde(rename = "lastUpdated")]
    pub last_updated: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "type")]
    pub r#type: models::ReportingCallType,
    /// Name of the queue that handled the call, if any.
    #[serde(rename = "queueName", skip_serializing_if = "Option::is_none")]
    pub queue_name: Option<String>,
    /// Name of the agent who handled the call, if any.
    #[serde(rename = "agentName", skip_serializing_if = "Option::is_none")]
    pub agent_name: Option<String>,
    /// Whether the call was bridged to an agent.
    #[serde(rename = "bridged")]
    pub bridged: bool,
    /// Total call duration, in seconds.
    #[serde(rename = "duration")]
    pub duration: i32,
    /// Time the caller waited before the call was answered, in seconds.
    #[serde(rename = "waitTime")]
    pub wait_time: i32,
    /// Time the call spent waiting in queue, in seconds.
    #[serde(rename = "queueWaitTime")]
    pub queue_wait_time: i32,
    /// Time until the call was bridged to an agent, in seconds.
    #[serde(rename = "bridgeTime")]
    pub bridge_time: i32,
    /// Time spent in conversation, in seconds.
    #[serde(rename = "talkTime")]
    pub talk_time: i32,
    /// Time the call was on hold, in seconds.
    #[serde(rename = "holdTime")]
    pub hold_time: i32,
    /// Agent wrap-up (after-call work) time, in seconds.
    #[serde(rename = "wrapupTime")]
    pub wrapup_time: i32,
    /// Total agent handle time (talk + hold + wrap-up), in seconds.
    #[serde(rename = "handleTime")]
    pub handle_time: i32,
}

impl ReportingCall {
    /// A call in the condensed reporting shape, carrying the per-call timing metrics (wait, queue, bridge, talk, hold, wrap-up and handle time) alongside the handling agent and queue. All durations are in seconds.
    pub fn new(
        id: uuid::Uuid,
        session_id: uuid::Uuid,
        date_created: chrono::DateTime<chrono::FixedOffset>,
        last_updated: chrono::DateTime<chrono::FixedOffset>,
        r#type: models::ReportingCallType,
        bridged: bool,
        duration: i32,
        wait_time: i32,
        queue_wait_time: i32,
        bridge_time: i32,
        talk_time: i32,
        hold_time: i32,
        wrapup_time: i32,
        handle_time: i32,
    ) -> ReportingCall {
        ReportingCall {
            id,
            session_id,
            date_created,
            last_updated,
            r#type,
            queue_name: None,
            agent_name: None,
            bridged,
            duration,
            wait_time,
            queue_wait_time,
            bridge_time,
            talk_time,
            hold_time,
            wrapup_time,
            handle_time,
        }
    }
}