fastly_api/models/
logging_s3_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 LoggingS3Response {
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    /// How the message should be formatted.
32    #[serde(rename = "message_type", skip_serializing_if = "Option::is_none")]
33    pub message_type: Option<MessageType>,
34    /// A timestamp format
35    #[serde(rename = "timestamp_format", skip_serializing_if = "Option::is_none")]
36    pub timestamp_format: Option<String>,
37    /// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
38    #[serde(rename = "compression_codec", skip_serializing_if = "Option::is_none")]
39    pub compression_codec: Option<CompressionCodec>,
40    /// How frequently log files are finalized so they can be available for reading (in seconds).
41    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
42    pub period: Option<String>,
43    /// The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
44    #[serde(rename = "gzip_level", skip_serializing_if = "Option::is_none")]
45    pub gzip_level: 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    /// The access key for your S3 account. Not required if `iam_role` is provided.
60    #[serde(rename = "access_key", skip_serializing_if = "Option::is_none")]
61    pub access_key: Option<String>,
62    /// The access control list (ACL) specific request header. See the AWS documentation for [Access Control List (ACL) Specific Request Headers](https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html#initiate-mpu-acl-specific-request-headers) for more information.
63    #[serde(rename = "acl", skip_serializing_if = "Option::is_none")]
64    pub acl: Option<String>,
65    /// The bucket name for S3 account.
66    #[serde(rename = "bucket_name", skip_serializing_if = "Option::is_none")]
67    pub bucket_name: Option<String>,
68    /// The domain of the Amazon S3 endpoint.
69    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
70    pub domain: Option<String>,
71    /// The Amazon Resource Name (ARN) for the IAM role granting Fastly access to S3. Not required if `access_key` and `secret_key` are provided.
72    #[serde(rename = "iam_role", skip_serializing_if = "Option::is_none")]
73    pub iam_role: Option<String>,
74    /// The path to upload logs to.
75    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
76    pub path: Option<String>,
77    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
78    #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
79    pub public_key: Option<String>,
80    /// The S3 redundancy level.
81    #[serde(rename = "redundancy", skip_serializing_if = "Option::is_none")]
82    pub redundancy: Option<String>,
83    /// The secret key for your S3 account. Not required if `iam_role` is provided.
84    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
85    pub secret_key: Option<String>,
86    /// Optional server-side KMS Key Id. Must be set if `server_side_encryption` is set to `aws:kms` or `AES256`.
87    #[serde(rename = "server_side_encryption_kms_key_id", skip_serializing_if = "Option::is_none")]
88    pub server_side_encryption_kms_key_id: Option<String>,
89    /// Set this to `AES256` or `aws:kms` to enable S3 Server Side Encryption.
90    #[serde(rename = "server_side_encryption", skip_serializing_if = "Option::is_none")]
91    pub server_side_encryption: Option<String>,
92    /// The maximum number of bytes for each uploaded file. A value of 0 can be used to indicate there is no limit on the size of uploaded files, otherwise the minimum value is 1048576 bytes (1 MiB.)
93    #[serde(rename = "file_max_bytes", skip_serializing_if = "Option::is_none")]
94    pub file_max_bytes: Option<i32>,
95}
96
97impl LoggingS3Response {
98    pub fn new() -> LoggingS3Response {
99        LoggingS3Response {
100            name: None,
101            placement: None,
102            response_condition: None,
103            format: None,
104            log_processing_region: None,
105            format_version: None,
106            message_type: None,
107            timestamp_format: None,
108            compression_codec: None,
109            period: None,
110            gzip_level: None,
111            created_at: None,
112            deleted_at: None,
113            updated_at: None,
114            service_id: None,
115            version: None,
116            access_key: None,
117            acl: None,
118            bucket_name: None,
119            domain: None,
120            iam_role: None,
121            path: None,
122            public_key: None,
123            redundancy: None,
124            secret_key: None,
125            server_side_encryption_kms_key_id: None,
126            server_side_encryption: None,
127            file_max_bytes: None,
128        }
129    }
130}
131
132/// 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`. 
133#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
134pub enum Placement {
135    #[serde(rename = "none")]
136    None,
137    #[serde(rename = "null")]
138    Null,
139}
140
141impl Default for Placement {
142    fn default() -> Placement {
143        Self::None
144    }
145}
146/// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
147#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
148pub enum LogProcessingRegion {
149    #[serde(rename = "none")]
150    None,
151    #[serde(rename = "eu")]
152    Eu,
153    #[serde(rename = "us")]
154    Us,
155}
156
157impl Default for LogProcessingRegion {
158    fn default() -> LogProcessingRegion {
159        Self::None
160    }
161}
162/// 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`. 
163#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
164pub enum FormatVersion {
165    #[serde(rename = "1")]
166    V1,
167    #[serde(rename = "2")]
168    V2,
169}
170
171impl Default for FormatVersion {
172    fn default() -> FormatVersion {
173        Self::V1
174    }
175}
176/// How the message should be formatted.
177#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
178pub enum MessageType {
179    #[serde(rename = "classic")]
180    Classic,
181    #[serde(rename = "loggly")]
182    Loggly,
183    #[serde(rename = "logplex")]
184    Logplex,
185    #[serde(rename = "blank")]
186    Blank,
187}
188
189impl Default for MessageType {
190    fn default() -> MessageType {
191        Self::Classic
192    }
193}
194/// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
195#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
196pub enum CompressionCodec {
197    #[serde(rename = "zstd")]
198    Zstd,
199    #[serde(rename = "snappy")]
200    Snappy,
201    #[serde(rename = "gzip")]
202    Gzip,
203}
204
205impl Default for CompressionCodec {
206    fn default() -> CompressionCodec {
207        Self::Zstd
208    }
209}
210