Skip to main content

dtz_billing/models/
consumption_value.rs

1/*
2 * DTZ Billing Api
3 *
4 * a generated client for the DTZ Billing API
5 *
6 * Contact: jens@apimeister.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10#[allow(unused_imports)]
11use crate::models;
12#[allow(unused_imports)]
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConsumptionValue {
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    #[serde(rename = "ecoMode", skip_serializing_if = "Option::is_none")]
20    pub eco_mode: Option<bool>,
21    #[serde(rename = "amount")]
22    pub amount: f64,
23    #[serde(rename = "unitOfAmount")]
24    pub unit_of_amount: UnitOfAmount,
25    #[serde(rename = "deduplicationKey")]
26    pub deduplication_key: String,
27}
28
29impl ConsumptionValue {
30    pub fn new(amount: f64, unit_of_amount: UnitOfAmount, deduplication_key: String) -> ConsumptionValue {
31        ConsumptionValue {
32            description: None,
33            eco_mode: None,
34            amount,
35            unit_of_amount,
36            deduplication_key,
37        }
38    }
39}
40/// 
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum UnitOfAmount {
43    #[serde(rename = "GbSeconds")]
44    GbSeconds,
45    #[serde(rename = "Requests")]
46    Requests,
47    #[serde(rename = "MilliSeconds")]
48    MilliSeconds,
49    #[serde(rename = "Watt")]
50    Watt,
51    #[serde(rename = "Euro")]
52    Euro,
53}
54
55impl Default for UnitOfAmount {
56    fn default() -> UnitOfAmount {
57        Self::GbSeconds
58    }
59}
60