@@ -96,10 +96,10 @@ public class ApiEndpoints: IApiEndpoints
9696 {
9797 public SDKConfig Config { get ; private set ; }
9898 private const string _language = "csharp" ;
99- private const string _sdkVersion = "2.1 .0" ;
100- private const string _sdkGenVersion = "2.185.0 " ;
99+ private const string _sdkVersion = "2.2 .0" ;
100+ private const string _sdkGenVersion = "2.192.1 " ;
101101 private const string _openapiDocVersion = "0.3.0" ;
102- private const string _userAgent = "speakeasy-sdk/csharp 2.1 .0 2.185.0 0.3.0 SpeakeasySDK" ;
102+ private const string _userAgent = "speakeasy-sdk/csharp 2.2 .0 2.192.1 0.3.0 SpeakeasySDK" ;
103103 private string _serverUrl = "" ;
104104 private ISpeakeasyHttpClient _defaultClient ;
105105 private ISpeakeasyHttpClient _securityClient ;
@@ -115,14 +115,9 @@ public ApiEndpoints(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient sec
115115
116116 public async Task < DeleteApiEndpointResponse > DeleteApiEndpointAsync ( DeleteApiEndpointRequest ? request = null )
117117 {
118- string baseUrl = _serverUrl ;
119- if ( baseUrl . EndsWith ( "/" ) )
120- {
121- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
122- }
118+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
123119 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}" , request ) ;
124120
125-
126121 var httpRequest = new HttpRequestMessage ( HttpMethod . Delete , urlString ) ;
127122 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
128123
@@ -152,14 +147,9 @@ public async Task<DeleteApiEndpointResponse> DeleteApiEndpointAsync(DeleteApiEnd
152147
153148 public async Task < FindApiEndpointResponse > FindApiEndpointAsync ( FindApiEndpointRequest ? request = null )
154149 {
155- string baseUrl = _serverUrl ;
156- if ( baseUrl . EndsWith ( "/" ) )
157- {
158- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
159- }
150+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
160151 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/find/{displayName}" , request ) ;
161152
162-
163153 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
164154 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
165155
@@ -193,14 +183,9 @@ public async Task<FindApiEndpointResponse> FindApiEndpointAsync(FindApiEndpointR
193183
194184 public async Task < GenerateOpenApiSpecForApiEndpointResponse > GenerateOpenApiSpecForApiEndpointAsync ( GenerateOpenApiSpecForApiEndpointRequest ? request = null )
195185 {
196- string baseUrl = _serverUrl ;
197- if ( baseUrl . EndsWith ( "/" ) )
198- {
199- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
200- }
186+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
201187 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}/generate/openapi" , request ) ;
202188
203-
204189 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
205190 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
206191
@@ -234,14 +219,9 @@ public async Task<GenerateOpenApiSpecForApiEndpointResponse> GenerateOpenApiSpec
234219
235220 public async Task < GeneratePostmanCollectionForApiEndpointResponse > GeneratePostmanCollectionForApiEndpointAsync ( GeneratePostmanCollectionForApiEndpointRequest ? request = null )
236221 {
237- string baseUrl = _serverUrl ;
238- if ( baseUrl . EndsWith ( "/" ) )
239- {
240- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
241- }
222+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
242223 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}/generate/postman" , request ) ;
243224
244-
245225 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
246226 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
247227
@@ -275,14 +255,9 @@ public async Task<GeneratePostmanCollectionForApiEndpointResponse> GeneratePostm
275255
276256 public async Task < GetAllApiEndpointsResponse > GetAllApiEndpointsAsync ( GetAllApiEndpointsRequest ? request = null )
277257 {
278- string baseUrl = _serverUrl ;
279- if ( baseUrl . EndsWith ( "/" ) )
280- {
281- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
282- }
258+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
283259 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/api_endpoints" , request ) ;
284260
285-
286261 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
287262 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
288263
@@ -316,14 +291,9 @@ public async Task<GetAllApiEndpointsResponse> GetAllApiEndpointsAsync(GetAllApiE
316291
317292 public async Task < GetAllForVersionApiEndpointsResponse > GetAllForVersionApiEndpointsAsync ( GetAllForVersionApiEndpointsRequest ? request = null )
318293 {
319- string baseUrl = _serverUrl ;
320- if ( baseUrl . EndsWith ( "/" ) )
321- {
322- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
323- }
294+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
324295 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints" , request ) ;
325296
326-
327297 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
328298 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
329299
@@ -357,14 +327,9 @@ public async Task<GetAllForVersionApiEndpointsResponse> GetAllForVersionApiEndpo
357327
358328 public async Task < GetApiEndpointResponse > GetApiEndpointAsync ( GetApiEndpointRequest ? request = null )
359329 {
360- string baseUrl = _serverUrl ;
361- if ( baseUrl . EndsWith ( "/" ) )
362- {
363- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
364- }
330+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
365331 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}" , request ) ;
366332
367-
368333 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
369334 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
370335
@@ -398,14 +363,9 @@ public async Task<GetApiEndpointResponse> GetApiEndpointAsync(GetApiEndpointRequ
398363
399364 public async Task < UpsertApiEndpointResponse > UpsertApiEndpointAsync ( UpsertApiEndpointRequest request )
400365 {
401- string baseUrl = _serverUrl ;
402- if ( baseUrl . EndsWith ( "/" ) )
403- {
404- baseUrl = baseUrl . Substring ( 0 , baseUrl . Length - 1 ) ;
405- }
366+ string baseUrl = this . Config . GetTemplatedServerDetails ( ) ;
406367 var urlString = URLBuilder . Build ( baseUrl , "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}" , request ) ;
407368
408-
409369 var httpRequest = new HttpRequestMessage ( HttpMethod . Put , urlString ) ;
410370 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
411371
0 commit comments