Skip to main content

netbox_openapi/models/
patched_writable_service_template_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/// PatchedWritableServiceTemplateRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableServiceTemplateRequest {
15    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
16    pub name: Option<String>,
17    /// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
18    #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")]
19    pub protocol: Option<Protocol>,
20    #[serde(rename = "ports", skip_serializing_if = "Option::is_none")]
21    pub ports: Option<Vec<i32>>,
22    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
23    pub description: Option<String>,
24    #[serde(
25        rename = "owner",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
31    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
32    pub comments: Option<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 PatchedWritableServiceTemplateRequest {
40    /// Base serializer class for models inheriting from PrimaryModel.
41    pub fn new() -> PatchedWritableServiceTemplateRequest {
42        PatchedWritableServiceTemplateRequest {
43            name: None,
44            protocol: None,
45            ports: None,
46            description: None,
47            owner: None,
48            comments: None,
49            tags: None,
50            custom_fields: None,
51        }
52    }
53}
54
55/// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Protocol {
58    #[serde(rename = "tcp")]
59    Tcp,
60    #[serde(rename = "udp")]
61    Udp,
62    #[serde(rename = "sctp")]
63    Sctp,
64}
65
66impl Default for Protocol {
67    fn default() -> Protocol {
68        Self::Tcp
69    }
70}