Skip to main content

windmill_api/models/
volume.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.651.1
7 * Contact: contact@windmill.dev
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 Volume {
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(rename = "size_bytes")]
19    pub size_bytes: i64,
20    #[serde(rename = "file_count")]
21    pub file_count: i32,
22    #[serde(rename = "created_at")]
23    pub created_at: String,
24    #[serde(rename = "created_by")]
25    pub created_by: String,
26    #[serde(rename = "updated_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub updated_at: Option<Option<String>>,
28    #[serde(rename = "last_used_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub last_used_at: Option<Option<String>>,
30    #[serde(rename = "extra_perms", skip_serializing_if = "Option::is_none")]
31    pub extra_perms: Option<std::collections::HashMap<String, serde_json::Value>>,
32}
33
34impl Volume {
35    pub fn new(name: String, size_bytes: i64, file_count: i32, created_at: String, created_by: String) -> Volume {
36        Volume {
37            name,
38            size_bytes,
39            file_count,
40            created_at,
41            created_by,
42            updated_at: None,
43            last_used_at: None,
44            extra_perms: None,
45        }
46    }
47}
48