Skip to main content

netbox_openapi/models/
patched_writable_rack_reservation_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.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableRackReservationRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableRackReservationRequest {
15    #[serde(rename = "rack", skip_serializing_if = "Option::is_none")]
16    pub rack: Option<Box<crate::models::PatchedWritableRackReservationRequestRack>>,
17    #[serde(rename = "units", skip_serializing_if = "Option::is_none")]
18    pub units: Option<Vec<i32>>,
19    /// * `pending` - Pending * `active` - Active * `stale` - Stale
20    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
21    pub status: Option<Status>,
22    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
23    pub user: Option<Box<crate::models::BookmarkRequestUser>>,
24    #[serde(
25        rename = "tenant",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
31    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
32    pub description: Option<String>,
33    #[serde(
34        rename = "owner",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
40    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
41    pub comments: Option<String>,
42    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
43    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
44    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
45    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
46}
47
48impl PatchedWritableRackReservationRequest {
49    /// Base serializer class for models inheriting from PrimaryModel.
50    pub fn new() -> PatchedWritableRackReservationRequest {
51        PatchedWritableRackReservationRequest {
52            rack: None,
53            units: None,
54            status: None,
55            user: None,
56            tenant: None,
57            description: None,
58            owner: None,
59            comments: None,
60            tags: None,
61            custom_fields: None,
62        }
63    }
64}
65
66/// * `pending` - Pending * `active` - Active * `stale` - Stale
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum Status {
69    #[serde(rename = "pending")]
70    Pending,
71    #[serde(rename = "active")]
72    Active,
73    #[serde(rename = "stale")]
74    Stale,
75}
76
77impl Default for Status {
78    fn default() -> Status {
79        Self::Pending
80    }
81}