netbox_openapi/models/
generic_object.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/// GenericObject : Minimal representation of some generic object identified by ContentType and PK.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct GenericObject {
15    #[serde(rename = "object_type")]
16    pub object_type: String,
17    #[serde(rename = "object_id")]
18    pub object_id: i32,
19    #[serde(
20        rename = "object",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub object: Option<Option<serde_json::Value>>,
26}
27
28impl GenericObject {
29    /// Minimal representation of some generic object identified by ContentType and PK.
30    pub fn new(object_type: String, object_id: i32) -> GenericObject {
31        GenericObject {
32            object_type,
33            object_id,
34            object: None,
35        }
36    }
37}