Skip to main content

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