Skip to content

Commit 4f19f2c

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#55)
Co-authored-by: github-actions[bot] <dependabot@bot.com>
1 parent 4559935 commit 4f19f2c

3 files changed

Lines changed: 53 additions & 2 deletions

File tree

src/libs/DeepL/Generated/DeepL.VoiceAPIClient.GetVoiceStreamingUrl.g.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ namespace DeepL
66
public partial class VoiceAPIClient
77
{
88

9+
private static readonly global::DeepL.AutoSDKServer[] s_GetVoiceStreamingUrlServers = new global::DeepL.AutoSDKServer[]
10+
{ new global::DeepL.AutoSDKServer(
11+
id: "https-api-deepl-com",
12+
name: "Override base path for all operations with the /v3/voice path",
13+
url: "https://api.deepl.com/",
14+
description: "Override base path for all operations with the /v3/voice path"),
15+
};
16+
917

1018
private static readonly global::DeepL.EndPointSecurityRequirement s_GetVoiceStreamingUrlSecurityRequirement0 =
1119
new global::DeepL.EndPointSecurityRequirement
@@ -109,7 +117,9 @@ partial void ProcessGetVoiceStreamingUrlResponseContent(
109117

110118
var __pathBuilder = new global::DeepL.PathBuilder(
111119
path: "/v3/voice/realtime",
112-
baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.deepl.com/", global::System.UriKind.RelativeOrAbsolute));
120+
baseUri: ResolveBaseUri(
121+
servers: s_GetVoiceStreamingUrlServers,
122+
defaultBaseUrl: "https://api.deepl.com/"));
113123
var __path = __pathBuilder.ToString();
114124
__path = global::DeepL.AutoSDKRequestOptionsSupport.AppendQueryParameters(
115125
path: __path,

src/libs/DeepL/Generated/DeepL.VoiceAPIClient.RequestReconnection.g.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ namespace DeepL
66
public partial class VoiceAPIClient
77
{
88

9+
private static readonly global::DeepL.AutoSDKServer[] s_RequestReconnectionServers = new global::DeepL.AutoSDKServer[]
10+
{ new global::DeepL.AutoSDKServer(
11+
id: "https-api-deepl-com",
12+
name: "Override base path for all operations with the /v3/voice path",
13+
url: "https://api.deepl.com/",
14+
description: "Override base path for all operations with the /v3/voice path"),
15+
};
16+
917

1018
private static readonly global::DeepL.EndPointSecurityRequirement s_RequestReconnectionSecurityRequirement0 =
1119
new global::DeepL.EndPointSecurityRequirement
@@ -104,7 +112,9 @@ partial void ProcessRequestReconnectionResponseContent(
104112

105113
var __pathBuilder = new global::DeepL.PathBuilder(
106114
path: "/v3/voice/realtime",
107-
baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.deepl.com/", global::System.UriKind.RelativeOrAbsolute));
115+
baseUri: ResolveBaseUri(
116+
servers: s_RequestReconnectionServers,
117+
defaultBaseUrl: "https://api.deepl.com/"));
108118
__pathBuilder
109119
.AddRequiredParameter("token", token)
110120
;

src/libs/DeepL/Generated/DeepL.VoiceAPIClient.g.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,36 @@ partial void ProcessResponseContent(
142142
global::System.Net.Http.HttpClient client,
143143
global::System.Net.Http.HttpResponseMessage response,
144144
ref string content);
145+
146+
147+
private global::System.Uri? ResolveBaseUri(
148+
global::DeepL.AutoSDKServer[] servers,
149+
string defaultBaseUrl)
150+
{
151+
if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
152+
{
153+
return explicitBaseUri;
154+
}
155+
156+
if (AutoSDKServerConfiguration.SelectedServer is global::DeepL.AutoSDKServer selectedServer)
157+
{
158+
foreach (var server in servers)
159+
{
160+
if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
161+
{
162+
return server.Uri;
163+
}
164+
}
165+
}
166+
167+
if (servers.Length > 0)
168+
{
169+
return servers[0].Uri;
170+
}
171+
172+
return string.IsNullOrWhiteSpace(defaultBaseUrl)
173+
? HttpClient.BaseAddress
174+
: new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
175+
}
145176
}
146177
}

0 commit comments

Comments
 (0)