Skip to main content

autogen_squareup/models/
measurement_unit_time.rs

1/*
2 * Square
3 *
4 * Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.
5 *
6 * The version of the OpenAPI document: 2.0
7 * Contact: developers@squareup.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// MeasurementUnitTime : Unit of time used to measure a quantity (a duration).
15/// Unit of time used to measure a quantity (a duration).
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum MeasurementUnitTime {
18    #[serde(rename = "GENERIC_MILLISECOND")]
19    GenericMillisecond,
20    #[serde(rename = "GENERIC_SECOND")]
21    GenericSecond,
22    #[serde(rename = "GENERIC_MINUTE")]
23    GenericMinute,
24    #[serde(rename = "GENERIC_HOUR")]
25    GenericHour,
26    #[serde(rename = "GENERIC_DAY")]
27    GenericDay,
28
29}
30
31impl std::fmt::Display for MeasurementUnitTime {
32    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33        match self {
34            Self::GenericMillisecond => write!(f, "GENERIC_MILLISECOND"),
35            Self::GenericSecond => write!(f, "GENERIC_SECOND"),
36            Self::GenericMinute => write!(f, "GENERIC_MINUTE"),
37            Self::GenericHour => write!(f, "GENERIC_HOUR"),
38            Self::GenericDay => write!(f, "GENERIC_DAY"),
39        }
40    }
41}
42
43impl Default for MeasurementUnitTime {
44    fn default() -> MeasurementUnitTime {
45        Self::GenericMillisecond
46    }
47}
48