diff --git a/sdk/translation/Azure.AI.Translation.Document/api/Azure.AI.Translation.Document.netstandard2.0.cs b/sdk/translation/Azure.AI.Translation.Document/api/Azure.AI.Translation.Document.netstandard2.0.cs index d04cc20eb763..664582e23538 100644 --- a/sdk/translation/Azure.AI.Translation.Document/api/Azure.AI.Translation.Document.netstandard2.0.cs +++ b/sdk/translation/Azure.AI.Translation.Document/api/Azure.AI.Translation.Document.netstandard2.0.cs @@ -96,12 +96,12 @@ public DocumentTranslationClient(System.Uri endpoint, Azure.Core.TokenCredential public virtual Azure.Pageable GetTranslationStatuses(Azure.AI.Translation.Document.GetTranslationStatusesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetTranslationStatusesAsync(Azure.AI.Translation.Document.GetTranslationStatusesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AI.Translation.Document.DocumentTranslationOperation StartTranslation(Azure.AI.Translation.Document.DocumentTranslationInput input, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation StartTranslation(Azure.WaitUntil waitUntil, Azure.AI.Translation.Document.StartTranslationDetails startTranslationDetails, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation StartTranslation(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation StartTranslation(Azure.WaitUntil waitUntil, Azure.AI.Translation.Document.StartTranslationDetails startTranslationDetails, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation StartTranslation(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.AI.Translation.Document.DocumentTranslationOperation StartTranslation(System.Collections.Generic.IEnumerable inputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartTranslationAsync(Azure.AI.Translation.Document.DocumentTranslationInput input, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task StartTranslationAsync(Azure.WaitUntil waitUntil, Azure.AI.Translation.Document.StartTranslationDetails startTranslationDetails, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task StartTranslationAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> StartTranslationAsync(Azure.WaitUntil waitUntil, Azure.AI.Translation.Document.StartTranslationDetails startTranslationDetails, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartTranslationAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task StartTranslationAsync(System.Collections.Generic.IEnumerable inputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DocumentTranslationClientOptions : Azure.Core.ClientOptions diff --git a/sdk/translation/Azure.AI.Translation.Document/src/Generated/DocumentTranslationClient.cs b/sdk/translation/Azure.AI.Translation.Document/src/Generated/DocumentTranslationClient.cs index 57acb10ae41e..16a29a17f69d 100644 --- a/sdk/translation/Azure.AI.Translation.Document/src/Generated/DocumentTranslationClient.cs +++ b/sdk/translation/Azure.AI.Translation.Document/src/Generated/DocumentTranslationClient.cs @@ -839,13 +839,14 @@ public virtual Pageable GetDocumentsStatus(Guid id, int? maxCount, i /// destination, it will be overwritten. The targetUrl for each target language /// must be unique. /// - public virtual async Task StartTranslationAsync(WaitUntil waitUntil, StartTranslationDetails startTranslationDetails, CancellationToken cancellationToken = default) + public virtual async Task> StartTranslationAsync(WaitUntil waitUntil, StartTranslationDetails startTranslationDetails, CancellationToken cancellationToken = default) { Argument.AssertNotNull(startTranslationDetails, nameof(startTranslationDetails)); using RequestContent content = startTranslationDetails.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - return await StartTranslationAsync(waitUntil, content, context).ConfigureAwait(false); + Operation response = await StartTranslationAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, TranslationStatusResult.FromResponse, ClientDiagnostics, "DocumentTranslationClient.StartTranslation"); } /// Submit a document translation request to the Document Translation service. @@ -874,13 +875,14 @@ public virtual async Task StartTranslationAsync(WaitUntil waitUntil, /// destination, it will be overwritten. The targetUrl for each target language /// must be unique. /// - public virtual Operation StartTranslation(WaitUntil waitUntil, StartTranslationDetails startTranslationDetails, CancellationToken cancellationToken = default) + public virtual Operation StartTranslation(WaitUntil waitUntil, StartTranslationDetails startTranslationDetails, CancellationToken cancellationToken = default) { Argument.AssertNotNull(startTranslationDetails, nameof(startTranslationDetails)); using RequestContent content = startTranslationDetails.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - return StartTranslation(waitUntil, content, context); + Operation response = StartTranslation(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, TranslationStatusResult.FromResponse, ClientDiagnostics, "DocumentTranslationClient.StartTranslation"); } /// @@ -904,7 +906,7 @@ public virtual Operation StartTranslation(WaitUntil waitUntil, StartTranslationD /// is null. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - public virtual async Task StartTranslationAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + public virtual async Task> StartTranslationAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); @@ -913,7 +915,7 @@ public virtual async Task StartTranslationAsync(WaitUntil waitUntil, try { using HttpMessage message = CreateStartTranslationRequest(content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "DocumentTranslationClient.StartTranslation", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentTranslationClient.StartTranslation", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -943,7 +945,7 @@ public virtual async Task StartTranslationAsync(WaitUntil waitUntil, /// is null. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - public virtual Operation StartTranslation(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + public virtual Operation StartTranslation(WaitUntil waitUntil, RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); @@ -952,7 +954,7 @@ public virtual Operation StartTranslation(WaitUntil waitUntil, RequestContent co try { using HttpMessage message = CreateStartTranslationRequest(content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "DocumentTranslationClient.StartTranslation", OperationFinalStateVia.OperationLocation, context, waitUntil); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentTranslationClient.StartTranslation", OperationFinalStateVia.OperationLocation, context, waitUntil); } catch (Exception e) { diff --git a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml index 837c4b587a84..932698b321e4 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml +++ b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/translation/Azure.AI.DocumentTranslation -commit: 27a9398801386caaba2df7e1a4d1a8abd19e3789 +commit: 5b7c8a200c2c67012cd56e643a1a7bc6b2d2b78c repo: Azure/azure-rest-api-specs +additionalDirectories: