Skip to content

Commit

Permalink
[Translation] Renames (#21582)
Browse files Browse the repository at this point in the history
  • Loading branch information
maririos authored Jun 4, 2021
1 parent 9d8d4cf commit f8f89a8
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 1,093 deletions.
2 changes: 2 additions & 0 deletions sdk/translation/Azure.AI.Translation.Document/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
### Breaking changes

- This version of the SDK defaults to the latest supported service version, which currently is `v1.0`.
- Renamed method `GetTranslations` to `GetAllTranslationStatuses` and same for the async equivalent method.
- Renamed property `TranslateTo` to `TranslatedTo` in type `DocumentStatusResult`.

## 1.0.0-beta.1 (2021-04-06)

Expand Down
8 changes: 4 additions & 4 deletions sdk/translation/Azure.AI.Translation.Document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ await foreach (DocumentStatusResult document in operation.Value)
if (document.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand All @@ -229,7 +229,7 @@ int docsCancelled = 0;
int docsSucceeded = 0;
int docsFailed = 0;

await foreach (TranslationStatusResult translationStatus in client.GetTranslationsAsync())
await foreach (TranslationStatusResult translationStatus in client.GetAllTranslationStatusesAsync())
{
if (!translationStatus.HasCompleted)
{
Expand Down Expand Up @@ -287,7 +287,7 @@ await foreach (DocumentStatusResult document in operation.GetValuesAsync())
if (document.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand Down Expand Up @@ -346,7 +346,7 @@ foreach (DocumentStatusResult document in operation.GetValues())
if (document.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Azure.AI.Translation.Document
{
public static partial class BatchDocumentTranslationModelFactory
{
public static Azure.AI.Translation.Document.DocumentStatusResult DocumentStatusResult(System.Uri translatedDocumentUri = null, System.Uri sourceDocumentUri = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.AI.Translation.Document.TranslationStatus status = default(Azure.AI.Translation.Document.TranslationStatus), string translateTo = null, Azure.AI.Translation.Document.DocumentTranslationError error = null, float progress = 0f, string documentId = null, long charactersCharged = (long)0) { throw null; }
public static Azure.AI.Translation.Document.DocumentStatusResult DocumentStatusResult(System.Uri translatedDocumentUri = null, System.Uri sourceDocumentUri = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.AI.Translation.Document.TranslationStatus status = default(Azure.AI.Translation.Document.TranslationStatus), string translatedTo = null, Azure.AI.Translation.Document.DocumentTranslationError error = null, float progress = 0f, string documentId = null, long charactersCharged = (long)0) { throw null; }
public static Azure.AI.Translation.Document.FileFormat FileFormat(string format = null, System.Collections.Generic.IReadOnlyList<string> fileExtensions = null, System.Collections.Generic.IReadOnlyList<string> contentTypes = null, string defaultFormatVersion = null, System.Collections.Generic.IReadOnlyList<string> formatVersions = null) { throw null; }
}
public partial class DocumentFilter
Expand All @@ -23,7 +23,7 @@ internal DocumentStatusResult() { }
public System.Uri SourceDocumentUri { get { throw null; } }
public Azure.AI.Translation.Document.TranslationStatus Status { get { throw null; } }
public System.Uri TranslatedDocumentUri { get { throw null; } }
public string TranslateTo { get { throw null; } }
public string TranslatedTo { get { throw null; } }
public float TranslationProgressPercentage { get { throw null; } }
}
public partial class DocumentTranslationClient
Expand All @@ -35,14 +35,14 @@ public DocumentTranslationClient(System.Uri endpoint, Azure.Core.TokenCredential
public DocumentTranslationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Translation.Document.DocumentTranslationClientOptions options) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
public virtual Azure.Pageable<Azure.AI.Translation.Document.TranslationStatusResult> GetAllTranslationStatuses(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.AI.Translation.Document.TranslationStatusResult> GetAllTranslationStatusesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Translation.Document.FileFormat>> GetDocumentFormats(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Translation.Document.FileFormat>>> GetDocumentFormatsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Translation.Document.FileFormat>> GetGlossaryFormats(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Translation.Document.FileFormat>>> GetGlossaryFormatsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public virtual Azure.Pageable<Azure.AI.Translation.Document.TranslationStatusResult> GetTranslations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.AI.Translation.Document.TranslationStatusResult> GetTranslationsAsync(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.AI.Translation.Document.DocumentTranslationOperation StartTranslation(System.Collections.Generic.IEnumerable<Azure.AI.Translation.Document.DocumentTranslationInput> inputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation> StartTranslationAsync(Azure.AI.Translation.Document.DocumentTranslationInput input, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ await foreach (DocumentStatusResult document in operation.Value)
if (document.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ await foreach (DocumentStatusResult document in operation.GetAllDocumentStatuses
if (responseDocumentStatus.Value.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int docsCancelled = 0;
int docsSucceeded = 0;
int docsFailed = 0;

await foreach (TranslationStatusResult translationStatus in client.GetTranslationsAsync())
await foreach (TranslationStatusResult translationStatus in client.GetAllTranslationStatusesAsync())
{
if (!translationStatus.HasCompleted)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ await foreach (DocumentStatusResult document in operation.GetValuesAsync())
if (document.Status == TranslationStatus.Succeeded)
{
Console.WriteLine($" Translated Document Uri: {document.TranslatedDocumentUri}");
Console.WriteLine($" Translated to language: {document.TranslateTo}.");
Console.WriteLine($" Translated to language: {document.TranslatedTo}.");
Console.WriteLine($" Document source Uri: {document.SourceDocumentUri}");
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public partial class DocumentStatusResult
/// This property will have a value only when the document was successfully processed.
/// </summary>
[CodeGenMember("To")]
public string TranslateTo { get; }
public string TranslatedTo { get; }

/// <summary>
/// The date time when the document was created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ public virtual async Task<DocumentTranslationOperation> StartTranslationAsync(Do
/// Get the status results for all submitted translation operations.
/// </summary>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
public virtual Pageable<TranslationStatusResult> GetTranslations(CancellationToken cancellationToken = default)
public virtual Pageable<TranslationStatusResult> GetAllTranslationStatuses(CancellationToken cancellationToken = default)
{
Page<TranslationStatusResult> FirstPageFunc(int? pageSizeHint)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetTranslations)}");
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetAllTranslationStatuses)}");
scope.Start();

try
Expand All @@ -238,7 +238,7 @@ Page<TranslationStatusResult> FirstPageFunc(int? pageSizeHint)

Page<TranslationStatusResult> NextPageFunc(string nextLink, int? pageSizeHint)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetTranslations)}");
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetAllTranslationStatuses)}");
scope.Start();

try
Expand All @@ -260,11 +260,11 @@ Page<TranslationStatusResult> NextPageFunc(string nextLink, int? pageSizeHint)
/// Get the status results for all submitted translation operations.
/// </summary>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
public virtual AsyncPageable<TranslationStatusResult> GetTranslationsAsync(CancellationToken cancellationToken = default)
public virtual AsyncPageable<TranslationStatusResult> GetAllTranslationStatusesAsync(CancellationToken cancellationToken = default)
{
async Task<Page<TranslationStatusResult>> FirstPageFunc(int? pageSizeHint)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetTranslations)}");
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetAllTranslationStatuses)}");
scope.Start();

try
Expand All @@ -281,7 +281,7 @@ async Task<Page<TranslationStatusResult>> FirstPageFunc(int? pageSizeHint)

async Task<Page<TranslationStatusResult>> NextPageFunc(string nextLink, int? pageSizeHint)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetTranslations)}");
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(DocumentTranslationClient)}.{nameof(GetAllTranslationStatuses)}");
scope.Start();

try
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f8f89a8

Please sign in to comment.