Skip to main content

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