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};

/// CreateSubaccountRequest : Request for POST https://api.hetzner.com/v1/storage_boxes/{id}/subaccounts
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateSubaccountRequest {
    #[serde(rename = "access_settings", skip_serializing_if = "Option::is_none")]
    pub access_settings: Option<Box<models::CreateSubaccountRequestAccessSettings>>,
    /// A description of Storage Box Subaccount.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Home directory of the Storage Box Subaccount.  The directory will be created if it doesn't exist yet.
    #[serde(rename = "home_directory")]
    pub home_directory: String,
    /// 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", skip_serializing_if = "Option::is_none")]
    pub labels: Option<std::collections::HashMap<String, String>>,
    /// Password of the Storage Box Subaccount.  For more details, see the Storage Boxes password policy.
    #[serde(rename = "password")]
    pub password: String,
}

impl CreateSubaccountRequest {
    /// Request for POST https://api.hetzner.com/v1/storage_boxes/{id}/subaccounts
    pub fn new(home_directory: String, password: String) -> CreateSubaccountRequest {
        CreateSubaccountRequest {
            access_settings: None,
            description: None,
            home_directory,
            labels: None,
            password,
        }
    }
}