Skip to main content

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