Share via


ShareFileClient.SetMetadata Method

Definition

The SetMetadata(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 Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo> SetMetadata (System.Collections.Generic.IDictionary<string,string> metadata, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetMetadata : System.Collections.Generic.IDictionary<string, string> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>
override this.SetMetadata : System.Collections.Generic.IDictionary<string, string> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileInfo>
Public Overridable Function SetMetadata (metadata As IDictionary(Of String, String), Optional conditions As ShareFileRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As 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