Compartilhar via


ReceivedSharesClient.GetReceivedShareAsync(String, RequestContext) Método

Definição

Obtenha um compartilhamento recebido por nome.

public virtual System.Threading.Tasks.Task<Azure.Response> GetReceivedShareAsync (string receivedShareName, Azure.RequestContext context = default);
abstract member GetReceivedShareAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetReceivedShareAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetReceivedShareAsync (receivedShareName As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parâmetros

receivedShareName
String

O nome do compartilhamento recebido.

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço. Os detalhes do esquema do corpo da resposta estão na seção Comentários abaixo.

Exceções

receivedShareName é nulo.

receivedShareName é uma cadeia de caracteres vazia e esperava-se que não estivesse vazia.

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar GetReceivedShareAsync com os parâmetros necessários e analisar o resultado.

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

Response response = await client.GetReceivedShareAsync("<receivedShareName>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("shareKind").ToString());

Comentários

Obter um compartilhamento recebido

Abaixo está o esquema JSON para o conteúdo da resposta.

Corpo da resposta:

InPlaceReceivedShare Esquema para InPlaceReceivedShare:
{
              shareKind: InPlace, # Required. Defines the supported types for share.
              id: string, # Optional. The resource id of the resource.
              name: string, # Optional. Name of the resource.
              type: string, # Optional. Type of the resource.
              properties: {
                collection: {
                  referenceName: string, # Required. Gets or sets the reference name.
                  type: string, # Required. Gets or sets the reference type property.
                }, # Required. Reference to a Collection.
                createdAt: string (ISO 8601 Format), # Optional. Time at which the received share was created.
                expirationDate: string (ISO 8601 Format), # Optional. The expiration date of the received share.
                invitationId: string, # Required. The invitation id.
                provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
                receivedShareStatus: "Active" | "Reinstating" | "Revoked" | "Revoking" | "RevokeFailed" | "ReinstateFailed" | "SourceDeleted", # Optional. received share status
                receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
                senderEmail: string, # Optional. Email of the sender who created the sent share invitation
                senderName: string, # Optional. Name of the sender who created the sent share invitation
                senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
                sentShareDescription: string, # Optional. Share description.
                sentShareLocation: string, # Required. Sent share location.
                sharedAt: string (ISO 8601 Format), # Optional. Time at which the sent share was shared.
                shareName: string, # Optional. Name of the share
              }, # Required. Properties of in place received share.
            }

Aplica-se a