Partager via


AcceptedSentSharesClient.ReinstateAsync Méthode

Définition

Rétablir un partage envoyé accepté révoqué.

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))

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.

sentShareName
String

Nom du partage envoyé.

acceptedSentShareName
String

Nom du partage envoyé accepté.

content
RequestContent

Contenu à envoyer en tant que corps de la demande. Les détails du schéma du corps de la demande se trouvent dans la section Remarques ci-dessous.

repeatabilityRequestId
String

Si elle est spécifiée, le client indique que la demande est reproductible ; autrement dit, le client peut effectuer la requête plusieurs fois avec le même Repeatability-Request-ID et obtenir une réponse appropriée sans que le serveur n’exécute la demande plusieurs fois. La valeur de Repeatability-Request-Id est une chaîne opaque représentant un identificateur généré par le client, globalement unique pour tout le temps, pour la requête. Il est recommandé d’utiliser des UUID version 4 (aléatoires).

context
RequestContext

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

Retours

du Operation<T> service qui contiendra un BinaryData objet une fois l’opération asynchrone sur le service terminée. Les détails du schéma du corps pour la valeur finale de l’opération se trouvent dans la section Remarques ci-dessous.

Exceptions

sentShareName, acceptedSentShareName ou content a la valeur Null.

sentShareName ou acceptedSentShareName est une chaîne vide, et était censé être non vide.

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

Exemples

Cet exemple montre comment appeler ReinstateAsync avec les paramètres requis et demander le contenu, et comment analyser le résultat.

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());

Cet exemple montre comment appeler ReinstateAsync avec tous les paramètres et le contenu de la demande, et comment analyser le résultat.

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());

Remarques

Rétablir un partage envoyé accepté révoqué

Vous trouverez ci-dessous le schéma JSON pour les charges utiles de requête et de réponse.

Corps de la demande :

InPlaceAcceptedSentShare Schéma pour 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.
            }

Corps de réponse :

InPlaceAcceptedSentShare Schéma pour 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.
            }

S’applique à