Skip to main content

netbox_openapi/models/
patched_bulk_inventory_item_template_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/// PatchedBulkInventoryItemTemplateRequest : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkInventoryItemTemplateRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "device_type", skip_serializing_if = "Option::is_none")]
18    pub device_type: Option<Box<crate::models::BulkDeviceBayTemplateRequestDeviceType>>,
19    #[serde(
20        rename = "parent",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub parent: Option<Option<i32>>,
26    /// {module} is accepted as a substitution for the module bay position when attached to a module type.
27    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
28    pub name: Option<String>,
29    /// Physical label
30    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
31    pub label: Option<String>,
32    #[serde(
33        rename = "role",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub role: Option<Option<Box<crate::models::BulkInventoryItemRequestRole>>>,
39    #[serde(
40        rename = "manufacturer",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub manufacturer: Option<Option<Box<crate::models::BulkInventoryItemRequestManufacturer>>>,
46    /// Manufacturer-assigned part identifier
47    #[serde(rename = "part_id", skip_serializing_if = "Option::is_none")]
48    pub part_id: Option<String>,
49    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
50    pub description: Option<String>,
51    #[serde(
52        rename = "component_type",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub component_type: Option<Option<String>>,
58    #[serde(
59        rename = "component_id",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub component_id: Option<Option<i64>>,
65}
66
67impl PatchedBulkInventoryItemTemplateRequest {
68    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
69    pub fn new(id: i32) -> PatchedBulkInventoryItemTemplateRequest {
70        PatchedBulkInventoryItemTemplateRequest {
71            id,
72            device_type: None,
73            parent: None,
74            name: None,
75            label: None,
76            role: None,
77            manufacturer: None,
78            part_id: None,
79            description: None,
80            component_type: None,
81            component_id: None,
82        }
83    }
84}