Skip to content

Commit

Permalink
Fixes Add a "buildName" optional parameter when building engine #92 -…
Browse files Browse the repository at this point in the history
…-ECL
  • Loading branch information
Enkidu93 committed Sep 13, 2023
1 parent e43b176 commit b94477c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Serval.Client/Client.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<PretranslateCorpusConfig>? Pretranslate { get; set; } = default!;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

public class TranslationBuildConfigDto
{
public string? Name { get; set; }
public IList<PretranslateCorpusConfigDto>? Pretranslate { get; set; }
}
1 change: 1 addition & 0 deletions src/Serval.Translation/Contracts/TranslationBuildDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PretranslateCorpusDto>? Pretranslate { get; set; }
public int Step { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PretranslateCorpus>();
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/Serval.Translation/Models/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PretranslateCorpus>? Pretranslate { get; set; }
public int Step { get; set; }
Expand Down

0 comments on commit b94477c

Please sign in to comment.