Udostępnij za pośrednictwem


ShareFileClient.SetMetadataAsync Method

Definition

The SetMetadataAsync(IDictionary<String,String>, ShareFileRequestConditions, CancellationToken) operation sets user-defined metadata for the specified file as one or more name-value pairs.

For more information, see Set File Metadata.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>> SetMetadataAsync (System.Collections.Generic.IDictionary<string,string> metadata, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetMetadataAsync : System.Collections.Generic.IDictionary<string, string> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>>
override this.SetMetadataAsync : System.Collections.Generic.IDictionary<string, string> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>>
Public Overridable Function SetMetadataAsync (metadata As IDictionary(Of String, String), Optional conditions As ShareFileRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ShareFileInfo))

Parameters

metadata
IDictionary<String,String>

Custom metadata to set for this file.

conditions
ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on creating the file.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> describing the updated file.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to