hcloud 0.13.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.12.0
 *
 * Generated by: https://openapi-generator.tech
 */

/// AssignPrimaryIpToResourceRequest : Request for POST https://api.hetzner.cloud/v1/primary_ips/{id}/actions/assign

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AssignPrimaryIpToResourceRequest {
    /// ID of a resource of type `assignee_type`
    #[serde(rename = "assignee_id")]
    pub assignee_id: i32,
    /// Type of resource assigning the Primary IP to
    #[serde(rename = "assignee_type")]
    pub assignee_type: AssigneeType,
}

impl AssignPrimaryIpToResourceRequest {
    #![allow(clippy::too_many_arguments)]
    /// Request for POST https://api.hetzner.cloud/v1/primary_ips/{id}/actions/assign
    pub fn new(assignee_id: i32, assignee_type: AssigneeType) -> AssignPrimaryIpToResourceRequest {
        AssignPrimaryIpToResourceRequest {
            assignee_id,
            assignee_type,
        }
    }
}

/// Type of resource assigning the Primary IP to
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AssigneeType {
    #[serde(rename = "server")]
    Server,
}

impl Default for AssigneeType {
    fn default() -> AssigneeType {
        Self::Server
    }
}