Skip to main content

nautobot_openapi/models/
cable.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/// Cable : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Cable {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(rename = "termination_a_type")]
27    pub termination_a_type: String,
28    #[serde(rename = "termination_b_type")]
29    pub termination_b_type: String,
30    #[serde(rename = "termination_a", skip_serializing_if = "Option::is_none")]
31    pub termination_a: Option<Box<crate::models::CableTermination>>,
32    #[serde(rename = "termination_b", skip_serializing_if = "Option::is_none")]
33    pub termination_b: Option<Box<crate::models::CableTermination>>,
34    #[serde(rename = "length_unit", skip_serializing_if = "Option::is_none")]
35    pub length_unit: Option<Box<crate::models::CableLengthUnit>>,
36    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
37    pub r#type: Option<Box<crate::models::CableType>>,
38    #[serde(rename = "termination_a_id")]
39    pub termination_a_id: uuid::Uuid,
40    #[serde(rename = "termination_b_id")]
41    pub termination_b_id: uuid::Uuid,
42    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
43    pub label: Option<String>,
44    /// RGB color in hexadecimal (e.g. 00ff00)
45    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
46    pub color: Option<String>,
47    #[serde(
48        rename = "length",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub length: Option<Option<i32>>,
54    #[serde(rename = "status")]
55    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
56    #[serde(
57        rename = "created",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub created: Option<Option<String>>,
63    #[serde(
64        rename = "last_updated",
65        default,
66        with = "::serde_with::rust::double_option",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub last_updated: Option<Option<String>>,
70    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
71    pub notes_url: Option<String>,
72    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
73    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
74    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
75    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
76}
77
78impl Cable {
79    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
80    pub fn new(
81        termination_a_type: String,
82        termination_b_type: String,
83        termination_a_id: uuid::Uuid,
84        termination_b_id: uuid::Uuid,
85        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
86    ) -> Cable {
87        Cable {
88            id: None,
89            object_type: None,
90            display: None,
91            url: None,
92            natural_slug: None,
93            termination_a_type,
94            termination_b_type,
95            termination_a: None,
96            termination_b: None,
97            length_unit: None,
98            r#type: None,
99            termination_a_id,
100            termination_b_id,
101            label: None,
102            color: None,
103            length: None,
104            status: Box::new(status),
105            created: None,
106            last_updated: None,
107            notes_url: None,
108            custom_fields: None,
109            tags: None,
110        }
111    }
112}