Skip to main content

netbox_openapi/models/
bulk_virtual_device_context_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BulkVirtualDeviceContextRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkVirtualDeviceContextRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "device")]
20    pub device: Box<crate::models::BriefInterfaceRequestDevice>,
21    #[serde(
22        rename = "identifier",
23        default,
24        with = "::serde_with::rust::double_option",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub identifier: Option<Option<i32>>,
28    #[serde(
29        rename = "tenant",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
35    #[serde(
36        rename = "primary_ip4",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub primary_ip4:
42        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
43    #[serde(
44        rename = "primary_ip6",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub primary_ip6:
50        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
51    /// * `active` - Active * `planned` - Planned * `offline` - Offline
52    #[serde(rename = "status")]
53    pub status: Status,
54    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
55    pub description: Option<String>,
56    #[serde(
57        rename = "owner",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
63    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
64    pub comments: Option<String>,
65    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
66    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
67    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
68    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
69}
70
71impl BulkVirtualDeviceContextRequest {
72    /// Base serializer class for models inheriting from PrimaryModel.
73    pub fn new(
74        id: i32,
75        name: String,
76        device: crate::models::BriefInterfaceRequestDevice,
77        status: Status,
78    ) -> BulkVirtualDeviceContextRequest {
79        BulkVirtualDeviceContextRequest {
80            id,
81            name,
82            device: Box::new(device),
83            identifier: None,
84            tenant: None,
85            primary_ip4: None,
86            primary_ip6: None,
87            status,
88            description: None,
89            owner: None,
90            comments: None,
91            tags: None,
92            custom_fields: None,
93        }
94    }
95}
96
97/// * `active` - Active * `planned` - Planned * `offline` - Offline
98#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
99pub enum Status {
100    #[serde(rename = "active")]
101    Active,
102    #[serde(rename = "planned")]
103    Planned,
104    #[serde(rename = "offline")]
105    Offline,
106}
107
108impl Default for Status {
109    fn default() -> Status {
110        Self::Active
111    }
112}