incus-client 0.1.1

Auto-generated Rust client for the Incus container and VM manager REST API
Documentation
/*
 * Incus external REST API
 *
 * This is the REST API used by all Incus clients. Internal endpoints aren't included in this documentation.  The Incus API is available over both a local unix+http and remote https API. Authentication for local users relies on group membership and access to the unix socket. For remote users, the default authentication method is TLS client certificates.
 *
 * The version of the OpenAPI document: 1.0
 * Contact: lxc-devel@lists.linuxcontainers.org
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Operation : Operation represents a background operation
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Operation {
    /// Type of operation (task, token or websocket)
    #[serde(rename = "class", skip_serializing_if = "Option::is_none")]
    pub class: Option<String>,
    /// Operation creation time
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// Description of the operation
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Operation error message
    #[serde(rename = "err", skip_serializing_if = "Option::is_none")]
    pub err: Option<String>,
    /// UUID of the operation
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// What cluster member this record was found on
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    /// Whether the operation can be canceled
    #[serde(rename = "may_cancel", skip_serializing_if = "Option::is_none")]
    pub may_cancel: Option<bool>,
    /// Operation specific metadata
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Affected resources
    #[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
    pub resources: Option<std::collections::HashMap<String, Vec<String>>>,
    /// Status name
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")]
    pub status_code: Option<i64>,
    /// Operation last change
    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<chrono::DateTime<chrono::FixedOffset>>,
}

impl Operation {
    /// Operation represents a background operation
    pub fn new() -> Operation {
        Operation {
            class: None,
            created_at: None,
            description: None,
            err: None,
            id: None,
            location: None,
            may_cancel: None,
            metadata: None,
            resources: None,
            status: None,
            status_code: None,
            updated_at: None,
        }
    }
}