Skip to main content

clientapi_pve/models/
nodes_storage_upload_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NodesStorageUploadRequest {
16
17    /// The expected checksum of the file.
18    #[serde(rename = "checksum", skip_serializing_if = "Option::is_none")]
19    pub checksum: Option<String>,
20
21    /// The algorithm to calculate the checksum of the file.
22    #[serde(rename = "checksum-algorithm", skip_serializing_if = "Option::is_none")]
23    pub checksum_algorithm: Option<models::PveChecksumAlgorithmEnum>,
24
25    /// Content type.
26    #[serde(rename = "content")]
27    pub content: models::PveContentEnum,
28
29    /// The name of the file to create. Caution: This will be normalized!
30    #[serde(rename = "filename")]
31    pub filename: String,
32
33    /// The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trusted port on localhost.
34    #[serde(rename = "tmpfilename", skip_serializing_if = "Option::is_none")]
35    pub tmpfilename: Option<String>,
36
37
38}
39
40impl NodesStorageUploadRequest {
41    pub fn new(content: models::PveContentEnum, filename: String) -> NodesStorageUploadRequest {
42        NodesStorageUploadRequest {
43            
44            checksum: None,
45            
46            checksum_algorithm: None,
47            
48            content,
49            
50            filename,
51            
52            tmpfilename: None,
53            
54        }
55    }
56}
57
58