fastly_api/models/
logging_azureblob_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 LoggingAzureblobResponse {
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    /// Date and time in ISO 8601 format.
47    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
48    pub created_at: Option<String>,
49    /// Date and time in ISO 8601 format.
50    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
51    pub deleted_at: Option<String>,
52    /// Date and time in ISO 8601 format.
53    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
54    pub updated_at: Option<String>,
55    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
56    pub service_id: Option<Box<String>>,
57    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
58    pub version: Option<Box<String>>,
59    /// The path to upload logs to.
60    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
61    pub path: Option<String>,
62    /// The unique Azure Blob Storage namespace in which your data objects are stored. Required.
63    #[serde(rename = "account_name", skip_serializing_if = "Option::is_none")]
64    pub account_name: Option<String>,
65    /// The name of the Azure Blob Storage container in which to store logs. Required.
66    #[serde(rename = "container", skip_serializing_if = "Option::is_none")]
67    pub container: Option<String>,
68    /// The Azure shared access signature providing write access to the blob service objects. Be sure to update your token before it expires or the logging functionality will not work. Required.
69    #[serde(rename = "sas_token", skip_serializing_if = "Option::is_none")]
70    pub sas_token: Option<String>,
71    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
72    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
73    pub public_key: Option<String>,
74    /// The maximum number of bytes for each uploaded file. A value of 0 can be used to indicate there is no limit on the size of uploaded files, otherwise the minimum value is 1048576 bytes (1 MiB). Note that Microsoft Azure Storage has [block size limits](https://learn.microsoft.com/en-us/rest/api/storageservices/put-block?tabs=microsoft-entra-id#remarks).
75    #[serde(rename = "file_max_bytes", skip_serializing_if = "Option::is_none")]
76    pub file_max_bytes: Option<i32>,
77}
78
79impl LoggingAzureblobResponse {
80    pub fn new() -> LoggingAzureblobResponse {
81        LoggingAzureblobResponse {
82            name: None,
83            placement: None,
84            response_condition: None,
85            format: None,
86            log_processing_region: None,
87            format_version: None,
88            message_type: None,
89            timestamp_format: None,
90            compression_codec: None,
91            period: None,
92            gzip_level: None,
93            created_at: None,
94            deleted_at: None,
95            updated_at: None,
96            service_id: None,
97            version: None,
98            path: None,
99            account_name: None,
100            container: None,
101            sas_token: None,
102            public_key: None,
103            file_max_bytes: None,
104        }
105    }
106}
107
108/// 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`. 
109#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
110pub enum Placement {
111    #[serde(rename = "none")]
112    None,
113    #[serde(rename = "null")]
114    Null,
115}
116
117impl Default for Placement {
118    fn default() -> Placement {
119        Self::None
120    }
121}
122/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
123#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
124pub enum LogProcessingRegion {
125    #[serde(rename = "none")]
126    None,
127    #[serde(rename = "eu")]
128    Eu,
129    #[serde(rename = "us")]
130    Us,
131}
132
133impl Default for LogProcessingRegion {
134    fn default() -> LogProcessingRegion {
135        Self::None
136    }
137}
138/// 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`. 
139#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
140pub enum FormatVersion {
141    #[serde(rename = "1")]
142    V1,
143    #[serde(rename = "2")]
144    V2,
145}
146
147impl Default for FormatVersion {
148    fn default() -> FormatVersion {
149        Self::V1
150    }
151}
152/// How the message should be formatted.
153#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
154pub enum MessageType {
155    #[serde(rename = "classic")]
156    Classic,
157    #[serde(rename = "loggly")]
158    Loggly,
159    #[serde(rename = "logplex")]
160    Logplex,
161    #[serde(rename = "blank")]
162    Blank,
163}
164
165impl Default for MessageType {
166    fn default() -> MessageType {
167        Self::Classic
168    }
169}
170/// 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.
171#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
172pub enum CompressionCodec {
173    #[serde(rename = "zstd")]
174    Zstd,
175    #[serde(rename = "snappy")]
176    Snappy,
177    #[serde(rename = "gzip")]
178    Gzip,
179}
180
181impl Default for CompressionCodec {
182    fn default() -> CompressionCodec {
183        Self::Zstd
184    }
185}
186