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