你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ReceivedSharesClient.DeleteReceivedShareAsync 方法

定义

[协议方法]删除收到的共享

  • 协议方法 允许显式创建请求并处理高级方案的响应。
public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> DeleteReceivedShareAsync (Azure.WaitUntil waitUntil, string receivedShareId, Azure.RequestContext context = default);
abstract member DeleteReceivedShareAsync : Azure.WaitUntil * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.DeleteReceivedShareAsync : Azure.WaitUntil * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
Public Overridable Function DeleteReceivedShareAsync (waitUntil As WaitUntil, receivedShareId As String, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))

参数

waitUntil
WaitUntil

Completed 如果方法应在服务上完成长时间运行的操作之前等待返回,则为 ; Started 如果它在启动操作后应返回,则为 。 有关长时间运行的操作的详细信息,请参阅 Azure.Core Long-Running 操作示例

receivedShareId
String

接收的共享的 ID。

context
RequestContext

请求上下文,它可以基于每个调用替代客户端管道的默认行为。

返回

表示 Operation 服务上的异步操作的 。

例外

receivedShareId 为 null。

receivedShareId 是一个空字符串,预期为非空。

服务返回了不成功状态代码。

示例

此示例演示如何使用所需参数调用 DeleteReceivedShareAsync 并分析结果。

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

var operation = await client.DeleteReceivedShareAsync(WaitUntil.Completed, "<receivedShareId>");

BinaryData responseData = operation.Value;
JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());

注解

删除收到的共享

下面是响应有效负载的 JSON 架构。

响应正文:

OperationResponse架构:

{
  endTime: string (ISO 8601 Format), # Optional. End time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
  error: {
    code: string, # Required. Code of the error
    details: [PurviewShareErrorInfo], # Optional. Nested details of the error model
    message: string, # Required. Message of the error
    target: string, # Optional. Target of the error
  }, # Optional. The purview share error body model.
  id: string, # Optional. Job id of the long running operation
  startTime: string (ISO 8601 Format), # Optional. Start time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
  status: "Running" | "TransientFailure" | "Succeeded" | "Failed" | "NotStarted", # Required. States for long running operations.
}

适用于