Skip to main content

authentik_client/models/
event_matcher_policy_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// EventMatcherPolicyRequest : Event Matcher Policy Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EventMatcherPolicyRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged.
20    #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")]
21    pub execution_logging: Option<bool>,
22    /// Match created events with this action type. When left empty, all action types will be matched.
23    #[serde(
24        rename = "action",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub action: Option<Option<models::EventActions>>,
30    /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy)
31    #[serde(
32        rename = "client_ip",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub client_ip: Option<Option<String>>,
38    /// Match events created by selected application. When left empty, all applications are matched.
39    #[serde(
40        rename = "app",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub app: Option<Option<models::AppEnum>>,
46    /// Match events created by selected model. When left empty, all models are matched. When an app is selected, all the application's models are matched.
47    #[serde(
48        rename = "model",
49        default,
50        with = "::serde_with::rust::double_option",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub model: Option<Option<models::ModelEnum>>,
54}
55
56impl EventMatcherPolicyRequest {
57    /// Event Matcher Policy Serializer
58    pub fn new(name: String) -> EventMatcherPolicyRequest {
59        EventMatcherPolicyRequest {
60            name,
61            execution_logging: None,
62            action: None,
63            client_ip: None,
64            app: None,
65            model: None,
66        }
67    }
68}