exoscale/models/
dbaas_service_common.rs

1/*
2 * Exoscale Public API
3 *
4 *  Infrastructure automation API, allowing programmatic access to all Exoscale products and services.  The [OpenAPI Specification](http://spec.openapis.org/oas/v3.0.3.html) source of this documentation can be obtained here:  * [JSON format](https://bump.sh/doc/exoscale-api.json) * [YAML format](https://bump.sh/doc/exoscale-api.yaml)
5 *
6 * The version of the OpenAPI document: 2.0.0
7 * Contact: api@exoscale.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct DbaasServiceCommon {
13    /// Service last update timestamp (ISO 8601)
14    #[serde(rename = "updated-at", skip_serializing_if = "Option::is_none")]
15    pub updated_at: Option<String>,
16    /// Number of service nodes in the active plan
17    #[serde(rename = "node-count", skip_serializing_if = "Option::is_none")]
18    pub node_count: Option<i64>,
19    /// Number of CPUs for each node
20    #[serde(rename = "node-cpu-count", skip_serializing_if = "Option::is_none")]
21    pub node_cpu_count: Option<i64>,
22    /// Service integrations
23    #[serde(rename = "integrations", skip_serializing_if = "Option::is_none")]
24    pub integrations: Option<Vec<crate::models::DbaasIntegration>>,
25    #[serde(rename = "name")]
26    pub name: String,
27    #[serde(rename = "type")]
28    pub _type: String,
29    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
30    pub state: Option<crate::models::EnumServiceState>,
31    /// Service is protected against termination and powering off
32    #[serde(
33        rename = "termination-protection",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub termination_protection: Option<bool>,
37    /// Service notifications
38    #[serde(rename = "notifications", skip_serializing_if = "Option::is_none")]
39    pub notifications: Option<Vec<crate::models::DbaasServiceNotification>>,
40    /// TODO UNIT disk space for data storage
41    #[serde(rename = "disk-size", skip_serializing_if = "Option::is_none")]
42    pub disk_size: Option<i64>,
43    /// TODO UNIT of memory for each node
44    #[serde(rename = "node-memory", skip_serializing_if = "Option::is_none")]
45    pub node_memory: Option<i64>,
46    /// Service creation timestamp (ISO 8601)
47    #[serde(rename = "created-at", skip_serializing_if = "Option::is_none")]
48    pub created_at: Option<String>,
49    /// Subscription plan
50    #[serde(rename = "plan")]
51    pub plan: String,
52}
53
54impl DbaasServiceCommon {
55    pub fn new(name: String, _type: String, plan: String) -> DbaasServiceCommon {
56        DbaasServiceCommon {
57            updated_at: None,
58            node_count: None,
59            node_cpu_count: None,
60            integrations: None,
61            name,
62            _type,
63            state: None,
64            termination_protection: None,
65            notifications: None,
66            disk_size: None,
67            node_memory: None,
68            created_at: None,
69            plan,
70        }
71    }
72}