< Summary

Class:Azure.ResourceManager.Storage.BlobServicesOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\BlobServicesOperations.cs
Covered lines:40
Uncovered lines:22
Coverable lines:62
Total lines:185
Line coverage:64.5% (40 of 62)
Covered branches:4
Total branches:8
Branch coverage:50% (4 of 8)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\BlobServicesOperations.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;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Storage.Models;
 15
 16namespace Azure.ResourceManager.Storage
 17{
 18    /// <summary> The BlobServices service client. </summary>
 19    public partial class BlobServicesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 5223        internal BlobServicesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of BlobServicesOperations for mocking. </summary>
 24025        protected BlobServicesOperations()
 26        {
 24027        }
 28        /// <summary> Initializes a new instance of BlobServicesOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 24034        internal BlobServicesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI
 35        {
 24036            RestClient = new BlobServicesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersio
 24037            _clientDiagnostics = clientDiagnostics;
 24038            _pipeline = pipeline;
 24039        }
 40
 41        /// <summary> Sets the properties of a storage account’s Blob service, including properties for Storage Analytic
 42        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 43        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 44        /// <param name="parameters"> The properties of a storage account’s Blob service, including properties for Stora
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<BlobServiceProperties>> SetServicePropertiesAsync(string resourceGroupName, s
 47        {
 848            using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.SetServiceProperties");
 849            scope.Start();
 50            try
 51            {
 852                return await RestClient.SetServicePropertiesAsync(resourceGroupName, accountName, parameters, cancellati
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 859        }
 60
 61        /// <summary> Sets the properties of a storage account’s Blob service, including properties for Storage Analytic
 62        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 63        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 64        /// <param name="parameters"> The properties of a storage account’s Blob service, including properties for Stora
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<BlobServiceProperties> SetServiceProperties(string resourceGroupName, string accountName
 67        {
 868            using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.SetServiceProperties");
 869            scope.Start();
 70            try
 71            {
 872                return RestClient.SetServiceProperties(resourceGroupName, accountName, parameters, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 879        }
 80
 81        /// <summary> Gets the properties of a storage account’s Blob service, including properties for Storage Analytic
 82        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 83        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual async Task<Response<BlobServiceProperties>> GetServicePropertiesAsync(string resourceGroupName, s
 86        {
 1687            using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.GetServiceProperties");
 1688            scope.Start();
 89            try
 90            {
 1691                return await RestClient.GetServicePropertiesAsync(resourceGroupName, accountName, cancellationToken).Con
 92            }
 093            catch (Exception e)
 94            {
 095                scope.Failed(e);
 096                throw;
 97            }
 1698        }
 99
 100        /// <summary> Gets the properties of a storage account’s Blob service, including properties for Storage Analytic
 101        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 102        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 103        /// <param name="cancellationToken"> The cancellation token to use. </param>
 104        public virtual Response<BlobServiceProperties> GetServiceProperties(string resourceGroupName, string accountName
 105        {
 16106            using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.GetServiceProperties");
 16107            scope.Start();
 108            try
 109            {
 16110                return RestClient.GetServiceProperties(resourceGroupName, accountName, cancellationToken);
 111            }
 0112            catch (Exception e)
 113            {
 0114                scope.Failed(e);
 0115                throw;
 116            }
 16117        }
 118
 119        /// <summary> List blob services of storage account. It returns a collection of one object named default. </summ
 120        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 121        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 122        /// <param name="cancellationToken"> The cancellation token to use. </param>
 123        public virtual AsyncPageable<BlobServiceProperties> ListAsync(string resourceGroupName, string accountName, Canc
 124        {
 2125            if (resourceGroupName == null)
 126            {
 0127                throw new ArgumentNullException(nameof(resourceGroupName));
 128            }
 2129            if (accountName == null)
 130            {
 0131                throw new ArgumentNullException(nameof(accountName));
 132            }
 133
 134            async Task<Page<BlobServiceProperties>> FirstPageFunc(int? pageSizeHint)
 135            {
 2136                using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.List");
 2137                scope.Start();
 138                try
 139                {
 2140                    var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).Configu
 2141                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 142                }
 0143                catch (Exception e)
 144                {
 0145                    scope.Failed(e);
 0146                    throw;
 147                }
 2148            }
 2149            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
 150        }
 151
 152        /// <summary> List blob services of storage account. It returns a collection of one object named default. </summ
 153        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 154        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 155        /// <param name="cancellationToken"> The cancellation token to use. </param>
 156        public virtual Pageable<BlobServiceProperties> List(string resourceGroupName, string accountName, CancellationTo
 157        {
 2158            if (resourceGroupName == null)
 159            {
 0160                throw new ArgumentNullException(nameof(resourceGroupName));
 161            }
 2162            if (accountName == null)
 163            {
 0164                throw new ArgumentNullException(nameof(accountName));
 165            }
 166
 167            Page<BlobServiceProperties> FirstPageFunc(int? pageSizeHint)
 168            {
 2169                using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.List");
 2170                scope.Start();
 171                try
 172                {
 2173                    var response = RestClient.List(resourceGroupName, accountName, cancellationToken);
 2174                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 175                }
 0176                catch (Exception e)
 177                {
 0178                    scope.Failed(e);
 0179                    throw;
 180                }
 2181            }
 2182            return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
 183        }
 184    }
 185}