hcloud 0.25.0

Unofficial Rust crate for accessing the Hetzner Cloud API
Documentation
/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 0.28.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Snapshot {
    /// Point in time when the Resource was created (in ISO-8601 format).
    #[serde(rename = "created")]
    pub created: String,
    /// Description of the Storage Box Snapshot.
    #[serde(rename = "description")]
    pub description: String,
    /// ID of the Storage Box Snapshot.
    #[serde(rename = "id")]
    pub id: i64,
    /// Whether the Storage Box Snapshot was created automatically.
    #[serde(rename = "is_automatic")]
    pub is_automatic: bool,
    /// User-defined labels (`key/value` pairs) for the Resource. For more information, see \"Labels\".  | User-defined labels (`key/value` pairs) for the Resource.  Note that the set of Labels provided in the request will overwrite the existing one.  For more information, see \"Labels\".
    #[serde(rename = "labels")]
    pub labels: std::collections::HashMap<String, String>,
    /// Name of the Storage Box Snapshot.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "stats")]
    pub stats: Box<models::SnapshotStats>,
    /// ID of the Storage Box.
    #[serde(rename = "storage_box")]
    pub storage_box: i64,
}

impl Snapshot {
    pub fn new(
        created: String,
        description: String,
        id: i64,
        is_automatic: bool,
        labels: std::collections::HashMap<String, String>,
        name: String,
        stats: models::SnapshotStats,
        storage_box: i64,
    ) -> Snapshot {
        Snapshot {
            created,
            description,
            id,
            is_automatic,
            labels,
            name,
            stats: Box::new(stats),
            storage_box,
        }
    }
}