Skip to main content

nautobot_openapi/models/
service_protocol.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct ServiceProtocol {
13    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
14    pub value: Option<Value>,
15    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
16    pub label: Option<Label>,
17}
18
19impl ServiceProtocol {
20    pub fn new() -> ServiceProtocol {
21        ServiceProtocol {
22            value: None,
23            label: None,
24        }
25    }
26}
27
28///
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum Value {
31    #[serde(rename = "tcp")]
32    Tcp,
33    #[serde(rename = "udp")]
34    Udp,
35}
36
37impl Default for Value {
38    fn default() -> Value {
39        Self::Tcp
40    }
41}
42///
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Label {
45    #[serde(rename = "TCP")]
46    Tcp,
47    #[serde(rename = "UDP")]
48    Udp,
49}
50
51impl Default for Label {
52    fn default() -> Label {
53        Self::Tcp
54    }
55}