Skip to main content

nautobot_openapi/models/
interface_template.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/// InterfaceTemplate : 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 InterfaceTemplate {
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 = "notes_url", skip_serializing_if = "Option::is_none")]
27    pub notes_url: Option<String>,
28    #[serde(rename = "type")]
29    pub r#type: Box<crate::models::InterfaceType>,
30    #[serde(rename = "port_type", skip_serializing_if = "Option::is_none")]
31    pub port_type: Option<Box<crate::models::FrontPortType>>,
32    #[serde(rename = "name")]
33    pub name: String,
34    /// Physical label
35    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
36    pub label: Option<String>,
37    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
38    pub description: Option<String>,
39    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
40    pub mgmt_only: Option<bool>,
41    #[serde(
42        rename = "speed",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub speed: Option<Option<i32>>,
48    #[serde(rename = "duplex", skip_serializing_if = "Option::is_none")]
49    pub duplex: Option<Box<crate::models::BulkWritableInterfaceTemplateRequestDuplex>>,
50    #[serde(
51        rename = "device_type",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub device_type: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
57    #[serde(
58        rename = "module_type",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub module_type: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
64    #[serde(
65        rename = "created",
66        default,
67        with = "::serde_with::rust::double_option",
68        skip_serializing_if = "Option::is_none"
69    )]
70    pub created: Option<Option<String>>,
71    #[serde(
72        rename = "last_updated",
73        default,
74        with = "::serde_with::rust::double_option",
75        skip_serializing_if = "Option::is_none"
76    )]
77    pub last_updated: Option<Option<String>>,
78    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
79    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
80}
81
82impl InterfaceTemplate {
83    /// 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.
84    pub fn new(r#type: crate::models::InterfaceType, name: String) -> InterfaceTemplate {
85        InterfaceTemplate {
86            id: None,
87            object_type: None,
88            display: None,
89            url: None,
90            natural_slug: None,
91            notes_url: None,
92            r#type: Box::new(r#type),
93            port_type: None,
94            name,
95            label: None,
96            description: None,
97            mgmt_only: None,
98            speed: None,
99            duplex: None,
100            device_type: None,
101            module_type: None,
102            created: None,
103            last_updated: None,
104            custom_fields: None,
105        }
106    }
107}