Skip to main content

netbox_openapi/models/
bulk_virtual_disk_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/// BulkVirtualDiskRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkVirtualDiskRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "virtual_machine")]
18    pub virtual_machine: Box<crate::models::BulkVmInterfaceRequestVirtualMachine>,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    #[serde(rename = "size")]
24    pub size: i32,
25    #[serde(
26        rename = "owner",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
32    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
33    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
34    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
35    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
36}
37
38impl BulkVirtualDiskRequest {
39    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
40    pub fn new(
41        id: i32,
42        virtual_machine: crate::models::BulkVmInterfaceRequestVirtualMachine,
43        name: String,
44        size: i32,
45    ) -> BulkVirtualDiskRequest {
46        BulkVirtualDiskRequest {
47            id,
48            virtual_machine: Box::new(virtual_machine),
49            name,
50            description: None,
51            size,
52            owner: None,
53            tags: None,
54            custom_fields: None,
55        }
56    }
57}