Compartir a través de


AcceptedSentSharesClient.ReinstateAsync Método

Definición

Restablezca un recurso compartido enviado aceptado revocado.

public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> ReinstateAsync (Azure.WaitUntil waitUntil, string sentShareName, string acceptedSentShareName, Azure.Core.RequestContent content, string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member ReinstateAsync : Azure.WaitUntil * string * string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.ReinstateAsync : Azure.WaitUntil * string * string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
Public Overridable Function ReinstateAsync (waitUntil As WaitUntil, sentShareName As String, acceptedSentShareName As String, content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))

Parámetros

waitUntil
WaitUntil

Completed si el método debe esperar a que se devuelva hasta que se haya completado la operación de ejecución prolongada en el servicio; Started si debe devolverse después de iniciar la operación. Para más información sobre las operaciones de larga duración, consulte Ejemplos de operaciones de azure.Core Long-Running.

sentShareName
String

Nombre del recurso compartido enviado.

acceptedSentShareName
String

Nombre del recurso compartido enviado aceptado.

content
RequestContent

Contenido que se va a enviar como el cuerpo de la solicitud. Los detalles del esquema del cuerpo de la solicitud se encuentran en la sección Comentarios a continuación.

repeatabilityRequestId
String

Si se especifica, el cliente dirige que se puede repetir la solicitud; es decir, que el cliente puede realizar la solicitud varias veces con el mismo Repeatability-Request-Id y obtener una respuesta adecuada sin que el servidor ejecute la solicitud varias veces. El valor de Repeatability-Request-Id es una cadena opaca que representa un identificador globalmente único para todo el tiempo y generado por el cliente para la solicitud. Se recomienda usar UUID de la versión 4 (aleatoria).

context
RequestContext

Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.

Devoluciones

Operation<T> del servicio que contendrá un BinaryData objeto una vez completada la operación asincrónica en el servicio. Los detalles del esquema de cuerpo para el valor final de la operación se encuentran en la sección Comentarios siguiente.

Excepciones

sentShareName, acceptedSentShareName o content es un valor null.

sentShareName o acceptedSentShareName es una cadena vacía y se esperaba que no estuviera vacía.

El servicio devolvió un código de estado no correcto.

Ejemplos

En este ejemplo se muestra cómo llamar a ReinstateAsync con los parámetros necesarios y el contenido de la solicitud, y cómo analizar el resultado.

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

var data = new {
    shareKind = "InPlace",
    properties = new {},
};

var operation = await client.ReinstateAsync(WaitUntil.Completed, "<sentShareName>", "<acceptedSentShareName>", RequestContent.Create(data));

BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.ToString());

En este ejemplo se muestra cómo llamar a ReinstateAsync con todos los parámetros y el contenido de la solicitud, y cómo analizar el resultado.

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

var data = new {
    shareKind = "InPlace",
    properties = new {
        expirationDate = "<2022-05-10T14:57:31.2311892-04:00>",
    },
};

var operation = await client.ReinstateAsync(WaitUntil.Completed, "<sentShareName>", "<acceptedSentShareName>", RequestContent.Create(data), "<repeatabilityRequestId>");

BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).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());

Comentarios

Restablecer un recurso compartido enviado aceptado revocado

A continuación se muestra el esquema JSON para las cargas de solicitud y respuesta.

Cuerpo de la solicitud:

InPlaceAcceptedSentShare Esquema para InPlaceAcceptedSentShare:
{
              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: {
                createdAt: string (ISO 8601 Format), # Optional. created at
                expirationDate: string (ISO 8601 Format), # Optional. Expiration date of the received share in UTC format
                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 and created the received share
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation and created the received share
                receiverTargetObjectId: string, # Optional. Receiver's target object id
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation and created the received share
                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
                sharedAt: string (ISO 8601 Format), # Optional. Shared at
              }, # Required. Properties of in place accepted sent share.
            }

Cuerpo de la respuesta:

InPlaceAcceptedSentShare Esquema para InPlaceAcceptedSentShare:
{
              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: {
                createdAt: string (ISO 8601 Format), # Optional. created at
                expirationDate: string (ISO 8601 Format), # Optional. Expiration date of the received share in UTC format
                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 and created the received share
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation and created the received share
                receiverTargetObjectId: string, # Optional. Receiver's target object id
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation and created the received share
                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
                sharedAt: string (ISO 8601 Format), # Optional. Shared at
              }, # Required. Properties of in place accepted sent share.
            }

Se aplica a