square_rust/api/models/enums/
api_version.rs

1//! Square API version enum
2use std::fmt;
3
4/// Square API version
5#[derive(Debug, Clone)]
6pub enum SquareApiVersion {
7    V20230925,
8}
9
10impl fmt::Display for SquareApiVersion {
11    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12        match self {
13            SquareApiVersion::V20230925 => write!(f, "2023-09-25"),
14        }
15    }
16}
17
18#[cfg(test)]
19mod tests {
20    use super::*;
21
22    #[test]
23    fn test_to_string() {
24        assert_eq!(SquareApiVersion::V20230925.to_string(), "2023-09-25".to_string());
25    }
26}