Skip to main content

nautobot_openapi/models/
bulk_writable_saved_view_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/// BulkWritableSavedViewRequest : 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 BulkWritableSavedViewRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    /// The name of this view
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The name of the list view that the saved view is derived from, e.g. dcim:device_list
21    #[serde(rename = "view")]
22    pub view: String,
23    /// Saved Configuration on this view
24    #[serde(
25        rename = "config",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub config: Option<Option<serde_json::Value>>,
31    #[serde(rename = "is_global_default", skip_serializing_if = "Option::is_none")]
32    pub is_global_default: Option<bool>,
33    #[serde(rename = "is_shared", skip_serializing_if = "Option::is_none")]
34    pub is_shared: Option<bool>,
35    #[serde(rename = "owner")]
36    pub owner: Box<crate::models::BulkWritableSavedViewRequestOwner>,
37}
38
39impl BulkWritableSavedViewRequest {
40    /// 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>)
41    pub fn new(
42        id: uuid::Uuid,
43        name: String,
44        view: String,
45        owner: crate::models::BulkWritableSavedViewRequestOwner,
46    ) -> BulkWritableSavedViewRequest {
47        BulkWritableSavedViewRequest {
48            id,
49            name,
50            view,
51            config: None,
52            is_global_default: None,
53            is_shared: None,
54            owner: Box::new(owner),
55        }
56    }
57}