fastly_api/models/logging_common.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 LoggingCommon {
13 /// The name for the real-time logging configuration.
14 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
15 pub name: Option<String>,
16 /// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
17 #[serde(rename = "placement", skip_serializing_if = "Option::is_none")]
18 pub placement: Option<Placement>,
19 /// The name of an existing condition in the configured endpoint, or leave blank to always execute.
20 #[serde(rename = "response_condition", skip_serializing_if = "Option::is_none")]
21 pub response_condition: Option<String>,
22 /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).
23 #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
24 pub format: Option<String>,
25}
26
27impl LoggingCommon {
28 pub fn new() -> LoggingCommon {
29 LoggingCommon {
30 name: None,
31 placement: None,
32 response_condition: None,
33 format: None,
34 }
35 }
36}
37
38/// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Placement {
41 #[serde(rename = "none")]
42 None,
43 #[serde(rename = "null")]
44 Null,
45}
46
47impl Default for Placement {
48 fn default() -> Placement {
49 Self::None
50 }
51}
52