Skip to main content

netbox_openapi/models/
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/// BulkServiceRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkServiceRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "parent_object_type")]
18    pub parent_object_type: String,
19    #[serde(rename = "parent_object_id")]
20    pub parent_object_id: i64,
21    #[serde(rename = "name")]
22    pub name: 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")]
27    pub ports: 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 BulkServiceRequest {
48    /// Base serializer class for models inheriting from PrimaryModel.
49    pub fn new(
50        id: i32,
51        parent_object_type: String,
52        parent_object_id: i64,
53        name: String,
54        ports: Vec<i32>,
55    ) -> BulkServiceRequest {
56        BulkServiceRequest {
57            id,
58            parent_object_type,
59            parent_object_id,
60            name,
61            protocol: None,
62            ports,
63            ipaddresses: None,
64            description: None,
65            owner: None,
66            comments: None,
67            tags: None,
68            custom_fields: None,
69        }
70    }
71}
72
73/// * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum Protocol {
76    #[serde(rename = "tcp")]
77    Tcp,
78    #[serde(rename = "udp")]
79    Udp,
80    #[serde(rename = "sctp")]
81    Sctp,
82}
83
84impl Default for Protocol {
85    fn default() -> Protocol {
86        Self::Tcp
87    }
88}