Skip to main content

openapi_service_fabric/models/
node_impact.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/// NodeImpact : Describes the expected impact of a repair to a particular node.  This type supports the Service Fabric platform; it is not meant to be used directly from your code.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NodeImpact {
17    /// The name of the impacted node.
18    #[serde(rename = "NodeName")]
19    pub node_name: String,
20    /// The level of impact expected.
21    #[serde(rename = "ImpactLevel", skip_serializing_if = "Option::is_none")]
22    pub impact_level: Option<ImpactLevel>,
23}
24
25impl NodeImpact {
26    /// Describes the expected impact of a repair to a particular node.  This type supports the Service Fabric platform; it is not meant to be used directly from your code.
27    pub fn new(node_name: String) -> NodeImpact {
28        NodeImpact {
29            node_name,
30            impact_level: None,
31        }
32    }
33}
34/// The level of impact expected.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum ImpactLevel {
37    #[serde(rename = "Invalid")]
38    Invalid,
39    #[serde(rename = "None")]
40    None,
41    #[serde(rename = "Restart")]
42    Restart,
43    #[serde(rename = "RemoveData")]
44    RemoveData,
45    #[serde(rename = "RemoveNode")]
46    RemoveNode,
47}
48
49impl Default for ImpactLevel {
50    fn default() -> ImpactLevel {
51        Self::Invalid
52    }
53}