fastly_api/models/
logging_generic_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 LoggingGenericCommon {
13    /// How the message should be formatted.
14    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
15    pub message_type: Option<MessageType>,
16    /// A timestamp format
17    #[serde(rename = "timestamp_format", skip_serializing_if = "Option::is_none")]
18    pub timestamp_format: Option<String>,
19    /// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
20    #[serde(rename = "compression_codec", skip_serializing_if = "Option::is_none")]
21    pub compression_codec: Option<CompressionCodec>,
22}
23
24impl LoggingGenericCommon {
25    pub fn new() -> LoggingGenericCommon {
26        LoggingGenericCommon {
27            message_type: None,
28            timestamp_format: None,
29            compression_codec: None,
30        }
31    }
32}
33
34/// How the message should be formatted.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum MessageType {
37    #[serde(rename = "classic")]
38    Classic,
39    #[serde(rename = "loggly")]
40    Loggly,
41    #[serde(rename = "logplex")]
42    Logplex,
43    #[serde(rename = "blank")]
44    Blank,
45}
46
47impl Default for MessageType {
48    fn default() -> MessageType {
49        Self::Classic
50    }
51}
52/// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum CompressionCodec {
55    #[serde(rename = "zstd")]
56    Zstd,
57    #[serde(rename = "snappy")]
58    Snappy,
59    #[serde(rename = "gzip")]
60    Gzip,
61}
62
63impl Default for CompressionCodec {
64    fn default() -> CompressionCodec {
65        Self::Zstd
66    }
67}
68