Skip to main content

netbox_openapi/models/
patched_bulk_journal_entry_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/// PatchedBulkJournalEntryRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkJournalEntryRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(
18        rename = "assigned_object_type",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub assigned_object_type: Option<String>,
22    #[serde(rename = "assigned_object_id", skip_serializing_if = "Option::is_none")]
23    pub assigned_object_id: Option<i64>,
24    #[serde(
25        rename = "created_by",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub created_by: Option<Option<i32>>,
31    /// * `info` - Info * `success` - Success * `warning` - Warning * `danger` - Danger
32    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
33    pub kind: Option<Kind>,
34    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
35    pub comments: Option<String>,
36    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
37    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
38    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
39    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
40}
41
42impl PatchedBulkJournalEntryRequest {
43    /// Adds support for custom fields and tags.
44    pub fn new(id: i32) -> PatchedBulkJournalEntryRequest {
45        PatchedBulkJournalEntryRequest {
46            id,
47            assigned_object_type: None,
48            assigned_object_id: None,
49            created_by: None,
50            kind: None,
51            comments: None,
52            tags: None,
53            custom_fields: None,
54        }
55    }
56}
57
58/// * `info` - Info * `success` - Success * `warning` - Warning * `danger` - Danger
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum Kind {
61    #[serde(rename = "info")]
62    Info,
63    #[serde(rename = "success")]
64    Success,
65    #[serde(rename = "warning")]
66    Warning,
67    #[serde(rename = "danger")]
68    Danger,
69}
70
71impl Default for Kind {
72    fn default() -> Kind {
73        Self::Info
74    }
75}