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

/// AssignFloatingIpToServerRequest : Request for POST https://api.hetzner.cloud/v1/floating_ips/{id}/actions/assign
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AssignFloatingIpToServerRequest {
    /// Server the Floating IP is assigned to.  `null` if not assigned.
    #[serde(rename = "server", deserialize_with = "Option::deserialize")]
    pub server: Option<i64>,
}

impl AssignFloatingIpToServerRequest {
    /// Request for POST https://api.hetzner.cloud/v1/floating_ips/{id}/actions/assign
    pub fn new(server: Option<i64>) -> AssignFloatingIpToServerRequest {
        AssignFloatingIpToServerRequest { server }
    }
}
