< Summary

Class:Azure.Storage.Files.Shares.Models.FilesModelFactory
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryProperties.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileDownloadDetails.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileDownloadInfo.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileInfo.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileItem.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileProperties.cs
Covered lines:33
Uncovered lines:77
Coverable lines:110
Total lines:752
Line coverage:30% (33 of 110)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
StorageDirectoryProperties(...)-0%100%
StorageFileDownloadProperties(...)-0%100%
StorageFileDownloadInfo(...)-100%100%
StorageFileInfo(...)-0%100%
StorageFileItem(...)-0%100%
StorageFileProperties(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryProperties.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Text;
 7
 8#pragma warning disable SA1402  // File may only contain a single type
 9
 10namespace Azure.Storage.Files.Shares.Models
 11{
 12    /// <summary>
 13    /// Properites for a directory.
 14    /// </summary>
 15    public class ShareDirectoryProperties
 16    {
 17        /// <summary>
 18        /// The internal RawStorageDirectoryProperties
 19        /// </summary>
 20        internal RawStorageDirectoryProperties _rawStorageDirectoryProperties;
 21
 22        /// <summary>
 23        /// A set of name-value pairs that contain metadata for the directory.
 24        /// </summary>
 25        public IDictionary<string, string> Metadata => _rawStorageDirectoryProperties.Metadata;
 26
 27        /// <summary>
 28        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 29        /// </summary>
 30        public ETag ETag => _rawStorageDirectoryProperties.ETag;
 31
 32        /// <summary>
 33        /// Returns DateTimeOffest the directory was last modified. Operations on files within the directory
 34        /// do not affect the last modified time of the directory.
 35        /// </summary>
 36        public DateTimeOffset LastModified => _rawStorageDirectoryProperties.LastModified;
 37
 38        /// <summary>
 39        /// Set to true if the directory metadata is completely encrypted using the specified algorithm.
 40        /// Otherwise, the value is set to false.
 41        /// </summary>
 42        public bool IsServerEncrypted => _rawStorageDirectoryProperties.IsServerEncrypted;
 43
 44        /// <summary>
 45        /// The SMB properties for the directory.
 46        /// </summary>
 47        public FileSmbProperties SmbProperties { get; set; }
 48
 49        internal ShareDirectoryProperties(RawStorageDirectoryProperties rawStorageDirectoryProperties)
 50        {
 51            _rawStorageDirectoryProperties = rawStorageDirectoryProperties;
 52            SmbProperties = new FileSmbProperties(rawStorageDirectoryProperties);
 53        }
 54    }
 55
 56    /// <summary>
 57    /// FilesModelFactory provides utilities for mocking.
 58    /// </summary>
 59    public static partial class FilesModelFactory
 60    {
 61        /// <summary>
 62        /// Creates a new StorageDirectoryProperties instance for mocking.
 63        /// </summary>
 64        public static ShareDirectoryProperties StorageDirectoryProperties(
 65                IDictionary<string, string> metadata,
 66                ETag eTag,
 67                DateTimeOffset lastModified,
 68                bool isServerEncrypted,
 69                string fileAttributes,
 70                DateTimeOffset fileCreationTime,
 71                DateTimeOffset fileLastWriteTime,
 72                DateTimeOffset fileChangeTime,
 73                string filePermissionKey,
 74                string fileId,
 75                string fileParentId
 76            )
 077            => new ShareDirectoryProperties(new RawStorageDirectoryProperties()
 078            {
 079                Metadata = metadata,
 080                ETag = eTag,
 081                LastModified = lastModified,
 082                IsServerEncrypted = isServerEncrypted,
 083                FileAttributes = fileAttributes,
 084                FileCreationTime = fileCreationTime,
 085                FileLastWriteTime = fileLastWriteTime,
 086                FileChangeTime = fileChangeTime,
 087                FilePermissionKey = filePermissionKey,
 088                FileId = fileId,
 089                FileParentId = fileParentId
 090            });
 91    }
 92}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileDownloadDetails.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7#pragma warning disable SA1402  // File may only contain a single type
 8
 9namespace Azure.Storage.Files.Shares.Models
 10{
 11    /// <summary>
 12    /// Details returned when downloading a File
 13    /// </summary>
 14    public partial class ShareFileDownloadDetails
 15    {
 16        /// <summary>
 17        /// Internal flattened property representation
 18        /// </summary>
 19        internal FlattenedStorageFileProperties _flattened;
 20
 21        /// <summary>
 22        /// Returns the date and time the file was last modified. Any operation that modifies the file or its properties
 23        /// </summary>
 24        public DateTimeOffset LastModified => _flattened.LastModified;
 25
 26        /// <summary>
 27        /// A set of name-value pairs associated with this file as user-defined metadata.
 28        /// </summary>
 29        public IDictionary<string, string> Metadata => _flattened.Metadata;
 30
 31        /// <summary>
 32        /// Indicates the range of bytes returned if the client requested a subset of the file by setting the Range requ
 33        /// </summary>
 34        public string ContentRange => _flattened.ContentRange;
 35
 36        /// <summary>
 37        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 38        /// </summary>
 39        public ETag ETag => _flattened.ETag;
 40
 41        /// <summary>
 42        /// Returns the value that was specified for the Content-Encoding request header.
 43        /// </summary>
 44        public IEnumerable<string> ContentEncoding => _flattened.ContentEncoding;
 45
 46        /// <summary>
 47        /// Returned if it was previously specified for the file.
 48        /// </summary>
 49        public string CacheControl => _flattened.CacheControl;
 50
 51        /// <summary>
 52        /// Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process 
 53        /// </summary>
 54        public string ContentDisposition => _flattened.ContentDisposition;
 55
 56        /// <summary>
 57        /// Returns the value that was specified for the Content-Language request header.
 58        /// </summary>
 59        public IEnumerable<string> ContentLanguage => _flattened.ContentLanguage;
 60
 61        /// <summary>
 62        /// Indicates that the service supports requests for partial file content.
 63        /// </summary>
 64        public string AcceptRanges => _flattened.AcceptRanges;
 65
 66        /// <summary>
 67        /// Conclusion time of the last attempted Copy File operation where this file was the destination file. This val
 68        /// </summary>
 69        public DateTimeOffset CopyCompletedOn => _flattened.CopyCompletionTime;
 70
 71        /// <summary>
 72        /// Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal copy operatio
 73        /// </summary>
 74        public string CopyStatusDescription => _flattened.CopyStatusDescription;
 75
 76        /// <summary>
 77        /// String identifier for the last attempted Copy File operation where this file was the destination file.
 78        /// </summary>
 79        public string CopyId => _flattened.CopyId;
 80
 81        /// <summary>
 82        /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy File operat
 83        /// </summary>
 84        public string CopyProgress => _flattened.CopyProgress;
 85
 86        /// <summary>
 87        /// URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where 
 88        /// </summary>
 89        public Uri CopySource => _flattened.CopySource;
 90
 91        /// <summary>
 92        /// State of the copy operation identified by 'x-ms-copy-id'.
 93        /// </summary>
 94        public CopyStatus CopyStatus => _flattened.CopyStatus;
 95
 96        /// <summary>
 97        /// If the file has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header
 98        /// </summary>
 99#pragma warning disable CA1819 // Properties should not return arrays
 100        public byte[] FileContentHash => _flattened.FileContentHash;
 101#pragma warning restore CA1819 // Properties should not return arrays
 102
 103        /// <summary>
 104        /// The value of this header is set to true if the file data and application metadata are completely encrypted u
 105        /// </summary>
 106        public bool IsServerEncrypted => _flattened.IsServerEncrypted;
 107
 108
 109        /// <summary>
 110        /// When a file is leased, specifies whether the lease is of infinite or fixed duration.
 111        /// </summary>
 112        public ShareLeaseDuration LeaseDuration => _flattened.LeaseDuration;
 113
 114        /// <summary>
 115        /// Lease state of the file.
 116        /// </summary>
 117        public ShareLeaseState LeaseState => _flattened.LeaseState;
 118
 119        /// <summary>
 120        /// The current lease status of the file.
 121        /// </summary>
 122        public ShareLeaseStatus LeaseStatus => _flattened.LeaseStatus;
 123
 124        /// <summary>
 125        /// The SMB properties for the file
 126        /// </summary>
 127        public FileSmbProperties SmbProperties { get; set; }
 128
 129        internal ShareFileDownloadDetails(FlattenedStorageFileProperties flattened)
 130        {
 131            _flattened = flattened;
 132            SmbProperties = new FileSmbProperties(flattened);
 133        }
 134    }
 135
 136    /// <summary>
 137    /// FilesModelFactory provides utilities for mocking.
 138    /// </summary>
 139    public static partial class FilesModelFactory
 140    {
 141        /// <summary>
 142        /// Creates a new StorageFileDownloadProperties instance for mocking.
 143        /// </summary>
 144        public static ShareFileDownloadDetails StorageFileDownloadProperties(
 145            DateTimeOffset lastModified,
 146            IDictionary<string, string> metadata,
 147            string contentType,
 148            string contentRange,
 149            ETag eTag,
 150            IEnumerable<string> contentEncoding,
 151            string cacheControl,
 152            string contentDisposition,
 153            IEnumerable<string> contentLanguage,
 154            string acceptRanges,
 155            DateTimeOffset copyCompletedOn,
 156            string copyStatusDescription,
 157            string copyId,
 158            string copyProgress,
 159            Uri copySource,
 160            CopyStatus copyStatus,
 161            byte[] fileContentHash,
 162            bool isServiceEncrypted)
 163        {
 0164            var flattened = new FlattenedStorageFileProperties()
 0165            {
 0166                LastModified = lastModified,
 0167                Metadata = metadata,
 0168                ContentType = contentType,
 0169                ContentRange = contentRange,
 0170                ETag = eTag,
 0171                ContentEncoding = contentEncoding,
 0172                CacheControl = cacheControl,
 0173                ContentDisposition = contentDisposition,
 0174                ContentLanguage = contentLanguage,
 0175                AcceptRanges = acceptRanges,
 0176                CopyCompletionTime = copyCompletedOn,
 0177                CopyStatusDescription = copyStatusDescription,
 0178                CopyId = copyId,
 0179                CopyProgress = copyProgress,
 0180                CopySource = copySource,
 0181                CopyStatus = copyStatus,
 0182                FileContentHash = fileContentHash,
 0183                IsServerEncrypted = isServiceEncrypted
 0184            };
 0185            return new ShareFileDownloadDetails(flattened);
 186        }
 187    }
 188}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileDownloadInfo.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.IO;
 7using System.Text;
 8using Azure.Storage.Shared;
 9
 10#pragma warning disable SA1402  // File may only contain a single type
 11
 12namespace Azure.Storage.Files.Shares.Models
 13{
 14    /// <summary>
 15    /// The properties and content returned from downloading a file
 16    /// </summary>
 17    public partial class ShareFileDownloadInfo : IDisposable, IDownloadedContent
 18    {
 19        /// <summary>
 20        /// Internal flattened property representation
 21        /// </summary>
 22        internal FlattenedStorageFileProperties _flattened;
 23
 24        /// <summary>
 25        /// The number of bytes present in the response body.
 26        /// </summary>
 27        public long ContentLength => _flattened.ContentLength;
 28
 29        /// <summary>
 30        /// Content
 31        /// </summary>
 32        public Stream Content => _flattened.Content;
 33
 34        /// <summary>
 35        /// The content type specified for the file. The default content type is 'application/octet-stream'
 36        /// </summary>
 37        public string ContentType => _flattened.ContentType;
 38
 39        /// <summary>
 40        /// If the file has an MD5 hash and this operation is to read the full content, this response header is returned
 41        /// </summary>
 42#pragma warning disable CA1819 // Properties should not return arrays
 43        public byte[] ContentHash => _flattened.ContentHash;
 44#pragma warning restore CA1819 // Properties should not return arrays
 45
 46        /// <summary>
 47        /// Details returned when downloading a file
 48        /// </summary>
 49        public ShareFileDownloadDetails Details { get; private set; }
 50
 51        /// <summary>
 52        /// Creates a new StorageFileDownloadInfo backed by FlattenedStorageFileProperties
 53        /// </summary>
 54        /// <param name="flattened">The FlattenedStorageFileProperties returned with the request</param>
 55        internal ShareFileDownloadInfo(FlattenedStorageFileProperties flattened)
 56        {
 57            _flattened = flattened;
 58            Details = new ShareFileDownloadDetails(flattened);
 59        }
 60
 61        /// <summary>
 62        /// Disposes the StorageFileDownloadInfo by calling Dispose on the underlying Content stream.
 63        /// </summary>
 64        public void Dispose()
 65        {
 66            Content?.Dispose();
 67            GC.SuppressFinalize(this);
 68        }
 69    }
 70    /// <summary>
 71    /// FilesModelFactory provides utilities for mocking.
 72    /// </summary>
 73    public static partial class FilesModelFactory
 74    {
 75        /// <summary>
 76        /// Creates a new StorageFileDownloadInfo instance for mocking.
 77        /// </summary>
 78        public static ShareFileDownloadInfo StorageFileDownloadInfo(
 79            System.DateTimeOffset lastModified = default,
 80            System.Collections.Generic.IEnumerable<string> contentLanguage = default,
 81            string acceptRanges = default,
 82            System.DateTimeOffset copyCompletionTime = default,
 83            string copyStatusDescription = default,
 84            string contentDisposition = default,
 85            string copyProgress = default,
 86            System.Uri copySource = default,
 87            Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = default,
 88            byte[] fileContentHash = default,
 89            bool isServerEncrypted = default,
 90            string cacheControl = default,
 91            string fileAttributes = default,
 92            System.Collections.Generic.IEnumerable<string> contentEncoding = default,
 93            System.DateTimeOffset fileCreationTime = default,
 94            byte[] contentHash = default,
 95            System.DateTimeOffset fileLastWriteTime = default,
 96            ETag eTag = default,
 97            System.DateTimeOffset fileChangeTime = default,
 98            string contentRange = default,
 99            string filePermissionKey = default,
 100            string contentType = default,
 101            string fileId = default,
 102            long contentLength = default,
 103            string fileParentId = default,
 104            System.Collections.Generic.IDictionary<string, string> metadata = default,
 105            System.IO.Stream content = default,
 106            string copyId = default)
 107        {
 1108            return new ShareFileDownloadInfo(
 1109                new FlattenedStorageFileProperties()
 1110                {
 1111                    LastModified = lastModified,
 1112                    ContentLanguage = contentLanguage,
 1113                    AcceptRanges = acceptRanges,
 1114                    CopyCompletionTime = copyCompletionTime,
 1115                    CopyStatusDescription = copyStatusDescription,
 1116                    ContentDisposition = contentDisposition,
 1117                    CopyProgress = copyProgress,
 1118                    CopySource = copySource,
 1119                    CopyStatus = copyStatus,
 1120                    FileContentHash = fileContentHash,
 1121                    IsServerEncrypted = isServerEncrypted,
 1122                    CacheControl = cacheControl,
 1123                    FileAttributes = fileAttributes,
 1124                    ContentEncoding = contentEncoding,
 1125                    FileCreationTime = fileCreationTime,
 1126                    ContentHash = contentHash,
 1127                    FileLastWriteTime = fileLastWriteTime,
 1128                    ETag = eTag,
 1129                    FileChangeTime = fileChangeTime,
 1130                    ContentRange = contentRange,
 1131                    FilePermissionKey = filePermissionKey,
 1132                    ContentType = contentType,
 1133                    FileId = fileId,
 1134                    ContentLength = contentLength,
 1135                    FileParentId = fileParentId,
 1136                    Metadata = metadata,
 1137                    Content = content,
 1138                    CopyId = copyId,
 1139                }
 1140            );
 141        }
 142    }
 143}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileInfo.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Text;
 7
 8#pragma warning disable SA1402  // File may only contain a single type
 9
 10namespace Azure.Storage.Files.Shares.Models
 11{
 12    /// <summary>
 13    /// Subset of the file's properties.
 14    /// </summary>
 15    public class ShareFileInfo
 16    {
 17        /// <summary>
 18        /// The internal RawStorageFileInfo.
 19        /// </summary>
 20        internal RawStorageFileInfo _rawStorageFileInfo;
 21
 22        /// <summary>
 23        /// The ETag contains a value which represents the version of the file, in quotes.
 24        /// </summary>
 25        public ETag ETag => _rawStorageFileInfo.ETag;
 26
 27        /// <summary>
 28        /// Returns the date and time the file was last modified.
 29        /// </summary>
 30        public DateTimeOffset LastModified => _rawStorageFileInfo.LastModified;
 31
 32        /// <summary>
 33        /// The value of this header is set to true if the contents of the request are successfully encrypted using the 
 34        /// </summary>
 35        public bool IsServerEncrypted => _rawStorageFileInfo.IsServerEncrypted;
 36
 37        /// <summary>
 38        /// The file's SMB properties.
 39        /// </summary>
 40        public FileSmbProperties SmbProperties { get; set; }
 41
 42        internal ShareFileInfo(RawStorageFileInfo rawStorageFileInfo)
 43        {
 44            _rawStorageFileInfo = rawStorageFileInfo;
 45            SmbProperties = new FileSmbProperties(rawStorageFileInfo);
 46        }
 47    }
 48
 49    /// <summary>
 50    /// FilesModelFactory provides utilities for mocking.
 51    /// </summary>
 52    public static partial class FilesModelFactory
 53    {
 54        /// <summary>
 55        /// Creates a new StorageFileInfo instance for mocking.
 56        /// </summary>
 57        public static ShareFileInfo StorageFileInfo(
 58            ETag eTag,
 59            DateTimeOffset lastModified,
 60            bool isServerEncrypted,
 61            string filePermissionKey,
 62            string fileAttributes,
 63            DateTimeOffset fileCreationTime,
 64            DateTimeOffset fileLastWriteTime,
 65            DateTimeOffset fileChangeTime,
 66            string fileId,
 67            string fileParentId
 68            )
 069            => new ShareFileInfo(new RawStorageFileInfo()
 070            {
 071                ETag = eTag,
 072                LastModified = lastModified,
 073                IsServerEncrypted = isServerEncrypted,
 074                FilePermissionKey = filePermissionKey,
 075                FileAttributes = fileAttributes,
 076                FileCreationTime = fileCreationTime,
 077                FileLastWriteTime = fileLastWriteTime,
 078                FileChangeTime = fileChangeTime,
 079                FileId = fileId,
 080                FileParentId = fileParentId
 081            });
 82    }
 83}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileItem.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4#pragma warning disable SA1402  // File may only contain a single type
 5
 6namespace Azure.Storage.Files.Shares.Models
 7{
 8    /// <summary>
 9    /// Describes a file or directory returned by
 10    /// <see cref="ShareDirectoryClient.GetFilesAndDirectoriesAsync"/>.
 11    /// </summary>
 12    public class ShareFileItem
 13    {
 14        /// <summary>
 15        /// Gets a value indicating whether this item is a directory.
 16        /// </summary>
 17        public bool IsDirectory { get; }
 18
 19        /// <summary>
 20        /// Gets the name of this item.
 21        /// </summary>
 22        public string Name { get; }
 23
 24        /// <summary>
 25        /// Gets an optional value indicating the file size, if this item is
 26        /// a file.
 27        /// </summary>
 28        public long? FileSize { get; }
 29
 30        internal ShareFileItem(bool isDirectory, string name, long? fileSize = null)
 31        {
 32            IsDirectory = isDirectory;
 33            Name = name;
 34            FileSize = fileSize;
 35        }
 36    }
 37
 38    /// <summary>
 39    /// FilesModelFactory provides utilities for mocking.
 40    /// </summary>
 41    public static partial class FilesModelFactory
 42    {
 43        /// <summary>
 44        /// Creates a new StorageFileItem instance for mocking.
 45        /// </summary>
 46        public static ShareFileItem StorageFileItem(
 47            bool isDirectory, string name, long? fileSize) =>
 048            new ShareFileItem(isDirectory, name, fileSize);
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileProperties.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7#pragma warning disable SA1402  // File may only contain a single type
 8
 9namespace Azure.Storage.Files.Shares.Models
 10{
 11    /// <summary>
 12    /// Properties for a file.
 13    /// </summary>
 14    public class ShareFileProperties
 15    {
 16        /// <summary>
 17        /// The internal RawStorageFileProperties
 18        /// </summary>
 19        internal RawStorageFileProperties _rawStorageFileProperties;
 20
 21        /// <summary>
 22        /// The DateTimeOffset when the file was last modified.
 23        /// </summary>
 24        public DateTimeOffset LastModified => _rawStorageFileProperties.LastModified;
 25
 26        /// <summary>
 27        /// A set of name-value pairs associated with this file as user-defined metadata.
 28        /// </summary>
 29        public IDictionary<string, string> Metadata => _rawStorageFileProperties.Metadata;
 30
 31        /// <summary>
 32        /// The size of the file in bytes.
 33        /// </summary>
 34        public long ContentLength => _rawStorageFileProperties.ContentLength;
 35
 36        /// <summary>
 37        /// The content type specified for the file. The default content type is 'application/octet-stream'
 38        /// </summary>
 39        public string ContentType => _rawStorageFileProperties.ContentType;
 40
 41        /// <summary>
 42        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 43        /// </summary>
 44        public ETag ETag => _rawStorageFileProperties.ETag;
 45
 46        /// <summary>
 47        /// If the Content-MD5 header has been set for the file, the Content-MD5 response header is returned so that the
 48        /// </summary>
 49#pragma warning disable CA1819 // Properties should not return arrays
 50        public byte[] ContentHash => _rawStorageFileProperties.ContentHash;
 51#pragma warning restore CA1819 // Properties should not return arrays
 52
 53        /// <summary>
 54        /// If the Content-Encoding request header has previously been set for the file, the Content-Encoding value is r
 55        /// </summary>
 56        public IEnumerable<string> ContentEncoding => _rawStorageFileProperties.ContentEncoding;
 57
 58        /// <summary>
 59        /// If the Cache-Control request header has previously been set for the file, the Cache-Control value is returne
 60        /// </summary>
 61        public string CacheControl => _rawStorageFileProperties.CacheControl;
 62
 63        /// <summary>
 64        /// Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process 
 65        /// </summary>
 66        public string ContentDisposition => _rawStorageFileProperties.ContentDisposition;
 67
 68        /// <summary>
 69        /// Returns the value that was specified for the Content-Language request header.
 70        /// </summary>
 71        public IEnumerable<string> ContentLanguage => _rawStorageFileProperties.ContentLanguage;
 72
 73        /// <summary>
 74        /// Conclusion time of the last attempted Copy File operation where this file was the destination file. This val
 75        /// </summary>
 76        public DateTimeOffset CopyCompletedOn => _rawStorageFileProperties.CopyCompletionTime;
 77
 78        /// <summary>
 79        /// Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal copy operatio
 80        /// </summary>
 81        public string CopyStatusDescription => _rawStorageFileProperties.CopyStatusDescription;
 82
 83        /// <summary>
 84        /// String identifier for the last attempted Copy File operation where this file was the destination file.
 85        /// </summary>
 86        public string CopyId => _rawStorageFileProperties.CopyId;
 87
 88        /// <summary>
 89        /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy File operat
 90        /// </summary>
 91        public string CopyProgress => _rawStorageFileProperties.CopyProgress;
 92
 93        /// <summary>
 94        /// URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where 
 95        /// </summary>
 96        public string CopySource => _rawStorageFileProperties.CopySource;
 97
 98        /// <summary>
 99        /// State of the copy operation identified by 'x-ms-copy-id'.
 100        /// </summary>
 101        public CopyStatus CopyStatus => _rawStorageFileProperties.CopyStatus;
 102
 103        /// <summary>
 104        /// The value of this header is set to true if the file data and application metadata are completely encrypted u
 105        /// </summary>
 106        public bool IsServerEncrypted => _rawStorageFileProperties.IsServerEncrypted;
 107
 108        /// <summary>
 109        /// The SMB properties for the file
 110        /// </summary>
 111        public FileSmbProperties SmbProperties { get; set; }
 112
 113        /// <summary>
 114        /// When a file is leased, specifies whether the lease is of infinite or fixed duration.
 115        /// </summary>
 116        public ShareLeaseDuration LeaseDuration => _rawStorageFileProperties.LeaseDuration;
 117
 118        /// <summary>
 119        /// Lease state of the file.
 120        /// </summary>
 121        public ShareLeaseState LeaseState => _rawStorageFileProperties.LeaseState;
 122
 123        /// <summary>
 124        /// The current lease status of the file.
 125        /// </summary>
 126        public ShareLeaseStatus LeaseStatus => _rawStorageFileProperties.LeaseStatus;
 127
 128        internal ShareFileProperties(RawStorageFileProperties rawStorageFileProperties)
 129        {
 130            _rawStorageFileProperties = rawStorageFileProperties;
 131            SmbProperties = new FileSmbProperties(rawStorageFileProperties);
 132        }
 133    }
 134
 135    /// <summary>
 136    /// FilesModelFactory provides utilities for mocking.
 137    /// </summary>
 138    public static partial class FilesModelFactory
 139    {
 140        /// <summary>
 141        /// Creates a new StorageFileProperties instance for mocking.
 142        /// </summary>
 143        public static ShareFileProperties StorageFileProperties(
 144            DateTimeOffset lastModified,
 145            IDictionary<string, string> metadata,
 146            long contentLength,
 147            string contentType,
 148            ETag eTag,
 149            byte[] contentHash,
 150            IEnumerable<string> contentEncoding,
 151            string cacheControl,
 152            string contentDisposition,
 153            IEnumerable<string> contentLanguage,
 154            DateTimeOffset copyCompletedOn,
 155            string copyStatusDescription,
 156            string copyId,
 157            string copyProgress,
 158            string copySource,
 159            CopyStatus copyStatus,
 160            bool isServerEncrypted,
 161            string fileAttributes,
 162            DateTimeOffset fileCreationTime,
 163            DateTimeOffset fileLastWriteTime,
 164            DateTimeOffset fileChangeTime,
 165            string filePermissionKey,
 166            string fileId,
 167            string fileParentId
 0168            ) => new ShareFileProperties(new RawStorageFileProperties()
 0169            {
 0170                LastModified = lastModified,
 0171                Metadata = metadata,
 0172                ContentLength = contentLength,
 0173                ContentType = contentType,
 0174                ETag = eTag,
 0175                ContentHash = contentHash,
 0176                ContentEncoding = contentEncoding,
 0177                CacheControl = cacheControl,
 0178                ContentDisposition = contentDisposition,
 0179                ContentLanguage = contentLanguage,
 0180                CopyCompletionTime = copyCompletedOn,
 0181                CopyStatusDescription = copyStatusDescription,
 0182                CopyId = copyId,
 0183                CopyProgress = copyProgress,
 0184                CopySource = copySource,
 0185                CopyStatus = copyStatus,
 0186                IsServerEncrypted = isServerEncrypted,
 0187                FileAttributes = fileAttributes,
 0188                FilePermissionKey = filePermissionKey,
 0189                FileCreationTime = fileCreationTime,
 0190                FileLastWriteTime = fileLastWriteTime,
 0191                FileChangeTime = fileChangeTime,
 0192                FileId = fileId,
 0193                FileParentId = fileParentId
 0194            });
 195    }
 196}