nile_client_rs/models/
create_policy_request.rs

1/*
2 * Nile API
3 *
4 * Making SaaS chill.
5 *
6 * The version of the OpenAPI document: 0.1.0-fdd7cd5
7 * Contact: support@thenile.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct CreatePolicyRequest {
13    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
14    pub subject: Option<Box<crate::models::Subject>>,
15    #[serde(rename = "resource", skip_serializing_if = "Option::is_none")]
16    pub resource: Option<crate::models::Resource>,
17    /// The actions to be allowed on the resource if an access policy matches a request.  At least one action must be provided and executable actions (i.e: `read`, `write`) cannot be combined with non-executable actions (i.e: `deny`).  If multiple access policies match a request, policies with a `deny` action take precedence over policies with a `read` action. You can define `deny` access policies to make exceptions in your policies that allow access.
18    #[serde(rename = "actions")]
19    pub actions: Vec<crate::models::Action>,
20}
21
22impl CreatePolicyRequest {
23    pub fn new(actions: Vec<crate::models::Action>) -> CreatePolicyRequest {
24        CreatePolicyRequest {
25            subject: None,
26            resource: None,
27            actions,
28        }
29    }
30}
31
32use serde::{Deserialize, Serialize};