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 = "null")]
74    Null,
75}
76
77impl Default for Placement {
78    fn default() -> Placement {
79        Self::None
80    }
81}
82/// 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`. 
83#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum FormatVersion {
85    #[serde(rename = "1")]
86    V1,
87    #[serde(rename = "2")]
88    V2,
89}
90
91impl Default for FormatVersion {
92    fn default() -> FormatVersion {
93        Self::V1
94    }
95}
96/// The region that log data will be sent to.
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum Region {
99    #[serde(rename = "US")]
100    US,
101    #[serde(rename = "US3")]
102    US3,
103    #[serde(rename = "US5")]
104    US5,
105    #[serde(rename = "EU (legacy, same as EU1)")]
106    EULegacySameAsEU1,
107    #[serde(rename = "EU1")]
108    EU1,
109    #[serde(rename = "AP1")]
110    AP1,
111}
112
113impl Default for Region {
114    fn default() -> Region {
115        Self::US
116    }
117}
118