internal BlobContainer(string containerName, string id, IBlobServiceClient blobServiceClient) { Utility.AssertNotNullOrEmpty(nameof(containerName), containerName); Utility.AssertNotNullOrEmpty(nameof(id), id); this.Name = containerName; this.ServiceClient = blobServiceClient; this.Id = id; _containersApi = ((BlobServiceClient)blobServiceClient).ContainersApiClient; }
internal Blob(IBlobServiceClient client, BlobContainer container, string blobId, string filename, string mimeType, long sizeInBytes, Uri downloadUrl) { Utility.AssertNotNull(nameof(client), client); Utility.AssertNotNull(nameof(container), container); Utility.AssertNotNullOrEmpty(nameof(blobId), blobId); Utility.AssertNotNullOrEmpty(nameof(filename), filename); Utility.AssertNotNullOrEmpty(nameof(mimeType), mimeType); Utility.AssertNotNull(nameof(downloadUrl), downloadUrl); this.ServiceClient = client; this.Id = blobId; this.Container = container; this.FileName = filename; this.MimeType = mimeType; this.SizeInBytes = sizeInBytes; this.DownloadUrl = downloadUrl; this._blobApi = ((BlobServiceClient)ServiceClient).BlobsApiClient; this._metaDataApi = ((BlobServiceClient)ServiceClient).MetaDatasApiClient; }
private static async Task <LeaseBlobAcquireResponse> LeaseExistingBlockBlob(IBlobServiceClient blobServiceClient, string containerName, string blobName, int leaseDuration, string proposedLeaseId) { return(await blobServiceClient.LeaseBlobAcquireAsync(containerName, blobName, leaseDuration, proposedLeaseId ?? Guid.NewGuid().ToString())); }