Skip to main content

nautobot_openapi/models/
platform.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Platform : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Platform {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(
27        rename = "network_driver_mappings",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub network_driver_mappings: Option<Option<serde_json::Value>>,
33    #[serde(rename = "device_count", skip_serializing_if = "Option::is_none")]
34    pub device_count: Option<i32>,
35    #[serde(
36        rename = "virtual_machine_count",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub virtual_machine_count: Option<i32>,
40    #[serde(rename = "name")]
41    pub name: String,
42    /// The normalized network driver to use when interacting with devices, e.g. cisco_ios, arista_eos, etc. Library-specific driver names will be derived from this setting as appropriate
43    #[serde(rename = "network_driver", skip_serializing_if = "Option::is_none")]
44    pub network_driver: Option<String>,
45    /// The name of the NAPALM driver to use when Nautobot internals interact with devices
46    #[serde(rename = "napalm_driver", skip_serializing_if = "Option::is_none")]
47    pub napalm_driver: Option<String>,
48    /// Additional arguments to pass when initiating the NAPALM driver (JSON format)
49    #[serde(
50        rename = "napalm_args",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub napalm_args: Option<Option<serde_json::Value>>,
56    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
57    pub description: Option<String>,
58    #[serde(
59        rename = "manufacturer",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub manufacturer: Option<Option<Box<crate::models::BulkWritablePlatformRequestManufacturer>>>,
65    #[serde(
66        rename = "created",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub created: Option<Option<String>>,
72    #[serde(
73        rename = "last_updated",
74        default,
75        with = "::serde_with::rust::double_option",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub last_updated: Option<Option<String>>,
79    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
80    pub notes_url: Option<String>,
81    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
82    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
83}
84
85impl Platform {
86    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
87    pub fn new(name: String) -> Platform {
88        Platform {
89            id: None,
90            object_type: None,
91            display: None,
92            url: None,
93            natural_slug: None,
94            network_driver_mappings: None,
95            device_count: None,
96            virtual_machine_count: None,
97            name,
98            network_driver: None,
99            napalm_driver: None,
100            napalm_args: None,
101            description: None,
102            manufacturer: None,
103            created: None,
104            last_updated: None,
105            notes_url: None,
106            custom_fields: None,
107        }
108    }
109}