diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminCreateDeveloperKey.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminCreateDeveloperKey.g.cs index 02141a3..d781f1f 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminCreateDeveloperKey.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminCreateDeveloperKey.g.cs @@ -365,13 +365,13 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -382,7 +382,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -402,13 +402,13 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -419,7 +419,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -439,13 +439,13 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -456,7 +456,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -476,13 +476,13 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -493,7 +493,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -536,7 +536,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -581,7 +581,7 @@ partial void ProcessAdminCreateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminDeactivateDeveloperKey.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminDeactivateDeveloperKey.g.cs index 5e6c407..10032cb 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminDeactivateDeveloperKey.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminDeactivateDeveloperKey.g.cs @@ -365,13 +365,13 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -382,7 +382,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -402,13 +402,13 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -419,7 +419,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -439,13 +439,13 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -456,7 +456,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -476,13 +476,13 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -493,7 +493,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -536,7 +536,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -581,7 +581,7 @@ partial void ProcessAdminDeactivateDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetAnalytics.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetAnalytics.g.cs index 3ba4d6b..40a1446 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetAnalytics.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetAnalytics.g.cs @@ -377,13 +377,13 @@ partial void ProcessAdminGetAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.AdminGetAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.AdminGetAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.AdminGetAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.AdminGetAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -394,7 +394,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -414,13 +414,13 @@ partial void ProcessAdminGetAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -431,7 +431,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -451,13 +451,13 @@ partial void ProcessAdminGetAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -468,7 +468,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -488,13 +488,13 @@ partial void ProcessAdminGetAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -505,7 +505,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -548,7 +548,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -593,7 +593,7 @@ partial void ProcessAdminGetAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetCustomTagAnalytics.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetCustomTagAnalytics.g.cs index f21d43c..dfdb272 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetCustomTagAnalytics.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetCustomTagAnalytics.g.cs @@ -395,13 +395,13 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.AdminGetCustomTagAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.AdminGetCustomTagAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.AdminGetCustomTagAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.AdminGetCustomTagAnalyticsResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -412,7 +412,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -432,13 +432,13 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -449,7 +449,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -469,13 +469,13 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -486,7 +486,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -506,13 +506,13 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -523,7 +523,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -566,7 +566,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -611,7 +611,7 @@ partial void ProcessAdminGetCustomTagAnalyticsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetDeveloperKeys.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetDeveloperKeys.g.cs index 7c615be..453c600 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetDeveloperKeys.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetDeveloperKeys.g.cs @@ -345,13 +345,13 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -362,7 +362,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -382,13 +382,13 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -399,7 +399,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -419,13 +419,13 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -436,7 +436,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -456,13 +456,13 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -473,7 +473,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -516,7 +516,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -561,7 +561,7 @@ partial void ProcessAdminGetDeveloperKeysResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminRenameDeveloperKey.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminRenameDeveloperKey.g.cs index f3fca7a..23efc4a 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminRenameDeveloperKey.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminRenameDeveloperKey.g.cs @@ -365,13 +365,13 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -382,7 +382,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -402,13 +402,13 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -419,7 +419,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -439,13 +439,13 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -456,7 +456,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -476,13 +476,13 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -493,7 +493,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -536,7 +536,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -581,7 +581,7 @@ partial void ProcessAdminRenameDeveloperKeyResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminSetDeveloperKeyUsageLimits.g.cs b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminSetDeveloperKeyUsageLimits.g.cs index c7afed9..245a2b3 100644 --- a/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminSetDeveloperKeyUsageLimits.g.cs +++ b/src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminSetDeveloperKeyUsageLimits.g.cs @@ -367,13 +367,13 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -384,7 +384,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -404,13 +404,13 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -421,7 +421,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -441,13 +441,13 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -458,7 +458,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -478,13 +478,13 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -495,7 +495,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -538,7 +538,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -583,7 +583,7 @@ partial void ProcessAdminSetDeveloperKeyUsageLimitsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.CorrectText.JsonSerializerContext.g.cs b/src/libs/DeepL/Generated/DeepL.CorrectText.JsonSerializerContext.g.cs index a1ef48b..918c3d6 100644 --- a/src/libs/DeepL/Generated/DeepL.CorrectText.JsonSerializerContext.g.cs +++ b/src/libs/DeepL/Generated/DeepL.CorrectText.JsonSerializerContext.g.cs @@ -21,7 +21,6 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.InfrastructureErrorResponseError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.ErrorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CorrectTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CorrectTextRequest2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.OneOf), TypeInfoPropertyName = "OneOfErrorResponseInfrastructureErrorResponse2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CorrectTextResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] diff --git a/src/libs/DeepL/Generated/DeepL.CorrectTextClient.CorrectText.g.cs b/src/libs/DeepL/Generated/DeepL.CorrectTextClient.CorrectText.g.cs index 3cbfc79..5055088 100644 --- a/src/libs/DeepL/Generated/DeepL.CorrectTextClient.CorrectText.g.cs +++ b/src/libs/DeepL/Generated/DeepL.CorrectTextClient.CorrectText.g.cs @@ -365,13 +365,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -382,7 +382,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -402,13 +402,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -419,7 +419,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -439,13 +439,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -456,7 +456,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -476,13 +476,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -493,7 +493,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -513,13 +513,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -530,7 +530,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -550,13 +550,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -567,7 +567,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -587,13 +587,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -604,7 +604,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -624,13 +624,13 @@ partial void ProcessCorrectTextResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -641,7 +641,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -684,7 +684,7 @@ partial void ProcessCorrectTextResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -729,7 +729,7 @@ partial void ProcessCorrectTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateCustomInstruction.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateCustomInstruction.g.cs index 352407c..c5e8d0d 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateCustomInstruction.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateCustomInstruction.g.cs @@ -374,13 +374,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -391,7 +391,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -411,13 +411,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -428,7 +428,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -448,13 +448,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -465,7 +465,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -485,13 +485,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -502,7 +502,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -522,13 +522,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -539,7 +539,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -559,13 +559,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -576,7 +576,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -596,13 +596,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -613,7 +613,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -633,13 +633,13 @@ partial void ProcessCreateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -650,7 +650,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -693,7 +693,7 @@ partial void ProcessCreateCustomInstructionResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -738,7 +738,7 @@ partial void ProcessCreateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateStyleRuleList.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateStyleRuleList.g.cs index f8a6d20..91b3c8d 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateStyleRuleList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.CreateStyleRuleList.g.cs @@ -369,13 +369,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -386,7 +386,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -406,13 +406,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -423,7 +423,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -443,13 +443,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -460,7 +460,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -480,13 +480,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -497,7 +497,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -517,13 +517,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -534,7 +534,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -554,13 +554,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -571,7 +571,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -591,13 +591,13 @@ partial void ProcessCreateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -608,7 +608,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -651,7 +651,7 @@ partial void ProcessCreateStyleRuleListResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -696,7 +696,7 @@ partial void ProcessCreateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteCustomInstruction.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteCustomInstruction.g.cs index 859d361..abcbe85 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteCustomInstruction.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteCustomInstruction.g.cs @@ -354,13 +354,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -371,7 +371,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -391,13 +391,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -408,7 +408,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -428,13 +428,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -445,7 +445,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -465,13 +465,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -482,7 +482,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -502,13 +502,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -519,7 +519,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -539,13 +539,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -556,7 +556,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -576,13 +576,13 @@ await DeleteCustomInstructionAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -593,7 +593,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -629,7 +629,7 @@ await DeleteCustomInstructionAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -665,7 +665,7 @@ await DeleteCustomInstructionAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteStyleRuleList.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteStyleRuleList.g.cs index ac9d78c..cd7c713 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteStyleRuleList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.DeleteStyleRuleList.g.cs @@ -347,13 +347,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -364,7 +364,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -384,13 +384,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -401,7 +401,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -421,13 +421,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -438,7 +438,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -458,13 +458,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -475,7 +475,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -495,13 +495,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -512,7 +512,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -532,13 +532,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -549,7 +549,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -569,13 +569,13 @@ await DeleteStyleRuleListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -586,7 +586,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -622,7 +622,7 @@ await DeleteStyleRuleListAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -658,7 +658,7 @@ await DeleteStyleRuleListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetCustomInstruction.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetCustomInstruction.g.cs index 4fe16cb..83152f9 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetCustomInstruction.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetCustomInstruction.g.cs @@ -361,13 +361,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -378,7 +378,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -398,13 +398,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -415,7 +415,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -435,13 +435,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -452,7 +452,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -472,13 +472,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -489,7 +489,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -509,13 +509,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -526,7 +526,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -546,13 +546,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -563,7 +563,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -583,13 +583,13 @@ partial void ProcessGetCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -600,7 +600,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -643,7 +643,7 @@ partial void ProcessGetCustomInstructionResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -688,7 +688,7 @@ partial void ProcessGetCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleList.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleList.g.cs index cb4df36..dc2eda4 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleList.g.cs @@ -352,13 +352,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -369,7 +369,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -389,13 +389,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -406,7 +406,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -426,13 +426,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -443,7 +443,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -463,13 +463,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -480,7 +480,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -500,13 +500,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -517,7 +517,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -537,13 +537,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -554,7 +554,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -574,13 +574,13 @@ partial void ProcessGetStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -591,7 +591,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -634,7 +634,7 @@ partial void ProcessGetStyleRuleListResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -679,7 +679,7 @@ partial void ProcessGetStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleLists.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleLists.g.cs index 46e0f24..c8dea43 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleLists.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.GetStyleRuleLists.g.cs @@ -389,13 +389,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -406,7 +406,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -426,13 +426,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -443,7 +443,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -463,13 +463,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -480,7 +480,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -500,13 +500,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -517,7 +517,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -537,13 +537,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -554,7 +554,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -574,13 +574,13 @@ partial void ProcessGetStyleRuleListsResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -591,7 +591,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -634,7 +634,7 @@ partial void ProcessGetStyleRuleListsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -679,7 +679,7 @@ partial void ProcessGetStyleRuleListsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateCustomInstruction.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateCustomInstruction.g.cs index 8a9765e..dd3acce 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateCustomInstruction.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateCustomInstruction.g.cs @@ -383,13 +383,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -400,7 +400,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -420,13 +420,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -437,7 +437,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -457,13 +457,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -474,7 +474,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -494,13 +494,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -511,7 +511,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -531,13 +531,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -548,7 +548,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -568,13 +568,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -585,7 +585,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -605,13 +605,13 @@ partial void ProcessUpdateCustomInstructionResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -622,7 +622,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -665,7 +665,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -710,7 +710,7 @@ partial void ProcessUpdateCustomInstructionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleConfiguredRules.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleConfiguredRules.g.cs index 64a7f7b..fc694d9 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleConfiguredRules.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleConfiguredRules.g.cs @@ -374,13 +374,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -391,7 +391,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -411,13 +411,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -428,7 +428,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -448,13 +448,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -465,7 +465,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -485,13 +485,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -502,7 +502,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -522,13 +522,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -539,7 +539,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -559,13 +559,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -576,7 +576,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -596,13 +596,13 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -613,7 +613,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -656,7 +656,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -701,7 +701,7 @@ partial void ProcessUpdateStyleRuleConfiguredRulesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleList.g.cs b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleList.g.cs index 7181887..21e2094 100644 --- a/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.DeepLClient.UpdateStyleRuleList.g.cs @@ -372,13 +372,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -389,7 +389,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -409,13 +409,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -426,7 +426,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -446,13 +446,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -463,7 +463,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -483,13 +483,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -500,7 +500,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -520,13 +520,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -537,7 +537,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -557,13 +557,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -574,7 +574,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -594,13 +594,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -611,7 +611,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -631,13 +631,13 @@ partial void ProcessUpdateStyleRuleListResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -648,7 +648,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -691,7 +691,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -736,7 +736,7 @@ partial void ProcessUpdateStyleRuleListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.DeleteDictionary.g.cs b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.DeleteDictionary.g.cs index e35b053..9d39b84 100644 --- a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.DeleteDictionary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.DeleteDictionary.g.cs @@ -15,7 +15,16 @@ public partial interface IManageMultilingualGlossariesClient /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -24,7 +33,7 @@ public partial interface IManageMultilingualGlossariesClient global::System.Threading.Tasks.Task DeleteDictionaryAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -38,7 +47,16 @@ public partial interface IManageMultilingualGlossariesClient /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -47,7 +65,7 @@ public partial interface IManageMultilingualGlossariesClient global::System.Threading.Tasks.Task DeleteDictionaryAsResponseAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs index 48c297d..15a3363 100644 --- a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs @@ -14,7 +14,16 @@ public partial interface IManageMultilingualGlossariesClient /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -23,7 +32,7 @@ public partial interface IManageMultilingualGlossariesClient global::System.Threading.Tasks.Task GetMultilingualGlossaryEntriesAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -36,7 +45,16 @@ public partial interface IManageMultilingualGlossariesClient /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -45,7 +63,7 @@ public partial interface IManageMultilingualGlossariesClient global::System.Threading.Tasks.Task> GetMultilingualGlossaryEntriesAsResponseAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.ReplaceDictionary.g.cs b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.ReplaceDictionary.g.cs index b0ac5e4..912a6dc 100644 --- a/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.ReplaceDictionary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.IManageMultilingualGlossariesClient.ReplaceDictionary.g.cs @@ -47,7 +47,16 @@ public partial interface IManageMultilingualGlossariesClient /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// @@ -68,7 +77,7 @@ public partial interface IManageMultilingualGlossariesClient global::System.Threading.Tasks.Task ReplaceDictionaryAsync( string glossaryId, global::DeepL.GlossarySourceLanguage? sourceLang = default, - global::DeepL.GlossaryTargetLanguage? targetLang = default, + global::DeepL.MultilingualGlossaryTargetLanguage? targetLang = default, string? entries = default, global::DeepL.GlossaryEntriesFormat? entriesFormat = default, global::DeepL.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/DeepL/Generated/DeepL.ITranslateTextClient.TranslateText.g.cs b/src/libs/DeepL/Generated/DeepL.ITranslateTextClient.TranslateText.g.cs index 47d1a1f..42cc9bb 100644 --- a/src/libs/DeepL/Generated/DeepL.ITranslateTextClient.TranslateText.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ITranslateTextClient.TranslateText.g.cs @@ -163,8 +163,9 @@ public partial interface ITranslateTextClient /// /// /// Sets which version of the tag handling algorithm should be used. Options currently available:
- /// * `v1`: Traditional algorithm (currently the default, will become deprecated in the future).
- /// * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + /// * `v1`: Traditional algorithm (will become deprecated in the future).
+ /// * `v2`: Improved algorithm released in October 2025. This is the default.
+ /// The `tag_handling_version` field in the response shows which version was applied. /// /// /// Disable the automatic detection of XML structure by setting the `outline_detection` parameter
diff --git a/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguage.g.cs b/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguage.g.cs new file mode 100644 index 0000000..ce8cba8 --- /dev/null +++ b/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguage.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepL.JsonConverters +{ + /// + public sealed class MultilingualGlossaryTargetLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepL.MultilingualGlossaryTargetLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepL.MultilingualGlossaryTargetLanguageExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepL.MultilingualGlossaryTargetLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepL.MultilingualGlossaryTargetLanguage); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepL.MultilingualGlossaryTargetLanguage value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepL.MultilingualGlossaryTargetLanguageExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguageNullable.g.cs b/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguageNullable.g.cs new file mode 100644 index 0000000..6a8f61b --- /dev/null +++ b/src/libs/DeepL/Generated/DeepL.JsonConverters.MultilingualGlossaryTargetLanguageNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepL.JsonConverters +{ + /// + public sealed class MultilingualGlossaryTargetLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepL.MultilingualGlossaryTargetLanguage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepL.MultilingualGlossaryTargetLanguageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepL.MultilingualGlossaryTargetLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepL.MultilingualGlossaryTargetLanguage?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepL.MultilingualGlossaryTargetLanguage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::DeepL.MultilingualGlossaryTargetLanguageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepL/Generated/DeepL.JsonSerializerContext.g.cs b/src/libs/DeepL/Generated/DeepL.JsonSerializerContext.g.cs index d213a51..34d9a9b 100644 --- a/src/libs/DeepL/Generated/DeepL.JsonSerializerContext.g.cs +++ b/src/libs/DeepL/Generated/DeepL.JsonSerializerContext.g.cs @@ -671,6 +671,10 @@ namespace DeepL typeof(global::DeepL.JsonConverters.GlossaryTargetLanguageNullableJsonConverter), + typeof(global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageJsonConverter), + + typeof(global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageNullableJsonConverter), + typeof(global::DeepL.JsonConverters.ModelTypeJsonConverter), typeof(global::DeepL.JsonConverters.ModelTypeNullableJsonConverter), @@ -1270,6 +1274,7 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.DocumentTranslationError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.DocumentKey))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.Formality), TypeInfoPropertyName = "Formality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MultilingualGlossaryTargetLanguage), TypeInfoPropertyName = "MultilingualGlossaryTargetLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryEntriesFormat), TypeInfoPropertyName = "GlossaryEntriesFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.ModelType), TypeInfoPropertyName = "ModelType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MonolingualGlossary))] @@ -1397,9 +1402,7 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.TranslateDocumentRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.RephraseTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.RephraseTextRequest2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CorrectTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CorrectTextRequest2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CreateTranslationMemoryImportRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CreateTranslationMemoryImportRequestSourceFile))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CreateTranslationMemoryImportRequestParameters))] diff --git a/src/libs/DeepL/Generated/DeepL.JsonSerializerContextTypes.g.cs b/src/libs/DeepL/Generated/DeepL.JsonSerializerContextTypes.g.cs index d09a8d0..7da27d7 100644 --- a/src/libs/DeepL/Generated/DeepL.JsonSerializerContextTypes.g.cs +++ b/src/libs/DeepL/Generated/DeepL.JsonSerializerContextTypes.g.cs @@ -802,515 +802,515 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepL.GlossaryEntriesFormat? Type191 { get; set; } + public global::DeepL.MultilingualGlossaryTargetLanguage? Type191 { get; set; } /// /// /// - public global::DeepL.ModelType? Type192 { get; set; } + public global::DeepL.GlossaryEntriesFormat? Type192 { get; set; } /// /// /// - public global::DeepL.MonolingualGlossary? Type193 { get; set; } + public global::DeepL.ModelType? Type193 { get; set; } /// /// /// - public global::DeepL.MultilingualGlossary? Type194 { get; set; } + public global::DeepL.MonolingualGlossary? Type194 { get; set; } /// /// /// - public global::DeepL.MultilingualGlossaryEntries? Type195 { get; set; } + public global::DeepL.MultilingualGlossary? Type195 { get; set; } /// /// /// - public global::DeepL.MultilingualGlossaryEntriesResponse? Type196 { get; set; } + public global::DeepL.MultilingualGlossaryEntries? Type196 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type197 { get; set; } + public global::DeepL.MultilingualGlossaryEntriesResponse? Type197 { get; set; } /// /// /// - public global::DeepL.MultilingualGlossaryEntriesInformation? Type198 { get; set; } + public global::System.Collections.Generic.IList? Type198 { get; set; } /// /// /// - public global::DeepL.OutlineDetectionOptionStr? Type199 { get; set; } + public global::DeepL.MultilingualGlossaryEntriesInformation? Type199 { get; set; } /// /// /// - public global::DeepL.PatchMultilingualGlossaryParameters? Type200 { get; set; } + public global::DeepL.OutlineDetectionOptionStr? Type200 { get; set; } /// /// /// - public global::DeepL.CreateSpokenTermsParameters? Type201 { get; set; } + public global::DeepL.PatchMultilingualGlossaryParameters? Type201 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type202 { get; set; } + public global::DeepL.CreateSpokenTermsParameters? Type202 { get; set; } /// /// /// - public global::DeepL.SpokenTermsListInput? Type203 { get; set; } + public global::System.Collections.Generic.IList? Type203 { get; set; } /// /// /// - public global::DeepL.PatchSpokenTermsParameters? Type204 { get; set; } + public global::DeepL.SpokenTermsListInput? Type204 { get; set; } /// /// /// - public global::DeepL.PutSpokenTermsListParameters? Type205 { get; set; } + public global::DeepL.PatchSpokenTermsParameters? Type205 { get; set; } /// /// /// - public global::DeepL.SpokenTerms? Type206 { get; set; } + public global::DeepL.PutSpokenTermsListParameters? Type206 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type207 { get; set; } + public global::DeepL.SpokenTerms? Type207 { get; set; } /// /// /// - public global::DeepL.SpokenTermsList? Type208 { get; set; } + public global::System.Collections.Generic.IList? Type208 { get; set; } /// /// /// - public global::DeepL.SpokenTermsEntries? Type209 { get; set; } + public global::DeepL.SpokenTermsList? Type209 { get; set; } /// /// /// - public global::DeepL.PreserveFormattingOptionStr? Type210 { get; set; } + public global::DeepL.SpokenTermsEntries? Type210 { get; set; } /// /// /// - public global::DeepL.SplitSentencesOption? Type211 { get; set; } + public global::DeepL.PreserveFormattingOptionStr? Type211 { get; set; } /// /// /// - public global::DeepL.TranslationMemory? Type212 { get; set; } + public global::DeepL.SplitSentencesOption? Type212 { get; set; } /// /// /// - public global::DeepL.TranslationMemorySourceLanguage? Type213 { get; set; } + public global::DeepL.TranslationMemory? Type213 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type214 { get; set; } + public global::DeepL.TranslationMemorySourceLanguage? Type214 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryTargetLanguage? Type215 { get; set; } + public global::System.Collections.Generic.IList? Type215 { get; set; } /// /// /// - public global::DeepL.TranslationMemorySegment? Type216 { get; set; } + public global::DeepL.TranslationMemoryTargetLanguage? Type216 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::DeepL.TranslationMemorySegment? Type217 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryTargetSegment? Type218 { get; set; } + public global::System.Collections.Generic.IList? Type218 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryExport? Type219 { get; set; } + public global::DeepL.TranslationMemoryTargetSegment? Type219 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryExportParameters? Type220 { get; set; } + public global::DeepL.CreateTranslationMemoryExport? Type220 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJob? Type221 { get; set; } + public global::DeepL.CreateTranslationMemoryExportParameters? Type221 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobOperation? Type222 { get; set; } + public global::DeepL.TranslationMemoryJob? Type222 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobSourceFile? Type223 { get; set; } + public global::DeepL.TranslationMemoryJobOperation? Type223 { get; set; } /// /// /// - public long? Type224 { get; set; } + public global::DeepL.TranslationMemoryJobSourceFile? Type224 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobParameters? Type225 { get; set; } + public long? Type225 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type226 { get; set; } + public global::DeepL.TranslationMemoryJobParameters? Type226 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobResult? Type227 { get; set; } + public global::System.Collections.Generic.IList? Type227 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobResultStatus? Type228 { get; set; } + public global::DeepL.TranslationMemoryJobResult? Type228 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobResultStatusMetadata? Type229 { get; set; } + public global::DeepL.TranslationMemoryJobResultStatus? Type229 { get; set; } /// /// /// - public global::DeepL.TranslationMemoryJobResultError? Type230 { get; set; } + public global::DeepL.TranslationMemoryJobResultStatusMetadata? Type230 { get; set; } /// /// /// - public global::DeepL.TagHandlingOption? Type231 { get; set; } + public global::DeepL.TranslationMemoryJobResultError? Type231 { get; set; } /// /// /// - public global::DeepL.TagHandlingVersionOption? Type232 { get; set; } + public global::DeepL.TagHandlingOption? Type232 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type233 { get; set; } + public global::DeepL.TagHandlingVersionOption? Type233 { get; set; } /// /// /// - public global::DeepL.TargetLanguageWrite? Type234 { get; set; } + public global::System.Collections.Generic.IList? Type234 { get; set; } /// /// /// - public global::DeepL.UsageResponse? Type235 { get; set; } + public global::DeepL.TargetLanguageWrite? Type235 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type236 { get; set; } + public global::DeepL.UsageResponse? Type236 { get; set; } /// /// /// - public global::DeepL.UsageResponseProduct? Type237 { get; set; } + public global::System.Collections.Generic.IList? Type237 { get; set; } /// /// /// - public global::DeepL.UsageResponseProductBillingUnit? Type238 { get; set; } + public global::DeepL.UsageResponseProduct? Type238 { get; set; } /// /// /// - public global::DeepL.VoiceFormality? Type239 { get; set; } + public global::DeepL.UsageResponseProductBillingUnit? Type239 { get; set; } /// /// /// - public global::DeepL.VoiceMessageFormat? Type240 { get; set; } + public global::DeepL.VoiceFormality? Type240 { get; set; } /// /// /// - public global::DeepL.VoiceTargetMediaVoice? Type241 { get; set; } + public global::DeepL.VoiceMessageFormat? Type241 { get; set; } /// /// /// - public global::DeepL.VoiceSourceMediaContentType? Type242 { get; set; } + public global::DeepL.VoiceTargetMediaVoice? Type242 { get; set; } /// /// /// - public global::DeepL.VoiceSourceLanguage? Type243 { get; set; } + public global::DeepL.VoiceSourceMediaContentType? Type243 { get; set; } /// /// /// - public global::DeepL.VoiceSourceLanguageMode? Type244 { get; set; } + public global::DeepL.VoiceSourceLanguage? Type244 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type245 { get; set; } + public global::DeepL.VoiceSourceLanguageMode? Type245 { get; set; } /// /// /// - public global::DeepL.VoiceTargetLanguage? Type246 { get; set; } + public global::System.Collections.Generic.IList? Type246 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type247 { get; set; } + public global::DeepL.VoiceTargetLanguage? Type247 { get; set; } /// /// /// - public global::DeepL.VoiceTargetMediaLanguage? Type248 { get; set; } + public global::System.Collections.Generic.IList? Type248 { get; set; } /// /// /// - public global::DeepL.VoiceTargetMediaContentType? Type249 { get; set; } + public global::DeepL.VoiceTargetMediaLanguage? Type249 { get; set; } /// /// /// - public global::DeepL.VoiceStreamingResponse? Type250 { get; set; } + public global::DeepL.VoiceTargetMediaContentType? Type250 { get; set; } /// /// /// - public global::DeepL.WritingStyle? Type251 { get; set; } + public global::DeepL.VoiceStreamingResponse? Type251 { get; set; } /// /// /// - public global::DeepL.WritingTone? Type252 { get; set; } + public global::DeepL.WritingStyle? Type252 { get; set; } /// /// /// - public global::DeepL.AdminUsageReport? Type253 { get; set; } + public global::DeepL.WritingTone? Type253 { get; set; } /// /// /// - public global::DeepL.AdminUsageReportData? Type254 { get; set; } + public global::DeepL.AdminUsageReport? Type254 { get; set; } /// /// /// - public global::DeepL.UsageBreakdown? Type255 { get; set; } + public global::DeepL.AdminUsageReportData? Type255 { get; set; } /// /// /// - public global::DeepL.AdminUsageReportDataGroupBy? Type256 { get; set; } + public global::DeepL.UsageBreakdown? Type256 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type257 { get; set; } + public global::DeepL.AdminUsageReportDataGroupBy? Type257 { get; set; } /// /// /// - public global::DeepL.KeyUsageItem? Type258 { get; set; } + public global::System.Collections.Generic.IList? Type258 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type259 { get; set; } + public global::DeepL.KeyUsageItem? Type259 { get; set; } /// /// /// - public global::DeepL.KeyAndDayUsageItem? Type260 { get; set; } + public global::System.Collections.Generic.IList? Type260 { get; set; } /// /// /// - public global::DeepL.CustomTagUsageReport? Type261 { get; set; } + public global::DeepL.KeyAndDayUsageItem? Type261 { get; set; } /// /// /// - public global::DeepL.CustomTagUsageReportData? Type262 { get; set; } + public global::DeepL.CustomTagUsageReport? Type262 { get; set; } /// /// /// - public global::DeepL.CustomTagUsageReportDataAggregateBy? Type263 { get; set; } + public global::DeepL.CustomTagUsageReportData? Type263 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type264 { get; set; } + public global::DeepL.CustomTagUsageReportDataAggregateBy? Type264 { get; set; } /// /// /// - public global::DeepL.CustomTagUsageItem? Type265 { get; set; } + public global::System.Collections.Generic.IList? Type265 { get; set; } /// /// /// - public global::DeepL.CustomTagBreakdown? Type266 { get; set; } + public global::DeepL.CustomTagUsageItem? Type266 { get; set; } /// /// /// - public global::DeepL.InfrastructureErrorResponse? Type267 { get; set; } + public global::DeepL.CustomTagBreakdown? Type267 { get; set; } /// /// /// - public global::DeepL.InfrastructureErrorResponseError? Type268 { get; set; } + public global::DeepL.InfrastructureErrorResponse? Type268 { get; set; } /// /// /// - public global::DeepL.ErrorResponse? Type269 { get; set; } + public global::DeepL.InfrastructureErrorResponseError? Type269 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobSourceContentType? Type270 { get; set; } + public global::DeepL.ErrorResponse? Type270 { get; set; } /// /// /// - public global::DeepL.JobSourceFileRequest? Type271 { get; set; } + public global::DeepL.VoiceTranslateJobSourceContentType? Type271 { get; set; } /// /// /// - public global::DeepL.JobSourceFileResponse? Type272 { get; set; } + public global::DeepL.JobSourceFileRequest? Type272 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobTargetOutputType? Type273 { get; set; } + public global::DeepL.JobSourceFileResponse? Type273 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobParametersRequest? Type274 { get; set; } + public global::DeepL.VoiceTranslateJobTargetOutputType? Type274 { get; set; } /// /// /// - public global::DeepL.AllOf? Type275 { get; set; } + public global::DeepL.VoiceTranslateJobParametersRequest? Type275 { get; set; } /// /// /// - public object? Type276 { get; set; } + public global::DeepL.AllOf? Type276 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobParametersResponse? Type277 { get; set; } + public object? Type277 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobTargetRequest? Type278 { get; set; } + public global::DeepL.VoiceTranslateJobParametersResponse? Type278 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobTargetResponse? Type279 { get; set; } + public global::DeepL.VoiceTranslateJobTargetRequest? Type279 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateCreateJobRequest? Type280 { get; set; } + public global::DeepL.VoiceTranslateJobTargetResponse? Type280 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type281 { get; set; } + public global::DeepL.VoiceTranslateCreateJobRequest? Type281 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateCreateJobResponse? Type282 { get; set; } + public global::System.Collections.Generic.IList? Type282 { get; set; } /// /// /// - public global::DeepL.JobUsage? Type283 { get; set; } + public global::DeepL.VoiceTranslateCreateJobResponse? Type283 { get; set; } /// /// /// - public global::DeepL.ResultStatus? Type284 { get; set; } + public global::DeepL.JobUsage? Type284 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobTargetResult? Type285 { get; set; } + public global::DeepL.ResultStatus? Type285 { get; set; } /// /// /// - public global::DeepL.VoiceTranslateJobStatusResponse? Type286 { get; set; } + public global::DeepL.VoiceTranslateJobTargetResult? Type286 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type287 { get; set; } + public global::DeepL.VoiceTranslateJobStatusResponse? Type287 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type288 { get; set; } + public global::System.Collections.Generic.IList? Type288 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationProcessing? Type289 { get; set; } + public global::System.Collections.Generic.IList? Type289 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationProcessingStatus? Type290 { get; set; } + public global::DeepL.QualityEvaluationProcessing? Type290 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationDone? Type291 { get; set; } + public global::DeepL.QualityEvaluationProcessingStatus? Type291 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationDoneStatus? Type292 { get; set; } + public global::DeepL.QualityEvaluationDone? Type292 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type293 { get; set; } + public global::DeepL.QualityEvaluationDoneStatus? Type293 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationSegment? Type294 { get; set; } + public global::System.Collections.Generic.IList? Type294 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationFailed? Type295 { get; set; } + public global::DeepL.QualityEvaluationSegment? Type295 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationFailedStatus? Type296 { get; set; } + public global::DeepL.QualityEvaluationFailed? Type296 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationFailedError? Type297 { get; set; } + public global::DeepL.QualityEvaluationFailedStatus? Type297 { get; set; } /// /// /// - public float? Type298 { get; set; } + public global::DeepL.QualityEvaluationFailedError? Type298 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type299 { get; set; } + public float? Type299 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationAppliedGlossaryTermPair? Type300 { get; set; } + public global::System.Collections.Generic.IList? Type300 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type301 { get; set; } + public global::DeepL.QualityEvaluationAppliedGlossaryTermPair? Type301 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationIssue? Type302 { get; set; } + public global::System.Collections.Generic.IList? Type302 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type303 { get; set; } + public global::DeepL.QualityEvaluationIssue? Type303 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationSpan? Type304 { get; set; } + public global::System.Collections.Generic.IList? Type304 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationIssueType? Type305 { get; set; } + public global::DeepL.QualityEvaluationSpan? Type305 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationIssueSubType? Type306 { get; set; } + public global::DeepL.QualityEvaluationIssueType? Type306 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationIssueSeverity? Type307 { get; set; } + public global::DeepL.QualityEvaluationIssueSubType? Type307 { get; set; } /// /// /// - public global::DeepL.QualityEvaluationApiError? Type308 { get; set; } + public global::DeepL.QualityEvaluationIssueSeverity? Type308 { get; set; } /// /// /// - public global::DeepL.AdminCreateDeveloperKeyRequest? Type309 { get; set; } + public global::DeepL.QualityEvaluationApiError? Type309 { get; set; } /// /// /// - public global::DeepL.AdminDeactivateDeveloperKeyRequest? Type310 { get; set; } + public global::DeepL.AdminCreateDeveloperKeyRequest? Type310 { get; set; } /// /// /// - public global::DeepL.AdminRenameDeveloperKeyRequest? Type311 { get; set; } + public global::DeepL.AdminDeactivateDeveloperKeyRequest? Type311 { get; set; } /// /// /// - public global::DeepL.AdminSetDeveloperKeyUsageLimitsRequest? Type312 { get; set; } + public global::DeepL.AdminRenameDeveloperKeyRequest? Type312 { get; set; } /// /// /// - public global::DeepL.TranslateTextRequest? Type313 { get; set; } + public global::DeepL.AdminSetDeveloperKeyUsageLimitsRequest? Type313 { get; set; } /// /// /// - public global::DeepL.TranslateTextRequest2? Type314 { get; set; } + public global::DeepL.TranslateTextRequest? Type314 { get; set; } /// /// /// - public global::DeepL.TranslateDocumentRequest? Type315 { get; set; } + public global::DeepL.TranslateTextRequest2? Type315 { get; set; } /// /// /// - public byte[]? Type316 { get; set; } + public global::DeepL.TranslateDocumentRequest? Type316 { get; set; } /// /// /// - public global::DeepL.RephraseTextRequest? Type317 { get; set; } + public byte[]? Type317 { get; set; } /// /// /// - public global::DeepL.RephraseTextRequest2? Type318 { get; set; } + public global::DeepL.RephraseTextRequest? Type318 { get; set; } /// /// /// @@ -1318,359 +1318,355 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepL.CorrectTextRequest2? Type320 { get; set; } + public global::DeepL.CreateTranslationMemoryImportRequest? Type320 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryImportRequest? Type321 { get; set; } + public global::DeepL.CreateTranslationMemoryImportRequestSourceFile? Type321 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryImportRequestSourceFile? Type322 { get; set; } + public global::DeepL.CreateTranslationMemoryImportRequestParameters? Type322 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryImportRequestParameters? Type323 { get; set; } + public global::DeepL.CreateStyleProfileRequest? Type323 { get; set; } /// /// /// - public global::DeepL.CreateStyleProfileRequest? Type324 { get; set; } + public global::DeepL.UpdateStyleProfileRequest? Type324 { get; set; } /// /// /// - public global::DeepL.UpdateStyleProfileRequest? Type325 { get; set; } + public global::DeepL.CreateStyleRuleListRequest? Type325 { get; set; } /// /// /// - public global::DeepL.CreateStyleRuleListRequest? Type326 { get; set; } + public global::System.Collections.Generic.IList? Type326 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type327 { get; set; } + public global::DeepL.CreateStyleRuleListRequestCustomInstruction? Type327 { get; set; } /// /// /// - public global::DeepL.CreateStyleRuleListRequestCustomInstruction? Type328 { get; set; } + public global::DeepL.UpdateStyleRuleListRequest? Type328 { get; set; } /// /// /// - public global::DeepL.UpdateStyleRuleListRequest? Type329 { get; set; } + public global::DeepL.CreateCustomInstructionRequest? Type329 { get; set; } /// /// /// - public global::DeepL.CreateCustomInstructionRequest? Type330 { get; set; } + public global::DeepL.UpdateCustomInstructionRequest? Type330 { get; set; } /// /// /// - public global::DeepL.UpdateCustomInstructionRequest? Type331 { get; set; } + public global::DeepL.GetVoiceStreamingUrlRequest? Type331 { get; set; } /// /// /// - public global::DeepL.GetVoiceStreamingUrlRequest? Type332 { get; set; } + public global::DeepL.AdminGetAnalyticsGroupBy? Type332 { get; set; } /// /// /// - public global::DeepL.AdminGetAnalyticsGroupBy? Type333 { get; set; } + public global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? Type333 { get; set; } /// /// /// - public global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? Type334 { get; set; } + public global::DeepL.GetLanguagesV2Type? Type334 { get; set; } /// /// /// - public global::DeepL.GetLanguagesV2Type? Type335 { get; set; } + public global::DeepL.GetLanguagesResource? Type335 { get; set; } /// /// /// - public global::DeepL.GetLanguagesResource? Type336 { get; set; } + public global::System.Collections.Generic.IList? Type336 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type337 { get; set; } + public global::DeepL.GetLanguagesIncludeItem? Type337 { get; set; } /// /// /// - public global::DeepL.GetLanguagesIncludeItem? Type338 { get; set; } + public global::System.Collections.Generic.IList? Type338 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type339 { get; set; } + public global::DeepL.CreateVoiceTranslateJobIncludeItem? Type339 { get; set; } /// /// /// - public global::DeepL.CreateVoiceTranslateJobIncludeItem? Type340 { get; set; } + public global::System.Collections.Generic.IList? Type340 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type341 { get; set; } + public global::DeepL.GetVoiceTranslateJobStatusIncludeItem? Type341 { get; set; } /// /// /// - public global::DeepL.GetVoiceTranslateJobStatusIncludeItem? Type342 { get; set; } + public global::DeepL.AdminGetAnalyticsResponse? Type342 { get; set; } /// /// /// - public global::DeepL.AdminGetAnalyticsResponse? Type343 { get; set; } + public global::DeepL.OneOf? Type343 { get; set; } /// /// /// - public global::DeepL.OneOf? Type344 { get; set; } + public global::DeepL.AdminGetCustomTagAnalyticsResponse? Type344 { get; set; } /// /// /// - public global::DeepL.AdminGetCustomTagAnalyticsResponse? Type345 { get; set; } + public global::System.Collections.Generic.IList? Type345 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type346 { get; set; } + public global::DeepL.TranslateTextResponse? Type346 { get; set; } /// /// /// - public global::DeepL.TranslateTextResponse? Type347 { get; set; } + public global::System.Collections.Generic.IList? Type347 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type348 { get; set; } + public global::DeepL.TranslateTextResponseTranslation? Type348 { get; set; } /// /// /// - public global::DeepL.TranslateTextResponseTranslation? Type349 { get; set; } + public global::DeepL.TranslateTextResponseTranslationTagHandlingVersion? Type349 { get; set; } /// /// /// - public global::DeepL.TranslateTextResponseTranslationTagHandlingVersion? Type350 { get; set; } + public global::DeepL.TranslateDocumentResponse? Type350 { get; set; } /// /// /// - public global::DeepL.TranslateDocumentResponse? Type351 { get; set; } + public global::DeepL.GetDocumentStatusResponse? Type351 { get; set; } /// /// /// - public global::DeepL.GetDocumentStatusResponse? Type352 { get; set; } + public global::DeepL.GetDocumentStatusResponseStatus? Type352 { get; set; } /// /// /// - public global::DeepL.GetDocumentStatusResponseStatus? Type353 { get; set; } + public global::DeepL.ListGlossaryLanguagesResponse? Type353 { get; set; } /// /// /// - public global::DeepL.ListGlossaryLanguagesResponse? Type354 { get; set; } + public global::System.Collections.Generic.IList? Type354 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type355 { get; set; } + public global::DeepL.ListGlossaryLanguagesResponseSupportedLanguage? Type355 { get; set; } /// /// /// - public global::DeepL.ListGlossaryLanguagesResponseSupportedLanguage? Type356 { get; set; } + public global::DeepL.ListGlossaryLanguagesResponse2? Type356 { get; set; } /// /// /// - public global::DeepL.ListGlossaryLanguagesResponse2? Type357 { get; set; } + public global::DeepL.CreateMultilingualGlossaryResponse? Type357 { get; set; } /// /// /// - public global::DeepL.CreateMultilingualGlossaryResponse? Type358 { get; set; } + public global::DeepL.ListMultilingualGlossariesResponse? Type358 { get; set; } /// /// /// - public global::DeepL.ListMultilingualGlossariesResponse? Type359 { get; set; } + public global::System.Collections.Generic.IList? Type359 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type360 { get; set; } + public global::DeepL.ListMultilingualGlossariesResponse2? Type360 { get; set; } /// /// /// - public global::DeepL.ListMultilingualGlossariesResponse2? Type361 { get; set; } + public global::DeepL.GetMultilingualGlossaryResponse? Type361 { get; set; } /// /// /// - public global::DeepL.GetMultilingualGlossaryResponse? Type362 { get; set; } + public global::DeepL.PatchMultilingualGlossaryResponse? Type362 { get; set; } /// /// /// - public global::DeepL.PatchMultilingualGlossaryResponse? Type363 { get; set; } + public global::DeepL.DeleteMultilingualGlossaryResponse? Type363 { get; set; } /// /// /// - public global::DeepL.DeleteMultilingualGlossaryResponse? Type364 { get; set; } + public global::DeepL.GetMultilingualGlossaryEntriesResponse? Type364 { get; set; } /// /// /// - public global::DeepL.GetMultilingualGlossaryEntriesResponse? Type365 { get; set; } + public global::System.Collections.Generic.IList? Type365 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type366 { get; set; } + public global::DeepL.GetMultilingualGlossaryEntriesResponse2? Type366 { get; set; } /// /// /// - public global::DeepL.GetMultilingualGlossaryEntriesResponse2? Type367 { get; set; } + public global::DeepL.DeleteDictionaryResponse? Type367 { get; set; } /// /// /// - public global::DeepL.DeleteDictionaryResponse? Type368 { get; set; } + public global::DeepL.ReplaceDictionaryResponse? Type368 { get; set; } /// /// /// - public global::DeepL.ReplaceDictionaryResponse? Type369 { get; set; } + public global::DeepL.CreateGlossaryResponse? Type369 { get; set; } /// /// /// - public global::DeepL.CreateGlossaryResponse? Type370 { get; set; } + public global::DeepL.ListGlossariesResponse? Type370 { get; set; } /// /// /// - public global::DeepL.ListGlossariesResponse? Type371 { get; set; } + public global::System.Collections.Generic.IList? Type371 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type372 { get; set; } + public global::DeepL.ListGlossariesResponse2? Type372 { get; set; } /// /// /// - public global::DeepL.ListGlossariesResponse2? Type373 { get; set; } + public global::DeepL.GetGlossaryResponse? Type373 { get; set; } /// /// /// - public global::DeepL.GetGlossaryResponse? Type374 { get; set; } + public global::DeepL.DeleteGlossaryResponse? Type374 { get; set; } /// /// /// - public global::DeepL.DeleteGlossaryResponse? Type375 { get; set; } + public global::DeepL.GetGlossaryEntriesResponse? Type375 { get; set; } /// /// /// - public global::DeepL.GetGlossaryEntriesResponse? Type376 { get; set; } + public global::DeepL.RephraseTextResponse? Type376 { get; set; } /// /// /// - public global::DeepL.RephraseTextResponse? Type377 { get; set; } + public global::System.Collections.Generic.IList? Type377 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type378 { get; set; } + public global::DeepL.RephraseTextResponseImprovement? Type378 { get; set; } /// /// /// - public global::DeepL.RephraseTextResponseImprovement? Type379 { get; set; } + public global::DeepL.CorrectTextResponse? Type379 { get; set; } /// /// /// - public global::DeepL.CorrectTextResponse? Type380 { get; set; } + public global::System.Collections.Generic.IList? Type380 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type381 { get; set; } + public global::DeepL.CorrectTextResponseImprovement? Type381 { get; set; } /// /// /// - public global::DeepL.CorrectTextResponseImprovement? Type382 { get; set; } + public global::System.Collections.Generic.IList? Type382 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type383 { get; set; } + public global::DeepL.GetLanguagesV2ResponseItem? Type383 { get; set; } /// /// /// - public global::DeepL.GetLanguagesV2ResponseItem? Type384 { get; set; } + public global::DeepL.ListSpokenTermsResponse? Type384 { get; set; } /// /// /// - public global::DeepL.ListSpokenTermsResponse? Type385 { get; set; } + public global::System.Collections.Generic.IList? Type385 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type386 { get; set; } + public global::System.Collections.Generic.IList? Type386 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type387 { get; set; } + public global::DeepL.GetLanguageResourcesResponseItem? Type387 { get; set; } /// /// /// - public global::DeepL.GetLanguageResourcesResponseItem? Type388 { get; set; } + public global::DeepL.GetLanguageResourcesResponseItemName? Type388 { get; set; } /// /// /// - public global::DeepL.GetLanguageResourcesResponseItemName? Type389 { get; set; } + public global::System.Collections.Generic.IList? Type389 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type390 { get; set; } + public global::DeepL.GetLanguageResourcesResponseItemFeature? Type390 { get; set; } /// /// /// - public global::DeepL.GetLanguageResourcesResponseItemFeature? Type391 { get; set; } + public global::DeepL.GetLanguageResourcesResponseItemFeatureName? Type391 { get; set; } /// /// /// - public global::DeepL.GetLanguageResourcesResponseItemFeatureName? Type392 { get; set; } + public global::System.Collections.Generic.IList? Type392 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type393 { get; set; } + public global::DeepL.GetLanguagesResponseItem? Type393 { get; set; } /// /// /// - public global::DeepL.GetLanguagesResponseItem? Type394 { get; set; } + public global::DeepL.GetLanguagesResponseItemStatus? Type394 { get; set; } /// /// /// - public global::DeepL.GetLanguagesResponseItemStatus? Type395 { get; set; } + public global::System.Collections.Generic.Dictionary? Type395 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type396 { get; set; } + public global::DeepL.GetLanguagesResponseItemFeatures2? Type396 { get; set; } /// /// /// - public global::DeepL.GetLanguagesResponseItemFeatures2? Type397 { get; set; } + public global::DeepL.GetLanguagesResponseItemFeaturesStatus? Type397 { get; set; } /// /// /// - public global::DeepL.GetLanguagesResponseItemFeaturesStatus? Type398 { get; set; } + public global::DeepL.ListTranslationMemoriesResponse? Type398 { get; set; } /// /// /// - public global::DeepL.ListTranslationMemoriesResponse? Type399 { get; set; } + public global::System.Collections.Generic.IList? Type399 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type400 { get; set; } + public global::DeepL.CreateTranslationMemoryImportResponse? Type400 { get; set; } /// /// /// - public global::DeepL.CreateTranslationMemoryImportResponse? Type401 { get; set; } + public global::DeepL.GetTranslationMemorySegmentsResponse? Type401 { get; set; } /// /// /// - public global::DeepL.GetTranslationMemorySegmentsResponse? Type402 { get; set; } + public global::System.Collections.Generic.IList? Type402 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type403 { get; set; } + public global::DeepL.ListStyleProfilesResponse? Type403 { get; set; } /// /// /// - public global::DeepL.ListStyleProfilesResponse? Type404 { get; set; } + public global::System.Collections.Generic.IList? Type404 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type405 { get; set; } + public global::DeepL.GetStyleRuleListsResponse? Type405 { get; set; } /// /// /// - public global::DeepL.GetStyleRuleListsResponse? Type406 { get; set; } + public global::System.Collections.Generic.IList? Type406 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type407 { get; set; } - /// - /// - /// - public global::DeepL.OneOf? Type408 { get; set; } + public global::DeepL.OneOf? Type407 { get; set; } /// /// diff --git a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.CreateGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.CreateGlossary.g.cs index 136eaf4..6f97c91 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.CreateGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.CreateGlossary.g.cs @@ -367,13 +367,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.CreateGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.CreateGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.CreateGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.CreateGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -384,7 +384,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -404,13 +404,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -421,7 +421,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -441,13 +441,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -458,7 +458,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -478,13 +478,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -495,7 +495,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -515,13 +515,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -532,7 +532,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -552,13 +552,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -569,7 +569,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -589,13 +589,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -606,7 +606,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -626,13 +626,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -643,7 +643,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -663,13 +663,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -680,7 +680,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -700,13 +700,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -717,7 +717,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -737,13 +737,13 @@ partial void ProcessCreateGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -754,7 +754,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -797,7 +797,7 @@ partial void ProcessCreateGlossaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -842,7 +842,7 @@ partial void ProcessCreateGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.DeleteGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.DeleteGlossary.g.cs index 9a63a02..bf9519d 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.DeleteGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.DeleteGlossary.g.cs @@ -345,13 +345,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -362,7 +362,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -382,13 +382,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -399,7 +399,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -419,13 +419,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -436,7 +436,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -456,13 +456,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -473,7 +473,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -493,13 +493,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -510,7 +510,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -530,13 +530,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -547,7 +547,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -567,13 +567,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -584,7 +584,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -604,13 +604,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -621,7 +621,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -641,13 +641,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -658,7 +658,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -678,13 +678,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -695,7 +695,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -715,13 +715,13 @@ await DeleteGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -732,7 +732,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -768,7 +768,7 @@ await DeleteGlossaryAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -804,7 +804,7 @@ await DeleteGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossary.g.cs index 4ce243e..c54b370 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossary.g.cs @@ -352,13 +352,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -369,7 +369,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -389,13 +389,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -406,7 +406,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -426,13 +426,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -443,7 +443,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -463,13 +463,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -480,7 +480,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -500,13 +500,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -517,7 +517,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -537,13 +537,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -554,7 +554,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -574,13 +574,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -591,7 +591,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -611,13 +611,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -628,7 +628,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -648,13 +648,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -665,7 +665,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -685,13 +685,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -702,7 +702,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -722,13 +722,13 @@ partial void ProcessGetGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -739,7 +739,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -782,7 +782,7 @@ partial void ProcessGetGlossaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -827,7 +827,7 @@ partial void ProcessGetGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossaryEntries.g.cs b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossaryEntries.g.cs index 3197b8d..cd424a5 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossaryEntries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.GetGlossaryEntries.g.cs @@ -371,13 +371,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetGlossaryEntriesResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetGlossaryEntriesResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetGlossaryEntriesResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetGlossaryEntriesResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -388,7 +388,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -408,13 +408,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -425,7 +425,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -445,13 +445,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -462,7 +462,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -482,13 +482,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -499,7 +499,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -519,13 +519,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -536,7 +536,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -556,13 +556,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -573,7 +573,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -593,13 +593,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -610,7 +610,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -630,13 +630,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -647,7 +647,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -667,13 +667,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -684,7 +684,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -704,13 +704,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -721,7 +721,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -741,13 +741,13 @@ partial void ProcessGetGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -758,7 +758,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -799,7 +799,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -842,7 +842,7 @@ partial void ProcessGetGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.ListGlossaries.g.cs b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.ListGlossaries.g.cs index 4149636..ecbf1ed 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.ListGlossaries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageGlossariesClient.ListGlossaries.g.cs @@ -343,13 +343,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ListGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ListGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ListGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ListGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -360,7 +360,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -380,13 +380,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -397,7 +397,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -417,13 +417,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -434,7 +434,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -454,13 +454,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -471,7 +471,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -491,13 +491,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -508,7 +508,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -528,13 +528,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -545,7 +545,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -565,13 +565,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -582,7 +582,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -602,13 +602,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -619,7 +619,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -639,13 +639,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -656,7 +656,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -676,13 +676,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -693,7 +693,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -713,13 +713,13 @@ partial void ProcessListGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -730,7 +730,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -773,7 +773,7 @@ partial void ProcessListGlossariesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -818,7 +818,7 @@ partial void ProcessListGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossaries.JsonSerializerContext.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossaries.JsonSerializerContext.g.cs index 02fefbc..e69639e 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossaries.JsonSerializerContext.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossaries.JsonSerializerContext.g.cs @@ -16,12 +16,12 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossarySourceLanguage), TypeInfoPropertyName = "GlossarySourceLanguage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryTargetLanguage), TypeInfoPropertyName = "GlossaryTargetLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.CreateMultilingualGlossaryParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryDictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MultilingualGlossaryTargetLanguage), TypeInfoPropertyName = "MultilingualGlossaryTargetLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryEntriesFormat), TypeInfoPropertyName = "GlossaryEntriesFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MultilingualGlossary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MultilingualGlossaryEntries))] @@ -44,9 +44,9 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.DeleteDictionaryResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.ReplaceDictionaryResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossarySourceLanguage?), TypeInfoPropertyName = "NullableGlossarySourceLanguage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryTargetLanguage?), TypeInfoPropertyName = "NullableGlossaryTargetLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.MultilingualGlossaryTargetLanguage?), TypeInfoPropertyName = "NullableMultilingualGlossaryTargetLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.GlossaryEntriesFormat?), TypeInfoPropertyName = "NullableGlossaryEntriesFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.OneOf?), TypeInfoPropertyName = "NullableOneOfErrorResponseInfrastructureErrorResponse2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -235,9 +235,9 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::DeepL.GlossarySourceLanguage?) - || typeToConvert == typeof(global::DeepL.GlossaryTargetLanguage) + || typeToConvert == typeof(global::DeepL.MultilingualGlossaryTargetLanguage) - || typeToConvert == typeof(global::DeepL.GlossaryTargetLanguage?); + || typeToConvert == typeof(global::DeepL.MultilingualGlossaryTargetLanguage?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( @@ -264,14 +264,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::DeepL.JsonConverters.GlossarySourceLanguageNullableJsonConverter(); } - if (typeToConvert == typeof(global::DeepL.GlossaryTargetLanguage)) + if (typeToConvert == typeof(global::DeepL.MultilingualGlossaryTargetLanguage)) { - return new global::DeepL.JsonConverters.GlossaryTargetLanguageJsonConverter(); + return new global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageJsonConverter(); } - if (typeToConvert == typeof(global::DeepL.GlossaryTargetLanguage?)) + if (typeToConvert == typeof(global::DeepL.MultilingualGlossaryTargetLanguage?)) { - return new global::DeepL.JsonConverters.GlossaryTargetLanguageNullableJsonConverter(); + return new global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.CreateMultilingualGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.CreateMultilingualGlossary.g.cs index 6e9e9b2..de3add8 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.CreateMultilingualGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.CreateMultilingualGlossary.g.cs @@ -367,13 +367,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.CreateMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.CreateMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.CreateMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.CreateMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -384,7 +384,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -404,13 +404,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -421,7 +421,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -441,13 +441,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -458,7 +458,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -478,13 +478,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -495,7 +495,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -515,13 +515,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -532,7 +532,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -552,13 +552,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -569,7 +569,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -589,13 +589,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -606,7 +606,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -626,13 +626,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -643,7 +643,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -663,13 +663,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -680,7 +680,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -700,13 +700,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -717,7 +717,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -737,13 +737,13 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -754,7 +754,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -797,7 +797,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -842,7 +842,7 @@ partial void ProcessCreateMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteDictionary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteDictionary.g.cs index 86e699c..fe5ccf3 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteDictionary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteDictionary.g.cs @@ -42,13 +42,13 @@ partial void PrepareDeleteDictionaryArguments( global::System.Net.Http.HttpClient httpClient, ref string glossaryId, ref global::DeepL.GlossarySourceLanguage sourceLang, - ref global::DeepL.GlossaryTargetLanguage targetLang); + ref global::DeepL.MultilingualGlossaryTargetLanguage targetLang); partial void PrepareDeleteDictionaryRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang); + global::DeepL.MultilingualGlossaryTargetLanguage targetLang); partial void ProcessDeleteDictionaryResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -64,7 +64,16 @@ partial void ProcessDeleteDictionaryResponse( /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -73,7 +82,7 @@ partial void ProcessDeleteDictionaryResponse( public async global::System.Threading.Tasks.Task DeleteDictionaryAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -96,7 +105,16 @@ await DeleteDictionaryAsResponseAsync( /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -105,7 +123,7 @@ await DeleteDictionaryAsResponseAsync( public async global::System.Threading.Tasks.Task DeleteDictionaryAsResponseAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -381,13 +399,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteDictionaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteDictionaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteDictionaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteDictionaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -398,7 +416,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -418,13 +436,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -435,7 +453,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -455,13 +473,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -472,7 +490,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -492,13 +510,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -509,7 +527,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -529,13 +547,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -546,7 +564,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -566,13 +584,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -583,7 +601,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -603,13 +621,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -620,7 +638,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -640,13 +658,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -657,7 +675,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -677,13 +695,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -694,7 +712,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -714,13 +732,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -731,7 +749,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -751,13 +769,13 @@ await DeleteDictionaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -768,7 +786,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -804,7 +822,7 @@ await DeleteDictionaryAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -840,7 +858,7 @@ await DeleteDictionaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteMultilingualGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteMultilingualGlossary.g.cs index 609f873..426b135 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteMultilingualGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.DeleteMultilingualGlossary.g.cs @@ -345,13 +345,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.DeleteMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.DeleteMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -362,7 +362,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -382,13 +382,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -399,7 +399,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -419,13 +419,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -436,7 +436,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -456,13 +456,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -473,7 +473,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -493,13 +493,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -510,7 +510,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -530,13 +530,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -547,7 +547,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -567,13 +567,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -584,7 +584,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -604,13 +604,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -621,7 +621,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -641,13 +641,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -658,7 +658,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -678,13 +678,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -695,7 +695,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -715,13 +715,13 @@ await DeleteMultilingualGlossaryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -732,7 +732,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -768,7 +768,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -804,7 +804,7 @@ await DeleteMultilingualGlossaryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossary.g.cs index 396a7e0..1e3809a 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossary.g.cs @@ -352,13 +352,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -369,7 +369,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -389,13 +389,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -406,7 +406,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -426,13 +426,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -443,7 +443,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -463,13 +463,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -480,7 +480,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -500,13 +500,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -517,7 +517,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -537,13 +537,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -554,7 +554,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -574,13 +574,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -591,7 +591,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -611,13 +611,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -628,7 +628,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -648,13 +648,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -665,7 +665,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -685,13 +685,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -702,7 +702,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -722,13 +722,13 @@ partial void ProcessGetMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -739,7 +739,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -782,7 +782,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -827,7 +827,7 @@ partial void ProcessGetMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs index 2d05219..38ee8f1 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.GetMultilingualGlossaryEntries.g.cs @@ -42,13 +42,13 @@ partial void PrepareGetMultilingualGlossaryEntriesArguments( global::System.Net.Http.HttpClient httpClient, ref string glossaryId, ref global::DeepL.GlossarySourceLanguage sourceLang, - ref global::DeepL.GlossaryTargetLanguage targetLang); + ref global::DeepL.MultilingualGlossaryTargetLanguage targetLang); partial void PrepareGetMultilingualGlossaryEntriesRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang); + global::DeepL.MultilingualGlossaryTargetLanguage targetLang); partial void ProcessGetMultilingualGlossaryEntriesResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -68,7 +68,16 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -77,7 +86,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( public async global::System.Threading.Tasks.Task GetMultilingualGlossaryEntriesAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -101,7 +110,16 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -110,7 +128,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( public async global::System.Threading.Tasks.Task> GetMultilingualGlossaryEntriesAsResponseAsync( string glossaryId, global::DeepL.GlossarySourceLanguage sourceLang, - global::DeepL.GlossaryTargetLanguage targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage targetLang, global::DeepL.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -386,13 +404,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetMultilingualGlossaryEntriesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetMultilingualGlossaryEntriesResponse2.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.GetMultilingualGlossaryEntriesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.GetMultilingualGlossaryEntriesResponse2.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -403,7 +421,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -423,13 +441,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -440,7 +458,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -460,13 +478,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -477,7 +495,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -497,13 +515,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -514,7 +532,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -534,13 +552,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -551,7 +569,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -571,13 +589,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -588,7 +606,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -608,13 +626,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -625,7 +643,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -645,13 +663,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -662,7 +680,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -682,13 +700,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -699,7 +717,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -719,13 +737,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -736,7 +754,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -756,13 +774,13 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -773,7 +791,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -816,7 +834,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -861,7 +879,7 @@ partial void ProcessGetMultilingualGlossaryEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ListMultilingualGlossaries.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ListMultilingualGlossaries.g.cs index 4184383..48022f0 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ListMultilingualGlossaries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ListMultilingualGlossaries.g.cs @@ -343,13 +343,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ListMultilingualGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ListMultilingualGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ListMultilingualGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ListMultilingualGlossariesResponse2.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -360,7 +360,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -380,13 +380,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -397,7 +397,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -417,13 +417,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -434,7 +434,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -454,13 +454,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -471,7 +471,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -491,13 +491,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -508,7 +508,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -528,13 +528,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -545,7 +545,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -565,13 +565,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -582,7 +582,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -602,13 +602,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -619,7 +619,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -639,13 +639,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -656,7 +656,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -676,13 +676,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -693,7 +693,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -713,13 +713,13 @@ partial void ProcessListMultilingualGlossariesResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -730,7 +730,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -773,7 +773,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -818,7 +818,7 @@ partial void ProcessListMultilingualGlossariesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.PatchMultilingualGlossary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.PatchMultilingualGlossary.g.cs index 0b2a9a4..fb278b8 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.PatchMultilingualGlossary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.PatchMultilingualGlossary.g.cs @@ -372,13 +372,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.PatchMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.PatchMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.PatchMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.PatchMultilingualGlossaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -389,7 +389,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -409,13 +409,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -426,7 +426,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -446,13 +446,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -463,7 +463,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -483,13 +483,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -500,7 +500,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -520,13 +520,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -537,7 +537,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -557,13 +557,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -574,7 +574,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -594,13 +594,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -611,7 +611,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -631,13 +631,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -648,7 +648,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -668,13 +668,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -685,7 +685,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -705,13 +705,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -722,7 +722,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -742,13 +742,13 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -759,7 +759,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -802,7 +802,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -847,7 +847,7 @@ partial void ProcessPatchMultilingualGlossaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ReplaceDictionary.g.cs b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ReplaceDictionary.g.cs index 979cea2..d8a709f 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ReplaceDictionary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageMultilingualGlossariesClient.ReplaceDictionary.g.cs @@ -374,13 +374,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ReplaceDictionaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ReplaceDictionaryResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ReplaceDictionaryResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ReplaceDictionaryResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -391,7 +391,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -411,13 +411,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -428,7 +428,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -448,13 +448,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -465,7 +465,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -485,13 +485,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -502,7 +502,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -522,13 +522,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -539,7 +539,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -559,13 +559,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -576,7 +576,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -596,13 +596,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -613,7 +613,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -633,13 +633,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -650,7 +650,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -670,13 +670,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -687,7 +687,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -707,13 +707,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -724,7 +724,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -744,13 +744,13 @@ partial void ProcessReplaceDictionaryResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -761,7 +761,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -804,7 +804,7 @@ partial void ProcessReplaceDictionaryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -849,7 +849,7 @@ partial void ProcessReplaceDictionaryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -877,7 +877,16 @@ partial void ProcessReplaceDictionaryResponseContent( /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// @@ -898,7 +907,7 @@ partial void ProcessReplaceDictionaryResponseContent( public async global::System.Threading.Tasks.Task ReplaceDictionaryAsync( string glossaryId, global::DeepL.GlossarySourceLanguage? sourceLang = default, - global::DeepL.GlossaryTargetLanguage? targetLang = default, + global::DeepL.MultilingualGlossaryTargetLanguage? targetLang = default, string? entries = default, global::DeepL.GlossaryEntriesFormat? entriesFormat = default, global::DeepL.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.CreateSpokenTerms.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.CreateSpokenTerms.g.cs index 3dcf8b2..ea5c9d6 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.CreateSpokenTerms.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.CreateSpokenTerms.g.cs @@ -363,13 +363,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -380,7 +380,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -400,13 +400,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -417,7 +417,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -437,13 +437,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -454,7 +454,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -474,13 +474,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -491,7 +491,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -511,13 +511,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -528,7 +528,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -548,13 +548,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -565,7 +565,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -585,13 +585,13 @@ partial void ProcessCreateSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -602,7 +602,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -645,7 +645,7 @@ partial void ProcessCreateSpokenTermsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -690,7 +690,7 @@ partial void ProcessCreateSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTerms.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTerms.g.cs index 1dc067b..c9271a4 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTerms.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTerms.g.cs @@ -345,13 +345,13 @@ await DeleteSpokenTermsAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -362,7 +362,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -382,13 +382,13 @@ await DeleteSpokenTermsAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -399,7 +399,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -419,13 +419,13 @@ await DeleteSpokenTermsAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -436,7 +436,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -456,13 +456,13 @@ await DeleteSpokenTermsAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -473,7 +473,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -493,13 +493,13 @@ await DeleteSpokenTermsAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -510,7 +510,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -546,7 +546,7 @@ await DeleteSpokenTermsAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -582,7 +582,7 @@ await DeleteSpokenTermsAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTermsList.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTermsList.g.cs index 93eb916..542d85e 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTermsList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.DeleteSpokenTermsList.g.cs @@ -361,13 +361,13 @@ await DeleteSpokenTermsListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -378,7 +378,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -398,13 +398,13 @@ await DeleteSpokenTermsListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -415,7 +415,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -435,13 +435,13 @@ await DeleteSpokenTermsListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -452,7 +452,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -472,13 +472,13 @@ await DeleteSpokenTermsListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -489,7 +489,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -509,13 +509,13 @@ await DeleteSpokenTermsListAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -526,7 +526,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -562,7 +562,7 @@ await DeleteSpokenTermsListAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -598,7 +598,7 @@ await DeleteSpokenTermsListAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTerms.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTerms.g.cs index 7bc5fae..3a37c04 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTerms.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTerms.g.cs @@ -352,13 +352,13 @@ partial void ProcessGetSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -369,7 +369,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -389,13 +389,13 @@ partial void ProcessGetSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -406,7 +406,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -426,13 +426,13 @@ partial void ProcessGetSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -443,7 +443,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -463,13 +463,13 @@ partial void ProcessGetSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -480,7 +480,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -500,13 +500,13 @@ partial void ProcessGetSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -517,7 +517,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -560,7 +560,7 @@ partial void ProcessGetSpokenTermsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -605,7 +605,7 @@ partial void ProcessGetSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTermsEntries.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTermsEntries.g.cs index af518f6..612cf55 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTermsEntries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.GetSpokenTermsEntries.g.cs @@ -368,13 +368,13 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -385,7 +385,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -405,13 +405,13 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -422,7 +422,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -442,13 +442,13 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -459,7 +459,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -479,13 +479,13 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -496,7 +496,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -516,13 +516,13 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -533,7 +533,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -576,7 +576,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -621,7 +621,7 @@ partial void ProcessGetSpokenTermsEntriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.ListSpokenTerms.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.ListSpokenTerms.g.cs index a8edfde..6a1278c 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.ListSpokenTerms.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.ListSpokenTerms.g.cs @@ -343,13 +343,13 @@ partial void ProcessListSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -360,7 +360,7 @@ partial void ProcessListSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -380,13 +380,13 @@ partial void ProcessListSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -397,7 +397,7 @@ partial void ProcessListSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -417,13 +417,13 @@ partial void ProcessListSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -434,7 +434,7 @@ partial void ProcessListSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -477,7 +477,7 @@ partial void ProcessListSpokenTermsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -522,7 +522,7 @@ partial void ProcessListSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PatchSpokenTerms.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PatchSpokenTerms.g.cs index 0a20fdb..e726e5f 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PatchSpokenTerms.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PatchSpokenTerms.g.cs @@ -372,13 +372,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -389,7 +389,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -409,13 +409,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -426,7 +426,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -446,13 +446,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -463,7 +463,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -483,13 +483,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -500,7 +500,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -520,13 +520,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -537,7 +537,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -557,13 +557,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -574,7 +574,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -594,13 +594,13 @@ partial void ProcessPatchSpokenTermsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -611,7 +611,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -654,7 +654,7 @@ partial void ProcessPatchSpokenTermsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -699,7 +699,7 @@ partial void ProcessPatchSpokenTermsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PutSpokenTermsList.g.cs b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PutSpokenTermsList.g.cs index 5e4ac3a..7481037 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PutSpokenTermsList.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageSpokenTermsClient.PutSpokenTermsList.g.cs @@ -372,13 +372,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -389,7 +389,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -409,13 +409,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -426,7 +426,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -446,13 +446,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -463,7 +463,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -483,13 +483,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -500,7 +500,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -520,13 +520,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -537,7 +537,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -557,13 +557,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -574,7 +574,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -594,13 +594,13 @@ partial void ProcessPutSpokenTermsListResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -611,7 +611,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -654,7 +654,7 @@ partial void ProcessPutSpokenTermsListResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -699,7 +699,7 @@ partial void ProcessPutSpokenTermsListResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.CreateStyleProfile.g.cs b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.CreateStyleProfile.g.cs index 1460ad1..c8d85f8 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.CreateStyleProfile.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.CreateStyleProfile.g.cs @@ -367,13 +367,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -384,7 +384,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -404,13 +404,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -421,7 +421,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -441,13 +441,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -458,7 +458,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -478,13 +478,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -495,7 +495,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -515,13 +515,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -532,7 +532,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -552,13 +552,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -569,7 +569,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -589,13 +589,13 @@ partial void ProcessCreateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -606,7 +606,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -649,7 +649,7 @@ partial void ProcessCreateStyleProfileResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -694,7 +694,7 @@ partial void ProcessCreateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.DeleteStyleProfile.g.cs b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.DeleteStyleProfile.g.cs index 3e73294..8a2e8f3 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.DeleteStyleProfile.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.DeleteStyleProfile.g.cs @@ -361,13 +361,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -378,7 +378,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -398,13 +398,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -415,7 +415,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -435,13 +435,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -452,7 +452,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -472,13 +472,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -489,7 +489,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -509,13 +509,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -526,7 +526,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -546,13 +546,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -563,7 +563,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -583,13 +583,13 @@ await DeleteStyleProfileAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -600,7 +600,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -636,7 +636,7 @@ await DeleteStyleProfileAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -672,7 +672,7 @@ await DeleteStyleProfileAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.GetStyleProfile.g.cs b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.GetStyleProfile.g.cs index d330dfd..a04df4b 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.GetStyleProfile.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.GetStyleProfile.g.cs @@ -360,13 +360,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -377,7 +377,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -397,13 +397,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -414,7 +414,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -434,13 +434,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -451,7 +451,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -471,13 +471,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -488,7 +488,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -508,13 +508,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -525,7 +525,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -545,13 +545,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -562,7 +562,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -582,13 +582,13 @@ partial void ProcessGetStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -599,7 +599,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -642,7 +642,7 @@ partial void ProcessGetStyleProfileResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -687,7 +687,7 @@ partial void ProcessGetStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.ListStyleProfiles.g.cs b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.ListStyleProfiles.g.cs index 1bfef24..060f507 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.ListStyleProfiles.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.ListStyleProfiles.g.cs @@ -377,13 +377,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -394,7 +394,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -414,13 +414,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -431,7 +431,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -451,13 +451,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -468,7 +468,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -488,13 +488,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -505,7 +505,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -525,13 +525,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -542,7 +542,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -562,13 +562,13 @@ partial void ProcessListStyleProfilesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -579,7 +579,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -622,7 +622,7 @@ partial void ProcessListStyleProfilesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -667,7 +667,7 @@ partial void ProcessListStyleProfilesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.UpdateStyleProfile.g.cs b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.UpdateStyleProfile.g.cs index a6ef4ce..092309a 100644 --- a/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.UpdateStyleProfile.g.cs +++ b/src/libs/DeepL/Generated/DeepL.ManageStyleProfilesClient.UpdateStyleProfile.g.cs @@ -388,13 +388,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -405,7 +405,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -425,13 +425,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -442,7 +442,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -462,13 +462,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -479,7 +479,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -499,13 +499,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -516,7 +516,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -536,13 +536,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -553,7 +553,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -573,13 +573,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -590,7 +590,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -610,13 +610,13 @@ partial void ProcessUpdateStyleProfileResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -627,7 +627,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -670,7 +670,7 @@ partial void ProcessUpdateStyleProfileResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -715,7 +715,7 @@ partial void ProcessUpdateStyleProfileResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguageResources.g.cs b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguageResources.g.cs index 25e5f7c..8a8943b 100644 --- a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguageResources.g.cs +++ b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguageResources.g.cs @@ -351,13 +351,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -368,7 +368,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -388,13 +388,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -405,7 +405,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -425,13 +425,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -442,7 +442,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -462,13 +462,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -479,7 +479,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -499,13 +499,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -516,7 +516,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -536,13 +536,13 @@ partial void ProcessGetLanguageResourcesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -553,7 +553,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -596,7 +596,7 @@ partial void ProcessGetLanguageResourcesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -641,7 +641,7 @@ partial void ProcessGetLanguageResourcesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguages.g.cs b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguages.g.cs index 5079215..705e482 100644 --- a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguages.g.cs +++ b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetLanguages.g.cs @@ -369,13 +369,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -386,7 +386,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -406,13 +406,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -423,7 +423,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -443,13 +443,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -460,7 +460,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -480,13 +480,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -497,7 +497,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -517,13 +517,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -534,7 +534,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -554,13 +554,13 @@ partial void ProcessGetLanguagesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -571,7 +571,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -614,7 +614,7 @@ partial void ProcessGetLanguagesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -659,7 +659,7 @@ partial void ProcessGetLanguagesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetUsage.g.cs b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetUsage.g.cs index 685f21b..872cb43 100644 --- a/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetUsage.g.cs +++ b/src/libs/DeepL/Generated/DeepL.MetaInformationClient.GetUsage.g.cs @@ -347,13 +347,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -364,7 +364,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -384,13 +384,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -401,7 +401,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -421,13 +421,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -438,7 +438,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -458,13 +458,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -475,7 +475,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -495,13 +495,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -512,7 +512,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -532,13 +532,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -549,7 +549,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -569,13 +569,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -586,7 +586,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -606,13 +606,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -623,7 +623,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -643,13 +643,13 @@ partial void ProcessGetUsageResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -660,7 +660,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -703,7 +703,7 @@ partial void ProcessGetUsageResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -748,7 +748,7 @@ partial void ProcessGetUsageResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.Json.g.cs b/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.Json.g.cs deleted file mode 100644 index c0e682f..0000000 --- a/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace DeepL -{ - public sealed partial class CorrectTextRequest2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepL.CorrectTextRequest2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepL.CorrectTextRequest2), - jsonSerializerContext) as global::DeepL.CorrectTextRequest2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::DeepL.CorrectTextRequest2? FromJson( - string json) - { - return FromJson( - json, - global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepL.CorrectTextRequest2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepL.CorrectTextRequest2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepL.CorrectTextRequest2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.g.cs b/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.g.cs deleted file mode 100644 index ea944e9..0000000 --- a/src/libs/DeepL/Generated/DeepL.Models.CorrectTextRequest2.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace DeepL -{ - /// - /// - /// - public sealed partial class CorrectTextRequest2 - { - /// - /// Text to be corrected. Only UTF-8-encoded plain text is supported. Corrections are returned in the same order as they are requested. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Text { get; set; } - - /// - /// The language for the text improvement.
- /// Example: de - ///
- /// de - [global::System.Text.Json.Serialization.JsonPropertyName("target_lang")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.TargetLanguageWriteJsonConverter))] - public global::DeepL.TargetLanguageWrite? TargetLang { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Text to be corrected. Only UTF-8-encoded plain text is supported. Corrections are returned in the same order as they are requested. - /// - /// - /// The language for the text improvement.
- /// Example: de - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CorrectTextRequest2( - global::System.Collections.Generic.IList text, - global::DeepL.TargetLanguageWrite? targetLang) - { - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - this.TargetLang = targetLang; - } - - /// - /// Initializes a new instance of the class. - /// - public CorrectTextRequest2() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/DeepL/Generated/DeepL.Models.GlossaryDictionary.g.cs b/src/libs/DeepL/Generated/DeepL.Models.GlossaryDictionary.g.cs index c7314c6..9a8c108 100644 --- a/src/libs/DeepL/Generated/DeepL.Models.GlossaryDictionary.g.cs +++ b/src/libs/DeepL/Generated/DeepL.Models.GlossaryDictionary.g.cs @@ -18,13 +18,22 @@ public sealed partial class GlossaryDictionary public global::DeepL.GlossarySourceLanguage? SourceLang { get; set; } /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de ///
/// de [global::System.Text.Json.Serialization.JsonPropertyName("target_lang")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.GlossaryTargetLanguageJsonConverter))] - public global::DeepL.GlossaryTargetLanguage? TargetLang { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageJsonConverter))] + public global::DeepL.MultilingualGlossaryTargetLanguage? TargetLang { get; set; } /// /// The entries of the glossary. The entries have to be specified in the format provided by the `entries_format` parameter.
@@ -67,7 +76,16 @@ public sealed partial class GlossaryDictionary /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// @@ -90,7 +108,7 @@ public sealed partial class GlossaryDictionary #endif public GlossaryDictionary( global::DeepL.GlossarySourceLanguage? sourceLang, - global::DeepL.GlossaryTargetLanguage? targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage? targetLang, string? entries, global::DeepL.GlossaryEntriesFormat? entriesFormat, int? entryCount) diff --git a/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntries.g.cs b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntries.g.cs index 733e3e5..6e458c8 100644 --- a/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntries.g.cs +++ b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntries.g.cs @@ -18,13 +18,22 @@ public sealed partial class MultilingualGlossaryEntries public global::DeepL.GlossarySourceLanguage? SourceLang { get; set; } /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de ///
/// de [global::System.Text.Json.Serialization.JsonPropertyName("target_lang")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.GlossaryTargetLanguageJsonConverter))] - public global::DeepL.GlossaryTargetLanguage? TargetLang { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageJsonConverter))] + public global::DeepL.MultilingualGlossaryTargetLanguage? TargetLang { get; set; } /// /// The entries of the glossary. The entries have to be specified in the format provided by the `entries_format` parameter.
@@ -61,7 +70,16 @@ public sealed partial class MultilingualGlossaryEntries /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// @@ -81,7 +99,7 @@ public sealed partial class MultilingualGlossaryEntries #endif public MultilingualGlossaryEntries( global::DeepL.GlossarySourceLanguage? sourceLang, - global::DeepL.GlossaryTargetLanguage? targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage? targetLang, string? entries, global::DeepL.GlossaryEntriesFormat? entriesFormat) { diff --git a/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntriesInformation.g.cs b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntriesInformation.g.cs index c4b6cac..6257a35 100644 --- a/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntriesInformation.g.cs +++ b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryEntriesInformation.g.cs @@ -18,13 +18,22 @@ public sealed partial class MultilingualGlossaryEntriesInformation public global::DeepL.GlossarySourceLanguage? SourceLang { get; set; } /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de ///
/// de [global::System.Text.Json.Serialization.JsonPropertyName("target_lang")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.GlossaryTargetLanguageJsonConverter))] - public global::DeepL.GlossaryTargetLanguage? TargetLang { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.MultilingualGlossaryTargetLanguageJsonConverter))] + public global::DeepL.MultilingualGlossaryTargetLanguage? TargetLang { get; set; } /// /// The number of entries in the glossary. @@ -46,7 +55,16 @@ public sealed partial class MultilingualGlossaryEntriesInformation /// Example: en /// /// - /// The language in which the target texts in the glossary are specified.
+ /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
/// Example: de /// /// @@ -57,7 +75,7 @@ public sealed partial class MultilingualGlossaryEntriesInformation #endif public MultilingualGlossaryEntriesInformation( global::DeepL.GlossarySourceLanguage? sourceLang, - global::DeepL.GlossaryTargetLanguage? targetLang, + global::DeepL.MultilingualGlossaryTargetLanguage? targetLang, int? entryCount) { this.SourceLang = sourceLang; diff --git a/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryTargetLanguage.g.cs b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryTargetLanguage.g.cs new file mode 100644 index 0000000..da0fbdd --- /dev/null +++ b/src/libs/DeepL/Generated/DeepL.Models.MultilingualGlossaryTargetLanguage.g.cs @@ -0,0 +1,313 @@ + +#nullable enable + +namespace DeepL +{ + /// + /// The language in which the target texts in the dictionary are specified. Besides the base languages, the
+ /// target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`,
+ /// `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current
+ /// list is returned by `GET /v3/languages?resource=glossary`.
+ /// A dictionary with a base target, such as `de`, applies when translating into that language and any of its
+ /// variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that
+ /// exact variant.
+ /// Within one glossary, each language family uses either the base language or its variants as targets, not
+ /// both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary
+ /// that breaks this rule returns a 400 error.
+ /// Example: de + ///
+ public enum MultilingualGlossaryTargetLanguage + { + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + Ar, + /// + /// + /// + Bg, + /// + /// + /// + Cs, + /// + /// + /// + Da, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + De, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + DeCh, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + DeDe, + /// + /// + /// + El, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + En, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + EnGb, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + EnUs, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + Es, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + Es419, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + EsEs, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + Et, + /// + /// + /// + Fi, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + Fr, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + FrCa, + /// + /// + /// + FrFr, + /// + /// `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + /// + He, + /// + /// + /// + Hu, + /// + /// + /// + Id, + /// + /// + /// + It, + /// + /// + /// + Ja, + /// + /// + /// + Ko, + /// + /// + /// + Lt, + /// + /// + /// + Lv, + /// + /// + /// + Nb, + /// + /// + /// + Nl, + /// + /// + /// + Pl, + /// + /// + /// + Pt, + /// + /// + /// + PtBr, + /// + /// + /// + PtPt, + /// + /// + /// + Ro, + /// + /// + /// + Ru, + /// + /// + /// + Sk, + /// + /// + /// + Sl, + /// + /// + /// + Sv, + /// + /// + /// + Tr, + /// + /// + /// + Uk, + /// + /// + /// + Vi, + /// + /// + /// + Zh, + /// + /// + /// + ZhHans, + /// + /// + /// + ZhHant, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class MultilingualGlossaryTargetLanguageExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this MultilingualGlossaryTargetLanguage value) + { + return value switch + { + MultilingualGlossaryTargetLanguage.Ar => "ar", + MultilingualGlossaryTargetLanguage.Bg => "bg", + MultilingualGlossaryTargetLanguage.Cs => "cs", + MultilingualGlossaryTargetLanguage.Da => "da", + MultilingualGlossaryTargetLanguage.De => "de", + MultilingualGlossaryTargetLanguage.DeCh => "de-CH", + MultilingualGlossaryTargetLanguage.DeDe => "de-DE", + MultilingualGlossaryTargetLanguage.El => "el", + MultilingualGlossaryTargetLanguage.En => "en", + MultilingualGlossaryTargetLanguage.EnGb => "en-GB", + MultilingualGlossaryTargetLanguage.EnUs => "en-US", + MultilingualGlossaryTargetLanguage.Es => "es", + MultilingualGlossaryTargetLanguage.Es419 => "es-419", + MultilingualGlossaryTargetLanguage.EsEs => "es-ES", + MultilingualGlossaryTargetLanguage.Et => "et", + MultilingualGlossaryTargetLanguage.Fi => "fi", + MultilingualGlossaryTargetLanguage.Fr => "fr", + MultilingualGlossaryTargetLanguage.FrCa => "fr-CA", + MultilingualGlossaryTargetLanguage.FrFr => "fr-FR", + MultilingualGlossaryTargetLanguage.He => "he", + MultilingualGlossaryTargetLanguage.Hu => "hu", + MultilingualGlossaryTargetLanguage.Id => "id", + MultilingualGlossaryTargetLanguage.It => "it", + MultilingualGlossaryTargetLanguage.Ja => "ja", + MultilingualGlossaryTargetLanguage.Ko => "ko", + MultilingualGlossaryTargetLanguage.Lt => "lt", + MultilingualGlossaryTargetLanguage.Lv => "lv", + MultilingualGlossaryTargetLanguage.Nb => "nb", + MultilingualGlossaryTargetLanguage.Nl => "nl", + MultilingualGlossaryTargetLanguage.Pl => "pl", + MultilingualGlossaryTargetLanguage.Pt => "pt", + MultilingualGlossaryTargetLanguage.PtBr => "pt-BR", + MultilingualGlossaryTargetLanguage.PtPt => "pt-PT", + MultilingualGlossaryTargetLanguage.Ro => "ro", + MultilingualGlossaryTargetLanguage.Ru => "ru", + MultilingualGlossaryTargetLanguage.Sk => "sk", + MultilingualGlossaryTargetLanguage.Sl => "sl", + MultilingualGlossaryTargetLanguage.Sv => "sv", + MultilingualGlossaryTargetLanguage.Tr => "tr", + MultilingualGlossaryTargetLanguage.Uk => "uk", + MultilingualGlossaryTargetLanguage.Vi => "vi", + MultilingualGlossaryTargetLanguage.Zh => "zh", + MultilingualGlossaryTargetLanguage.ZhHans => "zh-Hans", + MultilingualGlossaryTargetLanguage.ZhHant => "zh-Hant", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static MultilingualGlossaryTargetLanguage? ToEnum(string value) + { + return value switch + { + "ar" => MultilingualGlossaryTargetLanguage.Ar, + "bg" => MultilingualGlossaryTargetLanguage.Bg, + "cs" => MultilingualGlossaryTargetLanguage.Cs, + "da" => MultilingualGlossaryTargetLanguage.Da, + "de" => MultilingualGlossaryTargetLanguage.De, + "de-CH" => MultilingualGlossaryTargetLanguage.DeCh, + "de-DE" => MultilingualGlossaryTargetLanguage.DeDe, + "el" => MultilingualGlossaryTargetLanguage.El, + "en" => MultilingualGlossaryTargetLanguage.En, + "en-GB" => MultilingualGlossaryTargetLanguage.EnGb, + "en-US" => MultilingualGlossaryTargetLanguage.EnUs, + "es" => MultilingualGlossaryTargetLanguage.Es, + "es-419" => MultilingualGlossaryTargetLanguage.Es419, + "es-ES" => MultilingualGlossaryTargetLanguage.EsEs, + "et" => MultilingualGlossaryTargetLanguage.Et, + "fi" => MultilingualGlossaryTargetLanguage.Fi, + "fr" => MultilingualGlossaryTargetLanguage.Fr, + "fr-CA" => MultilingualGlossaryTargetLanguage.FrCa, + "fr-FR" => MultilingualGlossaryTargetLanguage.FrFr, + "he" => MultilingualGlossaryTargetLanguage.He, + "hu" => MultilingualGlossaryTargetLanguage.Hu, + "id" => MultilingualGlossaryTargetLanguage.Id, + "it" => MultilingualGlossaryTargetLanguage.It, + "ja" => MultilingualGlossaryTargetLanguage.Ja, + "ko" => MultilingualGlossaryTargetLanguage.Ko, + "lt" => MultilingualGlossaryTargetLanguage.Lt, + "lv" => MultilingualGlossaryTargetLanguage.Lv, + "nb" => MultilingualGlossaryTargetLanguage.Nb, + "nl" => MultilingualGlossaryTargetLanguage.Nl, + "pl" => MultilingualGlossaryTargetLanguage.Pl, + "pt" => MultilingualGlossaryTargetLanguage.Pt, + "pt-BR" => MultilingualGlossaryTargetLanguage.PtBr, + "pt-PT" => MultilingualGlossaryTargetLanguage.PtPt, + "ro" => MultilingualGlossaryTargetLanguage.Ro, + "ru" => MultilingualGlossaryTargetLanguage.Ru, + "sk" => MultilingualGlossaryTargetLanguage.Sk, + "sl" => MultilingualGlossaryTargetLanguage.Sl, + "sv" => MultilingualGlossaryTargetLanguage.Sv, + "tr" => MultilingualGlossaryTargetLanguage.Tr, + "uk" => MultilingualGlossaryTargetLanguage.Uk, + "vi" => MultilingualGlossaryTargetLanguage.Vi, + "zh" => MultilingualGlossaryTargetLanguage.Zh, + "zh-Hans" => MultilingualGlossaryTargetLanguage.ZhHans, + "zh-Hant" => MultilingualGlossaryTargetLanguage.ZhHant, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.Json.g.cs b/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.Json.g.cs deleted file mode 100644 index ec622f6..0000000 --- a/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace DeepL -{ - public sealed partial class RephraseTextRequest2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepL.RephraseTextRequest2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepL.RephraseTextRequest2), - jsonSerializerContext) as global::DeepL.RephraseTextRequest2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::DeepL.RephraseTextRequest2? FromJson( - string json) - { - return FromJson( - json, - global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepL.RephraseTextRequest2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepL.RephraseTextRequest2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepL.RephraseTextRequest2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::DeepL.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::DeepL.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.g.cs b/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.g.cs deleted file mode 100644 index df97ac3..0000000 --- a/src/libs/DeepL/Generated/DeepL.Models.RephraseTextRequest2.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace DeepL -{ - /// - /// - /// - public sealed partial class RephraseTextRequest2 - { - /// - /// Text to be improved. Only UTF-8-encoded plain text is supported. Improvements are returned in the same order as they are requested. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Text { get; set; } - - /// - /// The language for the text improvement.
- /// Example: de - ///
- /// de - [global::System.Text.Json.Serialization.JsonPropertyName("target_lang")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.TargetLanguageWriteJsonConverter))] - public global::DeepL.TargetLanguageWrite? TargetLang { get; set; } - - /// - /// Specify a style to rephrase your text in a way that fits your audience and goals.
- /// The `prefer_` prefix allows falling back to the default style if the language does not yet support styles. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("writing_style")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.WritingStyleJsonConverter))] - public global::DeepL.WritingStyle? WritingStyle { get; set; } - - /// - /// Specify the desired tone for your text.
- /// The `prefer_` prefix allows falling back to the default tone if the language does not yet support tones. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("tone")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.WritingToneJsonConverter))] - public global::DeepL.WritingTone? Tone { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Text to be improved. Only UTF-8-encoded plain text is supported. Improvements are returned in the same order as they are requested. - /// - /// - /// The language for the text improvement.
- /// Example: de - /// - /// - /// Specify a style to rephrase your text in a way that fits your audience and goals.
- /// The `prefer_` prefix allows falling back to the default style if the language does not yet support styles. - /// - /// - /// Specify the desired tone for your text.
- /// The `prefer_` prefix allows falling back to the default tone if the language does not yet support tones. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RephraseTextRequest2( - global::System.Collections.Generic.IList text, - global::DeepL.TargetLanguageWrite? targetLang, - global::DeepL.WritingStyle? writingStyle, - global::DeepL.WritingTone? tone) - { - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - this.TargetLang = targetLang; - this.WritingStyle = writingStyle; - this.Tone = tone; - } - - /// - /// Initializes a new instance of the class. - /// - public RephraseTextRequest2() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/DeepL/Generated/DeepL.Models.TagHandlingVersionOption.g.cs b/src/libs/DeepL/Generated/DeepL.Models.TagHandlingVersionOption.g.cs index 0381d2c..7a19d65 100644 --- a/src/libs/DeepL/Generated/DeepL.Models.TagHandlingVersionOption.g.cs +++ b/src/libs/DeepL/Generated/DeepL.Models.TagHandlingVersionOption.g.cs @@ -5,17 +5,18 @@ namespace DeepL { /// /// Sets which version of the tag handling algorithm should be used. Options currently available:
- /// * `v1`: Traditional algorithm (currently the default, will become deprecated in the future).
- /// * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + /// * `v1`: Traditional algorithm (will become deprecated in the future).
+ /// * `v2`: Improved algorithm released in October 2025. This is the default.
+ /// The `tag_handling_version` field in the response shows which version was applied. ///
public enum TagHandlingVersionOption { /// - /// Traditional algorithm (currently the default, will become deprecated in the future). + /// Traditional algorithm (will become deprecated in the future). /// V1, /// - /// Improved algorithm released in October 2025 (will become the default in the future). + /// Improved algorithm released in October 2025. This is the default. /// V2, } diff --git a/src/libs/DeepL/Generated/DeepL.Models.TranslateTextRequest.g.cs b/src/libs/DeepL/Generated/DeepL.Models.TranslateTextRequest.g.cs index 94566d4..ae22978 100644 --- a/src/libs/DeepL/Generated/DeepL.Models.TranslateTextRequest.g.cs +++ b/src/libs/DeepL/Generated/DeepL.Models.TranslateTextRequest.g.cs @@ -194,8 +194,9 @@ public sealed partial class TranslateTextRequest /// /// Sets which version of the tag handling algorithm should be used. Options currently available:
- /// * `v1`: Traditional algorithm (currently the default, will become deprecated in the future).
- /// * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + /// * `v1`: Traditional algorithm (will become deprecated in the future).
+ /// * `v2`: Improved algorithm released in October 2025. This is the default.
+ /// The `tag_handling_version` field in the response shows which version was applied. ///
[global::System.Text.Json.Serialization.JsonPropertyName("tag_handling_version")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepL.JsonConverters.TagHandlingVersionOptionJsonConverter))] @@ -361,8 +362,9 @@ public sealed partial class TranslateTextRequest /// /// /// Sets which version of the tag handling algorithm should be used. Options currently available:
- /// * `v1`: Traditional algorithm (currently the default, will become deprecated in the future).
- /// * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + /// * `v1`: Traditional algorithm (will become deprecated in the future).
+ /// * `v2`: Improved algorithm released in October 2025. This is the default.
+ /// The `tag_handling_version` field in the response shows which version was applied. /// /// /// Disable the automatic detection of XML structure by setting the `outline_detection` parameter
diff --git a/src/libs/DeepL/Generated/DeepL.QualityEvaluationClient.PollQualityEvaluation.g.cs b/src/libs/DeepL/Generated/DeepL.QualityEvaluationClient.PollQualityEvaluation.g.cs index bd59c0f..e95ff38 100644 --- a/src/libs/DeepL/Generated/DeepL.QualityEvaluationClient.PollQualityEvaluation.g.cs +++ b/src/libs/DeepL/Generated/DeepL.QualityEvaluationClient.PollQualityEvaluation.g.cs @@ -358,13 +358,13 @@ partial void ProcessPollQualityEvaluationResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.QualityEvaluationApiError.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.QualityEvaluationApiError.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.QualityEvaluationApiError.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.QualityEvaluationApiError.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -375,7 +375,7 @@ partial void ProcessPollQualityEvaluationResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -395,13 +395,13 @@ partial void ProcessPollQualityEvaluationResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.QualityEvaluationApiError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.QualityEvaluationApiError.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.QualityEvaluationApiError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.QualityEvaluationApiError.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -412,7 +412,7 @@ partial void ProcessPollQualityEvaluationResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -432,13 +432,13 @@ partial void ProcessPollQualityEvaluationResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -449,7 +449,7 @@ partial void ProcessPollQualityEvaluationResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -492,7 +492,7 @@ partial void ProcessPollQualityEvaluationResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -537,7 +537,7 @@ partial void ProcessPollQualityEvaluationResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.RephraseText.JsonSerializerContext.g.cs b/src/libs/DeepL/Generated/DeepL.RephraseText.JsonSerializerContext.g.cs index be32e78..bd4cc62 100644 --- a/src/libs/DeepL/Generated/DeepL.RephraseText.JsonSerializerContext.g.cs +++ b/src/libs/DeepL/Generated/DeepL.RephraseText.JsonSerializerContext.g.cs @@ -23,7 +23,6 @@ namespace DeepL [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.InfrastructureErrorResponseError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.ErrorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.RephraseTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.RephraseTextRequest2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.OneOf), TypeInfoPropertyName = "OneOfErrorResponseInfrastructureErrorResponse2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepL.RephraseTextResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] diff --git a/src/libs/DeepL/Generated/DeepL.RephraseTextClient.RephraseText.g.cs b/src/libs/DeepL/Generated/DeepL.RephraseTextClient.RephraseText.g.cs index fdb7505..e5fd5bd 100644 --- a/src/libs/DeepL/Generated/DeepL.RephraseTextClient.RephraseText.g.cs +++ b/src/libs/DeepL/Generated/DeepL.RephraseTextClient.RephraseText.g.cs @@ -367,13 +367,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -384,7 +384,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -404,13 +404,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -421,7 +421,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -441,13 +441,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -458,7 +458,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -478,13 +478,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } else { __content_415 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_415 = global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); + __value_415 = __content_415 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_415, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -495,7 +495,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_415 is { Length: > 0 } ? __content_415 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, responseBody: __content_415, responseObject: __value_415, @@ -515,13 +515,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -532,7 +532,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -552,13 +552,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -569,7 +569,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -589,13 +589,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -606,7 +606,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -626,13 +626,13 @@ partial void ProcessRephraseTextResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -643,7 +643,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -686,7 +686,7 @@ partial void ProcessRephraseTextResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -731,7 +731,7 @@ partial void ProcessRephraseTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.DownloadDocument.g.cs b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.DownloadDocument.g.cs index 020db35..d27bb05 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.DownloadDocument.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.DownloadDocument.g.cs @@ -377,13 +377,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -394,7 +394,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -414,13 +414,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -431,7 +431,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -451,13 +451,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -468,7 +468,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -488,13 +488,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -505,7 +505,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -525,13 +525,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -542,7 +542,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -562,13 +562,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -579,7 +579,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -599,13 +599,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -616,7 +616,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -636,13 +636,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -653,7 +653,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -673,13 +673,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -690,7 +690,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -710,13 +710,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -727,7 +727,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -770,7 +770,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -1085,13 +1085,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1102,7 +1102,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -1122,13 +1122,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1139,7 +1139,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -1159,13 +1159,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1176,7 +1176,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -1196,13 +1196,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1213,7 +1213,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -1233,13 +1233,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1250,7 +1250,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -1270,13 +1270,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1287,7 +1287,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -1307,13 +1307,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1324,7 +1324,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -1344,13 +1344,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1361,7 +1361,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -1381,13 +1381,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1398,7 +1398,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -1418,13 +1418,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1435,7 +1435,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -1482,7 +1482,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -1796,13 +1796,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1813,7 +1813,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -1833,13 +1833,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1850,7 +1850,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -1870,13 +1870,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1887,7 +1887,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -1907,13 +1907,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1924,7 +1924,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -1944,13 +1944,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1961,7 +1961,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -1981,13 +1981,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1998,7 +1998,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -2018,13 +2018,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2035,7 +2035,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -2055,13 +2055,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.DocumentTranslationError.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2072,7 +2072,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -2092,13 +2092,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2109,7 +2109,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -2129,13 +2129,13 @@ partial void ProcessDownloadDocumentResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2146,7 +2146,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -2226,7 +2226,7 @@ partial void ProcessDownloadDocumentResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.GetDocumentStatus.g.cs b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.GetDocumentStatus.g.cs index 8f32009..e2cf19b 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.GetDocumentStatus.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.GetDocumentStatus.g.cs @@ -377,13 +377,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -394,7 +394,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -414,13 +414,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -431,7 +431,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -451,13 +451,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -468,7 +468,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -488,13 +488,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -505,7 +505,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -525,13 +525,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -542,7 +542,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -562,13 +562,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -579,7 +579,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -599,13 +599,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -616,7 +616,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -636,13 +636,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -653,7 +653,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -673,13 +673,13 @@ partial void ProcessGetDocumentStatusResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -690,7 +690,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -733,7 +733,7 @@ partial void ProcessGetDocumentStatusResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -778,7 +778,7 @@ partial void ProcessGetDocumentStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.TranslateDocument.g.cs b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.TranslateDocument.g.cs index 0ffebc9..3d991c6 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.TranslateDocument.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslateDocumentsClient.TranslateDocument.g.cs @@ -530,13 +530,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -547,7 +547,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -567,13 +567,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -584,7 +584,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -604,13 +604,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -621,7 +621,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -641,13 +641,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -658,7 +658,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -678,13 +678,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -695,7 +695,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -715,13 +715,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -732,7 +732,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -752,13 +752,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -769,7 +769,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -789,13 +789,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -806,7 +806,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -826,13 +826,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -843,7 +843,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -886,7 +886,7 @@ request.Filename is null { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -931,7 +931,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -1732,13 +1732,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1749,7 +1749,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -1769,13 +1769,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1786,7 +1786,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -1806,13 +1806,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1823,7 +1823,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -1843,13 +1843,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1860,7 +1860,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -1880,13 +1880,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1897,7 +1897,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -1917,13 +1917,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1934,7 +1934,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -1954,13 +1954,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -1971,7 +1971,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -1991,13 +1991,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2008,7 +2008,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -2028,13 +2028,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2045,7 +2045,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -2084,7 +2084,7 @@ request.Filename is null { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -2125,7 +2125,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -2747,13 +2747,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2764,7 +2764,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -2784,13 +2784,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2801,7 +2801,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -2821,13 +2821,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2838,7 +2838,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -2858,13 +2858,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2875,7 +2875,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -2895,13 +2895,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2912,7 +2912,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -2932,13 +2932,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2949,7 +2949,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -2969,13 +2969,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -2986,7 +2986,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -3006,13 +3006,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -3023,7 +3023,7 @@ request.Filename is null throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -3043,13 +3043,13 @@ request.Filename is null if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -3060,7 +3060,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -3103,7 +3103,7 @@ request.Filename is null { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -3148,7 +3148,7 @@ request.Filename is null throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslateTextClient.TranslateText.g.cs b/src/libs/DeepL/Generated/DeepL.TranslateTextClient.TranslateText.g.cs index e9eb98c..e6e2a78 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslateTextClient.TranslateText.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslateTextClient.TranslateText.g.cs @@ -384,13 +384,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -401,7 +401,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -421,13 +421,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -438,7 +438,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -458,13 +458,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -475,7 +475,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -495,13 +495,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } else { __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); + __value_413 = __content_413 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_413, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -512,7 +512,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_413 is { Length: > 0 } ? __content_413 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, responseBody: __content_413, responseObject: __value_413, @@ -532,13 +532,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_414 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_414 = global::DeepL.OneOf.FromJson(__content_414, JsonSerializerContext); + __value_414 = __content_414 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_414, JsonSerializerContext); } else { __content_414 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_414 = global::DeepL.OneOf.FromJson(__content_414, JsonSerializerContext); + __value_414 = __content_414 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_414, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -549,7 +549,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_414 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_414 is { Length: > 0 } ? __content_414 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_414, responseBody: __content_414, responseObject: __value_414, @@ -569,13 +569,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -586,7 +586,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -606,13 +606,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -623,7 +623,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -643,13 +643,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -660,7 +660,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -680,13 +680,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } else { __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); + __value_504 = __content_504 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_504, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -697,7 +697,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_504 is { Length: > 0 } ? __content_504 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, responseBody: __content_504, responseObject: __value_504, @@ -717,13 +717,13 @@ partial void ProcessTranslateTextResponseContent( if (__effectiveReadResponseAsString) { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } else { __content_529 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_529 = global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); + __value_529 = __content_529 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_529, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -734,7 +734,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_529 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_529 is { Length: > 0 } ? __content_529 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_529, responseBody: __content_529, responseObject: __value_529, @@ -777,7 +777,7 @@ partial void ProcessTranslateTextResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -822,7 +822,7 @@ partial void ProcessTranslateTextResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -962,8 +962,9 @@ partial void ProcessTranslateTextResponseContent( /// /// /// Sets which version of the tag handling algorithm should be used. Options currently available:
- /// * `v1`: Traditional algorithm (currently the default, will become deprecated in the future).
- /// * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + /// * `v1`: Traditional algorithm (will become deprecated in the future).
+ /// * `v2`: Improved algorithm released in October 2025. This is the default.
+ /// The `tag_handling_version` field in the response shows which version was applied. /// /// /// Disable the automatic detection of XML structure by setting the `outline_detection` parameter
diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryExport.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryExport.g.cs index b6fb5d2..3063b99 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryExport.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryExport.g.cs @@ -376,13 +376,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -393,7 +393,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -413,13 +413,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -430,7 +430,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -450,13 +450,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -467,7 +467,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -487,13 +487,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -504,7 +504,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -524,13 +524,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::DeepL.ErrorResponse.FromJson(__content_409, JsonSerializerContext); + __value_409 = __content_409 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_409, JsonSerializerContext); } else { __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::DeepL.ErrorResponse.FromJson(__content_409, JsonSerializerContext); + __value_409 = __content_409 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_409, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -541,7 +541,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_409 is { Length: > 0 } ? __content_409 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, responseBody: __content_409, responseObject: __value_409, @@ -561,13 +561,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -578,7 +578,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -598,13 +598,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -615,7 +615,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -635,13 +635,13 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -652,7 +652,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -695,7 +695,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -740,7 +740,7 @@ partial void ProcessCreateTranslationMemoryExportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryImport.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryImport.g.cs index 7a66541..5e6ba34 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryImport.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.CreateTranslationMemoryImport.g.cs @@ -383,13 +383,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -400,7 +400,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -420,13 +420,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -437,7 +437,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -457,13 +457,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -474,7 +474,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -494,13 +494,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -511,7 +511,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -531,13 +531,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -548,7 +548,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -568,13 +568,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -585,7 +585,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -605,13 +605,13 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -622,7 +622,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -665,7 +665,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -710,7 +710,7 @@ partial void ProcessCreateTranslationMemoryImportResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.DeleteTranslationMemory.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.DeleteTranslationMemory.g.cs index 9f738ac..0dd9725 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.DeleteTranslationMemory.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.DeleteTranslationMemory.g.cs @@ -359,13 +359,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -376,7 +376,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -396,13 +396,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -413,7 +413,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -433,13 +433,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -450,7 +450,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -470,13 +470,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -487,7 +487,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -507,13 +507,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -524,7 +524,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -544,13 +544,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -561,7 +561,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -581,13 +581,13 @@ await DeleteTranslationMemoryAsResponseAsync( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -598,7 +598,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -634,7 +634,7 @@ await DeleteTranslationMemoryAsResponseAsync( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -670,7 +670,7 @@ await DeleteTranslationMemoryAsResponseAsync( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemory.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemory.g.cs index 5c0b38b..40af0cc 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemory.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemory.g.cs @@ -364,13 +364,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -381,7 +381,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -401,13 +401,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -418,7 +418,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -438,13 +438,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -455,7 +455,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -475,13 +475,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -492,7 +492,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -512,13 +512,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -529,7 +529,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -549,13 +549,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -566,7 +566,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -586,13 +586,13 @@ partial void ProcessGetTranslationMemoryResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -603,7 +603,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -646,7 +646,7 @@ partial void ProcessGetTranslationMemoryResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -691,7 +691,7 @@ partial void ProcessGetTranslationMemoryResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemoryJob.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemoryJob.g.cs index 4d8afce..c610076 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemoryJob.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemoryJob.g.cs @@ -360,13 +360,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -377,7 +377,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -397,13 +397,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -414,7 +414,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -434,13 +434,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -451,7 +451,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -471,13 +471,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -488,7 +488,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -508,13 +508,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -525,7 +525,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -545,13 +545,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -562,7 +562,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -582,13 +582,13 @@ partial void ProcessGetTranslationMemoryJobResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -599,7 +599,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -642,7 +642,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -687,7 +687,7 @@ partial void ProcessGetTranslationMemoryJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemorySegments.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemorySegments.g.cs index 5993481..fa76cc9 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemorySegments.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.GetTranslationMemorySegments.g.cs @@ -420,13 +420,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -437,7 +437,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -457,13 +457,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -474,7 +474,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -494,13 +494,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -511,7 +511,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -531,13 +531,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -548,7 +548,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -568,13 +568,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -585,7 +585,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -605,13 +605,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -622,7 +622,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -642,13 +642,13 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -659,7 +659,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -702,7 +702,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -747,7 +747,7 @@ partial void ProcessGetTranslationMemorySegmentsResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.ListTranslationMemories.g.cs b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.ListTranslationMemories.g.cs index bce0778..7b0cf01 100644 --- a/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.ListTranslationMemories.g.cs +++ b/src/libs/DeepL/Generated/DeepL.TranslationMemoriesClient.ListTranslationMemories.g.cs @@ -373,13 +373,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -390,7 +390,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -410,13 +410,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -427,7 +427,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -447,13 +447,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -464,7 +464,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -484,13 +484,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -501,7 +501,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -521,13 +521,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -538,7 +538,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -558,13 +558,13 @@ partial void ProcessListTranslationMemoriesResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -575,7 +575,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -618,7 +618,7 @@ partial void ProcessListTranslationMemoriesResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -663,7 +663,7 @@ partial void ProcessListTranslationMemoriesResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.GetVoiceStreamingUrl.g.cs b/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.GetVoiceStreamingUrl.g.cs index 38a1eb9..fee9f02 100644 --- a/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.GetVoiceStreamingUrl.g.cs +++ b/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.GetVoiceStreamingUrl.g.cs @@ -379,13 +379,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -396,7 +396,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -416,13 +416,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -433,7 +433,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -453,13 +453,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -470,7 +470,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -490,13 +490,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -507,7 +507,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -527,13 +527,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -544,7 +544,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -564,13 +564,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -581,7 +581,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -601,13 +601,13 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -618,7 +618,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -661,7 +661,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -706,7 +706,7 @@ partial void ProcessGetVoiceStreamingUrlResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.RequestReconnection.g.cs b/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.RequestReconnection.g.cs index 55926d1..07a7f45 100644 --- a/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.RequestReconnection.g.cs +++ b/src/libs/DeepL/Generated/DeepL.VoiceAPIClient.RequestReconnection.g.cs @@ -354,13 +354,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -371,7 +371,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -391,13 +391,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -408,7 +408,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -428,13 +428,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -445,7 +445,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -465,13 +465,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -482,7 +482,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -502,13 +502,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } else { __content_456 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_456 = global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); + __value_456 = __content_456 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_456, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -519,7 +519,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_456 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_456 is { Length: > 0 } ? __content_456 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_456, responseBody: __content_456, responseObject: __value_456, @@ -539,13 +539,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } else { __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); + __value_500 = __content_500 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_500, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -556,7 +556,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_500 is { Length: > 0 } ? __content_500 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, responseBody: __content_500, responseObject: __value_500, @@ -576,13 +576,13 @@ partial void ProcessRequestReconnectionResponseContent( if (__effectiveReadResponseAsString) { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } else { __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); + __value_503 = __content_503 is not { Length: > 0 } ? null : global::DeepL.OneOf.FromJson(__content_503, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -593,7 +593,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException?>.Create( statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_503 is { Length: > 0 } ? __content_503 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, responseBody: __content_503, responseObject: __value_503, @@ -636,7 +636,7 @@ partial void ProcessRequestReconnectionResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -681,7 +681,7 @@ partial void ProcessRequestReconnectionResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.CreateVoiceTranslateJob.g.cs b/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.CreateVoiceTranslateJob.g.cs index 3676e1c..d86c31f 100644 --- a/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.CreateVoiceTranslateJob.g.cs +++ b/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.CreateVoiceTranslateJob.g.cs @@ -375,13 +375,13 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( if (__effectiveReadResponseAsString) { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } else { __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + __value_400 = __content_400 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_400, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -392,7 +392,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_400 is { Length: > 0 } ? __content_400 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, responseBody: __content_400, responseObject: __value_400, @@ -412,13 +412,13 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -429,7 +429,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -449,13 +449,13 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( if (__effectiveReadResponseAsString) { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } else { __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + __value_403 = __content_403 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_403, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -466,7 +466,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_403 is { Length: > 0 } ? __content_403 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, responseBody: __content_403, responseObject: __value_403, @@ -486,13 +486,13 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -503,7 +503,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -546,7 +546,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -591,7 +591,7 @@ partial void ProcessCreateVoiceTranslateJobResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.GetVoiceTranslateJobStatus.g.cs b/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.GetVoiceTranslateJobStatus.g.cs index 62bc95b..7c0ee46 100644 --- a/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.GetVoiceTranslateJobStatus.g.cs +++ b/src/libs/DeepL/Generated/DeepL.VoiceTranslateJobClient.GetVoiceTranslateJobStatus.g.cs @@ -370,13 +370,13 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( if (__effectiveReadResponseAsString) { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } else { __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_401 = global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + __value_401 = __content_401 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_401, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -387,7 +387,7 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_401 is { Length: > 0 } ? __content_401 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, responseBody: __content_401, responseObject: __value_401, @@ -407,13 +407,13 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( if (__effectiveReadResponseAsString) { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } else { __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + __value_404 = __content_404 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_404, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -424,7 +424,7 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_404 is { Length: > 0 } ? __content_404 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, responseBody: __content_404, responseObject: __value_404, @@ -444,13 +444,13 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( if (__effectiveReadResponseAsString) { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } else { __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); + __value_429 = __content_429 is not { Length: > 0 } ? null : global::DeepL.ErrorResponse.FromJson(__content_429, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -461,7 +461,7 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + message: __content_429 is { Length: > 0 } ? __content_429 : __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, responseBody: __content_429, responseObject: __value_429, @@ -504,7 +504,7 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( { throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( @@ -549,7 +549,7 @@ partial void ProcessGetVoiceTranslateJobStatusResponseContent( throw global::DeepL.ApiException.Create( statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __content is { Length: > 0 } ? __content : __response.ReasonPhrase ?? string.Empty, innerException: __ex, responseBody: __content, responseHeaders: global::System.Linq.Enumerable.ToDictionary( diff --git a/src/libs/DeepL/openapi.yaml b/src/libs/DeepL/openapi.yaml index 32adbd1..46ed357 100644 --- a/src/libs/DeepL/openapi.yaml +++ b/src/libs/DeepL/openapi.yaml @@ -1734,7 +1734,7 @@ paths: in: query required: true schema: - $ref: '#/components/schemas/GlossaryTargetLanguage' + $ref: '#/components/schemas/MultilingualGlossaryTargetLanguage' responses: '200': description: The entries in tsv, wrapped in a JSON object. @@ -1795,7 +1795,7 @@ paths: in: query required: true schema: - $ref: '#/components/schemas/GlossaryTargetLanguage' + $ref: '#/components/schemas/MultilingualGlossaryTargetLanguage' responses: '204': description: Returns no content upon success. @@ -5373,7 +5373,6 @@ components: required: false description: > An optional custom reporting tag used to attribute this request's usage to a team, project, customer, or other category of your choosing. Values are limited to 100 characters. See [How to use custom reporting tags](/docs/learning-how-tos/examples-and-guides/how-to-use-custom-reporting-tags) for validation rules, naming guidance, and how to retrieve usage by tag. - schema: type: string maxLength: 100 @@ -5611,7 +5610,6 @@ components: type: apiKey description: > Authentication with `Authorization` header and `DeepL-Auth-Key` authentication scheme. Example: `DeepL-Auth-Key ` - name: Authorization in: header x-default: "DeepL-Auth-Key " @@ -7169,7 +7167,7 @@ components: source_lang: $ref: '#/components/schemas/GlossarySourceLanguage' target_lang: - $ref: '#/components/schemas/GlossaryTargetLanguage' + $ref: '#/components/schemas/MultilingualGlossaryTargetLanguage' entries: $ref: '#/components/schemas/GlossaryEntries' entries_format: @@ -7279,6 +7277,67 @@ components: - vi - zh example: de + MultilingualGlossaryTargetLanguage: + type: string + description: |- + The language in which the target texts in the dictionary are specified. Besides the base languages, the + target can be one of these variants: `de-CH`, `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-CA`, + `fr-FR`, `pt-BR`, `pt-PT`, `zh-Hans`, or `zh-Hant`. Source languages are always base languages. The current + list is returned by `GET /v3/languages?resource=glossary`. + + A dictionary with a base target, such as `de`, applies when translating into that language and any of its + variants. A dictionary with a variant target, such as `de-CH`, applies only when translating into that + exact variant. + + Within one glossary, each language family uses either the base language or its variants as targets, not + both. For example, `de-CH` and `de-DE` can be combined, but `de` and `de-DE` cannot. Adding a dictionary + that breaks this rule returns a 400 error. + enum: + - ar + - bg + - cs + - da + - de + - de-CH + - de-DE + - el + - en + - en-GB + - en-US + - es + - es-419 + - es-ES + - et + - fi + - fr + - fr-CA + - fr-FR + - he + - hu + - id + - it + - ja + - ko + - lt + - lv + - nb + - nl + - pl + - pt + - pt-BR + - pt-PT + - ro + - ru + - sk + - sl + - sv + - tr + - uk + - vi + - zh + - zh-Hans + - zh-Hant + example: de SpokenTermsId: type: string format: uuid @@ -7356,7 +7415,7 @@ components: source_lang: $ref: '#/components/schemas/GlossarySourceLanguage' target_lang: - $ref: '#/components/schemas/GlossaryTargetLanguage' + $ref: '#/components/schemas/MultilingualGlossaryTargetLanguage' entries: $ref: '#/components/schemas/GlossaryEntries' entries_format: @@ -7374,7 +7433,7 @@ components: source_lang: $ref: '#/components/schemas/GlossarySourceLanguage' target_lang: - $ref: '#/components/schemas/GlossaryTargetLanguage' + $ref: '#/components/schemas/MultilingualGlossaryTargetLanguage' entry_count: $ref: '#/components/schemas/GlossaryEntryCount' OutlineDetectionOption: @@ -7932,8 +7991,10 @@ components: TagHandlingVersionOption: description: |- Sets which version of the tag handling algorithm should be used. Options currently available: - * `v1`: Traditional algorithm (currently the default, will become deprecated in the future). - * `v2`: Improved algorithm released in October 2025 (will become the default in the future). + * `v1`: Traditional algorithm (will become deprecated in the future). + * `v2`: Improved algorithm released in October 2025. This is the default. + + The `tag_handling_version` field in the response shows which version was applied. type: string enum: - v2 @@ -8146,7 +8207,6 @@ components: Use `match` for speaker match, which produces translated speech with a voice close to the speaker's voice. Speaker match is only available for target languages whose translated speech is provided by DeepL, not for languages provided through external service partners. See the [supported languages table](/docs/voice/supported-voice-languages) for details. Requesting `match` for a target language that does not support it is not an error: the session is created and that language's translated speech uses a preset voice instead. - type: string enum: - male @@ -8183,7 +8243,6 @@ components: The source language of the audio stream. It can be left empty or must be one of the supported Voice API source languages and comply with IETF BCP 47 language tags. Note: Some source transcription languages are provided through external service partners. See the [supported languages table](/docs/voice/supported-voice-languages) for details. - enum: - ar - bg @@ -8244,7 +8303,6 @@ components: type: array description: > List of target languages for translation. The stream will emit translations for each language. Language identifiers must comply with IETF BCP 47. See the [supported languages table](/docs/voice/supported-voice-languages) for details. - items: type: string enum: @@ -8309,7 +8367,6 @@ components: List of target languages for which to generate synthesized audio. Languages specified here will automatically be added to target_languages if not already present, ensuring you receive both text translation and audio synthesis for these languages. If omitted, only text transcription and translation will be provided (no audio synthesis). Language identifiers must comply with IETF BCP 47. Note: Some translated audio languages are provided through external service partners. See the [supported languages table](/docs/voice/supported-voice-languages) for details. - items: type: string enum: @@ -8394,19 +8451,16 @@ components: type: string description: > The WebSocket URL to use for establishing [the stream connection](/api-reference/voice/websocket-streaming). - example: wss://api.deepl.com/v3/voice/realtime/connect token: type: string description: > A unique ephemeral token for authentication with the streaming endpoint. Pass this as a query parameter when connecting to [the streaming URL](/api-reference/voice/websocket-streaming). This token is ephemeral and valid for a short time and one-time use only. - example: VGhpcyBpcyBhIGZha2UgdG9rZW4K session_id: type: string description: > Internal use only. A unique identifier for the requested stream. - example: 4f911080-cfe2-41d4-8269-0e6ec15a0354 WritingStyle: type: string @@ -8594,7 +8648,6 @@ components: type: integer description: > Total number of characters used across character-based services. Voice usage is reported in minutes and is not included in this total. - example: 380 text_translation_characters: type: integer @@ -8615,7 +8668,6 @@ components: InfrastructureErrorResponse: description: > Error body returned by DeepL's edge infrastructure for failures that occur before a request reaches the API itself. The message is nested under `error`, unlike the application-level `ErrorResponse`. Clients that parse error bodies should handle both shapes. - type: object required: - error