fastly_api/models/
logging_kafka_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 LoggingKafkaResponse {
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    /// A secure certificate to authenticate a server with. Must be in PEM format.
29    #[serde(rename = "tls_ca_cert", skip_serializing_if = "Option::is_none")]
30    pub tls_ca_cert: Option<String>,
31    /// The client certificate used to make authenticated requests. Must be in PEM format.
32    #[serde(rename = "tls_client_cert", skip_serializing_if = "Option::is_none")]
33    pub tls_client_cert: Option<String>,
34    /// The client private key used to make authenticated requests. Must be in PEM format.
35    #[serde(rename = "tls_client_key", skip_serializing_if = "Option::is_none")]
36    pub tls_client_key: Option<String>,
37    /// The hostname to verify the server's certificate. This should be one of the Subject Alternative Name (SAN) fields for the certificate. Common Names (CN) are not supported.
38    #[serde(rename = "tls_hostname", skip_serializing_if = "Option::is_none")]
39    pub tls_hostname: Option<String>,
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 Kafka topic to send logs to. Required.
54    #[serde(rename = "topic", skip_serializing_if = "Option::is_none")]
55    pub topic: Option<String>,
56    /// A comma-separated list of IP addresses or hostnames of Kafka brokers. Required.
57    #[serde(rename = "brokers", skip_serializing_if = "Option::is_none")]
58    pub brokers: Option<String>,
59    /// The codec used for compression of your logs.
60    #[serde(rename = "compression_codec", skip_serializing_if = "Option::is_none")]
61    pub compression_codec: Option<CompressionCodec>,
62    /// The number of acknowledgements a leader must receive before a write is considered successful.
63    #[serde(rename = "required_acks", skip_serializing_if = "Option::is_none")]
64    pub required_acks: Option<RequiredAcks>,
65    /// The maximum number of bytes sent in one request. Defaults `0` (no limit).
66    #[serde(rename = "request_max_bytes", skip_serializing_if = "Option::is_none")]
67    pub request_max_bytes: Option<i32>,
68    /// Enables parsing of key=value tuples from the beginning of a logline, turning them into [record headers](https://cwiki.apache.org/confluence/display/KAFKA/KIP-82+-+Add+Record+Headers).
69    #[serde(rename = "parse_log_keyvals", skip_serializing_if = "Option::is_none")]
70    pub parse_log_keyvals: Option<bool>,
71    /// SASL authentication method.
72    #[serde(rename = "auth_method", skip_serializing_if = "Option::is_none")]
73    pub auth_method: Option<AuthMethod>,
74    /// SASL user.
75    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
76    pub user: Option<String>,
77    /// SASL password.
78    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
79    pub password: Option<String>,
80    #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")]
81    pub use_tls: Option<crate::models::LoggingUseTlsString>,
82}
83
84impl LoggingKafkaResponse {
85    pub fn new() -> LoggingKafkaResponse {
86        LoggingKafkaResponse {
87            name: None,
88            placement: None,
89            response_condition: None,
90            format: None,
91            format_version: None,
92            tls_ca_cert: None,
93            tls_client_cert: None,
94            tls_client_key: None,
95            tls_hostname: None,
96            created_at: None,
97            deleted_at: None,
98            updated_at: None,
99            service_id: None,
100            version: None,
101            topic: None,
102            brokers: None,
103            compression_codec: None,
104            required_acks: None,
105            request_max_bytes: None,
106            parse_log_keyvals: None,
107            auth_method: None,
108            user: None,
109            password: None,
110            use_tls: None,
111        }
112    }
113}
114
115/// 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`. 
116#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
117pub enum Placement {
118    #[serde(rename = "none")]
119    None,
120    #[serde(rename = "waf_debug")]
121    WafDebug,
122    #[serde(rename = "null")]
123    Null,
124}
125
126impl Default for Placement {
127    fn default() -> Placement {
128        Self::None
129    }
130}
131/// 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`. 
132#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
133pub enum FormatVersion {
134    #[serde(rename = "1")]
135    V1,
136    #[serde(rename = "2")]
137    V2,
138}
139
140impl Default for FormatVersion {
141    fn default() -> FormatVersion {
142        Self::V1
143    }
144}
145/// The codec used for compression of your logs.
146#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
147pub enum CompressionCodec {
148    #[serde(rename = "gzip")]
149    Gzip,
150    #[serde(rename = "snappy")]
151    Snappy,
152    #[serde(rename = "lz4")]
153    Lz4,
154    #[serde(rename = "null")]
155    Null,
156}
157
158impl Default for CompressionCodec {
159    fn default() -> CompressionCodec {
160        Self::Gzip
161    }
162}
163/// The number of acknowledgements a leader must receive before a write is considered successful.
164#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
165pub enum RequiredAcks {
166    #[serde(rename = "1")]
167    RequiredAcksOne,
168    #[serde(rename = "0")]
169    RequiredAcksNone,
170    #[serde(rename = "-1")]
171    RequiredAcksAll,
172}
173
174impl Default for RequiredAcks {
175    fn default() -> RequiredAcks {
176        Self::RequiredAcksOne
177    }
178}
179/// SASL authentication method.
180#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
181pub enum AuthMethod {
182    #[serde(rename = "plain")]
183    Plain,
184    #[serde(rename = "scram-sha-256")]
185    ScramSha256,
186    #[serde(rename = "scram-sha-512")]
187    ScramSha512,
188}
189
190impl Default for AuthMethod {
191    fn default() -> AuthMethod {
192        Self::Plain
193    }
194}
195