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

/// CreateStorageBoxRequest : Request for POST https://api.hetzner.com/v1/storage_boxes
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStorageBoxRequest {
    #[serde(rename = "access_settings", skip_serializing_if = "Option::is_none")]
    pub access_settings: Option<Box<models::CreateStorageBoxRequestAccessSettings>>,
    /// 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>>,
    /// ID or Name of Location.
    #[serde(rename = "location")]
    pub location: String,
    /// Name of the Storage Box.
    #[serde(rename = "name")]
    pub name: String,
    /// Password of the Storage Box.  For more details, see the Storage Boxes password policy.
    #[serde(rename = "password")]
    pub password: String,
    /// SSH public keys in OpenSSH format to inject into the Storage Box.
    #[serde(rename = "ssh_keys", skip_serializing_if = "Option::is_none")]
    pub ssh_keys: Option<Vec<String>>,
    /// ID or Name of the Storage Box Type.
    #[serde(rename = "storage_box_type")]
    pub storage_box_type: String,
}

impl CreateStorageBoxRequest {
    /// Request for POST https://api.hetzner.com/v1/storage_boxes
    pub fn new(
        location: String,
        name: String,
        password: String,
        storage_box_type: String,
    ) -> CreateStorageBoxRequest {
        CreateStorageBoxRequest {
            access_settings: None,
            labels: None,
            location,
            name,
            password,
            ssh_keys: None,
            storage_box_type,
        }
    }
}
