| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | |
|
| | 7 | | namespace Azure.Storage.Files.DataLake.Models |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Properties returned when downloading a File. |
| | 11 | | /// </summary> |
| | 12 | | public class FileDownloadDetails |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Returns the <see cref="DateTimeOffset"/> the file was last modified. Any operation that modifies the file, |
| | 16 | | /// including an update of the file's metadata or properties, changes the last-modified time of the file. |
| | 17 | | /// </summary> |
| 84 | 18 | | public DateTimeOffset LastModified { get; internal set; } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// The file's metadata. |
| | 22 | | /// </summary> |
| 0 | 23 | | public IDictionary<string, string> Metadata { get; internal set; } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Indicates the range of bytes returned in the event that the client requested a subset of the file |
| | 27 | | /// setting the 'Range' request header. |
| | 28 | | /// </summary> |
| 0 | 29 | | public string ContentRange { get; internal set; } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// The ETag contains a value that you can use to perform operations conditionally on the file. |
| | 33 | | /// If the request service version is 2011-08-18 or newer, the ETag value will be in quotes. |
| | 34 | | /// </summary> |
| 108 | 35 | | public ETag ETag { get; internal set; } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// This header returns the value that was specified for the Content-Encoding request header. |
| | 39 | | /// </summary> |
| 0 | 40 | | public string ContentEncoding { get; internal set; } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// This header is returned if it was previously specified for the file. |
| | 44 | | /// </summary> |
| 0 | 45 | | public string CacheControl { get; internal set; } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. |
| | 49 | | /// The Content-Disposition response header field conveys additional information about how to process the respon |
| | 50 | | /// and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the |
| | 51 | | /// should not display the response, but instead show a Save As dialog with a filename other than the file name |
| | 52 | | /// </summary> |
| 0 | 53 | | public string ContentDisposition { get; internal set; } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// This header returns the value that was specified for the Content-Language request header. |
| | 57 | | /// </summary> |
| 0 | 58 | | public string ContentLanguage { get; internal set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Conclusion time of the last attempted Copy Blob operation where this file was the destination file. |
| | 62 | | /// This value can specify the time of a completed, aborted, or failed copy attempt. This header does not |
| | 63 | | /// appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or |
| | 64 | | /// if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, |
| | 65 | | /// Put Blob, or Put Block List. |
| | 66 | | /// </summary> |
| 0 | 67 | | public DateTimeOffset CopyCompletedOn { get; internal set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or |
| | 71 | | /// non-fatal copy operation failure. This header does not appear if this blob has never been the destination |
| | 72 | | /// in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using |
| | 73 | | /// Set Blob Properties, Put Blob, or Put Block List |
| | 74 | | /// </summary> |
| 0 | 75 | | public string CopyStatusDescription { get; internal set; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// String identifier for this copy operation. Use with Get Properties to check the status of this copy |
| | 79 | | /// operation, or pass to Abort Copy Blob to abort a pending copy. |
| | 80 | | /// </summary> |
| 0 | 81 | | public string CopyId { get; internal set; } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operat |
| | 85 | | /// where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header do |
| | 86 | | /// appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modifi |
| | 87 | | /// a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List |
| | 88 | | /// </summary> |
| 0 | 89 | | public string CopyProgress { get; internal set; } |
| | 90 | |
|
| | 91 | | /// <summary> |
| | 92 | | /// URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob |
| | 93 | | /// operation where this blob was the destination blob. This header does not appear if this blob has never |
| | 94 | | /// been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy |
| | 95 | | /// Blob operation using Set Blob Properties, Put Blob, or Put Block List. |
| | 96 | | /// </summary> |
| 0 | 97 | | public Uri CopySource { get; internal set; } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// State of the copy operation identified by x-ms-copy-id. |
| | 101 | | /// </summary> |
| 0 | 102 | | public CopyStatus CopyStatus { get; internal set; } |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// When a file is leased, specifies whether the lease is of infinite or fixed duration. |
| | 106 | | /// </summary> |
| 0 | 107 | | public DataLakeLeaseDuration LeaseDuration { get; internal set; } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Lease state of the file. |
| | 111 | | /// </summary> |
| 84 | 112 | | public DataLakeLeaseState LeaseState { get; internal set; } |
| | 113 | |
|
| | 114 | | /// <summary> |
| | 115 | | /// The current lease status of the file. |
| | 116 | | /// </summary> |
| 84 | 117 | | public DataLakeLeaseStatus LeaseStatus { get; internal set; } |
| | 118 | |
|
| | 119 | | /// <summary> |
| | 120 | | /// Indicates that the service supports requests for partial file content. |
| | 121 | | /// </summary> |
| 84 | 122 | | public string AcceptRanges { get; internal set; } |
| | 123 | |
|
| | 124 | | /// <summary> |
| | 125 | | /// The value of this header is set to true if the file data and application metadata are completely |
| | 126 | | /// encrypted using the specified algorithm. Otherwise, the value is set to false (when the file is |
| | 127 | | /// unencrypted, or if only parts of the file/application metadata are encrypted). |
| | 128 | | /// </summary> |
| 84 | 129 | | public bool IsServerEncrypted { get; internal set; } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// The SHA-256 hash of the encryption key used to encrypt the file. This header is only returned when |
| | 133 | | /// the file was encrypted with a customer-provided key. |
| | 134 | | /// </summary> |
| 0 | 135 | | public string EncryptionKeySha256 { get; internal set; } |
| | 136 | |
|
| | 137 | | /// <summary> |
| | 138 | | /// If the file has a MD5 hash, and if request contains range header (Range or x-ms-range), this response |
| | 139 | | /// header is returned with the value of the whole file's MD5 value. This value may or may not be equal |
| | 140 | | /// to the value returned in Content-MD5 header, with the latter calculated from the requested range |
| | 141 | | /// </summary> |
| | 142 | | #pragma warning disable CA1819 // Properties should not return arrays |
| 0 | 143 | | public byte[] ContentHash { get; internal set; } |
| | 144 | | #pragma warning restore CA1819 // Properties should not return arrays |
| | 145 | |
|
| | 146 | | /// <summary> |
| | 147 | | /// Prevent direct instantiation of FileDownloadDetails instances. |
| | 148 | | /// You can use DataLakeModelFactory.FileDownloadDetails instead. |
| | 149 | | /// </summary> |
| 160 | 150 | | internal FileDownloadDetails() { } |
| | 151 | | } |
| | 152 | | } |