/*
 * rivet-api-public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.3.0-rc.11
 * Contact: developer@rivet.gg
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatacenterHealth {
    #[serde(rename = "datacenter_label")]
    pub datacenter_label: i32,
    #[serde(rename = "datacenter_name")]
    pub datacenter_name: String,
    #[serde(rename = "error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error: Option<Option<String>>,
    #[serde(rename = "response", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub response: Option<Option<Box<models::HealthResponse>>>,
    #[serde(rename = "rtt_ms", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub rtt_ms: Option<Option<f64>>,
    #[serde(rename = "status")]
    pub status: models::HealthStatus,
}

impl DatacenterHealth {
    pub fn new(datacenter_label: i32, datacenter_name: String, status: models::HealthStatus) -> DatacenterHealth {
        DatacenterHealth {
            datacenter_label,
            datacenter_name,
            error: None,
            response: None,
            rtt_ms: None,
            status,
        }
    }
}

