Skip to main content

nautobot_openapi/models/
writable_front_port_request.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/// WritableFrontPortRequest : 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 WritableFrontPortRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Physical label
20    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
21    pub label: Option<String>,
22    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
23    pub description: Option<String>,
24    #[serde(rename = "type")]
25    pub r#type: crate::models::PortTypeChoices,
26    #[serde(rename = "rear_port_position", skip_serializing_if = "Option::is_none")]
27    pub rear_port_position: Option<i32>,
28    #[serde(
29        rename = "device",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
35    #[serde(
36        rename = "module",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub module: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
42    #[serde(rename = "rear_port")]
43    pub rear_port: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
44    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
45    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
46    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
47    pub relationships: Option<
48        ::std::collections::HashMap<
49            String,
50            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
51        >,
52    >,
53    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
54    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
55}
56
57impl WritableFrontPortRequest {
58    /// 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.
59    pub fn new(
60        name: String,
61        r#type: crate::models::PortTypeChoices,
62        rear_port: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
63    ) -> WritableFrontPortRequest {
64        WritableFrontPortRequest {
65            id: None,
66            name,
67            label: None,
68            description: None,
69            r#type,
70            rear_port_position: None,
71            device: None,
72            module: None,
73            rear_port: Box::new(rear_port),
74            custom_fields: None,
75            relationships: None,
76            tags: None,
77        }
78    }
79}