Skip to main content

nautobot_openapi/models/
prefix_length_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/// PrefixLengthRequest : Input serializer for POST to /api/ipam/prefixes/{id}/available-prefixes/, i.e. allocating one or more sub-prefixes.  Since setting of multiple locations on create is not supported, this uses the legacy single-location option.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PrefixLengthRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "prefix_length")]
18    pub prefix_length: i32,
19    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
20    pub r#type: Option<crate::models::PrefixTypeChoices>,
21    #[serde(rename = "status")]
22    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
23    #[serde(
24        rename = "role",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
30    #[serde(
31        rename = "location",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub location: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
37    #[serde(
38        rename = "tenant",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
44    #[serde(
45        rename = "vlan",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
51    #[serde(
52        rename = "rir",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub rir: Option<Option<Box<crate::models::BulkWritablePrefixRequestRir>>>,
58    /// Date this prefix was allocated to an RIR, reserved in IPAM, etc.
59    #[serde(
60        rename = "date_allocated",
61        default,
62        with = "::serde_with::rust::double_option",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub date_allocated: Option<Option<String>>,
66    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
67    pub description: Option<String>,
68    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
69    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
70    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
71    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
72    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
73    pub relationships: Option<
74        ::std::collections::HashMap<
75            String,
76            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
77        >,
78    >,
79}
80
81impl PrefixLengthRequest {
82    /// Input serializer for POST to /api/ipam/prefixes/{id}/available-prefixes/, i.e. allocating one or more sub-prefixes.  Since setting of multiple locations on create is not supported, this uses the legacy single-location option.
83    pub fn new(
84        prefix_length: i32,
85        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
86    ) -> PrefixLengthRequest {
87        PrefixLengthRequest {
88            id: None,
89            prefix_length,
90            r#type: None,
91            status: Box::new(status),
92            role: None,
93            location: None,
94            tenant: None,
95            vlan: None,
96            rir: None,
97            date_allocated: None,
98            description: None,
99            tags: None,
100            custom_fields: None,
101            relationships: None,
102        }
103    }
104}