fastly_api/models/
request_settings_response.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 RequestSettingsResponse {
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    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
23    pub service_id: Option<Box<String>>,
24    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
25    pub version: Option<Box<String>>,
26    /// Allows you to terminate request handling and immediately perform an action.
27    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
28    pub action: Option<Action>,
29    /// Sets the host header.
30    #[serde(rename = "default_host", skip_serializing_if = "Option::is_none")]
31    pub default_host: Option<String>,
32    /// Comma separated list of varnish request object fields that should be in the hash key.
33    #[serde(rename = "hash_keys", skip_serializing_if = "Option::is_none")]
34    pub hash_keys: Option<String>,
35    /// Name for the request settings.
36    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
37    pub name: Option<String>,
38    /// Condition which, if met, will select this configuration during a request. Optional.
39    #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")]
40    pub request_condition: Option<String>,
41    /// Short for X-Forwarded-For.
42    #[serde(rename = "xff", skip_serializing_if = "Option::is_none")]
43    pub xff: Option<Xff>,
44    /// Disable collapsed forwarding, so you don't wait for other objects to origin.
45    #[serde(rename = "bypass_busy_wait", skip_serializing_if = "Option::is_none")]
46    pub bypass_busy_wait: Option<String>,
47    /// Allows you to force a cache miss for the request. Replaces the item in the cache if the content is cacheable.
48    #[serde(rename = "force_miss", skip_serializing_if = "Option::is_none")]
49    pub force_miss: Option<String>,
50    /// Forces the request use SSL (redirects a non-SSL to SSL).
51    #[serde(rename = "force_ssl", skip_serializing_if = "Option::is_none")]
52    pub force_ssl: Option<String>,
53    /// Injects Fastly-Geo-Country, Fastly-Geo-City, and Fastly-Geo-Region into the request headers.
54    #[serde(rename = "geo_headers", skip_serializing_if = "Option::is_none")]
55    pub geo_headers: Option<String>,
56    /// How old an object is allowed to be to serve stale-if-error or stale-while-revalidate.
57    #[serde(rename = "max_stale_age", skip_serializing_if = "Option::is_none")]
58    pub max_stale_age: Option<String>,
59    /// Injects the X-Timer info into the request for viewing origin fetch durations.
60    #[serde(rename = "timer_support", skip_serializing_if = "Option::is_none")]
61    pub timer_support: Option<String>,
62}
63
64impl RequestSettingsResponse {
65    pub fn new() -> RequestSettingsResponse {
66        RequestSettingsResponse {
67            created_at: None,
68            deleted_at: None,
69            updated_at: None,
70            service_id: None,
71            version: None,
72            action: None,
73            default_host: None,
74            hash_keys: None,
75            name: None,
76            request_condition: None,
77            xff: None,
78            bypass_busy_wait: None,
79            force_miss: None,
80            force_ssl: None,
81            geo_headers: None,
82            max_stale_age: None,
83            timer_support: None,
84        }
85    }
86}
87
88/// Allows you to terminate request handling and immediately perform an action.
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum Action {
91    #[serde(rename = "lookup")]
92    Lookup,
93    #[serde(rename = "pass")]
94    Pass,
95}
96
97impl Default for Action {
98    fn default() -> Action {
99        Self::Lookup
100    }
101}
102/// Short for X-Forwarded-For.
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum Xff {
105    #[serde(rename = "clear")]
106    Clear,
107    #[serde(rename = "leave")]
108    Leave,
109    #[serde(rename = "append")]
110    Append,
111    #[serde(rename = "append_all")]
112    AppendAll,
113    #[serde(rename = "overwrite")]
114    Overwrite,
115}
116
117impl Default for Xff {
118    fn default() -> Xff {
119        Self::Clear
120    }
121}
122