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

/// ChangeTypeOfServerRequest : Request for POST https://api.hetzner.cloud/v1/servers/{id}/actions/change_type
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChangeTypeOfServerRequest {
    /// ID or name of Server type the Server should migrate to.
    #[serde(rename = "server_type")]
    pub server_type: String,
    /// If false, do not upgrade the disk (this allows downgrading the Server type later).
    #[serde(rename = "upgrade_disk")]
    pub upgrade_disk: bool,
}

impl ChangeTypeOfServerRequest {
    /// Request for POST https://api.hetzner.cloud/v1/servers/{id}/actions/change_type
    pub fn new(server_type: String, upgrade_disk: bool) -> ChangeTypeOfServerRequest {
        ChangeTypeOfServerRequest {
            server_type,
            upgrade_disk,
        }
    }
}
