fastly_api/models/
logging_syslog_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 LoggingSyslogResponse {
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    /// A hostname or IPv4 address.
44    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
45    pub address: Option<String>,
46    /// The port number.
47    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
48    pub port: Option<i32>,
49    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
50    pub message_type: Option<crate::models::LoggingMessageType>,
51    /// The hostname used for the syslog endpoint.
52    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
53    pub hostname: Option<String>,
54    /// The IPv4 address used for the syslog endpoint.
55    #[serde(rename = "ipv4", skip_serializing_if = "Option::is_none")]
56    pub ipv4: Option<String>,
57    /// Whether to prepend each message with a specific token.
58    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
59    pub token: Option<String>,
60    #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")]
61    pub use_tls: Option<crate::models::LoggingUseTlsString>,
62    /// Date and time in ISO 8601 format.
63    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
64    pub created_at: Option<String>,
65    /// Date and time in ISO 8601 format.
66    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
67    pub deleted_at: Option<String>,
68    /// Date and time in ISO 8601 format.
69    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
70    pub updated_at: Option<String>,
71    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
72    pub service_id: Option<Box<String>>,
73    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
74    pub version: Option<Box<String>>,
75}
76
77impl LoggingSyslogResponse {
78    pub fn new() -> LoggingSyslogResponse {
79        LoggingSyslogResponse {
80            name: None,
81            placement: None,
82            response_condition: None,
83            format: None,
84            log_processing_region: None,
85            format_version: None,
86            tls_ca_cert: None,
87            tls_client_cert: None,
88            tls_client_key: None,
89            tls_hostname: None,
90            address: None,
91            port: None,
92            message_type: None,
93            hostname: None,
94            ipv4: None,
95            token: None,
96            use_tls: None,
97            created_at: None,
98            deleted_at: None,
99            updated_at: None,
100            service_id: None,
101            version: None,
102        }
103    }
104}
105
106/// 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`. 
107#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
108pub enum Placement {
109    #[serde(rename = "none")]
110    None,
111    #[serde(rename = "null")]
112    Null,
113}
114
115impl Default for Placement {
116    fn default() -> Placement {
117        Self::None
118    }
119}
120/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
121#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
122pub enum LogProcessingRegion {
123    #[serde(rename = "none")]
124    None,
125    #[serde(rename = "eu")]
126    Eu,
127    #[serde(rename = "us")]
128    Us,
129}
130
131impl Default for LogProcessingRegion {
132    fn default() -> LogProcessingRegion {
133        Self::None
134    }
135}
136/// 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`. 
137#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
138pub enum FormatVersion {
139    #[serde(rename = "1")]
140    V1,
141    #[serde(rename = "2")]
142    V2,
143}
144
145impl Default for FormatVersion {
146    fn default() -> FormatVersion {
147        Self::V1
148    }
149}
150