fastly_api/models/
logging_gcs_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 LoggingGcsResponse {
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    /// How the message should be formatted.
29    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
30    pub message_type: Option<MessageType>,
31    /// A timestamp format
32    #[serde(rename = "timestamp_format", skip_serializing_if = "Option::is_none")]
33    pub timestamp_format: Option<String>,
34    /// 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.
35    #[serde(rename = "compression_codec", skip_serializing_if = "Option::is_none")]
36    pub compression_codec: Option<CompressionCodec>,
37    /// How frequently log files are finalized so they can be available for reading (in seconds).
38    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
39    pub period: Option<String>,
40    /// The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
41    #[serde(rename = "gzip_level", skip_serializing_if = "Option::is_none")]
42    pub gzip_level: Option<String>,
43    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
44    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
45    pub user: Option<String>,
46    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
47    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
48    pub secret_key: Option<String>,
49    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
50    #[serde(rename = "account_name", skip_serializing_if = "Option::is_none")]
51    pub account_name: Option<String>,
52    /// Date and time in ISO 8601 format.
53    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
54    pub created_at: Option<String>,
55    /// Date and time in ISO 8601 format.
56    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
57    pub deleted_at: Option<String>,
58    /// Date and time in ISO 8601 format.
59    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
60    pub updated_at: Option<String>,
61    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
62    pub service_id: Option<Box<String>>,
63    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
64    pub version: Option<Box<String>>,
65    /// The name of the GCS bucket.
66    #[serde(rename = "bucket_name", skip_serializing_if = "Option::is_none")]
67    pub bucket_name: Option<String>,
68    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
69    pub path: Option<Box<String>>,
70    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
71    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
72    pub public_key: Option<String>,
73    /// Your Google Cloud Platform project ID. Required
74    #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")]
75    pub project_id: Option<String>,
76}
77
78impl LoggingGcsResponse {
79    pub fn new() -> LoggingGcsResponse {
80        LoggingGcsResponse {
81            name: None,
82            placement: None,
83            response_condition: None,
84            format: None,
85            format_version: None,
86            message_type: None,
87            timestamp_format: None,
88            compression_codec: None,
89            period: None,
90            gzip_level: None,
91            user: None,
92            secret_key: None,
93            account_name: None,
94            created_at: None,
95            deleted_at: None,
96            updated_at: None,
97            service_id: None,
98            version: None,
99            bucket_name: None,
100            path: None,
101            public_key: None,
102            project_id: None,
103        }
104    }
105}
106
107/// 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`. 
108#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
109pub enum Placement {
110    #[serde(rename = "none")]
111    None,
112    #[serde(rename = "waf_debug")]
113    WafDebug,
114    #[serde(rename = "null")]
115    Null,
116}
117
118impl Default for Placement {
119    fn default() -> Placement {
120        Self::None
121    }
122}
123/// 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`. 
124#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
125pub enum FormatVersion {
126    #[serde(rename = "1")]
127    V1,
128    #[serde(rename = "2")]
129    V2,
130}
131
132impl Default for FormatVersion {
133    fn default() -> FormatVersion {
134        Self::V1
135    }
136}
137/// How the message should be formatted.
138#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
139pub enum MessageType {
140    #[serde(rename = "classic")]
141    Classic,
142    #[serde(rename = "loggly")]
143    Loggly,
144    #[serde(rename = "logplex")]
145    Logplex,
146    #[serde(rename = "blank")]
147    Blank,
148}
149
150impl Default for MessageType {
151    fn default() -> MessageType {
152        Self::Classic
153    }
154}
155/// 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.
156#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
157pub enum CompressionCodec {
158    #[serde(rename = "zstd")]
159    Zstd,
160    #[serde(rename = "snappy")]
161    Snappy,
162    #[serde(rename = "gzip")]
163    Gzip,
164}
165
166impl Default for CompressionCodec {
167    fn default() -> CompressionCodec {
168        Self::Zstd
169    }
170}
171