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((System.Array) value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + return System.Convert.ToString(value, cultureInfo); + } + } + [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.6.0 (NJsonSchema v9.13.2.0 (Newtonsoft.Json v9.0.0.0))")] public partial interface IStatisticsClient { @@ -1446,13 +1630,13 @@ public partial interface ISchemasClient System.Threading.Tasks.Task DisableNestedFieldAsync(string app, string name, long parentId, long id, System.Threading.CancellationToken cancellationToken); /// Get schemas. - /// The name of the app to get the schemas for. + /// The name of the app. /// Schemas returned. /// A server side error occurred. System.Threading.Tasks.Task> GetSchemasAsync(string app); /// Get schemas. - /// The name of the app to get the schemas for. + /// The name of the app. /// Schemas returned. /// A server side error occurred. /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. @@ -3895,7 +4079,7 @@ public async System.Threading.Tasks.Task DisableNestedFieldAsync(string app, str } /// Get schemas. - /// The name of the app to get the schemas for. + /// The name of the app. /// Schemas returned. /// A server side error occurred. public System.Threading.Tasks.Task> GetSchemasAsync(string app) @@ -3904,7 +4088,7 @@ public async System.Threading.Tasks.Task DisableNestedFieldAsync(string app, str } /// Get schemas. - /// The name of the app to get the schemas for. + /// The name of the app. /// Schemas returned. /// A server side error occurred. /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. @@ -5153,17 +5337,6 @@ public partial interface IRulesClient /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. System.Threading.Tasks.Task> GetActionsAsync(System.Threading.CancellationToken cancellationToken); - /// Get the supported rule triggers. - /// Rule triggers returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetTriggersAsync(); - - /// Get the supported rule triggers. - /// Rule triggers returned. - /// 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> GetTriggersAsync(System.Threading.CancellationToken cancellationToken); - /// Get rules. /// The name of the app. /// Rules returned. @@ -5420,99 +5593,6 @@ public RulesClient(System.Net.Http.HttpClient httpClient) } } - /// Get the supported rule triggers. - /// Rule triggers returned. - /// A server side error occurred. - public System.Threading.Tasks.Task> GetTriggersAsync() - { - return GetTriggersAsync(System.Threading.CancellationToken.None); - } - - /// Get the supported rule triggers. - /// Rule triggers returned. - /// 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> GetTriggersAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("rules/triggers"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - 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(System.Collections.Generic.IDictionary); - 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(System.Collections.Generic.IDictionary); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - /// Get rules. /// The name of the app. /// Rules returned. @@ -6983,33 +7063,198 @@ public async System.Threading.Tasks.Task GetPingAsync(System.Threading.Cancellat } } } - finally + finally + { + } + } + + /// Get ping status. + /// The name of the app. + /// Service ping successful. + /// A server side error occurred. + public System.Threading.Tasks.Task GetAppPingAsync(string app) + { + return GetAppPingAsync(app, System.Threading.CancellationToken.None); + } + + /// Get ping status. + /// The name of the app. + /// Service ping successful. + /// 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 GetAppPingAsync(string app, System.Threading.CancellationToken cancellationToken) + { + if (app == null) + throw new System.ArgumentNullException("app"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append("ping/{app}"); + urlBuilder_.Replace("{app}", System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + + 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_ == "204") + { + return; + } + 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); + } + } + 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((System.Array) value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); } + + return System.Convert.ToString(value, cultureInfo); } + } - /// Get ping status. - /// The name of the app. - /// Service ping successful. + [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.6.0 (NJsonSchema v9.13.2.0 (Newtonsoft.Json v9.0.0.0))")] + public partial interface INewsClient + { + /// Get features since version. + /// The latest received version. + /// Latest features returned. /// A server side error occurred. - public System.Threading.Tasks.Task GetAppPingAsync(string app) + System.Threading.Tasks.Task GetLanguagesAsync(int? version); + + /// Get features since version. + /// The latest received version. + /// Latest features returned. + /// 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(int? version, 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 NewsClient : INewsClient + { + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public NewsClient(System.Net.Http.HttpClient httpClient) { - return GetAppPingAsync(app, System.Threading.CancellationToken.None); + _httpClient = httpClient; + _settings = new System.Lazy(() => + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + }); } - /// Get ping status. - /// The name of the app. - /// Service ping successful. + 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); + + /// Get features since version. + /// The latest received version. + /// Latest features returned. /// 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 GetAppPingAsync(string app, System.Threading.CancellationToken cancellationToken) + public System.Threading.Tasks.Task GetLanguagesAsync(int? version) { - if (app == null) - throw new System.ArgumentNullException("app"); + return GetLanguagesAsync(version, System.Threading.CancellationToken.None); + } + /// Get features since version. + /// The latest received version. + /// Latest features returned. + /// 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(int? version, System.Threading.CancellationToken cancellationToken) + { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("ping/{app}"); - urlBuilder_.Replace("{app}", System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("news/features?"); + if (version != null) + { + urlBuilder_.Append("version=").Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; var client_ = _httpClient; try @@ -7017,6 +7262,7 @@ public async System.Threading.Tasks.Task GetAppPingAsync(string app, System.Thre using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7036,9 +7282,19 @@ public async System.Threading.Tasks.Task GetAppPingAsync(string app, System.Thre ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + if (status_ == "200") { - return; + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(FeaturesDto); + 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") @@ -7061,6 +7317,8 @@ public async System.Threading.Tasks.Task GetAppPingAsync(string app, System.Thre 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(FeaturesDto); } finally { @@ -8811,24 +9069,28 @@ public partial interface IAssetsClient { /// Get the asset content. /// The id of the asset. + /// Optional suffix that can be used to seo-optimize the link to the image Has not effect. /// The optional version of the asset. /// The target width of the asset, if it is an image. /// The target height of the asset, if it is an image. + /// Optional image quality, it is is an jpeg image. /// The resize mode when the width and height is defined. /// Asset found and content or (resized) image returned. /// A server side error occurred. - System.Threading.Tasks.Task GetAssetContentAsync(string id, long? version, int? width, int? height, string mode); + System.Threading.Tasks.Task GetAssetContentAsync(string id, string more, long? version, int? width, int? height, int? quality, string mode); /// Get the asset content. /// The id of the asset. + /// Optional suffix that can be used to seo-optimize the link to the image Has not effect. /// The optional version of the asset. /// The target width of the asset, if it is an image. /// The target height of the asset, if it is an image. + /// Optional image quality, it is is an jpeg image. /// The resize mode when the width and height is defined. /// Asset found and content or (resized) image returned. /// 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 GetAssetContentAsync(string id, long? version, int? width, int? height, string mode, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task GetAssetContentAsync(string id, string more, long? version, int? width, int? height, int? quality, string mode, System.Threading.CancellationToken cancellationToken); /// Get assets tags. /// The name of the app. @@ -8908,7 +9170,7 @@ public partial interface IAssetsClient /// The asset object that needs to updated. /// Asset updated. /// A server side error occurred. - System.Threading.Tasks.Task PutAssetAsync(string app, string id, UpdateAssetDto request); + System.Threading.Tasks.Task PutAssetAsync(string app, string id, AnnotateAssetDto request); /// Updates the asset. /// The name of the app. @@ -8917,7 +9179,7 @@ public partial interface IAssetsClient /// Asset updated. /// 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 PutAssetAsync(string app, string id, UpdateAssetDto request, System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task PutAssetAsync(string app, string id, AnnotateAssetDto request, System.Threading.CancellationToken cancellationToken); /// Delete an asset. /// The name of the app. @@ -8977,34 +9239,42 @@ public AssetsClient(System.Net.Http.HttpClient httpClient) /// Get the asset content. /// The id of the asset. + /// Optional suffix that can be used to seo-optimize the link to the image Has not effect. /// The optional version of the asset. /// The target width of the asset, if it is an image. /// The target height of the asset, if it is an image. + /// Optional image quality, it is is an jpeg image. /// The resize mode when the width and height is defined. /// Asset found and content or (resized) image returned. /// A server side error occurred. - public System.Threading.Tasks.Task GetAssetContentAsync(string id, long? version, int? width, int? height, string mode) + public System.Threading.Tasks.Task GetAssetContentAsync(string id, string more, long? version, int? width, int? height, int? quality, string mode) { - return GetAssetContentAsync(id, version, width, height, mode, System.Threading.CancellationToken.None); + return GetAssetContentAsync(id, more, version, width, height, quality, mode, System.Threading.CancellationToken.None); } /// Get the asset content. /// The id of the asset. + /// Optional suffix that can be used to seo-optimize the link to the image Has not effect. /// The optional version of the asset. /// The target width of the asset, if it is an image. /// The target height of the asset, if it is an image. + /// Optional image quality, it is is an jpeg image. /// The resize mode when the width and height is defined. /// Asset found and content or (resized) image returned. /// 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 GetAssetContentAsync(string id, long? version, int? width, int? height, string mode, System.Threading.CancellationToken cancellationToken) + public async System.Threading.Tasks.Task GetAssetContentAsync(string id, string more, long? version, int? width, int? height, int? quality, string mode, System.Threading.CancellationToken cancellationToken) { if (id == null) throw new System.ArgumentNullException("id"); + if (more == null) + throw new System.ArgumentNullException("more"); + var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("assets/{id}?"); + urlBuilder_.Append("assets/{id}/{more}?"); urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{more}", System.Uri.EscapeDataString(ConvertToString(more, System.Globalization.CultureInfo.InvariantCulture))); if (version != null) { urlBuilder_.Append("version=").Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); @@ -9017,6 +9287,10 @@ public async System.Threading.Tasks.Task GetAssetContentAsync(stri { urlBuilder_.Append("height=").Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + if (quality != null) + { + urlBuilder_.Append("quality=").Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } if (mode != null) { urlBuilder_.Append("mode=").Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); @@ -9602,7 +9876,7 @@ public async System.Threading.Tasks.Task GetAssetAsync(string app, st /// The asset object that needs to updated. /// Asset updated. /// A server side error occurred. - public System.Threading.Tasks.Task PutAssetAsync(string app, string id, UpdateAssetDto request) + public System.Threading.Tasks.Task PutAssetAsync(string app, string id, AnnotateAssetDto request) { return PutAssetAsync(app, id, request, System.Threading.CancellationToken.None); } @@ -9614,7 +9888,7 @@ public System.Threading.Tasks.Task PutAssetAsync(string app, string id, UpdateAs /// Asset updated. /// 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 PutAssetAsync(string app, string id, UpdateAssetDto request, System.Threading.CancellationToken cancellationToken) + public async System.Threading.Tasks.Task PutAssetAsync(string app, string id, AnnotateAssetDto request, System.Threading.CancellationToken cancellationToken) { if (app == null) throw new System.ArgumentNullException("app"); @@ -12931,9 +13205,9 @@ public partial class UISettingsDto [System.ComponentModel.DataAnnotations.Required] public string MapKey { get; set; } - /// Indicates whether twitter actions are supported. - [Newtonsoft.Json.JsonProperty("supportsTwitterActions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool SupportsTwitterActions { get; set; } + /// True when the user can create apps. + [Newtonsoft.Json.JsonProperty("canCreateApps", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool CanCreateApps { get; set; } public string ToJson() { @@ -12969,6 +13243,10 @@ public static UpdateSettingDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public abstract partial class IJsonValue { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public JsonValueType Type { get; set; } + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); @@ -12982,26 +13260,25 @@ public static IJsonValue FromJson(string data) } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] - public partial class TokenRequest + public enum JsonValueType { - [Newtonsoft.Json.JsonProperty("pinCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string PinCode { get; set; } + [System.Runtime.Serialization.EnumMember(Value = "Array")] + Array = 0, - [Newtonsoft.Json.JsonProperty("requestToken", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequestToken { get; set; } + [System.Runtime.Serialization.EnumMember(Value = "Boolean")] + Boolean = 1, - [Newtonsoft.Json.JsonProperty("requestTokenSecret", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RequestTokenSecret { get; set; } + [System.Runtime.Serialization.EnumMember(Value = "Null")] + Null = 2, - public string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this); - } - - public static TokenRequest FromJson(string data) - { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data); - } + [System.Runtime.Serialization.EnumMember(Value = "Number")] + Number = 3, + + [System.Runtime.Serialization.EnumMember(Value = "Object")] + Object = 4, + + [System.Runtime.Serialization.EnumMember(Value = "String")] + String = 5, } @@ -13163,6 +13440,79 @@ public static ErrorDto FromJson(string data) } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class TranslationDto + { + /// The result of the translation. + [Newtonsoft.Json.JsonProperty("result", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public TranslationResult Result { get; set; } + + /// The translated text. + [Newtonsoft.Json.JsonProperty("text", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Text { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static TranslationDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public enum TranslationResult + { + [System.Runtime.Serialization.EnumMember(Value = "Translated")] + Translated = 0, + + [System.Runtime.Serialization.EnumMember(Value = "LanguageNotSupported")] + LanguageNotSupported = 1, + + [System.Runtime.Serialization.EnumMember(Value = "NotTranslated")] + NotTranslated = 2, + + [System.Runtime.Serialization.EnumMember(Value = "NotImplemented")] + NotImplemented = 3, + + [System.Runtime.Serialization.EnumMember(Value = "Failed")] + Failed = 4, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class TranslateDto + { + /// The text to translate. + [Newtonsoft.Json.JsonProperty("text", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Text { get; set; } + + /// The target language. + [Newtonsoft.Json.JsonProperty("targetLanguage", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string TargetLanguage { get; set; } + + /// The optional source language. + [Newtonsoft.Json.JsonProperty("sourceLanguage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string SourceLanguage { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static TranslateDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class LogDownloadDto { @@ -13492,6 +13842,7 @@ public partial class BooleanFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public BooleanFieldEditor Editor { get; set; } public string ToJson() @@ -13509,8 +13860,10 @@ public static BooleanFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum BooleanFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Checkbox")] Checkbox = 0, + [System.Runtime.Serialization.EnumMember(Value = "Toggle")] Toggle = 1, } @@ -13532,10 +13885,12 @@ public partial class DateTimeFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public DateTimeFieldEditor Editor { get; set; } /// The calculated default value for the field value. [Newtonsoft.Json.JsonProperty("calculatedDefaultValue", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public DateTimeCalculatedDefaultValue? CalculatedDefaultValue { get; set; } public string ToJson() @@ -13553,8 +13908,10 @@ public static DateTimeFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum DateTimeFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Date")] Date = 0, + [System.Runtime.Serialization.EnumMember(Value = "DateTime")] DateTime = 1, } @@ -13562,8 +13919,10 @@ public enum DateTimeFieldEditor [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum DateTimeCalculatedDefaultValue { + [System.Runtime.Serialization.EnumMember(Value = "Now")] Now = 0, + [System.Runtime.Serialization.EnumMember(Value = "Today")] Today = 1, } @@ -13577,6 +13936,7 @@ public partial class GeolocationFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public GeolocationFieldEditor Editor { get; set; } public string ToJson() @@ -13594,6 +13954,7 @@ public static GeolocationFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum GeolocationFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Map")] Map = 0, } @@ -13642,6 +14003,7 @@ public partial class NumberFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public NumberFieldEditor Editor { get; set; } public string ToJson() @@ -13659,12 +14021,16 @@ public static NumberFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum NumberFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Input")] Input = 0, + [System.Runtime.Serialization.EnumMember(Value = "Radio")] Radio = 1, + [System.Runtime.Serialization.EnumMember(Value = "Dropdown")] Dropdown = 2, + [System.Runtime.Serialization.EnumMember(Value = "Stars")] Stars = 3, } @@ -13733,6 +14099,7 @@ public partial class StringFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public StringFieldEditor Editor { get; set; } public string ToJson() @@ -13750,22 +14117,31 @@ public static StringFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum StringFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Input")] Input = 0, + [System.Runtime.Serialization.EnumMember(Value = "Color")] Color = 1, + [System.Runtime.Serialization.EnumMember(Value = "Markdown")] Markdown = 2, + [System.Runtime.Serialization.EnumMember(Value = "Dropdown")] Dropdown = 3, + [System.Runtime.Serialization.EnumMember(Value = "Html")] Html = 4, + [System.Runtime.Serialization.EnumMember(Value = "Radio")] Radio = 5, + [System.Runtime.Serialization.EnumMember(Value = "RichText")] RichText = 6, + [System.Runtime.Serialization.EnumMember(Value = "Slug")] Slug = 7, + [System.Runtime.Serialization.EnumMember(Value = "TextArea")] TextArea = 8, } @@ -13787,6 +14163,7 @@ public partial class TagsFieldPropertiesDto : FieldPropertiesDto /// The editor that is used to manage this field. [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public TagsFieldEditor Editor { get; set; } public string ToJson() @@ -13804,10 +14181,13 @@ public static TagsFieldPropertiesDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum TagsFieldEditor { + [System.Runtime.Serialization.EnumMember(Value = "Tags")] Tags = 0, + [System.Runtime.Serialization.EnumMember(Value = "Checkboxes")] Checkboxes = 1, + [System.Runtime.Serialization.EnumMember(Value = "Dropdown")] Dropdown = 2, } @@ -14410,6 +14790,11 @@ public partial class RuleElementDto [Newtonsoft.Json.JsonProperty("readMore", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string ReadMore { get; set; } + /// The properties. + [Newtonsoft.Json.JsonProperty("properties", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Properties { get; set; } = new System.Collections.ObjectModel.Collection(); + public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); @@ -14422,6 +14807,75 @@ public static RuleElementDto FromJson(string data) } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class RuleElementPropertyDto + { + /// The html editor. + [Newtonsoft.Json.JsonProperty("editor", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public RuleActionPropertyEditor Editor { get; set; } + + /// The name of the editor. + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Name { get; set; } + + /// The label to use. + [Newtonsoft.Json.JsonProperty("display", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Display { get; set; } + + /// The optional description. + [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Description { get; set; } + + /// Indicates if the property is formattable. + [Newtonsoft.Json.JsonProperty("isFormattable", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool IsFormattable { get; set; } + + /// Indicates if the property is required. + [Newtonsoft.Json.JsonProperty("isRequired", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool IsRequired { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static RuleElementPropertyDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public enum RuleActionPropertyEditor + { + [System.Runtime.Serialization.EnumMember(Value = "Checkbox")] + Checkbox = 0, + + [System.Runtime.Serialization.EnumMember(Value = "Email")] + Email = 1, + + [System.Runtime.Serialization.EnumMember(Value = "Number")] + Number = 2, + + [System.Runtime.Serialization.EnumMember(Value = "Password")] + Password = 3, + + [System.Runtime.Serialization.EnumMember(Value = "Text")] + Text = 4, + + [System.Runtime.Serialization.EnumMember(Value = "TextArea")] + TextArea = 5, + + [System.Runtime.Serialization.EnumMember(Value = "Url")] + Url = 6, + + } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class RuleDto { @@ -14479,6 +14933,7 @@ public static RuleDto FromJson(string data) [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "triggerType")] [JsonInheritanceAttribute("AssetChanged", typeof(AssetChangedRuleTriggerDto))] [JsonInheritanceAttribute("ContentChanged", typeof(ContentChangedRuleTriggerDto))] + [JsonInheritanceAttribute("SchemaChanged", typeof(SchemaChangedRuleTriggerDto))] [JsonInheritanceAttribute("Usage", typeof(UsageRuleTriggerDto))] [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public abstract partial class RuleTriggerDto @@ -14561,6 +15016,25 @@ public static ContentChangedRuleTriggerSchemaDto FromJson(string data) } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class SchemaChangedRuleTriggerDto : RuleTriggerDto + { + /// Javascript condition when to trigger. + [Newtonsoft.Json.JsonProperty("condition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Condition { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static SchemaChangedRuleTriggerDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class UsageRuleTriggerDto : RuleTriggerDto { @@ -14718,10 +15192,12 @@ public partial class RuleEventDto /// The result of the event. [Newtonsoft.Json.JsonProperty("result", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public RuleResult Result { get; set; } /// The result of the job. [Newtonsoft.Json.JsonProperty("jobResult", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public RuleJobResult JobResult { get; set; } public string ToJson() @@ -14739,12 +15215,16 @@ public static RuleEventDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum RuleResult { + [System.Runtime.Serialization.EnumMember(Value = "Pending")] Pending = 0, + [System.Runtime.Serialization.EnumMember(Value = "Success")] Success = 1, + [System.Runtime.Serialization.EnumMember(Value = "Failed")] Failed = 2, + [System.Runtime.Serialization.EnumMember(Value = "Timeout")] Timeout = 3, } @@ -14752,14 +15232,19 @@ public enum RuleResult [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum RuleJobResult { + [System.Runtime.Serialization.EnumMember(Value = "Pending")] Pending = 0, + [System.Runtime.Serialization.EnumMember(Value = "Success")] Success = 1, + [System.Runtime.Serialization.EnumMember(Value = "Retry")] Retry = 2, + [System.Runtime.Serialization.EnumMember(Value = "Failed")] Failed = 3, + [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] Cancelled = 4, } @@ -14885,6 +15370,55 @@ public static ChangePlanDto FromJson(string data) } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class FeaturesDto + { + /// The latest features. + [Newtonsoft.Json.JsonProperty("features", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Features { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// The recent version. + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Version { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static FeaturesDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class FeatureDto + { + /// The name of the feature. + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Name { get; set; } + + /// The description text. + [Newtonsoft.Json.JsonProperty("text", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Text { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static FeatureDto FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class HistoryEventDto { @@ -14962,7 +15496,7 @@ public partial class CommentDto /// The time when the comment was created or updated last. [Newtonsoft.Json.JsonProperty("time", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.Required] public System.DateTimeOffset Time { get; set; } /// The user who created or updated the comment. @@ -15032,6 +15566,7 @@ public partial class BackupJobDto /// The status of the operation. [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public JobStatus Status { get; set; } public string ToJson() @@ -15049,12 +15584,16 @@ public static BackupJobDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public enum JobStatus { + [System.Runtime.Serialization.EnumMember(Value = "Created")] Created = 0, + [System.Runtime.Serialization.EnumMember(Value = "Started")] Started = 1, + [System.Runtime.Serialization.EnumMember(Value = "Completed")] Completed = 2, + [System.Runtime.Serialization.EnumMember(Value = "Failed")] Failed = 3, } @@ -15082,6 +15621,7 @@ public partial class RestoreJobDto /// The status of the operation. [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public JobStatus Status { get; set; } public string ToJson() @@ -15157,6 +15697,11 @@ public partial class AssetDto [System.ComponentModel.DataAnnotations.Required] public string FileName { get; set; } + /// The slug. + [Newtonsoft.Json.JsonProperty("slug", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Slug { get; set; } + /// The mime type. [Newtonsoft.Json.JsonProperty("mimeType", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] @@ -15242,6 +15787,11 @@ public partial class AssetCreatedDto [System.ComponentModel.DataAnnotations.Required] public string FileName { get; set; } + /// The slug. + [Newtonsoft.Json.JsonProperty("slug", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string Slug { get; set; } + /// The mime type. [Newtonsoft.Json.JsonProperty("mimeType", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] @@ -15333,12 +15883,16 @@ public static AssetReplacedDto FromJson(string data) } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] - public partial class UpdateAssetDto + public partial class AnnotateAssetDto { /// The new name of the asset. [Newtonsoft.Json.JsonProperty("fileName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string FileName { get; set; } + /// The new slug of the asset. + [Newtonsoft.Json.JsonProperty("slug", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Slug { get; set; } + /// The new asset tags. [Newtonsoft.Json.JsonProperty("tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.ICollection Tags { get; set; } @@ -15348,9 +15902,9 @@ public string ToJson() return Newtonsoft.Json.JsonConvert.SerializeObject(this); } - public static UpdateAssetDto FromJson(string data) + public static AnnotateAssetDto FromJson(string data) { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); } } @@ -15887,7 +16441,7 @@ public static CreateAppDto FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class Webhook : RuleAction { - /// he url to the webhook. + /// The url to the webhook. [Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Uri Url { get; set; } @@ -16010,14 +16564,14 @@ public partial class Medium : RuleAction [Newtonsoft.Json.JsonProperty("canonicalUrl", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string CanonicalUrl { get; set; } - /// Optional publication id. - [Newtonsoft.Json.JsonProperty("publicationId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string PublicationId { get; set; } - /// The optional comma separated list of tags. [Newtonsoft.Json.JsonProperty("tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Tags { get; set; } + /// Optional publication id. + [Newtonsoft.Json.JsonProperty("publicationId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string PublicationId { get; set; } + /// Indicates whether the content is markdown or html. [Newtonsoft.Json.JsonProperty("isHtml", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool IsHtml { get; set; } @@ -16075,16 +16629,16 @@ public partial class Email : RuleAction [Newtonsoft.Json.JsonProperty("serverUseSsl", Required = Newtonsoft.Json.Required.Always)] public bool ServerUseSsl { get; set; } - /// The username for the SMTP server. - [Newtonsoft.Json.JsonProperty("serverUsername", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public string ServerUsername { get; set; } - /// The password for the SMTP server. [Newtonsoft.Json.JsonProperty("serverPassword", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public string ServerPassword { get; set; } + /// The username for the SMTP server. + [Newtonsoft.Json.JsonProperty("serverUsername", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public string ServerUsername { get; set; } + /// The email sending address. [Newtonsoft.Json.JsonProperty("messageFrom", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] @@ -16120,7 +16674,7 @@ public static Email FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class ElasticSearch : RuleAction { - /// The hostname of the elastic search instance or cluster. + /// The url to the elastic search instance or cluster. [Newtonsoft.Json.JsonProperty("host", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Uri Host { get; set; } @@ -16158,7 +16712,7 @@ public static ElasticSearch FromJson(string data) [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.2.0 (Newtonsoft.Json v9.0.0.0)")] public partial class Discourse : RuleAction { - /// he url to the discourse server. + /// The url to the discourse server. [Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Uri Url { get; set; } @@ -16240,7 +16794,7 @@ public partial class Algolia : RuleAction [System.ComponentModel.DataAnnotations.Required] public string ApiKey { get; set; } - /// THe name of the index. + /// The name of the index. [Newtonsoft.Json.JsonProperty("indexName", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public string IndexName { get; set; } diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj index 23e7446b..4f7a4e69 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj @@ -10,7 +10,7 @@ https://raw.githubusercontent.com/Squidex/squidex/master/media/logo-squared.png https://github.com/Squidex/squidex/blob/master/LICENSE.txt https://github.com/Squidex/squidex/ - 2.8 + 2.10 true diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexClientExtensions.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexClientExtensions.cs index fc314ce1..25876520 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexClientExtensions.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexClientExtensions.cs @@ -1,12 +1,17 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + using System.Threading.Tasks; namespace Squidex.ClientLibrary { public static class SquidexClientExtensions { - public static async Task> GetAllAsync( - this SquidexClient client, - int batchSize = 200) + public static async Task> GetAllAsync(this SquidexClient client, int batchSize = 200) where TEntity : SquidexEntityBase where TData : class, new() {