diff --git a/src/Serval/src/Serval.Client/Client.g.cs b/src/Serval/src/Serval.Client/Client.g.cs index 7cfa2548..2f2ff7cb 100644 --- a/src/Serval/src/Serval.Client/Client.g.cs +++ b/src/Serval/src/Serval.Client/Client.g.cs @@ -4218,7 +4218,7 @@ public partial interface ITranslationEnginesClient /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Add a corpus to a translation engine + /// Add a corpus to a translation engine (obsolete - use parallel corpora instead) /// /// /// ## Parameters @@ -4242,20 +4242,22 @@ public partial interface ITranslationEnginesClient /// The corpus configuration (see remarks) /// The added corpus /// A server side error occurred. + [System.Obsolete] System.Threading.Tasks.Task AddCorpusAsync(string id, TranslationCorpusConfig corpusConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all corpora for a translation engine + /// Get all corpora for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// The corpora /// A server side error occurred. + [System.Obsolete] System.Threading.Tasks.Task> GetAllCorporaAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Update a corpus with a new set of files + /// Update a corpus with a new set of files (obsolete - use parallel corpora instead) /// /// /// See posting a new corpus for details of use. Will completely replace corpus' file associations. @@ -4266,16 +4268,18 @@ public partial interface ITranslationEnginesClient /// The corpus configuration /// The corpus was updated successfully /// A server side error occurred. + [System.Obsolete] System.Threading.Tasks.Task UpdateCorpusAsync(string id, string corpusId, TranslationCorpusUpdateConfig corpusConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get the configuration of a corpus for a translation engine + /// Get the configuration of a corpus for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// The corpus id /// The corpus configuration /// A server side error occurred. + [System.Obsolete] System.Threading.Tasks.Task GetCorpusAsync(string id, string corpusId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. @@ -4355,7 +4359,7 @@ public partial interface ITranslationEnginesClient /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all pretranslations in a corpus of a translation engine + /// Get all pretranslations in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -4369,7 +4373,7 @@ public partial interface ITranslationEnginesClient ///
Only pretranslations for the most recent successful build of the engine are returned. ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id (optional) /// The pretranslations /// A server side error occurred. @@ -4377,7 +4381,7 @@ public partial interface ITranslationEnginesClient /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all pretranslations for the specified text in a corpus of a translation engine + /// Get all pretranslations for the specified text in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -4390,7 +4394,7 @@ public partial interface ITranslationEnginesClient ///
Only pretranslations for the most recent successful build of the engine are returned. ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// The pretranslations /// A server side error occurred. @@ -4416,7 +4420,7 @@ public partial interface ITranslationEnginesClient ///
Both scripture and non-scripture text in the USFM is parsed and grouped according to [this wiki](https://github.com/sillsdev/serval/wiki/USFM-Parsing-and-Translation). ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// The source[s] of the data to populate the USFM file with. /// The book in USFM format @@ -5542,7 +5546,7 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Add a corpus to a translation engine + /// Add a corpus to a translation engine (obsolete - use parallel corpora instead) /// /// /// ## Parameters @@ -5566,6 +5570,7 @@ public string BaseUrl /// The corpus configuration (see remarks) /// The added corpus /// A server side error occurred. + [System.Obsolete] public virtual async System.Threading.Tasks.Task AddCorpusAsync(string id, TranslationCorpusConfig corpusConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) @@ -5678,11 +5683,12 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all corpora for a translation engine + /// Get all corpora for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// The corpora /// A server side error occurred. + [System.Obsolete] public virtual async System.Threading.Tasks.Task> GetAllCorporaAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) @@ -5782,7 +5788,7 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Update a corpus with a new set of files + /// Update a corpus with a new set of files (obsolete - use parallel corpora instead) /// /// /// See posting a new corpus for details of use. Will completely replace corpus' file associations. @@ -5793,6 +5799,7 @@ public string BaseUrl /// The corpus configuration /// The corpus was updated successfully /// A server side error occurred. + [System.Obsolete] public virtual async System.Threading.Tasks.Task UpdateCorpusAsync(string id, string corpusId, TranslationCorpusUpdateConfig corpusConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) @@ -5909,12 +5916,13 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get the configuration of a corpus for a translation engine + /// Get the configuration of a corpus for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// The corpus id /// The corpus configuration /// A server side error occurred. + [System.Obsolete] public virtual async System.Threading.Tasks.Task GetCorpusAsync(string id, string corpusId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) @@ -6699,7 +6707,7 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all pretranslations in a corpus of a translation engine + /// Get all pretranslations in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -6713,7 +6721,7 @@ public string BaseUrl ///
Only pretranslations for the most recent successful build of the engine are returned. ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id (optional) /// The pretranslations /// A server side error occurred. @@ -6833,7 +6841,7 @@ public string BaseUrl /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all pretranslations for the specified text in a corpus of a translation engine + /// Get all pretranslations for the specified text in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -6846,7 +6854,7 @@ public string BaseUrl ///
Only pretranslations for the most recent successful build of the engine are returned. ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// The pretranslations /// A server side error occurred. @@ -6982,7 +6990,7 @@ public string BaseUrl ///
Both scripture and non-scripture text in the USFM is parsed and grouped according to [this wiki](https://github.com/sillsdev/serval/wiki/USFM-Parsing-and-Translation). ///
/// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// The source[s] of the data to populate the USFM file with. /// The book in USFM format @@ -9844,12 +9852,15 @@ public partial class TranslationBuild public partial class TrainingCorpus { [Newtonsoft.Json.JsonProperty("corpus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public ResourceLink? Corpus { get; set; } = default!; [Newtonsoft.Json.JsonProperty("textIds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public System.Collections.Generic.IList? TextIds { get; set; } = default!; [Newtonsoft.Json.JsonProperty("scriptureRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? ScriptureRange { get; set; } = default!; [Newtonsoft.Json.JsonProperty("parallelCorpus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -9882,12 +9893,15 @@ public partial class ParallelCorpusFilter public partial class PretranslateCorpus { [Newtonsoft.Json.JsonProperty("corpus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public ResourceLink? Corpus { get; set; } = default!; [Newtonsoft.Json.JsonProperty("textIds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public System.Collections.Generic.IList? TextIds { get; set; } = default!; [Newtonsoft.Json.JsonProperty("scriptureRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? ScriptureRange { get; set; } = default!; [Newtonsoft.Json.JsonProperty("parallelCorpus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -9919,12 +9933,15 @@ public partial class TranslationBuildConfig public partial class TrainingCorpusConfig { [Newtonsoft.Json.JsonProperty("corpusId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? CorpusId { get; set; } = default!; [Newtonsoft.Json.JsonProperty("textIds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public System.Collections.Generic.IList? TextIds { get; set; } = default!; [Newtonsoft.Json.JsonProperty("scriptureRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? ScriptureRange { get; set; } = default!; [Newtonsoft.Json.JsonProperty("parallelCorpusId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -9957,12 +9974,15 @@ public partial class ParallelCorpusFilterConfig public partial class PretranslateCorpusConfig { [Newtonsoft.Json.JsonProperty("corpusId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? CorpusId { get; set; } = default!; [Newtonsoft.Json.JsonProperty("textIds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public System.Collections.Generic.IList? TextIds { get; set; } = default!; [Newtonsoft.Json.JsonProperty("scriptureRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete] public string? ScriptureRange { get; set; } = default!; [Newtonsoft.Json.JsonProperty("parallelCorpusId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] diff --git a/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusConfigDto.cs b/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusConfigDto.cs index a88ebe3b..58756e3a 100644 --- a/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusConfigDto.cs +++ b/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusConfigDto.cs @@ -2,10 +2,13 @@ public record PretranslateCorpusConfigDto { + [Obsolete] public string? CorpusId { get; init; } + [Obsolete] public IReadOnlyList? TextIds { get; init; } + [Obsolete] public string? ScriptureRange { get; init; } public string? ParallelCorpusId { get; init; } diff --git a/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusDto.cs b/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusDto.cs index 9aa6f939..14fde716 100644 --- a/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusDto.cs +++ b/src/Serval/src/Serval.Translation/Contracts/PretranslateCorpusDto.cs @@ -2,10 +2,13 @@ public record PretranslateCorpusDto { + [Obsolete] public ResourceLinkDto? Corpus { get; init; } + [Obsolete] public IReadOnlyList? TextIds { get; init; } + [Obsolete] public string? ScriptureRange { get; init; } public ResourceLinkDto? ParallelCorpus { get; init; } diff --git a/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusConfigDto.cs b/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusConfigDto.cs index c8161a5f..a70bf5ab 100644 --- a/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusConfigDto.cs +++ b/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusConfigDto.cs @@ -2,8 +2,13 @@ namespace Serval.Translation.Contracts; public record TrainingCorpusConfigDto { + [Obsolete] public string? CorpusId { get; init; } + + [Obsolete] public IReadOnlyList? TextIds { get; init; } + + [Obsolete] public string? ScriptureRange { get; init; } public string? ParallelCorpusId { get; init; } diff --git a/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusDto.cs b/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusDto.cs index f734f43b..f958a07b 100644 --- a/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusDto.cs +++ b/src/Serval/src/Serval.Translation/Contracts/TrainingCorpusDto.cs @@ -2,8 +2,13 @@ namespace Serval.Translation.Contracts; public record TrainingCorpusDto { + [Obsolete] public ResourceLinkDto? Corpus { get; init; } + + [Obsolete] public IReadOnlyList? TextIds { get; init; } + + [Obsolete] public string? ScriptureRange { get; init; } public ResourceLinkDto? ParallelCorpus { get; init; } diff --git a/src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs b/src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs index 8fb394ae..48665a67 100644 --- a/src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs +++ b/src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs @@ -1,5 +1,7 @@ namespace Serval.Translation.Controllers; +#pragma warning disable CS0612 // Type or member is obsolete + [ApiVersion(1.0)] [Route("api/v{version:apiVersion}/translation/engines")] [OpenApiTag("Translation Engines")] @@ -313,7 +315,7 @@ await _engineService.TrainSegmentPairAsync( } /// - /// Add a corpus to a translation engine + /// Add a corpus to a translation engine (obsolete - use parallel corpora instead) /// /// /// ## Parameters @@ -344,6 +346,7 @@ await _engineService.TrainSegmentPairAsync( /// The authenticated client cannot perform the operation or does not own the translation engine. /// The engine does not exist. /// A necessary service is currently unavailable. Check `/health` for more details. + [Obsolete("This endpoint is obsolete. Use parallel corpora instead.")] [Authorize(Scopes.UpdateTranslationEngines)] [HttpPost("{id}/corpora")] [ProducesResponseType(StatusCodes.Status201Created)] @@ -369,7 +372,7 @@ CancellationToken cancellationToken } /// - /// Update a corpus with a new set of files + /// Update a corpus with a new set of files (obsolete - use parallel corpora instead) /// /// /// See posting a new corpus for details of use. Will completely replace corpus' file associations. @@ -386,6 +389,7 @@ CancellationToken cancellationToken /// The authenticated client cannot perform the operation or does not own the translation engine. /// The engine or corpus does not exist. /// A necessary service is currently unavailable. Check `/health` for more details. + [Obsolete("This endpoint is obsolete. Use parallel corpora instead.")] [Authorize(Scopes.UpdateTranslationEngines)] [HttpPatch("{id}/corpora/{corpusId}")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -418,7 +422,7 @@ corpusConfig.TargetFiles is null } /// - /// Get all corpora for a translation engine + /// Get all corpora for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// @@ -427,6 +431,7 @@ corpusConfig.TargetFiles is null /// The authenticated client cannot perform the operation or does not own the translation engine /// The engine does not exist /// A necessary service is currently unavailable. Check `/health` for more details. + [Obsolete("This endpoint is obsolete. Use parallel corpora instead.")] [Authorize(Scopes.ReadTranslationEngines)] [HttpGet("{id}/corpora")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -445,7 +450,7 @@ CancellationToken cancellationToken } /// - /// Get the configuration of a corpus for a translation engine + /// Get the configuration of a corpus for a translation engine (obsolete - use parallel corpora instead) /// /// The translation engine id /// The corpus id @@ -455,6 +460,7 @@ CancellationToken cancellationToken /// The authenticated client cannot perform the operation or does not own the translation engine. /// The engine or corpus does not exist. /// A necessary service is currently unavailable. Check `/health` for more details. + [Obsolete("This endpoint is obsolete. Use parallel corpora instead.")] [Authorize(Scopes.ReadTranslationEngines)] [HttpGet("{id}/corpora/{corpusId}", Name = Endpoints.GetTranslationCorpus)] [ProducesResponseType(StatusCodes.Status200OK)] @@ -698,7 +704,7 @@ CancellationToken cancellationToken } /// - /// Get all pretranslations in a corpus of a translation engine + /// Get all pretranslations in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -712,7 +718,7 @@ CancellationToken cancellationToken /// Only pretranslations for the most recent successful build of the engine are returned. /// /// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id (optional) /// /// The pretranslations @@ -761,7 +767,7 @@ CancellationToken cancellationToken } /// - /// Get all pretranslations for the specified text in a corpus of a translation engine + /// Get all pretranslations for the specified text in a corpus or parallel corpus of a translation engine /// /// /// Pretranslations are arranged in a list of dictionaries with the following fields per pretranslation: @@ -774,7 +780,7 @@ CancellationToken cancellationToken /// Only pretranslations for the most recent successful build of the engine are returned. /// /// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// /// The pretranslations @@ -841,7 +847,7 @@ CancellationToken cancellationToken /// Both scripture and non-scripture text in the USFM is parsed and grouped according to [this wiki](https://github.com/sillsdev/serval/wiki/USFM-Parsing-and-Translation). /// /// The translation engine id - /// The corpus id + /// The corpus id or parallel corpus id /// The text id /// The source[s] of the data to populate the USFM file with. /// @@ -1753,3 +1759,5 @@ private static ModelDownloadUrlDto Map(ModelDownloadUrl source) }; } } + +#pragma warning restore CS0612 // Type or member is obsolete diff --git a/src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs b/src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs index d5bb79f3..37826cfc 100644 --- a/src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs +++ b/src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs @@ -5,6 +5,8 @@ namespace Serval.ApiServer; +#pragma warning disable CS0612 // Type or member is obsolete + [TestFixture] [Category("Integration")] public class TranslationEngineTests @@ -2376,3 +2378,5 @@ protected override void DisposeManagedResources() } } } + +#pragma warning restore CS0612 // Type or member is obsolete diff --git a/src/Serval/test/Serval.E2ETests/ServalApiTests.cs b/src/Serval/test/Serval.E2ETests/ServalApiTests.cs index d4899775..8b7cd2f7 100644 --- a/src/Serval/test/Serval.E2ETests/ServalApiTests.cs +++ b/src/Serval/test/Serval.E2ETests/ServalApiTests.cs @@ -1,5 +1,7 @@ namespace Serval.E2ETests; +#pragma warning disable CS0612 // Type or member is obsolete + [TestFixture] [Category("E2E")] public class ServalApiTests @@ -456,3 +458,5 @@ public async Task OneTimeTearDown() await _helperClient.DisposeAsync(); } } + +#pragma warning restore CS0612 // Type or member is obsolete diff --git a/src/Serval/test/Serval.E2ETests/ServalClientHelper.cs b/src/Serval/test/Serval.E2ETests/ServalClientHelper.cs index d64fb15a..8046c833 100644 --- a/src/Serval/test/Serval.E2ETests/ServalClientHelper.cs +++ b/src/Serval/test/Serval.E2ETests/ServalClientHelper.cs @@ -1,5 +1,7 @@ namespace Serval.E2ETests; +#pragma warning disable CS0612 // Type or member is obsolete + public class ServalClientHelper : IAsyncDisposable { public DataFilesClient DataFilesClient { get; } @@ -408,3 +410,5 @@ public ValueTask DisposeAsync() return new ValueTask(Task.CompletedTask); } } + +#pragma warning restore CS0612 // Type or member is obsolete