Skip to main content

nautobot_openapi/models/
writable_prefix_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/// WritablePrefixRequest : 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 WritablePrefixRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "prefix")]
18    pub prefix: String,
19    #[serde(
20        rename = "location",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub location: Option<Option<Box<crate::models::BulkWritablePrefixRequestLocation>>>,
26    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
27    pub r#type: Option<crate::models::PrefixTypeChoices>,
28    /// Date this prefix was allocated to an RIR, reserved in IPAM, etc.
29    #[serde(
30        rename = "date_allocated",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub date_allocated: Option<Option<String>>,
36    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
37    pub description: Option<String>,
38    #[serde(rename = "status")]
39    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
40    #[serde(
41        rename = "role",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
47    #[serde(
48        rename = "parent",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub parent: Option<Option<Box<crate::models::BulkWritablePrefixRequestParent>>>,
54    #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
55    pub namespace: Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
56    #[serde(
57        rename = "tenant",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
63    #[serde(
64        rename = "vlan",
65        default,
66        with = "::serde_with::rust::double_option",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
70    #[serde(
71        rename = "rir",
72        default,
73        with = "::serde_with::rust::double_option",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub rir: Option<Option<Box<crate::models::BulkWritablePrefixRequestRir>>>,
77    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
78    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
79    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
80    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
81    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
82    pub relationships: Option<
83        ::std::collections::HashMap<
84            String,
85            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
86        >,
87    >,
88}
89
90impl WritablePrefixRequest {
91    /// 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.
92    pub fn new(
93        prefix: String,
94        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
95    ) -> WritablePrefixRequest {
96        WritablePrefixRequest {
97            id: None,
98            prefix,
99            location: None,
100            r#type: None,
101            date_allocated: None,
102            description: None,
103            status: Box::new(status),
104            role: None,
105            parent: None,
106            namespace: None,
107            tenant: None,
108            vlan: None,
109            rir: None,
110            tags: None,
111            custom_fields: None,
112            relationships: None,
113        }
114    }
115}