fastly_api/models/
logging_google_pubsub_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 LoggingGooglePubsubResponse {
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    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
32    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
33    pub user: Option<String>,
34    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
35    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
36    pub secret_key: Option<String>,
37    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
38    #[serde(rename = "account_name", skip_serializing_if = "Option::is_none")]
39    pub account_name: Option<String>,
40    /// The Google Cloud Pub/Sub topic to which logs will be published. Required.
41    #[serde(rename = "topic", skip_serializing_if = "Option::is_none")]
42    pub topic: Option<String>,
43    /// Your Google Cloud Platform project ID. Required
44    #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")]
45    pub project_id: Option<String>,
46    /// Date and time in ISO 8601 format.
47    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
48    pub created_at: Option<String>,
49    /// Date and time in ISO 8601 format.
50    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
51    pub deleted_at: Option<String>,
52    /// Date and time in ISO 8601 format.
53    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
54    pub updated_at: Option<String>,
55    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
56    pub service_id: Option<Box<String>>,
57    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
58    pub version: Option<Box<String>>,
59}
60
61impl LoggingGooglePubsubResponse {
62    pub fn new() -> LoggingGooglePubsubResponse {
63        LoggingGooglePubsubResponse {
64            name: None,
65            placement: None,
66            response_condition: None,
67            format: None,
68            log_processing_region: None,
69            format_version: None,
70            user: None,
71            secret_key: None,
72            account_name: None,
73            topic: None,
74            project_id: None,
75            created_at: None,
76            deleted_at: None,
77            updated_at: None,
78            service_id: None,
79            version: None,
80        }
81    }
82}
83
84/// 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`. 
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum Placement {
87    #[serde(rename = "none")]
88    None,
89    #[serde(rename = "null")]
90    Null,
91}
92
93impl Default for Placement {
94    fn default() -> Placement {
95        Self::None
96    }
97}
98/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum LogProcessingRegion {
101    #[serde(rename = "none")]
102    None,
103    #[serde(rename = "eu")]
104    Eu,
105    #[serde(rename = "us")]
106    Us,
107}
108
109impl Default for LogProcessingRegion {
110    fn default() -> LogProcessingRegion {
111        Self::None
112    }
113}
114/// 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`. 
115#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
116pub enum FormatVersion {
117    #[serde(rename = "1")]
118    V1,
119    #[serde(rename = "2")]
120    V2,
121}
122
123impl Default for FormatVersion {
124    fn default() -> FormatVersion {
125        Self::V1
126    }
127}
128