fastly_api/models/
logging_scalyr_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 LoggingScalyrResponse {
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    /// The region that log data will be sent to.
32    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
33    pub region: Option<Region>,
34    /// The token to use for authentication.
35    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
36    pub token: Option<String>,
37    /// The name of the logfile within Scalyr.
38    #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")]
39    pub project_id: Option<String>,
40    /// Date and time in ISO 8601 format.
41    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
42    pub created_at: Option<String>,
43    /// Date and time in ISO 8601 format.
44    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
45    pub deleted_at: Option<String>,
46    /// Date and time in ISO 8601 format.
47    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
48    pub updated_at: Option<String>,
49    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
50    pub service_id: Option<Box<String>>,
51    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
52    pub version: Option<Box<String>>,
53}
54
55impl LoggingScalyrResponse {
56    pub fn new() -> LoggingScalyrResponse {
57        LoggingScalyrResponse {
58            name: None,
59            placement: None,
60            response_condition: None,
61            format: None,
62            log_processing_region: None,
63            format_version: None,
64            region: None,
65            token: None,
66            project_id: None,
67            created_at: None,
68            deleted_at: None,
69            updated_at: None,
70            service_id: None,
71            version: None,
72        }
73    }
74}
75
76/// 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`. 
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum Placement {
79    #[serde(rename = "none")]
80    None,
81    #[serde(rename = "null")]
82    Null,
83}
84
85impl Default for Placement {
86    fn default() -> Placement {
87        Self::None
88    }
89}
90/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum LogProcessingRegion {
93    #[serde(rename = "none")]
94    None,
95    #[serde(rename = "eu")]
96    Eu,
97    #[serde(rename = "us")]
98    Us,
99}
100
101impl Default for LogProcessingRegion {
102    fn default() -> LogProcessingRegion {
103        Self::None
104    }
105}
106/// 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`. 
107#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
108pub enum FormatVersion {
109    #[serde(rename = "1")]
110    V1,
111    #[serde(rename = "2")]
112    V2,
113}
114
115impl Default for FormatVersion {
116    fn default() -> FormatVersion {
117        Self::V1
118    }
119}
120/// The region that log data will be sent to.
121#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
122pub enum Region {
123    #[serde(rename = "US")]
124    US,
125    #[serde(rename = "EU")]
126    EU,
127}
128
129impl Default for Region {
130    fn default() -> Region {
131        Self::US
132    }
133}
134