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

/// DeprecationInfo : Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated.  | This field is deprecated.  Use the `deprecation` object in the `locations` field instead (`.locations[].deprecation`).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeprecationInfo {
    /// Date of the deprecation announcement.
    #[serde(rename = "announced")]
    pub announced: String,
    /// Date of the deprecated resource removal.  Once this date is reached, the resource will not be returned by resource type \"list\" endpoint, and the resource can not be used to create new resources. For example, if this is an image, you can not create new servers with this image after the mentioned date.
    #[serde(rename = "unavailable_after")]
    pub unavailable_after: String,
}

impl DeprecationInfo {
    /// Describes if, when and how the resource is deprecated. If this field is set to `null` the resource is not deprecated. If a value is set, it is considered deprecated.  | This field is deprecated.  Use the `deprecation` object in the `locations` field instead (`.locations[].deprecation`).
    pub fn new(announced: String, unavailable_after: String) -> DeprecationInfo {
        DeprecationInfo {
            announced,
            unavailable_after,
        }
    }
}