diff --git a/src/Serval.Client/Client.g.cs b/src/Serval.Client/Client.g.cs index 02de8cdf..2cf33919 100644 --- a/src/Serval.Client/Client.g.cs +++ b/src/Serval.Client/Client.g.cs @@ -4290,6 +4290,9 @@ public partial class TranslationBuild [Newtonsoft.Json.JsonProperty("revision", Required = Newtonsoft.Json.Required.Always)] public int Revision { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string? Name { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("engine", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public ResourceLink Engine { get; set; } = new ResourceLink(); @@ -4355,6 +4358,9 @@ public enum JobState [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TranslationBuildConfig { + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string? Name { get; set; } = default!; + [Newtonsoft.Json.JsonProperty("pretranslate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.IList? Pretranslate { get; set; } = default!; diff --git a/src/Serval.Translation/Contracts/TranslationBuildConfigDto.cs b/src/Serval.Translation/Contracts/TranslationBuildConfigDto.cs index 41e81af9..7ad0a141 100644 --- a/src/Serval.Translation/Contracts/TranslationBuildConfigDto.cs +++ b/src/Serval.Translation/Contracts/TranslationBuildConfigDto.cs @@ -2,5 +2,6 @@ public class TranslationBuildConfigDto { + public string? Name { get; set; } public IList? Pretranslate { get; set; } } diff --git a/src/Serval.Translation/Contracts/TranslationBuildDto.cs b/src/Serval.Translation/Contracts/TranslationBuildDto.cs index 1bf34c54..561caa95 100644 --- a/src/Serval.Translation/Contracts/TranslationBuildDto.cs +++ b/src/Serval.Translation/Contracts/TranslationBuildDto.cs @@ -5,6 +5,7 @@ public class TranslationBuildDto public string Id { get; set; } = default!; public string Url { get; set; } = default!; public int Revision { get; set; } + public string? Name { get; set; } public ResourceLinkDto Engine { get; set; } = default!; public IList? Pretranslate { get; set; } public int Step { get; set; } diff --git a/src/Serval.Translation/Controllers/TranslationEnginesController.cs b/src/Serval.Translation/Controllers/TranslationEnginesController.cs index 8507a721..3a750840 100644 --- a/src/Serval.Translation/Controllers/TranslationEnginesController.cs +++ b/src/Serval.Translation/Controllers/TranslationEnginesController.cs @@ -960,7 +960,7 @@ private Engine Map(TranslationEngineConfigDto source) private static Build Map(Engine engine, TranslationBuildConfigDto source) { - var build = new Build { EngineRef = engine.Id }; + var build = new Build { EngineRef = engine.Id, Name = source.Name }; if (source.Pretranslate != null) { var pretranslateCorpora = new List(); @@ -1003,6 +1003,7 @@ private TranslationBuildDto Map(Build source) Id = source.Id, Url = _urlService.GetUrl("GetTranslationBuild", new { id = source.EngineRef, buildId = source.Id }), Revision = source.Revision, + Name = source.Name, Engine = new ResourceLinkDto { Id = source.EngineRef, diff --git a/src/Serval.Translation/Models/Build.cs b/src/Serval.Translation/Models/Build.cs index ac6cb7fa..8791c252 100644 --- a/src/Serval.Translation/Models/Build.cs +++ b/src/Serval.Translation/Models/Build.cs @@ -4,6 +4,7 @@ public class Build : IEntity { public string Id { get; set; } = default!; public int Revision { get; set; } = 1; + public string? Name { get; set; } public string EngineRef { get; set; } = default!; public List? Pretranslate { get; set; } public int Step { get; set; }