nautobot_openapi/models/
service_protocol.rs1#[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#[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#[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}