< Summary

Class:Azure.ResourceManager.Storage.PrivateLinkResourcesOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\PrivateLinkResourcesOperations.cs
Covered lines:16
Uncovered lines:6
Coverable lines:22
Total lines:78
Line coverage:72.7% (16 of 22)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
ListByStorageAccountAsync()-57.14%100%
ListByStorageAccount(...)-57.14%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\PrivateLinkResourcesOperations.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 PrivateLinkResources service client. </summary>
 18    public partial class PrivateLinkResourcesOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 422        internal PrivateLinkResourcesRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of PrivateLinkResourcesOperations for mocking. </summary>
 24024        protected PrivateLinkResourcesOperations()
 25        {
 24026        }
 27        /// <summary> Initializes a new instance of PrivateLinkResourcesOperations. </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 PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 34        {
 24035            RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, a
 24036            _clientDiagnostics = clientDiagnostics;
 24037            _pipeline = pipeline;
 24038        }
 39
 40        /// <summary> Gets the private link resources that need to be created for a storage account. </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<PrivateLinkResourceListResult>> ListByStorageAccountAsync(string resourceGrou
 45        {
 246            using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByStorageAccount");
 247            scope.Start();
 48            try
 49            {
 250                return await RestClient.ListByStorageAccountAsync(resourceGroupName, accountName, cancellationToken).Con
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 257        }
 58
 59        /// <summary> Gets the private link resources that need to be created for a storage account. </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<PrivateLinkResourceListResult> ListByStorageAccount(string resourceGroupName, string acc
 64        {
 265            using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByStorageAccount");
 266            scope.Start();
 67            try
 68            {
 269                return RestClient.ListByStorageAccount(resourceGroupName, accountName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 276        }
 77    }
 78}