DocumentTranslationClient.CancelTranslationAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CancelTranslationAsync(Guid, RequestContext) |
[Protocol Method] Cancel a currently processing or queued translation
|
CancelTranslationAsync(Guid, CancellationToken) |
Cancel a currently processing or queued translation. |
CancelTranslationAsync(Guid, RequestContext)
- Source:
- DocumentTranslationClient.cs
- Source:
- DocumentTranslationClient.cs
[Protocol Method] Cancel a currently processing or queued translation
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler CancelTranslationAsync(Guid, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> CancelTranslationAsync (Guid translationId, Azure.RequestContext context);
public virtual System.Threading.Tasks.Task<Azure.Response> CancelTranslationAsync (Guid id, Azure.RequestContext context);
abstract member CancelTranslationAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CancelTranslationAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
abstract member CancelTranslationAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CancelTranslationAsync : Guid * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CancelTranslationAsync (translationId As Guid, context As RequestContext) As Task(Of Response)
Public Overridable Function CancelTranslationAsync (id As Guid, context As RequestContext) As Task(Of Response)
Parameters
- translationIdid
- Guid
Format - uuid. The operation-id.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
Service returned a non-success status code.
Applies to
CancelTranslationAsync(Guid, CancellationToken)
- Source:
- DocumentTranslationClient.cs
- Source:
- DocumentTranslationClient.cs
Cancel a currently processing or queued translation.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>> CancelTranslationAsync (Guid translationId, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>> CancelTranslationAsync (Guid id, System.Threading.CancellationToken cancellationToken = default);
abstract member CancelTranslationAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>>
override this.CancelTranslationAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>>
abstract member CancelTranslationAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>>
override this.CancelTranslationAsync : Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Translation.Document.TranslationStatusResult>>
Public Overridable Function CancelTranslationAsync (translationId As Guid, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of TranslationStatusResult))
Public Overridable Function CancelTranslationAsync (id As Guid, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of TranslationStatusResult))
Parameters
- translationIdid
- Guid
Format - uuid. The operation-id.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Remarks
Cancel a currently processing or queued translation. A translation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned. All documents that have completed translation will not be cancelled and will be charged. All pending documents will be cancelled if possible.