-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRevAiApiDeploymentConfiguration.java
62 lines (49 loc) · 1.75 KB
/
RevAiApiDeploymentConfiguration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package ai.rev.helpers;
import java.util.HashMap;
import java.util.Map;
public class RevAiApiDeploymentConfiguration {
// Enum for API deployment regions
public enum RevAiApiDeployment {
US("US"),
EU("EU");
private final String value;
RevAiApiDeployment(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
// Configuration map for deployment URLs
private static final Map<RevAiApiDeployment, DeploymentConfig> RevAiApiDeploymentConfigMap;
static {
RevAiApiDeploymentConfigMap = new HashMap<>();
RevAiApiDeploymentConfigMap.put(
RevAiApiDeployment.US,
new DeploymentConfig("https://api.rev.ai", "wss://api.rev.ai")
);
RevAiApiDeploymentConfigMap.put(
RevAiApiDeployment.EU,
new DeploymentConfig("https://ec1.api.rev.ai", "wss://ec1.api.rev.ai")
);
}
// Inner class for deployment configurations
public static class DeploymentConfig {
private final String baseUrl;
private final String baseWebsocketUrl;
public DeploymentConfig(String baseUrl, String baseWebsocketUrl) {
this.baseUrl = baseUrl;
this.baseWebsocketUrl = baseWebsocketUrl;
}
public String getBaseUrl() {
return baseUrl;
}
public String getBaseWebsocketUrl() {
return baseWebsocketUrl;
}
}
// Method to get the configuration for a specific deployment
public static DeploymentConfig getConfig(RevAiApiDeployment deployment) {
return RevAiApiDeploymentConfigMap.get(deployment);
}
}