| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | |
| | | 6 | | namespace Azure.Storage.Files.DataLake.Models |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Parameters for Schedule Deletion. |
| | | 10 | | /// </summary> |
| | | 11 | | internal class DataLakeFileScheduleDeletionOptions |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Duration before file should be deleted. |
| | | 15 | | /// </summary> |
| | 48 | 16 | | public TimeSpan? TimeToExpire { get; private set; } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Specifies if TimeToExpire should be |
| | | 20 | | /// set relative to the file's creation time, or the current |
| | | 21 | | /// time. Defaults to current time. |
| | | 22 | | /// </summary> |
| | 24 | 23 | | public DataLakeFileExpirationOrigin? SetExpiryRelativeTo { get; private set; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The <see cref="DateTimeOffset"/> to set for when |
| | | 27 | | /// the file will be deleted. If null, the existing |
| | | 28 | | /// ExpiresOn time on the file will be removed, if it exists. |
| | | 29 | | /// </summary> |
| | 28 | 30 | | public DateTimeOffset? ExpiresOn { get; private set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Constructor. Sets the <see cref="DateTimeOffset"/> when the file will |
| | | 34 | | /// be deleted. |
| | | 35 | | /// </summary> |
| | | 36 | | /// <param name="expiresOn"> |
| | | 37 | | /// The DateTimeOffset when the file will be deleted. |
| | | 38 | | /// If null, if the file was already scheduled for deletion, |
| | | 39 | | /// the deletion will be cancelled. |
| | | 40 | | /// </param> |
| | 8 | 41 | | public DataLakeFileScheduleDeletionOptions(DateTimeOffset? expiresOn) |
| | | 42 | | { |
| | 8 | 43 | | ExpiresOn = expiresOn; |
| | 8 | 44 | | } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Constructor. Sets time when the file will be deleted, relative to the file |
| | | 48 | | /// creation time or the current time. |
| | | 49 | | /// </summary> |
| | | 50 | | /// <param name="timeToExpire"> |
| | | 51 | | /// Duration before file will be deleted. |
| | | 52 | | /// </param> |
| | | 53 | | /// <param name="setRelativeTo"> |
| | | 54 | | /// Specifies if TimeToExpire should be |
| | | 55 | | /// set relative to the file's creation time, or the current |
| | | 56 | | /// time. Defaults to current time. |
| | | 57 | | /// </param> |
| | 12 | 58 | | public DataLakeFileScheduleDeletionOptions(TimeSpan timeToExpire, DataLakeFileExpirationOrigin setRelativeTo) |
| | | 59 | | { |
| | 12 | 60 | | TimeToExpire = timeToExpire; |
| | 12 | 61 | | SetExpiryRelativeTo = setRelativeTo; |
| | 12 | 62 | | } |
| | | 63 | | |
| | | 64 | | /// <summary> |
| | | 65 | | /// Constructor. If the file. was scheduled for deletetion, the deletion will be cancelled. |
| | | 66 | | /// </summary> |
| | 4 | 67 | | public DataLakeFileScheduleDeletionOptions() |
| | | 68 | | { |
| | | 69 | | |
| | 4 | 70 | | } |
| | | 71 | | } |
| | | 72 | | } |