Skip to main content

netbox_openapi/models/
bulk_cluster_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/// BulkClusterRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkClusterRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "type")]
20    pub r#type: Box<crate::models::BulkClusterRequestType>,
21    #[serde(
22        rename = "group",
23        default,
24        with = "::serde_with::rust::double_option",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub group: Option<Option<Box<crate::models::BulkClusterRequestGroup>>>,
28    /// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `offline` - Offline
29    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
30    pub status: Option<Status>,
31    #[serde(
32        rename = "tenant",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
38    #[serde(
39        rename = "scope_type",
40        default,
41        with = "::serde_with::rust::double_option",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub scope_type: Option<Option<String>>,
45    #[serde(
46        rename = "scope_id",
47        default,
48        with = "::serde_with::rust::double_option",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub scope_id: Option<Option<i32>>,
52    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
53    pub description: Option<String>,
54    #[serde(
55        rename = "owner",
56        default,
57        with = "::serde_with::rust::double_option",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
61    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
62    pub comments: Option<String>,
63    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
64    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
65    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
66    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
67}
68
69impl BulkClusterRequest {
70    /// Base serializer class for models inheriting from PrimaryModel.
71    pub fn new(
72        id: i32,
73        name: String,
74        r#type: crate::models::BulkClusterRequestType,
75    ) -> BulkClusterRequest {
76        BulkClusterRequest {
77            id,
78            name,
79            r#type: Box::new(r#type),
80            group: None,
81            status: None,
82            tenant: None,
83            scope_type: None,
84            scope_id: None,
85            description: None,
86            owner: None,
87            comments: None,
88            tags: None,
89            custom_fields: None,
90        }
91    }
92}
93
94/// * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `offline` - Offline
95#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
96pub enum Status {
97    #[serde(rename = "planned")]
98    Planned,
99    #[serde(rename = "staging")]
100    Staging,
101    #[serde(rename = "active")]
102    Active,
103    #[serde(rename = "decommissioning")]
104    Decommissioning,
105    #[serde(rename = "offline")]
106    Offline,
107}
108
109impl Default for Status {
110    fn default() -> Status {
111        Self::Planned
112    }
113}