Skip to main content

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