diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Management/Generated.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Management/Generated.cs
index fbed5bb5..6abac1a7 100644
--- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Management/Generated.cs
+++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Management/Generated.cs
@@ -415,6 +415,190 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.6.0 (NJsonSchema v9.13.2.0 (Newtonsoft.Json v9.0.0.0))")]
+ public partial interface ITranslationsClient
+ {
+ /// Translate a text.
+ /// The name of the app.
+ /// The translation request.
+ /// Text translated.
+ /// A server side error occurred.
+ System.Threading.Tasks.Task GetLanguagesAsync(string app, TranslateDto request);
+
+ /// Translate a text.
+ /// The name of the app.
+ /// The translation request.
+ /// Text translated.
+ /// A server side error occurred.
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ System.Threading.Tasks.Task GetLanguagesAsync(string app, TranslateDto request, System.Threading.CancellationToken cancellationToken);
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.6.0 (NJsonSchema v9.13.2.0 (Newtonsoft.Json v9.0.0.0))")]
+ public partial class TranslationsClient : ITranslationsClient
+ {
+ private System.Net.Http.HttpClient _httpClient;
+ private System.Lazy _settings;
+
+ public TranslationsClient(System.Net.Http.HttpClient httpClient)
+ {
+ _httpClient = httpClient;
+ _settings = new System.Lazy(() =>
+ {
+ var settings = new Newtonsoft.Json.JsonSerializerSettings();
+ UpdateJsonSerializerSettings(settings);
+ return settings;
+ });
+ }
+
+ protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
+
+ partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
+ partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
+ partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
+ partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
+
+ /// Translate a text.
+ /// The name of the app.
+ /// The translation request.
+ /// Text translated.
+ /// A server side error occurred.
+ public System.Threading.Tasks.Task GetLanguagesAsync(string app, TranslateDto request)
+ {
+ return GetLanguagesAsync(app, request, System.Threading.CancellationToken.None);
+ }
+
+ /// Translate a text.
+ /// The name of the app.
+ /// The translation request.
+ /// Text translated.
+ /// A server side error occurred.
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ public async System.Threading.Tasks.Task GetLanguagesAsync(string app, TranslateDto request, System.Threading.CancellationToken cancellationToken)
+ {
+ if (app == null)
+ throw new System.ArgumentNullException("app");
+
+ var urlBuilder_ = new System.Text.StringBuilder();
+ urlBuilder_.Append("apps/{app}/translations");
+ urlBuilder_.Replace("{app}", System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value));
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
+
+ PrepareRequest(client_, request_, urlBuilder_);
+ var url_ = urlBuilder_.ToString();
+ request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
+ PrepareRequest(client_, request_, url_);
+
+ var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
+ try
+ {
+ var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
+ if (response_.Content != null && response_.Content.Headers != null)
+ {
+ foreach (var item_ in response_.Content.Headers)
+ headers_[item_.Key] = item_.Value;
+ }
+
+ ProcessResponse(client_, response_);
+
+ var status_ = ((int)response_.StatusCode).ToString();
+ if (status_ == "200")
+ {
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var result_ = default(TranslationDto);
+ try
+ {
+ result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value);
+ return result_;
+ }
+ catch (System.Exception exception_)
+ {
+ throw new SquidexManagementException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
+ }
+ }
+ else
+ if (status_ == "500")
+ {
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ var result_ = default(ErrorDto);
+ try
+ {
+ result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value);
+ }
+ catch (System.Exception exception_)
+ {
+ throw new SquidexManagementException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
+ }
+ throw new SquidexManagementException("Operation failed", (int)response_.StatusCode, responseData_, headers_, result_, null);
+ }
+ else
+ if (status_ != "200" && status_ != "204")
+ {
+ var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new SquidexManagementException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
+ }
+
+ return default(TranslationDto);
+ }
+ finally
+ {
+ if (response_ != null)
+ response_.Dispose();
+ }
+ }
+ }
+ finally
+ {
+ }
+ }
+
+ private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
+ {
+ if (value is System.Enum)
+ {
+ string name = System.Enum.GetName(value.GetType(), value);
+ if (name != null)
+ {
+ var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
+ if (field != null)
+ {
+ var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
+ as System.Runtime.Serialization.EnumMemberAttribute;
+ if (attribute != null)
+ {
+ return attribute.Value;
+ }
+ }
+ }
+ }
+ else if (value is bool) {
+ return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
+ }
+ else if (value is byte[])
+ {
+ return System.Convert.ToBase64String((byte[]) value);
+ }
+ else if (value != null && value.GetType().IsArray)
+ {
+ var array = System.Linq.Enumerable.OfType