Skip to main content

nautobot_openapi/models/
patched_object_metadata_request.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/// PatchedObjectMetadataRequest : 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 PatchedObjectMetadataRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(
18        rename = "assigned_object_type",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub assigned_object_type: Option<String>,
22    #[serde(
23        rename = "value",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub value: Option<Option<serde_json::Value>>,
29    /// List of scoped fields, only direct fields on the model
30    #[serde(
31        rename = "scoped_fields",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub scoped_fields: Option<Option<serde_json::Value>>,
37    #[serde(rename = "assigned_object_id", skip_serializing_if = "Option::is_none")]
38    pub assigned_object_id: Option<uuid::Uuid>,
39    #[serde(rename = "metadata_type", skip_serializing_if = "Option::is_none")]
40    pub metadata_type:
41        Option<Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
42    #[serde(
43        rename = "contact",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub contact: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
49    #[serde(
50        rename = "team",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub team: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
56}
57
58impl PatchedObjectMetadataRequest {
59    /// 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>)
60    pub fn new() -> PatchedObjectMetadataRequest {
61        PatchedObjectMetadataRequest {
62            id: None,
63            assigned_object_type: None,
64            value: None,
65            scoped_fields: None,
66            assigned_object_id: None,
67            metadata_type: None,
68            contact: None,
69            team: None,
70        }
71    }
72}