fastly_api/models/
dashboard_item_property_data_source.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/// DashboardItemPropertyDataSource : [An object](#data-source) which describes the data to display.
9
10
11
12#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
13pub struct DashboardItemPropertyDataSource {
14    /// The source of the data to display.
15    #[serde(rename = "type")]
16    pub _type: Type,
17    #[serde(rename = "config")]
18    pub config: Box<crate::models::DashboardItemPropertyDataSourcePropertyConfig>,
19}
20
21impl DashboardItemPropertyDataSource {
22    /// [An object](#data-source) which describes the data to display.
23    pub fn new(_type: Type, config: crate::models::DashboardItemPropertyDataSourcePropertyConfig) -> DashboardItemPropertyDataSource {
24        DashboardItemPropertyDataSource {
25            _type,
26            config: Box::new(config),
27        }
28    }
29}
30
31/// The source of the data to display.
32#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
33pub enum Type {
34    #[serde(rename = "stats.edge")]
35    Edge,
36    #[serde(rename = "stats.domain")]
37    Domain,
38    #[serde(rename = "stats.origin")]
39    Origin,
40}
41
42impl Default for Type {
43    fn default() -> Type {
44        Self::Edge
45    }
46}
47