public virtual async Task <Response> DeleteModelAsync(string modelId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); Guid guid = ClientCommon.ValidateModelId(modelId, nameof(modelId)); return(await ServiceClient.DeleteCustomModelAsync(guid, cancellationToken).ConfigureAwait(false)); }
/// <summary> /// Deletes the model with the specified model ID. /// </summary> /// <param name="modelId">The ID of the model to delete.</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param> /// <returns>A <see cref="Response"/> representing the result of the operation.</returns> public virtual async Task <Response> DeleteModelAsync(string modelId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); using DiagnosticScope scope = Diagnostics.CreateScope($"{nameof(FormTrainingClient)}.{nameof(DeleteModel)}"); scope.Start(); try { Guid guid = ClientCommon.ValidateModelId(modelId, nameof(modelId)); return(await ServiceClient.DeleteCustomModelAsync(guid, cancellationToken).ConfigureAwait(false)); } catch (Exception e) { scope.Failed(e); throw; } }