fastly_api/models/
logging_kinesis_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 LoggingKinesisResponse {
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    #[serde(rename = "placement", skip_serializing_if = "Option::is_none")]
17    pub placement: Option<crate::models::LoggingPlacement>,
18    /// A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).
19    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
20    pub format: Option<String>,
21    /// The Amazon Kinesis stream to send logs to. Required.
22    #[serde(rename = "topic", skip_serializing_if = "Option::is_none")]
23    pub topic: Option<String>,
24    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
25    pub region: Option<crate::models::AwsRegion>,
26    /// The secret key associated with the target Amazon Kinesis stream. Not required if `iam_role` is specified.
27    #[serde(rename = "secret_key", skip_serializing_if = "Option::is_none")]
28    pub secret_key: Option<String>,
29    /// The access key associated with the target Amazon Kinesis stream. Not required if `iam_role` is specified.
30    #[serde(rename = "access_key", skip_serializing_if = "Option::is_none")]
31    pub access_key: Option<String>,
32    /// The ARN for an IAM role granting Fastly access to the target Amazon Kinesis stream. Not required if `access_key` and `secret_key` are provided.
33    #[serde(rename = "iam_role", skip_serializing_if = "Option::is_none")]
34    pub iam_role: Option<String>,
35    /// 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`. 
36    #[serde(rename = "format_version", skip_serializing_if = "Option::is_none")]
37    pub format_version: Option<FormatVersion>,
38    /// Date and time in ISO 8601 format.
39    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
40    pub created_at: Option<String>,
41    /// Date and time in ISO 8601 format.
42    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
43    pub deleted_at: Option<String>,
44    /// Date and time in ISO 8601 format.
45    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
46    pub updated_at: Option<String>,
47    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
48    pub service_id: Option<Box<String>>,
49    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
50    pub version: Option<Box<String>>,
51}
52
53impl LoggingKinesisResponse {
54    pub fn new() -> LoggingKinesisResponse {
55        LoggingKinesisResponse {
56            name: None,
57            placement: None,
58            format: None,
59            topic: None,
60            region: None,
61            secret_key: None,
62            access_key: None,
63            iam_role: None,
64            format_version: None,
65            created_at: None,
66            deleted_at: None,
67            updated_at: None,
68            service_id: None,
69            version: None,
70        }
71    }
72}
73
74/// 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`. 
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum FormatVersion {
77    #[serde(rename = "1")]
78    V1,
79    #[serde(rename = "2")]
80    V2,
81}
82
83impl Default for FormatVersion {
84    fn default() -> FormatVersion {
85        Self::V1
86    }
87}
88