Skip to main content

nautobot_openapi/models/
config_context.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/// ConfigContext : 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 ConfigContext {
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 = "owner_content_type",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub owner_content_type: Option<Option<String>>,
33    #[serde(
34        rename = "owner",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub owner: Option<Option<Box<crate::models::ConfigContextOwner>>>,
40    #[serde(rename = "name")]
41    pub name: String,
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 = "weight", skip_serializing_if = "Option::is_none")]
50    pub weight: Option<i32>,
51    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
52    pub description: Option<String>,
53    #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")]
54    pub is_active: Option<bool>,
55    #[serde(rename = "data", deserialize_with = "Option::deserialize")]
56    pub data: Option<serde_json::Value>,
57    #[serde(
58        rename = "config_context_schema",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub config_context_schema:
64        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
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 = "tags", skip_serializing_if = "Option::is_none")]
82    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
83}
84
85impl ConfigContext {
86    /// 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>)
87    pub fn new(name: String, data: Option<serde_json::Value>) -> ConfigContext {
88        ConfigContext {
89            id: None,
90            object_type: None,
91            display: None,
92            url: None,
93            natural_slug: None,
94            owner_content_type: None,
95            owner: None,
96            name,
97            owner_object_id: None,
98            weight: None,
99            description: None,
100            is_active: None,
101            data,
102            config_context_schema: None,
103            created: None,
104            last_updated: None,
105            notes_url: None,
106            tags: None,
107        }
108    }
109}