/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v1.0.0.0; DO NOT EDIT. */
#![allow(unused_imports)]

use std::collections::HashMap;

use chrono::{DateTime, Utc};
use derive_builder::Builder;
use iso8601_duration::Duration;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use super::super::common_types::{b64::Bytes, date_only::Date, decimal::Decimal, time_only::Time};
use super::status_schema::StatusSchema;

/// The runtime health of the specific inbound endpoint details as specified in the topic.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct RuntimeHealth {
    /// The timestamp (RFC3339) when the health status was last updated, even if the status did not change.
    #[serde(rename = "lastUpdateTime")]
    pub last_update_time: DateTime<Utc>,

    /// A human-readable message describing the last transition.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub message: Option<String>,

    /// Unique, CamelCase reason code describing the cause of the last health state transition.
    #[serde(rename = "reasonCode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub reason_code: Option<String>,

    /// The current health status of the resource.
    pub status: StatusSchema,

    /// The version of the resource for which the runtime health is being reported.
    pub version: u64,
}
