fastly_api/models/
logging_common_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 LoggingCommonResponse {
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://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).
23    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
24    pub format: Option<String>,
25    /// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
26    #[serde(rename = "log_processing_region", skip_serializing_if = "Option::is_none")]
27    pub log_processing_region: Option<LogProcessingRegion>,
28    /// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
29    #[serde(rename = "format_version", skip_serializing_if = "Option::is_none")]
30    pub format_version: Option<FormatVersion>,
31}
32
33impl LoggingCommonResponse {
34    pub fn new() -> LoggingCommonResponse {
35        LoggingCommonResponse {
36            name: None,
37            placement: None,
38            response_condition: None,
39            format: None,
40            log_processing_region: None,
41            format_version: None,
42        }
43    }
44}
45
46/// 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`. 
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Placement {
49    #[serde(rename = "none")]
50    None,
51    #[serde(rename = "null")]
52    Null,
53}
54
55impl Default for Placement {
56    fn default() -> Placement {
57        Self::None
58    }
59}
60/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum LogProcessingRegion {
63    #[serde(rename = "none")]
64    None,
65    #[serde(rename = "eu")]
66    Eu,
67    #[serde(rename = "us")]
68    Us,
69}
70
71impl Default for LogProcessingRegion {
72    fn default() -> LogProcessingRegion {
73        Self::None
74    }
75}
76/// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum FormatVersion {
79    #[serde(rename = "1")]
80    V1,
81    #[serde(rename = "2")]
82    V2,
83}
84
85impl Default for FormatVersion {
86    fn default() -> FormatVersion {
87        Self::V1
88    }
89}
90