Skip to content

Commit d980a74

Browse files
authored
libs: Add ca and au regions to default url parsing (#1918)
2 parents 4cc0fbb + d11a98d commit d980a74

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

csharp/Svix/Utils.cs

+8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ internal static string DefaultServerUrlFromToken(string token)
4141
{
4242
return "https://api.in.svix.com";
4343
}
44+
else if (region == "ca")
45+
{
46+
return "https://api.ca.svix.com";
47+
}
48+
else if (region == "au")
49+
{
50+
return "https://api.au.svix.com";
51+
}
4452
else
4553
{
4654
return "https://api.svix.com";

go/svix.go

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func getDefaultBaseUrl(token string) string {
111111
return "https://api.eu.svix.com"
112112
} else if region == "in" {
113113
return "https://api.in.svix.com"
114+
} else if region == "ca" {
115+
return "https://api.ca.svix.com"
116+
} else if region == "au" {
117+
return "https://api.au.svix.com"
114118
} else {
115119
return "https://api.svix.com"
116120
}

java/lib/src/main/java/com/svix/Svix.java

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ public Svix(String token, SvixOptions options) {
4343
case "in":
4444
options.setServerUrl("https://api.in.svix.com");
4545
break;
46+
case "ca":
47+
options.setServerUrl("https://api.ca.svix.com");
48+
break;
49+
case "au":
50+
options.setServerUrl("https://api.au.svix.com");
51+
break;
52+
4653
default:
4754
options.setServerUrl(SvixOptions.DEFAULT_URL);
4855
}

javascript/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const REGIONS = [
3838
{ region: "us", url: "https://api.us.svix.com" },
3939
{ region: "eu", url: "https://api.eu.svix.com" },
4040
{ region: "in", url: "https://api.in.svix.com" },
41+
{ region: "ca", url: "https://api.ca.svix.com" },
42+
{ region: "au", url: "https://api.au.svix.com" },
4143
];
4244

4345
export class Svix {

kotlin/lib/src/main/kotlin/Svix.kt

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class Svix(token: String, options: SvixOptions = SvixOptions()) {
2525
"us" -> options.baseUrl = "https://api.us.svix.com"
2626
"eu" -> options.baseUrl = "https://api.eu.svix.com"
2727
"in" -> options.baseUrl = "https://api.in.svix.com"
28+
"ca" -> options.baseUrl = "https://api.ca.svix.com"
29+
"au" -> options.baseUrl = "https://api.au.svix.com"
2830
else -> options.baseUrl = "https://api.svix.com"
2931
}
3032
}

python/svix/api/svix.py

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def __init__(self, auth_token: str, options: SvixOptions = SvixOptions()) -> Non
6363
regional_url = "https://api.eu.svix.com"
6464
elif region == "in":
6565
regional_url = "https://api.in.svix.com"
66+
elif region == "ca":
67+
regional_url = "https://api.ca.svix.com"
68+
elif region == "au":
69+
regional_url = "https://api.au.svix.com"
6670

6771
host = options.server_url or regional_url or DEFAULT_SERVER_URL
6872
client = AuthenticatedClient(

ruby/lib/svix/svix.rb

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def initialize(auth_token, options = SvixOptions.new)
3636
regional_url = "https://api.eu.svix.com"
3737
elsif region == "in"
3838
regional_url = "https://api.in.svix.com"
39+
elsif region == "ca"
40+
regional_url = "https://api.ca.svix.com"
41+
elsif region == "au"
42+
regional_url = "https://api.au.svix.com"
3943
else
4044
regional_url = "https://api.svix.com"
4145
end

rust/src/api/client.rs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ impl Svix {
7676
Some("us") => "https://api.us.svix.com",
7777
Some("eu") => "https://api.eu.svix.com",
7878
Some("in") => "https://api.in.svix.com",
79+
Some("ca") => "https://api.ca.svix.com",
80+
Some("au") => "https://api.au.svix.com",
7981
_ => "https://api.svix.com",
8082
}
8183
.to_string()

0 commit comments

Comments
 (0)