1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use serde::Deserialize;

/// The regions the datacenters are grouped in.
#[derive(Deserialize, Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[serde(rename_all = "snake_case")]
pub enum Region {
    /// US East, US West, US Central, US South Central, Brazil South
    Ncsa,
    /// EU West, EU North
    Emea,
    /// Asia East, Asia SouthEast, Australia East
    Apac,
}

impl Region {
    /// Returns the string representation for the api.
    pub fn as_str(self) -> &'static str {
        match self {
            Self::Ncsa => "ncsa",
            Self::Emea => "emea",
            Self::Apac => "apac",
        }
    }
}