< Summary

Class:Azure.ResourceManager.AppConfiguration.PrivateLinkResourcesOperations
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\PrivateLinkResourcesOperations.cs
Covered lines:32
Uncovered lines:32
Coverable lines:64
Total lines:177
Line coverage:50% (32 of 64)
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%
GetAsync()-57.14%100%
Get(...)-57.14%100%
ListByConfigurationStoreAsync(...)-38.1%50%
<ListByConfigurationStoreAsync()-62.5%100%
<ListByConfigurationStoreAsync()-0%100%
ListByConfigurationStore(...)-38.1%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\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;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.AppConfiguration.Models;
 15
 16namespace Azure.ResourceManager.AppConfiguration
 17{
 18    /// <summary> The PrivateLinkResources service client. </summary>
 19    public partial class PrivateLinkResourcesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 2023        internal PrivateLinkResourcesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PrivateLinkResourcesOperations for mocking. </summary>
 825        protected PrivateLinkResourcesOperations()
 26        {
 827        }
 28        /// <summary> Initializes a new instance of PrivateLinkResourcesOperations. </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 Microsoft Azure subscription ID. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 834        internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 35        {
 836            RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, a
 837            _clientDiagnostics = clientDiagnostics;
 838            _pipeline = pipeline;
 839        }
 40
 41        /// <summary> Gets a private link resource that need to be created for a configuration store. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 43        /// <param name="configStoreName"> The name of the configuration store. </param>
 44        /// <param name="groupName"> The name of the private link resource group. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<PrivateLinkResource>> GetAsync(string resourceGroupName, string configStoreNa
 47        {
 448            using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.Get");
 449            scope.Start();
 50            try
 51            {
 452                return await RestClient.GetAsync(resourceGroupName, configStoreName, groupName, cancellationToken).Confi
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 459        }
 60
 61        /// <summary> Gets a private link resource that need to be created for a configuration store. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 63        /// <param name="configStoreName"> The name of the configuration store. </param>
 64        /// <param name="groupName"> The name of the private link resource group. </param>
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<PrivateLinkResource> Get(string resourceGroupName, string configStoreName, string groupN
 67        {
 468            using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.Get");
 469            scope.Start();
 70            try
 71            {
 472                return RestClient.Get(resourceGroupName, configStoreName, groupName, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 479        }
 80
 81        /// <summary> Gets the private link resources that need to be created for a configuration store. </summary>
 82        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 83        /// <param name="configStoreName"> The name of the configuration store. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual AsyncPageable<PrivateLinkResource> ListByConfigurationStoreAsync(string resourceGroupName, string
 86        {
 687            if (resourceGroupName == null)
 88            {
 089                throw new ArgumentNullException(nameof(resourceGroupName));
 90            }
 691            if (configStoreName == null)
 92            {
 093                throw new ArgumentNullException(nameof(configStoreName));
 94            }
 95
 96            async Task<Page<PrivateLinkResource>> FirstPageFunc(int? pageSizeHint)
 97            {
 698                using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByConfigurationStor
 699                scope.Start();
 100                try
 101                {
 6102                    var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, ca
 6103                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 104                }
 0105                catch (Exception e)
 106                {
 0107                    scope.Failed(e);
 0108                    throw;
 109                }
 6110            }
 111            async Task<Page<PrivateLinkResource>> NextPageFunc(string nextLink, int? pageSizeHint)
 112            {
 0113                using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByConfigurationStor
 0114                scope.Start();
 115                try
 116                {
 0117                    var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, c
 0118                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 119                }
 0120                catch (Exception e)
 121                {
 0122                    scope.Failed(e);
 0123                    throw;
 124                }
 0125            }
 6126            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 127        }
 128
 129        /// <summary> Gets the private link resources that need to be created for a configuration store. </summary>
 130        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 131        /// <param name="configStoreName"> The name of the configuration store. </param>
 132        /// <param name="cancellationToken"> The cancellation token to use. </param>
 133        public virtual Pageable<PrivateLinkResource> ListByConfigurationStore(string resourceGroupName, string configSto
 134        {
 6135            if (resourceGroupName == null)
 136            {
 0137                throw new ArgumentNullException(nameof(resourceGroupName));
 138            }
 6139            if (configStoreName == null)
 140            {
 0141                throw new ArgumentNullException(nameof(configStoreName));
 142            }
 143
 144            Page<PrivateLinkResource> FirstPageFunc(int? pageSizeHint)
 145            {
 6146                using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByConfigurationStor
 6147                scope.Start();
 148                try
 149                {
 6150                    var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, cancellationT
 6151                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 152                }
 0153                catch (Exception e)
 154                {
 0155                    scope.Failed(e);
 0156                    throw;
 157                }
 6158            }
 159            Page<PrivateLinkResource> NextPageFunc(string nextLink, int? pageSizeHint)
 160            {
 0161                using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByConfigurationStor
 0162                scope.Start();
 163                try
 164                {
 0165                    var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreN
 0166                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 167                }
 0168                catch (Exception e)
 169                {
 0170                    scope.Failed(e);
 0171                    throw;
 172                }
 0173            }
 6174            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 175        }
 176    }
 177}