fastly_api/models/
request_settings_additional.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 RequestSettingsAdditional {
13    /// Allows you to terminate request handling and immediately perform an action.
14    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
15    pub action: Option<Action>,
16    /// Sets the host header.
17    #[serde(rename = "default_host", skip_serializing_if = "Option::is_none")]
18    pub default_host: Option<String>,
19    /// Comma separated list of varnish request object fields that should be in the hash key.
20    #[serde(rename = "hash_keys", skip_serializing_if = "Option::is_none")]
21    pub hash_keys: Option<String>,
22    /// Name for the request settings.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// Condition which, if met, will select this configuration during a request. Optional.
26    #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")]
27    pub request_condition: Option<String>,
28    /// Short for X-Forwarded-For.
29    #[serde(rename = "xff", skip_serializing_if = "Option::is_none")]
30    pub xff: Option<Xff>,
31}
32
33impl RequestSettingsAdditional {
34    pub fn new() -> RequestSettingsAdditional {
35        RequestSettingsAdditional {
36            action: None,
37            default_host: None,
38            hash_keys: None,
39            name: None,
40            request_condition: None,
41            xff: None,
42        }
43    }
44}
45
46/// Allows you to terminate request handling and immediately perform an action.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Action {
49    #[serde(rename = "lookup")]
50    Lookup,
51    #[serde(rename = "pass")]
52    Pass,
53}
54
55impl Default for Action {
56    fn default() -> Action {
57        Self::Lookup
58    }
59}
60/// Short for X-Forwarded-For.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Xff {
63    #[serde(rename = "clear")]
64    Clear,
65    #[serde(rename = "leave")]
66    Leave,
67    #[serde(rename = "append")]
68    Append,
69    #[serde(rename = "append_all")]
70    AppendAll,
71    #[serde(rename = "overwrite")]
72    Overwrite,
73}
74
75impl Default for Xff {
76    fn default() -> Xff {
77        Self::Clear
78    }
79}
80