Partager via


ConversationAuthoringClient.DeleteProject Méthode

Définition

[Méthode de protocole] Supprime un projet.

  • Cette méthode de protocole permet la création explicite de la demande et le traitement de la réponse pour les scénarios avancés.
public virtual Azure.Operation<BinaryData> DeleteProject (Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = default);
abstract member DeleteProject : Azure.WaitUntil * string * Azure.RequestContext -> Azure.Operation<BinaryData>
override this.DeleteProject : Azure.WaitUntil * string * Azure.RequestContext -> Azure.Operation<BinaryData>
Public Overridable Function DeleteProject (waitUntil As WaitUntil, projectName As String, Optional context As RequestContext = Nothing) As Operation(Of BinaryData)

Paramètres

waitUntil
WaitUntil

Completed si la méthode doit attendre pour retourner jusqu’à ce que l’opération de longue durée soit terminée sur le service ; Started si elle doit être retournée après le démarrage de l’opération. Pour plus d’informations sur les opérations de longue durée, consultez Exemples d’opérations de Long-Running Azure.Core.

projectName
String

Nom du projet à utiliser.

context
RequestContext

Contexte de la demande, qui peut remplacer les comportements par défaut du pipeline client par appel.

Retours

Operation représentant une opération asynchrone sur le service.

Exceptions

projectName a la valeur null.

projectName est une chaîne vide et devait être non vide.

Le service a retourné un code de status non réussi.

Exemples

Cet exemple montre comment appeler DeleteProject avec les paramètres requis et analyser le résultat.

var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConversationAuthoringClient(endpoint, credential);

var operation = client.DeleteProject(WaitUntil.Completed, "<projectName>");

BinaryData responseData = operation.Value;
JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());

Remarques

Vous trouverez des informations supplémentaires dans la documentation de l’API REST de service : https://learn.microsoft.com/rest/api/language/2023-04-01/conversational-analysis-authoring/delete-project

S’applique à