Skip to main content

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