fastly_api/models/
logging_ftp_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 LoggingFtpResponse {
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    /// An hostname or IPv4 address.
60    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
61    pub address: Option<String>,
62    /// Hostname used.
63    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
64    pub hostname: Option<String>,
65    /// IPv4 address of the host.
66    #[serde(rename = "ipv4", skip_serializing_if = "Option::is_none")]
67    pub ipv4: Option<String>,
68    /// The password for the server. For anonymous use an email address.
69    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
70    pub password: Option<String>,
71    /// The path to upload log files to. If the path ends in `/` then it is treated as a directory.
72    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
73    pub path: Option<String>,
74    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
75    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
76    pub public_key: Option<String>,
77    /// The username for the server. Can be anonymous.
78    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
79    pub user: Option<String>,
80    /// The port number.
81    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
82    pub port: Option<String>,
83}
84
85impl LoggingFtpResponse {
86    pub fn new() -> LoggingFtpResponse {
87        LoggingFtpResponse {
88            name: None,
89            placement: None,
90            response_condition: None,
91            format: None,
92            log_processing_region: None,
93            format_version: None,
94            message_type: None,
95            timestamp_format: None,
96            compression_codec: None,
97            period: None,
98            gzip_level: None,
99            created_at: None,
100            deleted_at: None,
101            updated_at: None,
102            service_id: None,
103            version: None,
104            address: None,
105            hostname: None,
106            ipv4: None,
107            password: None,
108            path: None,
109            public_key: None,
110            user: None,
111            port: None,
112        }
113    }
114}
115
116/// 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`. 
117#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
118pub enum Placement {
119    #[serde(rename = "none")]
120    None,
121    #[serde(rename = "null")]
122    Null,
123}
124
125impl Default for Placement {
126    fn default() -> Placement {
127        Self::None
128    }
129}
130/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
131#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
132pub enum LogProcessingRegion {
133    #[serde(rename = "none")]
134    None,
135    #[serde(rename = "eu")]
136    Eu,
137    #[serde(rename = "us")]
138    Us,
139}
140
141impl Default for LogProcessingRegion {
142    fn default() -> LogProcessingRegion {
143        Self::None
144    }
145}
146/// 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`. 
147#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
148pub enum FormatVersion {
149    #[serde(rename = "1")]
150    V1,
151    #[serde(rename = "2")]
152    V2,
153}
154
155impl Default for FormatVersion {
156    fn default() -> FormatVersion {
157        Self::V1
158    }
159}
160/// How the message should be formatted.
161#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
162pub enum MessageType {
163    #[serde(rename = "classic")]
164    Classic,
165    #[serde(rename = "loggly")]
166    Loggly,
167    #[serde(rename = "logplex")]
168    Logplex,
169    #[serde(rename = "blank")]
170    Blank,
171}
172
173impl Default for MessageType {
174    fn default() -> MessageType {
175        Self::Classic
176    }
177}
178/// 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.
179#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
180pub enum CompressionCodec {
181    #[serde(rename = "zstd")]
182    Zstd,
183    #[serde(rename = "snappy")]
184    Snappy,
185    #[serde(rename = "gzip")]
186    Gzip,
187}
188
189impl Default for CompressionCodec {
190    fn default() -> CompressionCodec {
191        Self::Zstd
192    }
193}
194