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