fastly_api/models/
logging_heroku_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 LoggingHerokuResponse {
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 token to use for authentication ([https://devcenter.heroku.com/articles/add-on-partner-log-integration](https://devcenter.heroku.com/articles/add-on-partner-log-integration)).
32    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
33    pub token: Option<String>,
34    /// The URL to stream logs to.
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 LoggingHerokuResponse {
53    pub fn new() -> LoggingHerokuResponse {
54        LoggingHerokuResponse {
55            name: None,
56            placement: None,
57            response_condition: None,
58            format: None,
59            log_processing_region: None,
60            format_version: None,
61            token: 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 = "null")]
78    Null,
79}
80
81impl Default for Placement {
82    fn default() -> Placement {
83        Self::None
84    }
85}
86/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum LogProcessingRegion {
89    #[serde(rename = "none")]
90    None,
91    #[serde(rename = "eu")]
92    Eu,
93    #[serde(rename = "us")]
94    Us,
95}
96
97impl Default for LogProcessingRegion {
98    fn default() -> LogProcessingRegion {
99        Self::None
100    }
101}
102/// 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`. 
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum FormatVersion {
105    #[serde(rename = "1")]
106    V1,
107    #[serde(rename = "2")]
108    V2,
109}
110
111impl Default for FormatVersion {
112    fn default() -> FormatVersion {
113        Self::V1
114    }
115}
116