netbox_openapi/models/
patched_writable_service_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/// PatchedWritableServiceRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableServiceRequest {
15    #[serde(rename = "parent_object_type", skip_serializing_if = "Option::is_none")]
16    pub parent_object_type: Option<String>,
17    #[serde(rename = "parent_object_id", skip_serializing_if = "Option::is_none")]
18    pub parent_object_id: Option<i64>,
19    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
20    pub name: Option<String>,
21    /// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
22    #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")]
23    pub protocol: Option<Protocol>,
24    #[serde(rename = "ports", skip_serializing_if = "Option::is_none")]
25    pub ports: Option<Vec<i32>>,
26    #[serde(rename = "ipaddresses", skip_serializing_if = "Option::is_none")]
27    pub ipaddresses: Option<Vec<i32>>,
28    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
29    pub description: Option<String>,
30    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
31    pub comments: Option<String>,
32    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
33    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
34    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
35    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
36}
37
38impl PatchedWritableServiceRequest {
39    /// Adds support for custom fields and tags.
40    pub fn new() -> PatchedWritableServiceRequest {
41        PatchedWritableServiceRequest {
42            parent_object_type: None,
43            parent_object_id: None,
44            name: None,
45            protocol: None,
46            ports: None,
47            ipaddresses: None,
48            description: None,
49            comments: None,
50            tags: None,
51            custom_fields: None,
52        }
53    }
54}
55
56/// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Protocol {
59    #[serde(rename = "tcp")]
60    Tcp,
61    #[serde(rename = "udp")]
62    Udp,
63    #[serde(rename = "sctp")]
64    Sctp,
65}
66
67impl Default for Protocol {
68    fn default() -> Protocol {
69        Self::Tcp
70    }
71}