Skip to main content

nautobot_openapi/models/
bulk_writable_device_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/// BulkWritableDeviceRequest : 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 BulkWritableDeviceRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "face", skip_serializing_if = "Option::is_none")]
18    pub face: Option<crate::models::FaceEnum>,
19    #[serde(
20        rename = "local_config_context_data",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub local_config_context_data: Option<Option<serde_json::Value>>,
26    #[serde(
27        rename = "local_config_context_data_owner_object_id",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub local_config_context_data_owner_object_id: Option<Option<uuid::Uuid>>,
33    #[serde(
34        rename = "name",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub name: Option<Option<String>>,
40    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
41    pub serial: Option<String>,
42    /// A unique tag used to identify this device
43    #[serde(
44        rename = "asset_tag",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub asset_tag: Option<Option<String>>,
50    /// The lowest-numbered unit occupied by the device
51    #[serde(
52        rename = "position",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub position: Option<Option<i32>>,
58    /// The priority the device has in the device redundancy group.
59    #[serde(
60        rename = "device_redundancy_group_priority",
61        default,
62        with = "::serde_with::rust::double_option",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub device_redundancy_group_priority: Option<Option<i32>>,
66    #[serde(
67        rename = "vc_position",
68        default,
69        with = "::serde_with::rust::double_option",
70        skip_serializing_if = "Option::is_none"
71    )]
72    pub vc_position: Option<Option<i32>>,
73    #[serde(
74        rename = "vc_priority",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub vc_priority: Option<Option<i32>>,
80    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
81    pub comments: Option<String>,
82    #[serde(
83        rename = "local_config_context_schema",
84        default,
85        with = "::serde_with::rust::double_option",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub local_config_context_schema:
89        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
90    #[serde(
91        rename = "local_config_context_data_owner_content_type",
92        default,
93        with = "::serde_with::rust::double_option",
94        skip_serializing_if = "Option::is_none"
95    )]
96    pub local_config_context_data_owner_content_type:
97        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
98    #[serde(rename = "device_type")]
99    pub device_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
100    #[serde(rename = "status")]
101    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
102    #[serde(rename = "role")]
103    pub role: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
104    #[serde(
105        rename = "tenant",
106        default,
107        with = "::serde_with::rust::double_option",
108        skip_serializing_if = "Option::is_none"
109    )]
110    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
111    #[serde(
112        rename = "platform",
113        default,
114        with = "::serde_with::rust::double_option",
115        skip_serializing_if = "Option::is_none"
116    )]
117    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
118    #[serde(rename = "location")]
119    pub location: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
120    #[serde(
121        rename = "rack",
122        default,
123        with = "::serde_with::rust::double_option",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub rack: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
127    #[serde(
128        rename = "primary_ip4",
129        default,
130        with = "::serde_with::rust::double_option",
131        skip_serializing_if = "Option::is_none"
132    )]
133    pub primary_ip4: Option<Option<Box<crate::models::PrimaryIpv4>>>,
134    #[serde(
135        rename = "primary_ip6",
136        default,
137        with = "::serde_with::rust::double_option",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub primary_ip6: Option<Option<Box<crate::models::PrimaryIpv6>>>,
141    #[serde(
142        rename = "virtual_chassis",
143        default,
144        with = "::serde_with::rust::double_option",
145        skip_serializing_if = "Option::is_none"
146    )]
147    pub virtual_chassis: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
148    #[serde(
149        rename = "device_redundancy_group",
150        default,
151        with = "::serde_with::rust::double_option",
152        skip_serializing_if = "Option::is_none"
153    )]
154    pub device_redundancy_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
155    #[serde(
156        rename = "software_version",
157        default,
158        with = "::serde_with::rust::double_option",
159        skip_serializing_if = "Option::is_none"
160    )]
161    pub software_version:
162        Option<Option<Box<crate::models::BulkWritableDeviceRequestSoftwareVersion>>>,
163    #[serde(
164        rename = "secrets_group",
165        default,
166        with = "::serde_with::rust::double_option",
167        skip_serializing_if = "Option::is_none"
168    )]
169    pub secrets_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
170    #[serde(
171        rename = "controller_managed_device_group",
172        default,
173        with = "::serde_with::rust::double_option",
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub controller_managed_device_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
177    /// Override the software image files associated with the software version for this device
178    #[serde(
179        rename = "software_image_files",
180        skip_serializing_if = "Option::is_none"
181    )]
182    pub software_image_files: Option<Vec<crate::models::SoftwareImageFiles>>,
183    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
184    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
185    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
186    pub relationships: Option<
187        ::std::collections::HashMap<
188            String,
189            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
190        >,
191    >,
192    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
193    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
194    #[serde(
195        rename = "parent_bay",
196        default,
197        with = "::serde_with::rust::double_option",
198        skip_serializing_if = "Option::is_none"
199    )]
200    pub parent_bay: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
201}
202
203impl BulkWritableDeviceRequest {
204    /// 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.
205    pub fn new(
206        id: uuid::Uuid,
207        device_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
208        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
209        role: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
210        location: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
211    ) -> BulkWritableDeviceRequest {
212        BulkWritableDeviceRequest {
213            id,
214            face: None,
215            local_config_context_data: None,
216            local_config_context_data_owner_object_id: None,
217            name: None,
218            serial: None,
219            asset_tag: None,
220            position: None,
221            device_redundancy_group_priority: None,
222            vc_position: None,
223            vc_priority: None,
224            comments: None,
225            local_config_context_schema: None,
226            local_config_context_data_owner_content_type: None,
227            device_type: Box::new(device_type),
228            status: Box::new(status),
229            role: Box::new(role),
230            tenant: None,
231            platform: None,
232            location: Box::new(location),
233            rack: None,
234            primary_ip4: None,
235            primary_ip6: None,
236            virtual_chassis: None,
237            device_redundancy_group: None,
238            software_version: None,
239            secrets_group: None,
240            controller_managed_device_group: None,
241            software_image_files: None,
242            custom_fields: None,
243            relationships: None,
244            tags: None,
245            parent_bay: None,
246        }
247    }
248}