scaleway_api_rs/models/
install_server_request.rs

1/*
2 * Account API
3 *
4 * # Introduction  The Account API allows you to manage projects. Project is Scaleway’s resource management feature. Designed to help you organize your infrastructure and cloud services, the feature allows resources to be isolated and grouped into specific projects.
5 *
6 * The version of the OpenAPI document: v2
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct InstallServerRequest {
13    /// ID of the OS to install on the server
14    #[serde(rename = "os_id")]
15    pub os_id: String,
16    /// Hostname of the server
17    #[serde(rename = "hostname")]
18    pub hostname: String,
19    /// SSH key IDs authorized on the server
20    #[serde(rename = "ssh_key_ids")]
21    pub ssh_key_ids: Vec<String>,
22    /// User used for the installation
23    #[serde(
24        rename = "user",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub user: Option<Option<String>>,
30    /// Password used for the installation
31    #[serde(
32        rename = "password",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub password: Option<Option<String>>,
38    /// User used for the service to install
39    #[serde(
40        rename = "service_user",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub service_user: Option<Option<String>>,
46    /// Password used for the service to install
47    #[serde(
48        rename = "service_password",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub service_password: Option<Option<String>>,
54}
55
56impl InstallServerRequest {
57    pub fn new(os_id: String, hostname: String, ssh_key_ids: Vec<String>) -> InstallServerRequest {
58        InstallServerRequest {
59            os_id,
60            hostname,
61            ssh_key_ids,
62            user: None,
63            password: None,
64            service_user: None,
65            service_password: None,
66        }
67    }
68}