Skip to main content

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.6.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableServiceRequest : Base serializer class for models inheriting from PrimaryModel.
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(
31        rename = "owner",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
37    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
38    pub comments: Option<String>,
39    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
40    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
41    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
42    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
43}
44
45impl PatchedWritableServiceRequest {
46    /// Base serializer class for models inheriting from PrimaryModel.
47    pub fn new() -> PatchedWritableServiceRequest {
48        PatchedWritableServiceRequest {
49            parent_object_type: None,
50            parent_object_id: None,
51            name: None,
52            protocol: None,
53            ports: None,
54            ipaddresses: None,
55            description: None,
56            owner: None,
57            comments: None,
58            tags: None,
59            custom_fields: None,
60        }
61    }
62}
63
64/// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum Protocol {
67    #[serde(rename = "tcp")]
68    Tcp,
69    #[serde(rename = "udp")]
70    Udp,
71    #[serde(rename = "sctp")]
72    Sctp,
73}
74
75impl Default for Protocol {
76    fn default() -> Protocol {
77        Self::Tcp
78    }
79}