Skip to main content

incus_client/models/
operation.rs

1/*
2 * Incus external REST API
3 *
4 * 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.
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: lxc-devel@lists.linuxcontainers.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Operation : Operation represents a background operation
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Operation {
17    /// Type of operation (task, token or websocket)
18    #[serde(rename = "class", skip_serializing_if = "Option::is_none")]
19    pub class: Option<String>,
20    /// Operation creation time
21    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
22    pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
23    /// Description of the operation
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    /// Operation error message
27    #[serde(rename = "err", skip_serializing_if = "Option::is_none")]
28    pub err: Option<String>,
29    /// UUID of the operation
30    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
31    pub id: Option<String>,
32    /// What cluster member this record was found on
33    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
34    pub location: Option<String>,
35    /// Whether the operation can be canceled
36    #[serde(rename = "may_cancel", skip_serializing_if = "Option::is_none")]
37    pub may_cancel: Option<bool>,
38    /// Operation specific metadata
39    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
40    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
41    /// Affected resources
42    #[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
43    pub resources: Option<std::collections::HashMap<String, Vec<String>>>,
44    /// Status name
45    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
46    pub status: Option<String>,
47    #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")]
48    pub status_code: Option<i64>,
49    /// Operation last change
50    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
51    pub updated_at: Option<chrono::DateTime<chrono::FixedOffset>>,
52}
53
54impl Operation {
55    /// Operation represents a background operation
56    pub fn new() -> Operation {
57        Operation {
58            class: None,
59            created_at: None,
60            description: None,
61            err: None,
62            id: None,
63            location: None,
64            may_cancel: None,
65            metadata: None,
66            resources: None,
67            status: None,
68            status_code: None,
69            updated_at: None,
70        }
71    }
72}
73