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://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    /// Date and time in ISO 8601 format.
38    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
39    pub created_at: Option<String>,
40    /// Date and time in ISO 8601 format.
41    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
42    pub deleted_at: Option<String>,
43    /// Date and time in ISO 8601 format.
44    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
45    pub updated_at: Option<String>,
46    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
47    pub service_id: Option<Box<String>>,
48    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
49    pub version: Option<Box<String>>,
50    /// The password for the server. If both `password` and `secret_key` are passed, `secret_key` will be used in preference.
51    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
52    pub password: Option<String>,
53    /// The path to upload logs to.
54    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
55    pub path: Option<String>,
56    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
57    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
58    pub public_key: Option<String>,
59    /// The SSH private key for the server. If both `password` and `secret_key` are passed, `secret_key` will be used in preference.
60    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
61    pub secret_key: Option<String>,
62    /// A list of host keys for all hosts we can connect to over SFTP.
63    #[serde(rename = "ssh_known_hosts", skip_serializing_if = "Option::is_none")]
64    pub ssh_known_hosts: Option<String>,
65    /// The username for the server.
66    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
67    pub user: Option<String>,
68    /// A hostname or IPv4 address.
69    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
70    pub address: Option<String>,
71    /// The port number.
72    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
73    pub port: Option<String>,
74    /// How frequently log files are finalized so they can be available for reading (in seconds).
75    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
76    pub period: Option<String>,
77    /// 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.
78    #[serde(rename = "gzip_level", skip_serializing_if = "Option::is_none")]
79    pub gzip_level: Option<i32>,
80}
81
82impl LoggingSftpResponse {
83    pub fn new() -> LoggingSftpResponse {
84        LoggingSftpResponse {
85            name: None,
86            placement: None,
87            response_condition: None,
88            format: None,
89            format_version: None,
90            message_type: None,
91            timestamp_format: None,
92            compression_codec: None,
93            created_at: None,
94            deleted_at: None,
95            updated_at: None,
96            service_id: None,
97            version: None,
98            password: None,
99            path: None,
100            public_key: None,
101            secret_key: None,
102            ssh_known_hosts: None,
103            user: None,
104            address: None,
105            port: None,
106            period: None,
107            gzip_level: None,
108        }
109    }
110}
111
112/// 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`. 
113#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
114pub enum Placement {
115    #[serde(rename = "none")]
116    None,
117    #[serde(rename = "waf_debug")]
118    WafDebug,
119    #[serde(rename = "null")]
120    Null,
121}
122
123impl Default for Placement {
124    fn default() -> Placement {
125        Self::None
126    }
127}
128/// 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`. 
129#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
130pub enum FormatVersion {
131    #[serde(rename = "1")]
132    V1,
133    #[serde(rename = "2")]
134    V2,
135}
136
137impl Default for FormatVersion {
138    fn default() -> FormatVersion {
139        Self::V1
140    }
141}
142/// How the message should be formatted.
143#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
144pub enum MessageType {
145    #[serde(rename = "classic")]
146    Classic,
147    #[serde(rename = "loggly")]
148    Loggly,
149    #[serde(rename = "logplex")]
150    Logplex,
151    #[serde(rename = "blank")]
152    Blank,
153}
154
155impl Default for MessageType {
156    fn default() -> MessageType {
157        Self::Classic
158    }
159}
160/// 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.
161#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
162pub enum CompressionCodec {
163    #[serde(rename = "zstd")]
164    Zstd,
165    #[serde(rename = "snappy")]
166    Snappy,
167    #[serde(rename = "gzip")]
168    Gzip,
169}
170
171impl Default for CompressionCodec {
172    fn default() -> CompressionCodec {
173        Self::Zstd
174    }
175}
176