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://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    /// A secure certificate to authenticate a server with. Must be in PEM format.
32    #[serde(rename = "tls_ca_cert", skip_serializing_if = "Option::is_none")]
33    pub tls_ca_cert: Option<String>,
34    /// The client certificate used to make authenticated requests. Must be in PEM format.
35    #[serde(rename = "tls_client_cert", skip_serializing_if = "Option::is_none")]
36    pub tls_client_cert: Option<String>,
37    /// The client private key used to make authenticated requests. Must be in PEM format.
38    #[serde(rename = "tls_client_key", skip_serializing_if = "Option::is_none")]
39    pub tls_client_key: Option<String>,
40    /// 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.
41    #[serde(rename = "tls_hostname", skip_serializing_if = "Option::is_none")]
42    pub tls_hostname: Option<String>,
43    /// Date and time in ISO 8601 format.
44    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
45    pub created_at: Option<String>,
46    /// Date and time in ISO 8601 format.
47    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
48    pub deleted_at: Option<String>,
49    /// Date and time in ISO 8601 format.
50    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
51    pub updated_at: Option<String>,
52    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
53    pub service_id: Option<Box<String>>,
54    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
55    pub version: Option<Box<String>>,
56    /// The Kafka topic to send logs to. Required.
57    #[serde(rename = "topic", skip_serializing_if = "Option::is_none")]
58    pub topic: Option<String>,
59    /// A comma-separated list of IP addresses or hostnames of Kafka brokers. Required.
60    #[serde(rename = "brokers", skip_serializing_if = "Option::is_none")]
61    pub brokers: Option<String>,
62    /// The codec used for compression of your logs.
63    #[serde(rename = "compression_codec", skip_serializing_if = "Option::is_none")]
64    pub compression_codec: Option<CompressionCodec>,
65    /// The number of acknowledgements a leader must receive before a write is considered successful.
66    #[serde(rename = "required_acks", skip_serializing_if = "Option::is_none")]
67    pub required_acks: Option<RequiredAcks>,
68    /// The maximum number of bytes sent in one request. Defaults `0` (no limit).
69    #[serde(rename = "request_max_bytes", skip_serializing_if = "Option::is_none")]
70    pub request_max_bytes: Option<i32>,
71    /// 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).
72    #[serde(rename = "parse_log_keyvals", skip_serializing_if = "Option::is_none")]
73    pub parse_log_keyvals: Option<bool>,
74    /// SASL authentication method.
75    #[serde(rename = "auth_method", skip_serializing_if = "Option::is_none")]
76    pub auth_method: Option<AuthMethod>,
77    /// SASL user.
78    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
79    pub user: Option<String>,
80    /// SASL password.
81    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
82    pub password: Option<String>,
83    #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")]
84    pub use_tls: Option<crate::models::LoggingUseTlsString>,
85}
86
87impl LoggingKafkaResponse {
88    pub fn new() -> LoggingKafkaResponse {
89        LoggingKafkaResponse {
90            name: None,
91            placement: None,
92            response_condition: None,
93            format: None,
94            log_processing_region: None,
95            format_version: None,
96            tls_ca_cert: None,
97            tls_client_cert: None,
98            tls_client_key: None,
99            tls_hostname: None,
100            created_at: None,
101            deleted_at: None,
102            updated_at: None,
103            service_id: None,
104            version: None,
105            topic: None,
106            brokers: None,
107            compression_codec: None,
108            required_acks: None,
109            request_max_bytes: None,
110            parse_log_keyvals: None,
111            auth_method: None,
112            user: None,
113            password: None,
114            use_tls: None,
115        }
116    }
117}
118
119/// 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`. 
120#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
121pub enum Placement {
122    #[serde(rename = "none")]
123    None,
124    #[serde(rename = "null")]
125    Null,
126}
127
128impl Default for Placement {
129    fn default() -> Placement {
130        Self::None
131    }
132}
133/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
134#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
135pub enum LogProcessingRegion {
136    #[serde(rename = "none")]
137    None,
138    #[serde(rename = "eu")]
139    Eu,
140    #[serde(rename = "us")]
141    Us,
142}
143
144impl Default for LogProcessingRegion {
145    fn default() -> LogProcessingRegion {
146        Self::None
147    }
148}
149/// 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`. 
150#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
151pub enum FormatVersion {
152    #[serde(rename = "1")]
153    V1,
154    #[serde(rename = "2")]
155    V2,
156}
157
158impl Default for FormatVersion {
159    fn default() -> FormatVersion {
160        Self::V1
161    }
162}
163/// The codec used for compression of your logs.
164#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
165pub enum CompressionCodec {
166    #[serde(rename = "gzip")]
167    Gzip,
168    #[serde(rename = "snappy")]
169    Snappy,
170    #[serde(rename = "lz4")]
171    Lz4,
172    #[serde(rename = "null")]
173    Null,
174}
175
176impl Default for CompressionCodec {
177    fn default() -> CompressionCodec {
178        Self::Gzip
179    }
180}
181/// The number of acknowledgements a leader must receive before a write is considered successful.
182#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
183pub enum RequiredAcks {
184    #[serde(rename = "1")]
185    RequiredAcksOne,
186    #[serde(rename = "0")]
187    RequiredAcksNone,
188    #[serde(rename = "-1")]
189    RequiredAcksAll,
190}
191
192impl Default for RequiredAcks {
193    fn default() -> RequiredAcks {
194        Self::RequiredAcksOne
195    }
196}
197/// SASL authentication method.
198#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
199pub enum AuthMethod {
200    #[serde(rename = "plain")]
201    Plain,
202    #[serde(rename = "scram-sha-256")]
203    ScramSha256,
204    #[serde(rename = "scram-sha-512")]
205    ScramSha512,
206}
207
208impl Default for AuthMethod {
209    fn default() -> AuthMethod {
210        Self::Plain
211    }
212}
213