Partager via


AcceptedSentSharesClient.UpdateExpiration Méthode

Définition

Mettez à jour la date d’expiration d’un partage envoyé accepté actif.

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

Paramètres

waitUntil
WaitUntil

Completed si la méthode doit attendre la fin de l’opération de longue durée sur le service ; Started s’il doit retourner 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 Azure.Core Long-Running.

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 demande 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 requête, qui peut remplacer les comportements par défaut du pipeline client par appel.

Retours

à Operation<T> partir du service qui contiendra un BinaryData objet une fois l’opération asynchrone sur le service terminée. Les détails du schéma de 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 on s’attendait à ce qu’elle ne soit pas vide.

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

Exemples

Cet exemple montre comment appeler UpdateExpiration 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 = client.UpdateExpiration(WaitUntil.Completed, "<sentShareName>", "<acceptedSentShareName>", RequestContent.Create(data));

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

Cet exemple montre comment appeler UpdateExpiration avec tous les paramètres 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 {
        expirationDate = "<2022-05-10T14:57:31.2311892-04:00>",
    },
};

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

BinaryData data = operation.WaitForCompletion();
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

Mettre à jour la date d’expiration d’un partage envoyé accepté

Vous trouverez ci-dessous le schéma JSON pour les charges utiles de demande 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 à