netbox_openapi/models/
patched_object_permission_request.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/// PatchedObjectPermissionRequest : 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 PatchedObjectPermissionRequest {
15    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
16    pub name: Option<String>,
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
20    pub enabled: Option<bool>,
21    #[serde(rename = "object_types", skip_serializing_if = "Option::is_none")]
22    pub object_types: Option<Vec<String>>,
23    /// The list of actions granted by this permission
24    #[serde(rename = "actions", skip_serializing_if = "Option::is_none")]
25    pub actions: Option<Vec<String>>,
26    /// Queryset filter matching the applicable objects of the selected type(s)
27    #[serde(
28        rename = "constraints",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub constraints: Option<Option<serde_json::Value>>,
34    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
35    pub groups: Option<Vec<i32>>,
36    #[serde(rename = "users", skip_serializing_if = "Option::is_none")]
37    pub users: Option<Vec<i32>>,
38}
39
40impl PatchedObjectPermissionRequest {
41    /// 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>)
42    pub fn new() -> PatchedObjectPermissionRequest {
43        PatchedObjectPermissionRequest {
44            name: None,
45            description: None,
46            enabled: None,
47            object_types: None,
48            actions: None,
49            constraints: None,
50            groups: None,
51            users: None,
52        }
53    }
54}