fastly_api/models/
logging_logentries_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 LoggingLogentriesResponse {
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    /// 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`. 
26    #[serde(rename = "format_version", skip_serializing_if = "Option::is_none")]
27    pub format_version: Option<FormatVersion>,
28    /// The port number.
29    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
30    pub port: Option<i32>,
31    /// Use token based authentication.
32    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
33    pub token: Option<String>,
34    #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")]
35    pub use_tls: Option<crate::models::LoggingUseTlsString>,
36    /// The region to which to stream logs.
37    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
38    pub region: Option<Region>,
39    /// Date and time in ISO 8601 format.
40    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
41    pub created_at: Option<String>,
42    /// Date and time in ISO 8601 format.
43    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
44    pub deleted_at: Option<String>,
45    /// Date and time in ISO 8601 format.
46    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
47    pub updated_at: Option<String>,
48    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
49    pub service_id: Option<Box<String>>,
50    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
51    pub version: Option<Box<String>>,
52}
53
54impl LoggingLogentriesResponse {
55    pub fn new() -> LoggingLogentriesResponse {
56        LoggingLogentriesResponse {
57            name: None,
58            placement: None,
59            response_condition: None,
60            format: None,
61            format_version: None,
62            port: None,
63            token: None,
64            use_tls: None,
65            region: None,
66            created_at: None,
67            deleted_at: None,
68            updated_at: None,
69            service_id: None,
70            version: None,
71        }
72    }
73}
74
75/// 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`. 
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
77pub enum Placement {
78    #[serde(rename = "none")]
79    None,
80    #[serde(rename = "waf_debug")]
81    WafDebug,
82    #[serde(rename = "null")]
83    Null,
84}
85
86impl Default for Placement {
87    fn default() -> Placement {
88        Self::None
89    }
90}
91/// 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`. 
92#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
93pub enum FormatVersion {
94    #[serde(rename = "1")]
95    V1,
96    #[serde(rename = "2")]
97    V2,
98}
99
100impl Default for FormatVersion {
101    fn default() -> FormatVersion {
102        Self::V1
103    }
104}
105/// The region to which to stream logs.
106#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
107pub enum Region {
108    #[serde(rename = "US")]
109    US,
110    #[serde(rename = "US-2")]
111    US2,
112    #[serde(rename = "US-3")]
113    US3,
114    #[serde(rename = "EU")]
115    EU,
116    #[serde(rename = "CA")]
117    CA,
118    #[serde(rename = "AU")]
119    AU,
120    #[serde(rename = "AP")]
121    AP,
122}
123
124impl Default for Region {
125    fn default() -> Region {
126        Self::US
127    }
128}
129