< Summary

Class:Azure.Storage.Files.Shares.ShareClientOptions
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\ShareClientOptions.cs
Covered lines:75
Uncovered lines:1
Coverable lines:76
Total lines:155
Line coverage:98.6% (75 of 76)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Version()-100%100%
.ctor(...)-87.5%50%
AddHeadersAndQueryParameters()-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Azure.Core;
 5
 6namespace Azure.Storage.Files.Shares
 7{
 8    /// <summary>
 9    /// Provides the client configuration options for connecting to Azure File
 10    /// Storage.
 11    /// </summary>
 12    public class ShareClientOptions : ClientOptions
 13    {
 14        /// <summary>
 15        /// The Latest service version supported by this client library.
 16        /// </summary>
 17        internal const ServiceVersion LatestVersion = StorageVersionExtensions.LatestVersion;
 18
 19        /// <summary>
 20        /// The versions of Azure File Storage supported by this client
 21        /// library.  For more, see
 22        /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-servic
 23        /// Versioning for the Azure Storage services</see>.
 24        /// </summary>
 25        public enum ServiceVersion
 26        {
 27#pragma warning disable CA1707 // Identifiers should not contain underscores
 28            /// <summary>
 29            /// The 2019-02-02 service version described at
 30            /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/version-2019-02-02">
 31            /// Version 2019-02-02</see>
 32            /// </summary>
 33            V2019_02_02 = 1,
 34
 35            /// <summary>
 36            /// The 2019-07-07 service version described at
 37            /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/version-2019-07-07">
 38            /// Version 2019-07-07</see>
 39            /// </summary>
 40            V2019_07_07 = 2,
 41
 42            /// <summary>
 43            /// The 2019-12-12 service version.
 44            /// </summary>
 45            V2019_12_12 = 3
 46#pragma warning restore CA1707 // Identifiers should not contain underscores
 47        }
 48
 49        /// <summary>
 50        /// Gets the <see cref="ServiceVersion"/> of the service API used when
 51        /// making requests.  For more, see
 52        /// <see href="https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-servic
 53        /// Versioning for the Azure Storage services</see>.
 54        /// </summary>
 61755        public ServiceVersion Version { get; }
 56
 57        /// <summary>
 58        /// Initializes a new instance of the <see cref="ShareClientOptions"/>
 59        /// class.
 60        /// </summary>
 61        /// <param name="version">
 62        /// The <see cref="ServiceVersion"/> of the service API used when
 63        /// making requests.
 64        /// </param>
 61765        public ShareClientOptions(ServiceVersion version = LatestVersion)
 66        {
 61767            if (ServiceVersion.V2019_02_02 <= version
 61768                && version <= LatestVersion)
 69            {
 61770                Version = version;
 71            }
 72            else
 73            {
 074                throw Errors.VersionNotSupported(nameof(version));
 75            }
 76
 61777            this.Initialize();
 61778            AddHeadersAndQueryParameters();
 61779        }
 80
 81        /// <summary>
 82        /// Add headers and query parameters in <see cref="DiagnosticsOptions.LoggedHeaderNames"/> and <see cref="Diagno
 83        /// </summary>
 84        private void AddHeadersAndQueryParameters()
 85        {
 61786            Diagnostics.LoggedHeaderNames.Add("Access-Control-Allow-Origin");
 61787            Diagnostics.LoggedHeaderNames.Add("Transfer-Encoding");
 61788            Diagnostics.LoggedHeaderNames.Add("x-ms-date");
 61789            Diagnostics.LoggedHeaderNames.Add("x-ms-error-code");
 61790            Diagnostics.LoggedHeaderNames.Add("x-ms-request-id");
 61791            Diagnostics.LoggedHeaderNames.Add("x-ms-version");
 61792            Diagnostics.LoggedHeaderNames.Add("Accept-Ranges");
 61793            Diagnostics.LoggedHeaderNames.Add("Content-Disposition");
 61794            Diagnostics.LoggedHeaderNames.Add("Content-Encoding");
 61795            Diagnostics.LoggedHeaderNames.Add("Content-Language");
 61796            Diagnostics.LoggedHeaderNames.Add("Content-MD5");
 61797            Diagnostics.LoggedHeaderNames.Add("Content-Range");
 61798            Diagnostics.LoggedHeaderNames.Add("Vary");
 61799            Diagnostics.LoggedHeaderNames.Add("x-ms-content-crc64");
 617100            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-action");
 617101            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-completion-time");
 617102            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-id");
 617103            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-progress");
 617104            Diagnostics.LoggedHeaderNames.Add("x-ms-copy-status");
 617105            Diagnostics.LoggedHeaderNames.Add("x-ms-has-immutability-policy");
 617106            Diagnostics.LoggedHeaderNames.Add("x-ms-has-legal-hold");
 617107            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-state");
 617108            Diagnostics.LoggedHeaderNames.Add("x-ms-lease-status");
 617109            Diagnostics.LoggedHeaderNames.Add("x-ms-range");
 617110            Diagnostics.LoggedHeaderNames.Add("x-ms-request-server-encrypted");
 617111            Diagnostics.LoggedHeaderNames.Add("x-ms-server-encrypted");
 617112            Diagnostics.LoggedHeaderNames.Add("x-ms-snapshot");
 617113            Diagnostics.LoggedHeaderNames.Add("x-ms-source-range");
 617114            Diagnostics.LoggedHeaderNames.Add("x-ms-cache-control");
 617115            Diagnostics.LoggedHeaderNames.Add("x-ms-content-disposition");
 617116            Diagnostics.LoggedHeaderNames.Add("x-ms-content-encoding");
 617117            Diagnostics.LoggedHeaderNames.Add("x-ms-content-language");
 617118            Diagnostics.LoggedHeaderNames.Add("x-ms-content-length");
 617119            Diagnostics.LoggedHeaderNames.Add("x-ms-content-md5");
 617120            Diagnostics.LoggedHeaderNames.Add("x-ms-content-type");
 617121            Diagnostics.LoggedHeaderNames.Add("x-ms-file-attributes");
 617122            Diagnostics.LoggedHeaderNames.Add("x-ms-file-change-time");
 617123            Diagnostics.LoggedHeaderNames.Add("x-ms-file-creation-time");
 617124            Diagnostics.LoggedHeaderNames.Add("x-ms-file-id");
 617125            Diagnostics.LoggedHeaderNames.Add("x-ms-file-last-write-time");
 617126            Diagnostics.LoggedHeaderNames.Add("x-ms-file-parent-id");
 617127            Diagnostics.LoggedHeaderNames.Add("x-ms-handle-id");
 617128            Diagnostics.LoggedHeaderNames.Add("x-ms-number-of-handles-closed");
 617129            Diagnostics.LoggedHeaderNames.Add("x-ms-recursive");
 617130            Diagnostics.LoggedHeaderNames.Add("x-ms-share-quota");
 617131            Diagnostics.LoggedHeaderNames.Add("x-ms-type");
 617132            Diagnostics.LoggedHeaderNames.Add("x-ms-write");
 133
 617134            Diagnostics.LoggedQueryParameters.Add("comp");
 617135            Diagnostics.LoggedQueryParameters.Add("maxresults");
 617136            Diagnostics.LoggedQueryParameters.Add("rscc");
 617137            Diagnostics.LoggedQueryParameters.Add("rscd");
 617138            Diagnostics.LoggedQueryParameters.Add("rsce");
 617139            Diagnostics.LoggedQueryParameters.Add("rscl");
 617140            Diagnostics.LoggedQueryParameters.Add("rsct");
 617141            Diagnostics.LoggedQueryParameters.Add("se");
 617142            Diagnostics.LoggedQueryParameters.Add("si");
 617143            Diagnostics.LoggedQueryParameters.Add("sip");
 617144            Diagnostics.LoggedQueryParameters.Add("sp");
 617145            Diagnostics.LoggedQueryParameters.Add("spr");
 617146            Diagnostics.LoggedQueryParameters.Add("sr");
 617147            Diagnostics.LoggedQueryParameters.Add("srt");
 617148            Diagnostics.LoggedQueryParameters.Add("ss");
 617149            Diagnostics.LoggedQueryParameters.Add("st");
 617150            Diagnostics.LoggedQueryParameters.Add("sv");
 617151            Diagnostics.LoggedQueryParameters.Add("copyid");
 617152            Diagnostics.LoggedQueryParameters.Add("restype");
 617153        }
 154    }
 155}