|
10 | 10 | #nullable enable
|
11 | 11 | namespace SpeakeasySDK
|
12 | 12 | {
|
| 13 | + using Newtonsoft.Json; |
13 | 14 | using SpeakeasySDK.Models.Operations;
|
14 | 15 | using SpeakeasySDK.Models.Shared;
|
15 | 16 | using SpeakeasySDK.Utils;
|
@@ -41,10 +42,10 @@ public class Events: IEvents
|
41 | 42 | {
|
42 | 43 | public SDKConfig SDKConfiguration { get; private set; }
|
43 | 44 | private const string _language = "csharp";
|
44 |
| - private const string _sdkVersion = "5.0.0"; |
45 |
| - private const string _sdkGenVersion = "2.250.16"; |
| 45 | + private const string _sdkVersion = "5.0.1"; |
| 46 | + private const string _sdkGenVersion = "2.250.22"; |
46 | 47 | private const string _openapiDocVersion = "0.4.0";
|
47 |
| - private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.250.16 0.4.0 SpeakeasySDK"; |
| 48 | + private const string _userAgent = "speakeasy-sdk/csharp 5.0.1 2.250.22 0.4.0 SpeakeasySDK"; |
48 | 49 | private string _serverUrl = "";
|
49 | 50 | private ISpeakeasyHttpClient _defaultClient;
|
50 | 51 | private Func<Security>? _securitySource;
|
@@ -95,6 +96,20 @@ public async Task<PostWorkspaceEventsResponse> PostWorkspaceEventsAsync(PostWork
|
95 | 96 | RawResponse = httpResponse
|
96 | 97 | };
|
97 | 98 |
|
| 99 | + if((response.StatusCode >= 200 && response.StatusCode < 300)) |
| 100 | + { |
| 101 | + |
| 102 | + return response; |
| 103 | + } |
| 104 | + if((response.StatusCode >= 500 && response.StatusCode < 600)) |
| 105 | + { |
| 106 | + if(Utilities.IsContentTypeMatch("application/json",response.ContentType)) |
| 107 | + { |
| 108 | + response.Error = JsonConvert.DeserializeObject<Error>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }}); |
| 109 | + } |
| 110 | + |
| 111 | + return response; |
| 112 | + } |
98 | 113 | return response;
|
99 | 114 | }
|
100 | 115 |
|
|
0 commit comments