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

/// ListDataCentersResponse : Response to GET https://api.hetzner.cloud/v1/datacenters
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListDataCentersResponse {
    /// List of Data Centers.
    #[serde(rename = "datacenters")]
    pub datacenters: Vec<models::DataCenter>,
    #[serde(rename = "meta")]
    pub meta: Box<models::Meta>,
    /// Recommended Data Center for creating new resources.
    #[serde(rename = "recommendation")]
    pub recommendation: i64,
}

impl ListDataCentersResponse {
    /// Response to GET https://api.hetzner.cloud/v1/datacenters
    pub fn new(
        datacenters: Vec<models::DataCenter>,
        meta: models::Meta,
        recommendation: i64,
    ) -> ListDataCentersResponse {
        ListDataCentersResponse {
            datacenters,
            meta: Box::new(meta),
            recommendation,
        }
    }
}
