fastly_api/models/
log_record.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 LogRecord {
13    /// The ID of the Fastly customer that owns the service.
14    #[serde(rename = "customer_id", skip_serializing_if = "Option::is_none")]
15    pub customer_id: Option<String>,
16    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
17    pub service_id: Option<Box<crate::models::LogPropertyServiceId>>,
18    /// Timestamp of the request in ISO 8601 format.
19    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
20    pub timestamp: Option<String>,
21    /// The autonomous system (AS) number of the client.
22    #[serde(rename = "client_as_number", skip_serializing_if = "Option::is_none")]
23    pub client_as_number: Option<i32>,
24    /// The client's country subdivision code as found in ISO 3166-2.
25    #[serde(rename = "client_region", skip_serializing_if = "Option::is_none")]
26    pub client_region: Option<String>,
27    /// The two-letter ISO 3166-1 country code for the client.
28    #[serde(rename = "client_country_code", skip_serializing_if = "Option::is_none")]
29    pub client_country_code: Option<String>,
30    /// The name of the operating system installed on the client device.
31    #[serde(rename = "client_os_name", skip_serializing_if = "Option::is_none")]
32    pub client_os_name: Option<String>,
33    /// The type of the client's device.
34    #[serde(rename = "client_device_type", skip_serializing_if = "Option::is_none")]
35    pub client_device_type: Option<String>,
36    /// The name of the browser in use on the client device.
37    #[serde(rename = "client_browser_name", skip_serializing_if = "Option::is_none")]
38    pub client_browser_name: Option<String>,
39    /// The version of the browser in use on client device.
40    #[serde(rename = "client_browser_version", skip_serializing_if = "Option::is_none")]
41    pub client_browser_version: Option<String>,
42    /// The name of the Fastly POP that served this request.
43    #[serde(rename = "fastly_pop", skip_serializing_if = "Option::is_none")]
44    pub fastly_pop: Option<String>,
45    /// The name of the origin host that served this request.
46    #[serde(rename = "origin_host", skip_serializing_if = "Option::is_none")]
47    pub origin_host: Option<String>,
48    /// HTTP protocol version in use for this request. For example, HTTP/1.1.
49    #[serde(rename = "request_protocol", skip_serializing_if = "Option::is_none")]
50    pub request_protocol: Option<String>,
51    /// The name of the request host used for this request.
52    #[serde(rename = "request_host", skip_serializing_if = "Option::is_none")]
53    pub request_host: Option<String>,
54    /// The URL path supplied for this request.
55    #[serde(rename = "request_path", skip_serializing_if = "Option::is_none")]
56    pub request_path: Option<String>,
57    /// HTTP method sent by the client such as \"GET\" or \"POST\".
58    #[serde(rename = "request_method", skip_serializing_if = "Option::is_none")]
59    pub request_method: Option<String>,
60    /// Body bytes sent to the client in the response.
61    #[serde(rename = "response_bytes_body", skip_serializing_if = "Option::is_none")]
62    pub response_bytes_body: Option<i32>,
63    /// Header bytes sent to the client in the response.
64    #[serde(rename = "response_bytes_header", skip_serializing_if = "Option::is_none")]
65    pub response_bytes_header: Option<i32>,
66    /// Total bytes sent to the client in the response.
67    #[serde(rename = "response_content_length", skip_serializing_if = "Option::is_none")]
68    pub response_content_length: Option<i32>,
69    /// The content type of the response sent to the client.
70    #[serde(rename = "response_content_type", skip_serializing_if = "Option::is_none")]
71    pub response_content_type: Option<String>,
72    /// The HTTP reason phrase returned for this request, if any.
73    #[serde(rename = "response_reason", skip_serializing_if = "Option::is_none")]
74    pub response_reason: Option<String>,
75    /// The state of the request with optional suffixes describing special cases.
76    #[serde(rename = "response_state", skip_serializing_if = "Option::is_none")]
77    pub response_state: Option<String>,
78    /// The HTTP response code returned for this request.
79    #[serde(rename = "response_status", skip_serializing_if = "Option::is_none")]
80    pub response_status: Option<i32>,
81    /// The time since the request started in seconds.
82    #[serde(rename = "response_time", skip_serializing_if = "Option::is_none")]
83    pub response_time: Option<f32>,
84    /// Indicates whether the request was a HIT or a MISS.
85    #[serde(rename = "response_x_cache", skip_serializing_if = "Option::is_none")]
86    pub response_x_cache: Option<String>,
87    /// Indicates whether this request was fulfilled from cache.
88    #[serde(rename = "is_cache_hit", skip_serializing_if = "Option::is_none")]
89    pub is_cache_hit: Option<bool>,
90    /// Indicates whether the request was handled by a Fastly edge POP.
91    #[serde(rename = "is_edge", skip_serializing_if = "Option::is_none")]
92    pub is_edge: Option<bool>,
93    /// Indicates whether the request was handled by a Fastly shield POP.
94    #[serde(rename = "is_shield", skip_serializing_if = "Option::is_none")]
95    pub is_shield: Option<bool>,
96}
97
98impl LogRecord {
99    pub fn new() -> LogRecord {
100        LogRecord {
101            customer_id: None,
102            service_id: None,
103            timestamp: None,
104            client_as_number: None,
105            client_region: None,
106            client_country_code: None,
107            client_os_name: None,
108            client_device_type: None,
109            client_browser_name: None,
110            client_browser_version: None,
111            fastly_pop: None,
112            origin_host: None,
113            request_protocol: None,
114            request_host: None,
115            request_path: None,
116            request_method: None,
117            response_bytes_body: None,
118            response_bytes_header: None,
119            response_content_length: None,
120            response_content_type: None,
121            response_reason: None,
122            response_state: None,
123            response_status: None,
124            response_time: None,
125            response_x_cache: None,
126            is_cache_hit: None,
127            is_edge: None,
128            is_shield: None,
129        }
130    }
131}
132
133