voltaria_sdk/
environment.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
4pub enum Environment {
5 #[serde(rename = "sandbox")]
6 Sandbox,
7 #[serde(rename = "production")]
8 Production,
9}
10impl Environment {
11 pub fn url(&self) -> &'static str {
12 match self {
13 Self::Sandbox => "https://api.sandbox.voltaria.io",
14 Self::Production => "https://api.voltaria.io",
15 }
16 }
17}
18impl Default for Environment {
19 fn default() -> Self {
20 Self::Sandbox
21 }
22}