| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | | using System.Text; |
| | 7 | |
|
| | 8 | | #pragma warning disable SA1402 // File may only contain a single type |
| | 9 | |
|
| | 10 | | namespace Azure.Storage.Files.Shares.Models |
| | 11 | | { |
| | 12 | | /// <summary> |
| | 13 | | /// Subset of the directory's properties. |
| | 14 | | /// </summary> |
| | 15 | | public class ShareDirectoryInfo |
| | 16 | | { |
| | 17 | | internal RawStorageDirectoryInfo _rawStorageDirectoryInfo; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// The ETag contains a value which represents the version of the directory, in quotes. |
| | 21 | | /// </summary> |
| 34 | 22 | | public ETag ETag => _rawStorageDirectoryInfo.ETag; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Returns the date and time the directory was last modified. Any operation that modifies the directory or |
| | 26 | | /// its properties updates the last modified time. Operations on files do not affect the last modified time of t |
| | 27 | | /// </summary> |
| 10 | 28 | | public DateTimeOffset LastModified => _rawStorageDirectoryInfo.LastModified; |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// The directory's SMB properties. |
| | 32 | | /// </summary> |
| 367 | 33 | | public FileSmbProperties SmbProperties { get; set; } |
| | 34 | |
|
| 339 | 35 | | internal ShareDirectoryInfo(RawStorageDirectoryInfo rawStorageDirectoryInfo) |
| | 36 | | { |
| 339 | 37 | | _rawStorageDirectoryInfo = rawStorageDirectoryInfo; |
| 339 | 38 | | SmbProperties = new FileSmbProperties(rawStorageDirectoryInfo); |
| 339 | 39 | | } |
| | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// FilesModelFactory provides utilities for mocking. |
| | 44 | | /// </summary> |
| | 45 | | public static partial class SharesModelFactory |
| | 46 | | { |
| | 47 | | /// <summary> |
| | 48 | | /// Creates a new StorageDirectoryInfo instance for mocking. |
| | 49 | | /// </summary> |
| | 50 | | public static ShareDirectoryInfo StorageDirectoryInfo( |
| | 51 | | ETag eTag, |
| | 52 | | DateTimeOffset lastModified, |
| | 53 | | string filePermissionKey, |
| | 54 | | string fileAttributes, |
| | 55 | | DateTimeOffset fileCreationTime, |
| | 56 | | DateTimeOffset fileLastWriteTime, |
| | 57 | | DateTimeOffset fileChangeTime, |
| | 58 | | string fileId, |
| | 59 | | string fileParentId |
| | 60 | | ) |
| | 61 | | => new ShareDirectoryInfo(new RawStorageDirectoryInfo |
| | 62 | | { |
| | 63 | | ETag = eTag, |
| | 64 | | LastModified = lastModified, |
| | 65 | | FilePermissionKey = filePermissionKey, |
| | 66 | | FileAttributes = fileAttributes, |
| | 67 | | FileCreationTime = fileCreationTime, |
| | 68 | | FileLastWriteTime = fileLastWriteTime, |
| | 69 | | FileChangeTime = fileChangeTime, |
| | 70 | | FileId = fileId, |
| | 71 | | FileParentId = fileParentId |
| | 72 | | }); |
| | 73 | | } |
| | 74 | | } |