fastly_api/models/
logging_https_additional.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 LoggingHttpsAdditional {
13    /// The URL to send logs to. Must use HTTPS. Required.
14    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
15    pub url: Option<String>,
16    /// The maximum number of logs sent in one request. Defaults `0` (10k).
17    #[serde(rename = "request_max_entries", skip_serializing_if = "Option::is_none")]
18    pub request_max_entries: Option<i32>,
19    /// The maximum number of bytes sent in one request. Defaults `0` (100MB).
20    #[serde(rename = "request_max_bytes", skip_serializing_if = "Option::is_none")]
21    pub request_max_bytes: Option<i32>,
22    /// Content type of the header sent with the request.
23    #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")]
24    pub content_type: Option<String>,
25    /// Name of the custom header sent with the request.
26    #[serde(rename = "header_name", skip_serializing_if = "Option::is_none")]
27    pub header_name: Option<String>,
28    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
29    pub message_type: Option<crate::models::LoggingMessageType>,
30    /// Value of the custom header sent with the request.
31    #[serde(rename = "header_value", skip_serializing_if = "Option::is_none")]
32    pub header_value: Option<String>,
33    /// HTTP method used for request.
34    #[serde(rename = "method", skip_serializing_if = "Option::is_none")]
35    pub method: Option<Method>,
36    /// Enforces valid JSON formatting for log entries.
37    #[serde(rename = "json_format", skip_serializing_if = "Option::is_none")]
38    pub json_format: Option<JsonFormat>,
39    /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).
40    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
41    pub format: Option<String>,
42}
43
44impl LoggingHttpsAdditional {
45    pub fn new() -> LoggingHttpsAdditional {
46        LoggingHttpsAdditional {
47            url: None,
48            request_max_entries: None,
49            request_max_bytes: None,
50            content_type: None,
51            header_name: None,
52            message_type: None,
53            header_value: None,
54            method: None,
55            json_format: None,
56            format: None,
57        }
58    }
59}
60
61/// HTTP method used for request.
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum Method {
64    #[serde(rename = "POST")]
65    POST,
66    #[serde(rename = "PUT")]
67    PUT,
68}
69
70impl Default for Method {
71    fn default() -> Method {
72        Self::POST
73    }
74}
75/// Enforces valid JSON formatting for log entries.
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
77pub enum JsonFormat {
78    #[serde(rename = "0")]
79    Disabled,
80    #[serde(rename = "1")]
81    JsonArray,
82    #[serde(rename = "2")]
83    NewlineDelimitedJson,
84}
85
86impl Default for JsonFormat {
87    fn default() -> JsonFormat {
88        Self::Disabled
89    }
90}
91