Skip to main content

nautobot_openapi/models/
graph_ql_query.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/// GraphQlQuery : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct GraphQlQuery {
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(rename = "variables", skip_serializing_if = "Option::is_none")]
27    pub variables: Option<::std::collections::HashMap<String, serde_json::Value>>,
28    #[serde(
29        rename = "owner_content_type",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub owner_content_type: Option<Option<String>>,
35    #[serde(
36        rename = "owner",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub owner: Option<Option<Box<crate::models::GraphQlQueryOwner>>>,
42    #[serde(
43        rename = "owner_object_id",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub owner_object_id: Option<Option<uuid::Uuid>>,
49    #[serde(rename = "name")]
50    pub name: String,
51    #[serde(rename = "query")]
52    pub query: String,
53    #[serde(
54        rename = "created",
55        default,
56        with = "::serde_with::rust::double_option",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub created: Option<Option<String>>,
60    #[serde(
61        rename = "last_updated",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub last_updated: Option<Option<String>>,
67    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
68    pub notes_url: Option<String>,
69}
70
71impl GraphQlQuery {
72    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
73    pub fn new(name: String, query: String) -> GraphQlQuery {
74        GraphQlQuery {
75            id: None,
76            object_type: None,
77            display: None,
78            url: None,
79            natural_slug: None,
80            variables: None,
81            owner_content_type: None,
82            owner: None,
83            owner_object_id: None,
84            name,
85            query,
86            created: None,
87            last_updated: None,
88            notes_url: None,
89        }
90    }
91}