Skip to main content

openapi_service_fabric/models/
node_event.rs

1/*
2 * Service Fabric Client APIs
3 *
4 * Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services.
5 *
6 * The version of the OpenAPI document: 8.2
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NodeEvent {
16    #[serde(rename = "Kind")]
17    pub kind: models::FabricEventKind,
18    /// The identifier for the FabricEvent instance.
19    #[serde(rename = "EventInstanceId")]
20    pub event_instance_id: uuid::Uuid,
21    /// The category of event.
22    #[serde(rename = "Category", skip_serializing_if = "Option::is_none")]
23    pub category: Option<String>,
24    /// The time event was logged.
25    #[serde(rename = "TimeStamp")]
26    pub time_stamp: String,
27    /// Shows there is existing related events available.
28    #[serde(
29        rename = "HasCorrelatedEvents",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub has_correlated_events: Option<bool>,
33    /// The name of a Service Fabric node.
34    #[serde(rename = "NodeName")]
35    pub node_name: String,
36}
37
38impl NodeEvent {
39    pub fn new(
40        kind: models::FabricEventKind,
41        event_instance_id: uuid::Uuid,
42        time_stamp: String,
43        node_name: String,
44    ) -> NodeEvent {
45        NodeEvent {
46            kind,
47            event_instance_id,
48            category: None,
49            time_stamp,
50            has_correlated_events: None,
51            node_name,
52        }
53    }
54}