< Summary

Class:Azure.ResourceManager.Storage.FileServicesOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\FileServicesOperations.cs
Covered lines:24
Uncovered lines:26
Coverable lines:50
Total lines:156
Line coverage:48% (24 of 50)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
ListAsync()-0%100%
List(...)-0%100%
SetServicePropertiesAsync()-57.14%100%
SetServiceProperties(...)-57.14%100%
GetServicePropertiesAsync()-57.14%100%
GetServiceProperties(...)-57.14%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\FileServicesOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core.Pipeline;
 13using Azure.ResourceManager.Storage.Models;
 14
 15namespace Azure.ResourceManager.Storage
 16{
 17    /// <summary> The FileServices service client. </summary>
 18    public partial class FileServicesOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 1222        internal FileServicesRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of FileServicesOperations for mocking. </summary>
 24024        protected FileServicesOperations()
 25        {
 24026        }
 27        /// <summary> Initializes a new instance of FileServicesOperations. </summary>
 28        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 29        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 30        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 31        /// <param name="endpoint"> server parameter. </param>
 32        /// <param name="apiVersion"> Api Version. </param>
 24033        internal FileServicesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI
 34        {
 24035            RestClient = new FileServicesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersio
 24036            _clientDiagnostics = clientDiagnostics;
 24037            _pipeline = pipeline;
 24038        }
 39
 40        /// <summary> List all file services in storage accounts. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 42        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<FileServiceItems>> ListAsync(string resourceGroupName, string accountName, Ca
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.List");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(fals
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> List all file services in storage accounts. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 61        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<FileServiceItems> List(string resourceGroupName, string accountName, CancellationToken c
 64        {
 065            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.List");
 066            scope.Start();
 67            try
 68            {
 069                return RestClient.List(resourceGroupName, accountName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 076        }
 77
 78        /// <summary> Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sh
 79        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 80        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 81        /// <param name="parameters"> The properties of file services in storage accounts, including CORS (Cross-Origin 
 82        /// <param name="cancellationToken"> The cancellation token to use. </param>
 83        public virtual async Task<Response<FileServiceProperties>> SetServicePropertiesAsync(string resourceGroupName, s
 84        {
 285            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.SetServiceProperties");
 286            scope.Start();
 87            try
 88            {
 289                return await RestClient.SetServicePropertiesAsync(resourceGroupName, accountName, parameters, cancellati
 90            }
 091            catch (Exception e)
 92            {
 093                scope.Failed(e);
 094                throw;
 95            }
 296        }
 97
 98        /// <summary> Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sh
 99        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 100        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 101        /// <param name="parameters"> The properties of file services in storage accounts, including CORS (Cross-Origin 
 102        /// <param name="cancellationToken"> The cancellation token to use. </param>
 103        public virtual Response<FileServiceProperties> SetServiceProperties(string resourceGroupName, string accountName
 104        {
 2105            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.SetServiceProperties");
 2106            scope.Start();
 107            try
 108            {
 2109                return RestClient.SetServiceProperties(resourceGroupName, accountName, parameters, cancellationToken);
 110            }
 0111            catch (Exception e)
 112            {
 0113                scope.Failed(e);
 0114                throw;
 115            }
 2116        }
 117
 118        /// <summary> Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sh
 119        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 120        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 121        /// <param name="cancellationToken"> The cancellation token to use. </param>
 122        public virtual async Task<Response<FileServiceProperties>> GetServicePropertiesAsync(string resourceGroupName, s
 123        {
 4124            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.GetServiceProperties");
 4125            scope.Start();
 126            try
 127            {
 4128                return await RestClient.GetServicePropertiesAsync(resourceGroupName, accountName, cancellationToken).Con
 129            }
 0130            catch (Exception e)
 131            {
 0132                scope.Failed(e);
 0133                throw;
 134            }
 4135        }
 136
 137        /// <summary> Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sh
 138        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 139        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 140        /// <param name="cancellationToken"> The cancellation token to use. </param>
 141        public virtual Response<FileServiceProperties> GetServiceProperties(string resourceGroupName, string accountName
 142        {
 4143            using var scope = _clientDiagnostics.CreateScope("FileServicesOperations.GetServiceProperties");
 4144            scope.Start();
 145            try
 146            {
 4147                return RestClient.GetServiceProperties(resourceGroupName, accountName, cancellationToken);
 148            }
 0149            catch (Exception e)
 150            {
 0151                scope.Failed(e);
 0152                throw;
 153            }
 4154        }
 155    }
 156}