fastly_api/models/
logging_https_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 LoggingHttpsResponse {
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    /// The maximum number of logs sent in one request. Defaults `0` (10k).
41    #[serde(rename = "request_max_entries", skip_serializing_if = "Option::is_none")]
42    pub request_max_entries: Option<i32>,
43    /// The maximum number of bytes sent in one request. Defaults `0` (100MB).
44    #[serde(rename = "request_max_bytes", skip_serializing_if = "Option::is_none")]
45    pub request_max_bytes: Option<i32>,
46    /// The URL to send logs to. Must use HTTPS. Required.
47    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
48    pub url: Option<String>,
49    /// Content type of the header sent with the request.
50    #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")]
51    pub content_type: Option<String>,
52    /// Name of the custom header sent with the request.
53    #[serde(rename = "header_name", skip_serializing_if = "Option::is_none")]
54    pub header_name: Option<String>,
55    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
56    pub message_type: Option<crate::models::LoggingMessageType>,
57    /// Value of the custom header sent with the request.
58    #[serde(rename = "header_value", skip_serializing_if = "Option::is_none")]
59    pub header_value: Option<String>,
60    /// HTTP method used for request.
61    #[serde(rename = "method", skip_serializing_if = "Option::is_none")]
62    pub method: Option<Method>,
63    /// Enforces valid JSON formatting for log entries.
64    #[serde(rename = "json_format", skip_serializing_if = "Option::is_none")]
65    pub json_format: Option<JsonFormat>,
66    /// Date and time in ISO 8601 format.
67    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
68    pub created_at: Option<String>,
69    /// Date and time in ISO 8601 format.
70    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
71    pub deleted_at: Option<String>,
72    /// Date and time in ISO 8601 format.
73    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
74    pub updated_at: Option<String>,
75    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
76    pub service_id: Option<Box<String>>,
77    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
78    pub version: Option<Box<String>>,
79}
80
81impl LoggingHttpsResponse {
82    pub fn new() -> LoggingHttpsResponse {
83        LoggingHttpsResponse {
84            name: None,
85            placement: None,
86            response_condition: None,
87            format: None,
88            format_version: None,
89            tls_ca_cert: None,
90            tls_client_cert: None,
91            tls_client_key: None,
92            tls_hostname: None,
93            request_max_entries: None,
94            request_max_bytes: None,
95            url: None,
96            content_type: None,
97            header_name: None,
98            message_type: None,
99            header_value: None,
100            method: None,
101            json_format: None,
102            created_at: None,
103            deleted_at: None,
104            updated_at: None,
105            service_id: None,
106            version: None,
107        }
108    }
109}
110
111/// 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`. 
112#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
113pub enum Placement {
114    #[serde(rename = "none")]
115    None,
116    #[serde(rename = "waf_debug")]
117    WafDebug,
118    #[serde(rename = "null")]
119    Null,
120}
121
122impl Default for Placement {
123    fn default() -> Placement {
124        Self::None
125    }
126}
127/// 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`. 
128#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
129pub enum FormatVersion {
130    #[serde(rename = "1")]
131    V1,
132    #[serde(rename = "2")]
133    V2,
134}
135
136impl Default for FormatVersion {
137    fn default() -> FormatVersion {
138        Self::V1
139    }
140}
141/// HTTP method used for request.
142#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
143pub enum Method {
144    #[serde(rename = "POST")]
145    POST,
146    #[serde(rename = "PUT")]
147    PUT,
148}
149
150impl Default for Method {
151    fn default() -> Method {
152        Self::POST
153    }
154}
155/// Enforces valid JSON formatting for log entries.
156#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
157pub enum JsonFormat {
158    #[serde(rename = "0")]
159    Disabled,
160    #[serde(rename = "1")]
161    JsonArray,
162    #[serde(rename = "2")]
163    NewlineDelimitedJson,
164}
165
166impl Default for JsonFormat {
167    fn default() -> JsonFormat {
168        Self::Disabled
169    }
170}
171