netbox_openapi/models/
route_target_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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// RouteTargetRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct RouteTargetRequest {
15    /// Route target value (formatted in accordance with RFC 4360)
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(
19        rename = "tenant",
20        default,
21        with = "::serde_with::rust::double_option",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
25    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
26    pub description: Option<String>,
27    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
28    pub comments: Option<String>,
29    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
30    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
31    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
32    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
33}
34
35impl RouteTargetRequest {
36    /// Adds support for custom fields and tags.
37    pub fn new(name: String) -> RouteTargetRequest {
38        RouteTargetRequest {
39            name,
40            tenant: None,
41            description: None,
42            comments: None,
43            tags: None,
44            custom_fields: None,
45        }
46    }
47}