fastly_api/models/
logging_newrelicotlp_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 LoggingNewrelicotlpResponse {
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).
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 Insert API key from the Account page of your New Relic account. Required.
29    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
30    pub token: Option<String>,
31    /// The region to which to stream logs.
32    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
33    pub region: Option<Region>,
34    /// (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing.
35    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
36    pub url: Option<String>,
37    /// Date and time in ISO 8601 format.
38    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
39    pub created_at: Option<String>,
40    /// Date and time in ISO 8601 format.
41    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
42    pub deleted_at: Option<String>,
43    /// Date and time in ISO 8601 format.
44    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
45    pub updated_at: Option<String>,
46    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
47    pub service_id: Option<Box<String>>,
48    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
49    pub version: Option<Box<String>>,
50}
51
52impl LoggingNewrelicotlpResponse {
53    pub fn new() -> LoggingNewrelicotlpResponse {
54        LoggingNewrelicotlpResponse {
55            name: None,
56            placement: None,
57            response_condition: None,
58            format: None,
59            format_version: None,
60            token: None,
61            region: None,
62            url: None,
63            created_at: None,
64            deleted_at: None,
65            updated_at: None,
66            service_id: None,
67            version: None,
68        }
69    }
70}
71
72/// 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`. 
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum Placement {
75    #[serde(rename = "none")]
76    None,
77    #[serde(rename = "waf_debug")]
78    WafDebug,
79    #[serde(rename = "null")]
80    Null,
81}
82
83impl Default for Placement {
84    fn default() -> Placement {
85        Self::None
86    }
87}
88/// 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`. 
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum FormatVersion {
91    #[serde(rename = "1")]
92    V1,
93    #[serde(rename = "2")]
94    V2,
95}
96
97impl Default for FormatVersion {
98    fn default() -> FormatVersion {
99        Self::V1
100    }
101}
102/// The region to which to stream logs.
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum Region {
105    #[serde(rename = "US")]
106    US,
107    #[serde(rename = "EU")]
108    EU,
109}
110
111impl Default for Region {
112    fn default() -> Region {
113        Self::US
114    }
115}
116