fastly_api/models/
waf_exclusion_response_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 WafExclusionResponseDataAttributes {
13    /// Date and time in ISO 8601 format.
14    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
15    pub created_at: Option<String>,
16    /// Date and time in ISO 8601 format.
17    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
18    pub deleted_at: Option<String>,
19    /// Date and time in ISO 8601 format.
20    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
21    pub updated_at: Option<String>,
22    /// A conditional expression in VCL used to determine if the condition is met.
23    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
24    pub condition: Option<String>,
25    /// The type of exclusion.
26    #[serde(rename = "exclusion_type", skip_serializing_if = "Option::is_none")]
27    pub exclusion_type: Option<ExclusionType>,
28    /// Whether to generate a log upon matching.
29    #[serde(rename = "logging", skip_serializing_if = "Option::is_none")]
30    pub logging: Option<bool>,
31    /// Name of the exclusion.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// A numeric ID identifying a WAF exclusion.
35    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
36    pub number: Option<i32>,
37    /// 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`.
38    #[serde(rename = "variable", skip_serializing_if = "Option::is_none")]
39    pub variable: Option<Variable>,
40}
41
42impl WafExclusionResponseDataAttributes {
43    pub fn new() -> WafExclusionResponseDataAttributes {
44        WafExclusionResponseDataAttributes {
45            created_at: None,
46            deleted_at: None,
47            updated_at: None,
48            condition: None,
49            exclusion_type: None,
50            logging: None,
51            name: None,
52            number: None,
53            variable: None,
54        }
55    }
56}
57
58/// The type of exclusion.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum ExclusionType {
61    #[serde(rename = "rule")]
62    Rule,
63    #[serde(rename = "variable")]
64    Variable,
65    #[serde(rename = "waf")]
66    Waf,
67}
68
69impl Default for ExclusionType {
70    fn default() -> ExclusionType {
71        Self::Rule
72    }
73}
74/// 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`.
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum Variable {
77    #[serde(rename = "req.cookies")]
78    ReqCookies,
79    #[serde(rename = "req.headers")]
80    ReqHeaders,
81    #[serde(rename = "req.post")]
82    ReqPost,
83    #[serde(rename = "req.post_filename")]
84    ReqPostFilename,
85    #[serde(rename = "req.qs")]
86    ReqQs,
87    #[serde(rename = "null")]
88    Null,
89}
90
91impl Default for Variable {
92    fn default() -> Variable {
93        Self::ReqCookies
94    }
95}
96