babelforce-manager-sdk 0.44.0

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AuditLog {
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "dateCreated")]
    pub date_created: chrono::DateTime<chrono::FixedOffset>,
    /// Username of user who carried out the request
    #[serde(rename = "user")]
    pub user: String,
    /// API resource URI
    #[serde(rename = "uri")]
    pub uri: String,
    #[serde(rename = "method")]
    pub method: models::AuditLogMethod,
    #[serde(rename = "operation")]
    pub operation: models::AuditLogOperation,
    /// Human-friendly resource name
    #[serde(rename = "resource")]
    pub resource: String,
    /// The unique Identifier (UUID) of the object
    #[serde(rename = "resourceUuid")]
    pub resource_uuid: uuid::Uuid,
    /// JSON string representing request body
    #[serde(rename = "resourcePayload")]
    pub resource_payload: String,
    /// JSON string representing resource item state prior to request
    #[serde(rename = "itemBefore")]
    pub item_before: String,
    /// JSON string representing resource item state after the request
    #[serde(rename = "itemAfter")]
    pub item_after: String,
    /// Resource item URI
    #[serde(rename = "_url")]
    pub _url: String,
}

impl AuditLog {
    pub fn new(
        id: uuid::Uuid,
        date_created: chrono::DateTime<chrono::FixedOffset>,
        user: String,
        uri: String,
        method: models::AuditLogMethod,
        operation: models::AuditLogOperation,
        resource: String,
        resource_uuid: uuid::Uuid,
        resource_payload: String,
        item_before: String,
        item_after: String,
        _url: String,
    ) -> AuditLog {
        AuditLog {
            id,
            date_created,
            user,
            uri,
            method,
            operation,
            resource,
            resource_uuid,
            resource_payload,
            item_before,
            item_after,
            _url,
        }
    }
}