Skip to content

Commit 536a365

Browse files
authored
Merge pull request #58 from apideck-libraries/speakeasy-sdk-regen-1760429792
chore: 🐝 Update SDK - Generate 0.18.0
2 parents b40c7c2 + ad39041 commit 536a365

File tree

183 files changed

+3546
-1019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+3546
-1019
lines changed

.speakeasy/gen.lock

Lines changed: 74 additions & 42 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ generation:
1717
oAuth2ClientCredentialsEnabled: true
1818
oAuth2PasswordEnabled: true
1919
hoistGlobalSecurity: true
20+
schemas:
21+
allOfMergeStrategy: shallowMerge
2022
tests:
2123
generateTests: true
2224
generateNewTests: false
2325
skipResponseBodyAssertions: false
2426
csharp:
25-
version: 0.17.0
27+
version: 0.18.0
2628
additionalDependencies: []
2729
author: Speakeasy
2830
baseErrorName: ApideckError

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.636.3
1+
speakeasyVersion: 1.638.0
22
sources:
33
Apideck:
44
sourceNamespace: apideck
5-
sourceRevisionDigest: sha256:284c332c5f33230229bc34bc3a70fb5e205f40df0d163f7911e41d874e0cb1c8
6-
sourceBlobDigest: sha256:cc1a0fc165bc74203fb1b352268314fd298f2abbd75dd8a29d132371b842d45e
5+
sourceRevisionDigest: sha256:d38f634aafc8bd67fab6d8580a3df253866a63416570d238f73e9f72ce0577ad
6+
sourceBlobDigest: sha256:4176a0d252e96d7734ac1c58d1f2a519ddc86675491690f88723e29950634315
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1759403528
10-
- 10.21.4
9+
- speakeasy-sdk-regen-1760429792
10+
- 10.21.6
1111
targets:
1212
apideck:
1313
source: Apideck
1414
sourceNamespace: apideck
15-
sourceRevisionDigest: sha256:284c332c5f33230229bc34bc3a70fb5e205f40df0d163f7911e41d874e0cb1c8
16-
sourceBlobDigest: sha256:cc1a0fc165bc74203fb1b352268314fd298f2abbd75dd8a29d132371b842d45e
15+
sourceRevisionDigest: sha256:d38f634aafc8bd67fab6d8580a3df253866a63416570d238f73e9f72ce0577ad
16+
sourceBlobDigest: sha256:4176a0d252e96d7734ac1c58d1f2a519ddc86675491690f88723e29950634315
1717
codeSamplesNamespace: apideck-csharp-code-samples
18-
codeSamplesRevisionDigest: sha256:1ed3bfeb3fafef2238eb4884da275356d35ab123b7cfadebcf44fbd767ef159f
18+
codeSamplesRevisionDigest: sha256:7e1d5a91338fcd7dcdb81c8e4df0f1ac99df0c32f77c282e3a48d8a5c4cbca20
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

