< Summary

Class:Azure.ResourceManager.Network.AvailableResourceGroupDelegationsOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\AvailableResourceGroupDelegationsOperations.cs
Covered lines:0
Uncovered lines:50
Coverable lines:50
Total lines:136
Line coverage:0% (0 of 50)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\AvailableResourceGroupDelegationsOperations.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.Network.Models;
 15
 16namespace Azure.ResourceManager.Network
 17{
 18    /// <summary> The AvailableResourceGroupDelegations service client. </summary>
 19    public partial class AvailableResourceGroupDelegationsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal AvailableResourceGroupDelegationsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of AvailableResourceGroupDelegationsOperations for mocking. </summary>
 025        protected AvailableResourceGroupDelegationsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of AvailableResourceGroupDelegationsOperations. </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 subscription credentials which uniquely identify the Microsoft Azure subsc
 32        /// <param name="endpoint"> server parameter. </param>
 033        internal AvailableResourceGroupDelegationsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline,
 34        {
 035            RestClient = new AvailableResourceGroupDelegationsRestOperations(clientDiagnostics, pipeline, subscriptionId
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets all of the available subnet delegations for this resource group in this region. </summary>
 41        /// <param name="location"> The location of the domain name. </param>
 42        /// <param name="resourceGroupName"> The name of the resource group. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual AsyncPageable<AvailableDelegation> ListAsync(string location, string resourceGroupName, Cancellat
 45        {
 046            if (location == null)
 47            {
 048                throw new ArgumentNullException(nameof(location));
 49            }
 050            if (resourceGroupName == null)
 51            {
 052                throw new ArgumentNullException(nameof(resourceGroupName));
 53            }
 54
 55            async Task<Page<AvailableDelegation>> FirstPageFunc(int? pageSizeHint)
 56            {
 057                using var scope = _clientDiagnostics.CreateScope("AvailableResourceGroupDelegationsOperations.List");
 058                scope.Start();
 59                try
 60                {
 061                    var response = await RestClient.ListAsync(location, resourceGroupName, cancellationToken).ConfigureA
 062                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 63                }
 064                catch (Exception e)
 65                {
 066                    scope.Failed(e);
 067                    throw;
 68                }
 069            }
 70            async Task<Page<AvailableDelegation>> NextPageFunc(string nextLink, int? pageSizeHint)
 71            {
 072                using var scope = _clientDiagnostics.CreateScope("AvailableResourceGroupDelegationsOperations.List");
 073                scope.Start();
 74                try
 75                {
 076                    var response = await RestClient.ListNextPageAsync(nextLink, location, resourceGroupName, cancellatio
 077                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 78                }
 079                catch (Exception e)
 80                {
 081                    scope.Failed(e);
 082                    throw;
 83                }
 084            }
 085            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 86        }
 87
 88        /// <summary> Gets all of the available subnet delegations for this resource group in this region. </summary>
 89        /// <param name="location"> The location of the domain name. </param>
 90        /// <param name="resourceGroupName"> The name of the resource group. </param>
 91        /// <param name="cancellationToken"> The cancellation token to use. </param>
 92        public virtual Pageable<AvailableDelegation> List(string location, string resourceGroupName, CancellationToken c
 93        {
 094            if (location == null)
 95            {
 096                throw new ArgumentNullException(nameof(location));
 97            }
 098            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 102
 103            Page<AvailableDelegation> FirstPageFunc(int? pageSizeHint)
 104            {
 0105                using var scope = _clientDiagnostics.CreateScope("AvailableResourceGroupDelegationsOperations.List");
 0106                scope.Start();
 107                try
 108                {
 0109                    var response = RestClient.List(location, resourceGroupName, cancellationToken);
 0110                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 111                }
 0112                catch (Exception e)
 113                {
 0114                    scope.Failed(e);
 0115                    throw;
 116                }
 0117            }
 118            Page<AvailableDelegation> NextPageFunc(string nextLink, int? pageSizeHint)
 119            {
 0120                using var scope = _clientDiagnostics.CreateScope("AvailableResourceGroupDelegationsOperations.List");
 0121                scope.Start();
 122                try
 123                {
 0124                    var response = RestClient.ListNextPage(nextLink, location, resourceGroupName, cancellationToken);
 0125                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 126                }
 0127                catch (Exception e)
 128                {
 0129                    scope.Failed(e);
 0130                    throw;
 131                }
 0132            }
 0133            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 134        }
 135    }
 136}