/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 4b3f595
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Subaccount {
    #[serde(rename = "access_settings")]
    pub access_settings: Box<models::SubaccountAccessSetting>,
    /// Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format).
    #[serde(rename = "created")]
    pub created: String,
    /// A description of Storage Box Subaccount.
    #[serde(rename = "description")]
    pub description: String,
    /// Home directory of the Storage Box Subaccount.
    #[serde(rename = "home_directory")]
    pub home_directory: String,
    /// ID of the Storage Box Subaccount.
    #[serde(rename = "id")]
    pub id: i64,
    /// 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>,
    /// FQDN of the Storage Box Subaccount.
    #[serde(rename = "server")]
    pub server: String,
    /// ID of the Storage Box.
    #[serde(rename = "storage_box")]
    pub storage_box: i64,
    /// Username of the Storage Box Subaccount.
    #[serde(rename = "username")]
    pub username: String,
}

impl Subaccount {
    pub fn new(
        access_settings: models::SubaccountAccessSetting,
        created: String,
        description: String,
        home_directory: String,
        id: i64,
        labels: std::collections::HashMap<String, String>,
        server: String,
        storage_box: i64,
        username: String,
    ) -> Subaccount {
        Subaccount {
            access_settings: Box::new(access_settings),
            created,
            description,
            home_directory,
            id,
            labels,
            server,
            storage_box,
            username,
        }
    }
}
