fastly_api/models/
logging_datadog_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 LoggingDatadogResponse {
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). Must produce valid JSON that Datadog can ingest. 
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    /// The region that log data will be sent to.
29    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
30    pub region: Option<Region>,
31    /// The API key from your Datadog account. Required.
32    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
33    pub token: Option<String>,
34    /// Date and time in ISO 8601 format.
35    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
36    pub created_at: Option<String>,
37    /// Date and time in ISO 8601 format.
38    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
39    pub deleted_at: Option<String>,
40    /// Date and time in ISO 8601 format.
41    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
42    pub updated_at: Option<String>,
43    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
44    pub service_id: Option<Box<String>>,
45    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
46    pub version: Option<Box<String>>,
47}
48
49impl LoggingDatadogResponse {
50    pub fn new() -> LoggingDatadogResponse {
51        LoggingDatadogResponse {
52            name: None,
53            placement: None,
54            response_condition: None,
55            format: None,
56            format_version: None,
57            region: None,
58            token: None,
59            created_at: None,
60            deleted_at: None,
61            updated_at: None,
62            service_id: None,
63            version: None,
64        }
65    }
66}
67
68/// 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`. 
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Placement {
71    #[serde(rename = "none")]
72    None,
73    #[serde(rename = "waf_debug")]
74    WafDebug,
75    #[serde(rename = "null")]
76    Null,
77}
78
79impl Default for Placement {
80    fn default() -> Placement {
81        Self::None
82    }
83}
84/// 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`. 
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum FormatVersion {
87    #[serde(rename = "1")]
88    V1,
89    #[serde(rename = "2")]
90    V2,
91}
92
93impl Default for FormatVersion {
94    fn default() -> FormatVersion {
95        Self::V1
96    }
97}
98/// The region that log data will be sent to.
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum Region {
101    #[serde(rename = "US")]
102    US,
103    #[serde(rename = "US3")]
104    US3,
105    #[serde(rename = "US5")]
106    US5,
107    #[serde(rename = "EU (legacy, same as EU1)")]
108    EULegacySameAsEU1,
109    #[serde(rename = "EU1")]
110    EU1,
111    #[serde(rename = "AP1")]
112    AP1,
113}
114
115impl Default for Region {
116    fn default() -> Region {
117        Self::US
118    }
119}
120