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

/// StoredFile : A stored File (recording, prompt or backup)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct StoredFile {
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "dateCreated", skip_serializing_if = "Option::is_none")]
    pub date_created: Option<chrono::DateTime<chrono::FixedOffset>>,
    #[serde(rename = "lastUpdated", skip_serializing_if = "Option::is_none")]
    pub last_updated: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// Public URL of the File
    #[serde(rename = "url")]
    pub url: String,
    /// Storage path
    #[serde(rename = "path")]
    pub path: String,
    /// The file's name.
    #[serde(rename = "filename")]
    pub filename: String,
    /// MIME content type of the file.
    #[serde(
        rename = "contentType",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub content_type: Option<Option<String>>,
    /// File size in bytes
    #[serde(
        rename = "size",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub size: Option<Option<i64>>,
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<models::StorageState>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<models::StorageType>,
    /// Absolute self-link to this File
    #[serde(rename = "_url", skip_serializing_if = "Option::is_none")]
    pub _url: Option<String>,
}

impl StoredFile {
    /// A stored File (recording, prompt or backup)
    pub fn new(id: uuid::Uuid, url: String, path: String, filename: String) -> StoredFile {
        StoredFile {
            id,
            date_created: None,
            last_updated: None,
            url,
            path,
            filename,
            content_type: None,
            size: None,
            state: None,
            r#type: None,
            _url: None,
        }
    }
}