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

/// RequestConsoleForServerResponse : Response to POST https://api.hetzner.cloud/v1/servers/{id}/actions/request_console
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestConsoleForServerResponse {
    #[serde(rename = "action")]
    pub action: Box<models::Action>,
    /// VNC password to use for this connection (this password only works in combination with a wss_url with valid token).
    #[serde(rename = "password")]
    pub password: String,
    /// URL of websocket proxy to use; this includes a token which is valid for a limited time only.
    #[serde(rename = "wss_url")]
    pub wss_url: String,
}

impl RequestConsoleForServerResponse {
    /// Response to POST https://api.hetzner.cloud/v1/servers/{id}/actions/request_console
    pub fn new(
        action: models::Action,
        password: String,
        wss_url: String,
    ) -> RequestConsoleForServerResponse {
        RequestConsoleForServerResponse {
            action: Box::new(action),
            password,
            wss_url,
        }
    }
}