NUGET.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,150 @@ var res = await sdk.Accounting.Attachments.UploadAsync(
427427
```
428428
<!-- End Server Selection [server] -->
429429

430+
<!-- Start Custom HTTP Client [http-client] -->
431+
## Custom HTTP Client
432+
433+
The C# SDK makes API calls using an `ISpeakeasyHttpClient` that wraps the native
434+
[HttpClient](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient). This
435+
client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle
436+
errors and response.
437+
438+
The `ISpeakeasyHttpClient` interface allows you to either use the default `SpeakeasyHttpClient` that comes with the SDK,
439+
or provide your own custom implementation with customized configuration such as custom message handlers, timeouts,
440+
connection pooling, and other HTTP client settings.
441+
442+
The following example shows how to create a custom HTTP client with request modification and error handling:
443+
444+
```csharp
445+
using ApideckUnifySdk;
446+
using ApideckUnifySdk.Utils;
447+
using System.Net.Http;
448+
using System.Threading;
449+
using System.Threading.Tasks;
450+
451+
// Create a custom HTTP client
452+
public class CustomHttpClient : ISpeakeasyHttpClient
453+
{
454+
private readonly ISpeakeasyHttpClient _defaultClient;
455+
456+
public CustomHttpClient()
457+
{
458+
_defaultClient = new SpeakeasyHttpClient();
459+
}
460+
461+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
462+
{
463+
// Add custom header and timeout
464+
request.Headers.Add("x-custom-header", "custom value");
465+
request.Headers.Add("x-request-timeout", "30");
466+
467+
try
468+
{
469+
var response = await _defaultClient.SendAsync(request, cancellationToken);
470+
// Log successful response
471+
Console.WriteLine($"Request successful: {response.StatusCode}");
472+
return response;
473+
}
474+
catch (Exception error)
475+
{
476+
// Log error
477+
Console.WriteLine($"Request failed: {error.Message}");
478+
throw;
479+
}
480+
}
481+
482+
public void Dispose()
483+
{
484+
_httpClient?.Dispose();
485+
_defaultClient?.Dispose();
486+
}
487+
}
488+
489+
// Use the custom HTTP client with the SDK
490+
var customHttpClient = new CustomHttpClient();
491+
var sdk = new Apideck(client: customHttpClient);
492+
```
493+
494+
<details>
495+
<summary>You can also provide a completely custom HTTP client with your own configuration:</summary>
496+
497+
```csharp
498+
using ApideckUnifySdk.Utils;
499+
using System.Net.Http;
500+
using System.Threading;
501+
using System.Threading.Tasks;
502+
503+
// Custom HTTP client with custom configuration
504+
public class AdvancedHttpClient : ISpeakeasyHttpClient
505+
{
506+
private readonly HttpClient _httpClient;
507+
508+
public AdvancedHttpClient()
509+
{
510+
var handler = new HttpClientHandler()
511+
{
512+
MaxConnectionsPerServer = 10,
513+
// ServerCertificateCustomValidationCallback = customCertValidation, // Custom SSL validation if needed
514+
};
515+
516+
_httpClient = new HttpClient(handler)
517+
{
518+
Timeout = TimeSpan.FromSeconds(30)
519+
};
520+
}
521+
522+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
523+
{
524+
return await _httpClient.SendAsync(request, cancellationToken ?? CancellationToken.None);
525+
}
526+
527+
public void Dispose()
528+
{
529+
_httpClient?.Dispose();
530+
}
531+
}
532+
533+
var sdk = Apideck.Builder()
534+
.WithClient(new AdvancedHttpClient())
535+
.Build();
536+
```
537+
</details>
538+
539+
<details>
540+
<summary>For simple debugging, you can enable request/response logging by implementing a custom client:</summary>
541+
542+
```csharp
543+
public class LoggingHttpClient : ISpeakeasyHttpClient
544+
{
545+
private readonly ISpeakeasyHttpClient _innerClient;
546+
547+
public LoggingHttpClient(ISpeakeasyHttpClient innerClient = null)
548+
{
549+
_innerClient = innerClient ?? new SpeakeasyHttpClient();
550+
}
551+
552+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
553+
{
554+
// Log request
555+
Console.WriteLine($"Sending {request.Method} request to {request.RequestUri}");
556+
557+
var response = await _innerClient.SendAsync(request, cancellationToken);
558+
559+
// Log response
560+
Console.WriteLine($"Received {response.StatusCode} response");
561+
562+
return response;
563+
}
564+
565+
public void Dispose() => _innerClient?.Dispose();
566+
}
567+
568+
var sdk = new Apideck(client: new LoggingHttpClient());
569+
```
570+
</details>
571+
572+
The SDK also provides built-in hook support through the `SDKConfiguration.Hooks` system, which automatically handles
573+
`BeforeRequestAsync`, `AfterSuccessAsync`, and `AfterErrorAsync` hooks for advanced request lifecycle management.
574+
<!-- End Custom HTTP Client [http-client] -->
575+
430576
<!-- Placeholder for Future Speakeasy SDK Sections -->

README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ For more information about the API: [Apideck Developer Docs](https://developers.
3030
* [Retries](#retries)
3131
* [Error Handling](#error-handling)
3232
* [Server Selection](#server-selection)
33+
* [Custom HTTP Client](#custom-http-client)
3334
* [Development](#development)
3435
* [Maturity](#maturity)
3536
* [Contributions](#contributions)
@@ -1048,6 +1049,152 @@ var res = await sdk.Accounting.Attachments.UploadAsync(
10481049
```
10491050
<!-- End Server Selection [server] -->
10501051

1052+
<!-- Start Custom HTTP Client [http-client] -->
1053+
## Custom HTTP Client
1054+
1055+
The C# SDK makes API calls using an `ISpeakeasyHttpClient` that wraps the native
1056+
[HttpClient](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient). This
1057+
client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle
1058+
errors and response.
1059+
1060+
The `ISpeakeasyHttpClient` interface allows you to either use the default `SpeakeasyHttpClient` that comes with the SDK,
1061+
or provide your own custom implementation with customized configuration such as custom message handlers, timeouts,
1062+
connection pooling, and other HTTP client settings.
1063+
1064+
The following example shows how to create a custom HTTP client with request modification and error handling:
1065+
1066+
```csharp
1067+
using ApideckUnifySdk;
1068+
using ApideckUnifySdk.Utils;
1069+
using System.Net.Http;
1070+
using System.Threading;
1071+
using System.Threading.Tasks;
1072+
1073+
// Create a custom HTTP client
1074+
public class CustomHttpClient : ISpeakeasyHttpClient
1075+
{
1076+
private readonly ISpeakeasyHttpClient _defaultClient;
1077+
1078+
public CustomHttpClient()
1079+
{
1080+
_defaultClient = new SpeakeasyHttpClient();
1081+
}
1082+
1083+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
1084+
{
1085+
// Add custom header and timeout
1086+
request.Headers.Add("x-custom-header", "custom value");
1087+
request.Headers.Add("x-request-timeout", "30");
1088+
1089+
try
1090+
{
1091+
var response = await _defaultClient.SendAsync(request, cancellationToken);
1092+
// Log successful response
1093+
Console.WriteLine($"Request successful: {response.StatusCode}");
1094+
return response;
1095+
}
1096+
catch (Exception error)
1097+
{
1098+
// Log error
1099+
Console.WriteLine($"Request failed: {error.Message}");
1100+
throw;
1101+
}
1102+
}
1103+
1104+
public void Dispose()
1105+
{
1106+
_httpClient?.Dispose();
1107+
_defaultClient?.Dispose();
1108+
}
1109+
}
1110+
1111+
// Use the custom HTTP client with the SDK
1112+
var customHttpClient = new CustomHttpClient();
1113+
var sdk = new Apideck(client: customHttpClient);
1114+
```
1115+
1116+
<details>
1117+
<summary>You can also provide a completely custom HTTP client with your own configuration:</summary>
1118+
1119+
```csharp
1120+
using ApideckUnifySdk.Utils;
1121+
using System.Net.Http;
1122+
using System.Threading;
1123+
using System.Threading.Tasks;
1124+
1125+
// Custom HTTP client with custom configuration
1126+
public class AdvancedHttpClient : ISpeakeasyHttpClient
1127+
{
1128+
private readonly HttpClient _httpClient;
1129+
1130+
public AdvancedHttpClient()
1131+
{
1132+
var handler = new HttpClientHandler()
1133+
{
1134+
MaxConnectionsPerServer = 10,
1135+
// ServerCertificateCustomValidationCallback = customCertValidation, // Custom SSL validation if needed
1136+
};
1137+
1138+
_httpClient = new HttpClient(handler)
1139+
{
1140+
Timeout = TimeSpan.FromSeconds(30)
1141+
};
1142+
}
1143+
1144+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
1145+
{
1146+
return await _httpClient.SendAsync(request, cancellationToken ?? CancellationToken.None);
1147+
}
1148+
1149+
public void Dispose()
1150+
{
1151+
_httpClient?.Dispose();
1152+
}
1153+
}
1154+
1155+
var sdk = Apideck.Builder()
1156+
.WithClient(new AdvancedHttpClient())
1157+
.Build();
1158+
```
1159+
</details>
1160+
1161+
<details>
1162+
<summary>For simple debugging, you can enable request/response logging by implementing a custom client:</summary>
1163+
1164+
```csharp
1165+
public class LoggingHttpClient : ISpeakeasyHttpClient
1166+
{
1167+
private readonly ISpeakeasyHttpClient _innerClient;
1168+
1169+
public LoggingHttpClient(ISpeakeasyHttpClient innerClient = null)
1170+
{
1171+
_innerClient = innerClient ?? new SpeakeasyHttpClient();
1172+
}
1173+
1174+
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
1175+
{
1176+
// Log request
1177+
Console.WriteLine($"Sending {request.Method} request to {request.RequestUri}");
1178+
1179+
var response = await _innerClient.SendAsync(request, cancellationToken);
1180+
1181+
// Log response
1182+
Console.WriteLine($"Received {response.StatusCode} response");
1183+
1184+
return response;
1185+
}
1186+
1187+
public void Dispose() => _innerClient?.Dispose();
1188+
}
1189+
1190+
var sdk = new Apideck(client: new LoggingHttpClient());
1191+
```
1192+
</details>
1193+
1194+
The SDK also provides built-in hook support through the `SDKConfiguration.Hooks` system, which automatically handles
1195+
`BeforeRequestAsync`, `AfterSuccessAsync`, and `AfterErrorAsync` hooks for advanced request lifecycle management.
1196+
<!-- End Custom HTTP Client [http-client] -->
1197+
10511198
<!-- Placeholder for Future Speakeasy SDK Sections -->
10521199

10531200
# Development

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,4 +448,14 @@ Based on:
448448
### Generated
449449
- [csharp v0.17.0] .
450450
### Releases
451-
- [NuGet v0.17.0] https://www.nuget.org/packages/ApideckUnifySdk/0.17.0 - .
451+
- [NuGet v0.17.0] https://www.nuget.org/packages/ApideckUnifySdk/0.17.0 - .
452+
453+
## 2025-10-22 00:12:53
454+
### Changes
455+
Based on:
456+
- OpenAPI Doc
457+
- Speakeasy CLI 1.638.0 (2.728.0) https://github.com/speakeasy-api/speakeasy
458+
### Generated
459+
- [csharp v0.18.0] .
460+
### Releases
461+
- [NuGet v0.18.0] https://www.nuget.org/packages/ApideckUnifySdk/0.18.0 - .

0 commit comments

Comments
 (0)