fastly_api/models/
logging_sftp_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 LoggingSftpResponse {
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    /// Date and time in ISO 8601 format.
41    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
42    pub created_at: Option<String>,
43    /// Date and time in ISO 8601 format.
44    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
45    pub deleted_at: Option<String>,
46    /// Date and time in ISO 8601 format.
47    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
48    pub updated_at: Option<String>,
49    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
50    pub service_id: Option<Box<String>>,
51    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
52    pub version: Option<Box<String>>,
53    /// The password for the server. If both `password` and `secret_key` are passed, `secret_key` will be used in preference.
54    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
55    pub password: Option<String>,
56    /// The path to upload logs to.
57    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
58    pub path: Option<String>,
59    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
60    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
61    pub public_key: Option<String>,
62    /// The SSH private key for the server. If both `password` and `secret_key` are passed, `secret_key` will be used in preference.
63    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
64    pub secret_key: Option<String>,
65    /// A list of host keys for all hosts we can connect to over SFTP.
66    #[serde(rename = "ssh_known_hosts", skip_serializing_if = "Option::is_none")]
67    pub ssh_known_hosts: Option<String>,
68    /// The username for the server.
69    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
70    pub user: Option<String>,
71    /// A hostname or IPv4 address.
72    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
73    pub address: Option<String>,
74    /// The port number.
75    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
76    pub port: Option<String>,
77    /// How frequently log files are finalized so they can be available for reading (in seconds).
78    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
79    pub period: Option<String>,
80    /// 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.
81    #[serde(rename = "gzip_level", skip_serializing_if = "Option::is_none")]
82    pub gzip_level: Option<i32>,
83}
84
85impl LoggingSftpResponse {
86    pub fn new() -> LoggingSftpResponse {
87        LoggingSftpResponse {
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            created_at: None,
98            deleted_at: None,
99            updated_at: None,
100            service_id: None,
101            version: None,
102            password: None,
103            path: None,
104            public_key: None,
105            secret_key: None,
106            ssh_known_hosts: None,
107            user: None,
108            address: None,
109            port: None,
110            period: None,
111            gzip_level: 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