public async Task <string> GetDownloadUrl(int expiryTimeInMinutes = 5) { var request = new GetDownloadUrlRequest { FileName = this.FileName, ExpiryInMinutes = expiryTimeInMinutes }; var response = await request.ExecuteAsync(); return(response.Url); }
/// <summary> /// Returns a limited time validity download url for the file associated with this FileDownload object. /// </summary> /// <param name="expiryTimeInMinutes">The validity interval for the download url (in minutes)."</param> /// <param name="cacheControlMaxAgeInSeconds">The value to be returned in the cache-control header for the file.</param> /// <returns>Download url.</returns> public async Task <string> GetDownloadUrlAsync(int expiryTimeInMinutes = 5, long cacheControlMaxAgeInSeconds = 2592000) { var request = new GetDownloadUrlRequest { FileName = this.FileName, ExpiryInMinutes = expiryTimeInMinutes, CacheControlMaxAge = cacheControlMaxAgeInSeconds }; ApiOptions.Apply(request, this.Options); var response = await request.ExecuteAsync(); return(response.Url); }