fastly_api/models/
waf_exclusion_data_attributes.rs

1/*
2 * Fastly API
3 *
4 * Via the Fastly API you can perform any of the operations that are possible within the management console,  including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) 
5 *
6 */
7
8
9
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct WafExclusionDataAttributes {
13    /// A conditional expression in VCL used to determine if the condition is met.
14    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
15    pub condition: Option<String>,
16    /// The type of exclusion.
17    #[serde(rename = "exclusion_type", skip_serializing_if = "Option::is_none")]
18    pub exclusion_type: Option<ExclusionType>,
19    /// Whether to generate a log upon matching.
20    #[serde(rename = "logging", skip_serializing_if = "Option::is_none")]
21    pub logging: Option<bool>,
22    /// Name of the exclusion.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// A numeric ID identifying a WAF exclusion.
26    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
27    pub number: Option<i32>,
28    /// The variable to exclude. An optional selector can be specified after the variable separated by a colon (`:`) to restrict the variable to a particular parameter. Required for `exclusion_type=variable`.
29    #[serde(rename = "variable", skip_serializing_if = "Option::is_none")]
30    pub variable: Option<Variable>,
31}
32
33impl WafExclusionDataAttributes {
34    pub fn new() -> WafExclusionDataAttributes {
35        WafExclusionDataAttributes {
36            condition: None,
37            exclusion_type: None,
38            logging: None,
39            name: None,
40            number: None,
41            variable: None,
42        }
43    }
44}
45
46/// The type of exclusion.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum ExclusionType {
49    #[serde(rename = "rule")]
50    Rule,
51    #[serde(rename = "variable")]
52    Variable,
53    #[serde(rename = "waf")]
54    Waf,
55}
56
57impl Default for ExclusionType {
58    fn default() -> ExclusionType {
59        Self::Rule
60    }
61}
62/// The variable to exclude. An optional selector can be specified after the variable separated by a colon (`:`) to restrict the variable to a particular parameter. Required for `exclusion_type=variable`.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum Variable {
65    #[serde(rename = "req.cookies")]
66    ReqCookies,
67    #[serde(rename = "req.headers")]
68    ReqHeaders,
69    #[serde(rename = "req.post")]
70    ReqPost,
71    #[serde(rename = "req.post_filename")]
72    ReqPostFilename,
73    #[serde(rename = "req.qs")]
74    ReqQs,
75    #[serde(rename = "null")]
76    Null,
77}
78
79impl Default for Variable {
80    fn default() -> Variable {
81        Self::ReqCookies
82    }
83}
84