< Summary

Class:Azure.ResourceManager.Network.NetworkInterfacesOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\NetworkInterfacesOperations.cs
Covered lines:120
Uncovered lines:254
Coverable lines:374
Total lines:932
Line coverage:32% (120 of 374)
Covered branches:22
Total branches:76
Branch coverage:28.9% (22 of 76)

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%
UpdateTagsAsync()-0%100%
UpdateTags(...)-0%100%
GetVirtualMachineScaleSetNetworkInterfaceAsync()-57.14%100%
GetVirtualMachineScaleSetNetworkInterface(...)-57.14%100%
GetVirtualMachineScaleSetIpConfigurationAsync()-0%100%
GetVirtualMachineScaleSetIpConfiguration(...)-0%100%
<ListAllAsync()-62.5%100%
<ListAllAsync()-0%100%
ListAllAsync(...)-100%100%
ListAll(...)-100%100%
ListAsync(...)-36.84%50%
<ListAsync()-62.5%100%
<ListAsync()-0%100%
List(...)-36.84%50%
ListVirtualMachineScaleSetVMNetworkInterfacesAsync(...)-39.13%50%
<ListVirtualMachineScaleSetVMNetworkInterfacesAsync()-62.5%100%
<ListVirtualMachineScaleSetVMNetworkInterfacesAsync()-0%100%
ListVirtualMachineScaleSetVMNetworkInterfaces(...)-39.13%50%
ListVirtualMachineScaleSetNetworkInterfacesAsync(...)-38.1%50%
<ListVirtualMachineScaleSetNetworkInterfacesAsync()-62.5%100%
<ListVirtualMachineScaleSetNetworkInterfacesAsync()-0%100%
ListVirtualMachineScaleSetNetworkInterfaces(...)-38.1%50%
ListVirtualMachineScaleSetIpConfigurationsAsync(...)-0%0%
<ListVirtualMachineScaleSetIpConfigurationsAsync()-0%100%
<ListVirtualMachineScaleSetIpConfigurationsAsync()-0%100%
ListVirtualMachineScaleSetIpConfigurations(...)-0%0%
StartDeleteAsync()-58.33%50%
StartDelete(...)-58.33%50%
StartCreateOrUpdateAsync()-78.57%50%
StartCreateOrUpdate(...)-78.57%50%
StartGetEffectiveRouteTableAsync()-0%0%
StartGetEffectiveRouteTable(...)-0%0%
StartListEffectiveNetworkSecurityGroupsAsync()-0%0%
StartListEffectiveNetworkSecurityGroups(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\NetworkInterfacesOperations.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 NetworkInterfaces service client. </summary>
 19    public partial class NetworkInterfacesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 47623        internal NetworkInterfacesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of NetworkInterfacesOperations for mocking. </summary>
 52425        protected NetworkInterfacesOperations()
 26        {
 52427        }
 28        /// <summary> Initializes a new instance of NetworkInterfacesOperations. </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>
 52433        internal NetworkInterfacesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscrip
 34        {
 52435            RestClient = new NetworkInterfacesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 52436            _clientDiagnostics = clientDiagnostics;
 52437            _pipeline = pipeline;
 52438        }
 39
 40        /// <summary> Gets information about the specified network interface. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 43        /// <param name="expand"> Expands referenced resources. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<NetworkInterface>> GetAsync(string resourceGroupName, string networkInterface
 46        {
 4647            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.Get");
 4648            scope.Start();
 49            try
 50            {
 4651                return await RestClient.GetAsync(resourceGroupName, networkInterfaceName, expand, cancellationToken).Con
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 4658        }
 59
 60        /// <summary> Gets information about the specified network interface. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 63        /// <param name="expand"> Expands referenced resources. </param>
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<NetworkInterface> Get(string resourceGroupName, string networkInterfaceName, string expa
 66        {
 4667            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.Get");
 4668            scope.Start();
 69            try
 70            {
 4671                return RestClient.Get(resourceGroupName, networkInterfaceName, expand, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 4678        }
 79
 80        /// <summary> Updates a network interface tags. </summary>
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 83        /// <param name="parameters"> Parameters supplied to update network interface tags. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual async Task<Response<NetworkInterface>> UpdateTagsAsync(string resourceGroupName, string networkIn
 86        {
 087            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.UpdateTags");
 088            scope.Start();
 89            try
 90            {
 091                return await RestClient.UpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters, cancellatio
 92            }
 093            catch (Exception e)
 94            {
 095                scope.Failed(e);
 096                throw;
 97            }
 098        }
 99
 100        /// <summary> Updates a network interface tags. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 103        /// <param name="parameters"> Parameters supplied to update network interface tags. </param>
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public virtual Response<NetworkInterface> UpdateTags(string resourceGroupName, string networkInterfaceName, Tags
 106        {
 0107            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.UpdateTags");
 0108            scope.Start();
 109            try
 110            {
 0111                return RestClient.UpdateTags(resourceGroupName, networkInterfaceName, parameters, cancellationToken);
 112            }
 0113            catch (Exception e)
 114            {
 0115                scope.Failed(e);
 0116                throw;
 117            }
 0118        }
 119
 120        /// <summary> Get the specified network interface in a virtual machine scale set. </summary>
 121        /// <param name="resourceGroupName"> The name of the resource group. </param>
 122        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 123        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 124        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 125        /// <param name="expand"> Expands referenced resources. </param>
 126        /// <param name="cancellationToken"> The cancellation token to use. </param>
 127        public virtual async Task<Response<NetworkInterface>> GetVirtualMachineScaleSetNetworkInterfaceAsync(string reso
 128        {
 2129            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.GetVirtualMachineScaleSetNetwo
 2130            scope.Start();
 131            try
 132            {
 2133                return await RestClient.GetVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachine
 134            }
 0135            catch (Exception e)
 136            {
 0137                scope.Failed(e);
 0138                throw;
 139            }
 2140        }
 141
 142        /// <summary> Get the specified network interface in a virtual machine scale set. </summary>
 143        /// <param name="resourceGroupName"> The name of the resource group. </param>
 144        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 145        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 146        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 147        /// <param name="expand"> Expands referenced resources. </param>
 148        /// <param name="cancellationToken"> The cancellation token to use. </param>
 149        public virtual Response<NetworkInterface> GetVirtualMachineScaleSetNetworkInterface(string resourceGroupName, st
 150        {
 2151            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.GetVirtualMachineScaleSetNetwo
 2152            scope.Start();
 153            try
 154            {
 2155                return RestClient.GetVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetNam
 156            }
 0157            catch (Exception e)
 158            {
 0159                scope.Failed(e);
 0160                throw;
 161            }
 2162        }
 163
 164        /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary>
 165        /// <param name="resourceGroupName"> The name of the resource group. </param>
 166        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 167        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 168        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 169        /// <param name="ipConfigurationName"> The name of the ip configuration. </param>
 170        /// <param name="expand"> Expands referenced resources. </param>
 171        /// <param name="cancellationToken"> The cancellation token to use. </param>
 172        public virtual async Task<Response<NetworkInterfaceIPConfiguration>> GetVirtualMachineScaleSetIpConfigurationAsy
 173        {
 0174            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.GetVirtualMachineScaleSetIpCon
 0175            scope.Start();
 176            try
 177            {
 0178                return await RestClient.GetVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineS
 179            }
 0180            catch (Exception e)
 181            {
 0182                scope.Failed(e);
 0183                throw;
 184            }
 0185        }
 186
 187        /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary>
 188        /// <param name="resourceGroupName"> The name of the resource group. </param>
 189        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 190        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 191        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 192        /// <param name="ipConfigurationName"> The name of the ip configuration. </param>
 193        /// <param name="expand"> Expands referenced resources. </param>
 194        /// <param name="cancellationToken"> The cancellation token to use. </param>
 195        public virtual Response<NetworkInterfaceIPConfiguration> GetVirtualMachineScaleSetIpConfiguration(string resourc
 196        {
 0197            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.GetVirtualMachineScaleSetIpCon
 0198            scope.Start();
 199            try
 200            {
 0201                return RestClient.GetVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName
 202            }
 0203            catch (Exception e)
 204            {
 0205                scope.Failed(e);
 0206                throw;
 207            }
 0208        }
 209
 210        /// <summary> Gets all network interfaces in a subscription. </summary>
 211        /// <param name="cancellationToken"> The cancellation token to use. </param>
 212        public virtual AsyncPageable<NetworkInterface> ListAllAsync(CancellationToken cancellationToken = default)
 213        {
 214            async Task<Page<NetworkInterface>> FirstPageFunc(int? pageSizeHint)
 215            {
 6216                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListAll");
 6217                scope.Start();
 218                try
 219                {
 6220                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 6221                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 222                }
 0223                catch (Exception e)
 224                {
 0225                    scope.Failed(e);
 0226                    throw;
 227                }
 6228            }
 229            async Task<Page<NetworkInterface>> NextPageFunc(string nextLink, int? pageSizeHint)
 230            {
 0231                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListAll");
 0232                scope.Start();
 233                try
 234                {
 0235                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0236                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 237                }
 0238                catch (Exception e)
 239                {
 0240                    scope.Failed(e);
 0241                    throw;
 242                }
 0243            }
 6244            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 245        }
 246
 247        /// <summary> Gets all network interfaces in a subscription. </summary>
 248        /// <param name="cancellationToken"> The cancellation token to use. </param>
 249        public virtual Pageable<NetworkInterface> ListAll(CancellationToken cancellationToken = default)
 250        {
 251            Page<NetworkInterface> FirstPageFunc(int? pageSizeHint)
 252            {
 6253                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListAll");
 6254                scope.Start();
 255                try
 256                {
 6257                    var response = RestClient.ListAll(cancellationToken);
 6258                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 259                }
 0260                catch (Exception e)
 261                {
 0262                    scope.Failed(e);
 0263                    throw;
 264                }
 6265            }
 266            Page<NetworkInterface> NextPageFunc(string nextLink, int? pageSizeHint)
 267            {
 0268                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListAll");
 0269                scope.Start();
 270                try
 271                {
 0272                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0273                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 274                }
 0275                catch (Exception e)
 276                {
 0277                    scope.Failed(e);
 0278                    throw;
 279                }
 0280            }
 6281            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 282        }
 283
 284        /// <summary> Gets all network interfaces in a resource group. </summary>
 285        /// <param name="resourceGroupName"> The name of the resource group. </param>
 286        /// <param name="cancellationToken"> The cancellation token to use. </param>
 287        public virtual AsyncPageable<NetworkInterface> ListAsync(string resourceGroupName, CancellationToken cancellatio
 288        {
 22289            if (resourceGroupName == null)
 290            {
 0291                throw new ArgumentNullException(nameof(resourceGroupName));
 292            }
 293
 294            async Task<Page<NetworkInterface>> FirstPageFunc(int? pageSizeHint)
 295            {
 22296                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.List");
 22297                scope.Start();
 298                try
 299                {
 22300                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 22301                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 302                }
 0303                catch (Exception e)
 304                {
 0305                    scope.Failed(e);
 0306                    throw;
 307                }
 22308            }
 309            async Task<Page<NetworkInterface>> NextPageFunc(string nextLink, int? pageSizeHint)
 310            {
 0311                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.List");
 0312                scope.Start();
 313                try
 314                {
 0315                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0316                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 317                }
 0318                catch (Exception e)
 319                {
 0320                    scope.Failed(e);
 0321                    throw;
 322                }
 0323            }
 22324            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 325        }
 326
 327        /// <summary> Gets all network interfaces in a resource group. </summary>
 328        /// <param name="resourceGroupName"> The name of the resource group. </param>
 329        /// <param name="cancellationToken"> The cancellation token to use. </param>
 330        public virtual Pageable<NetworkInterface> List(string resourceGroupName, CancellationToken cancellationToken = d
 331        {
 22332            if (resourceGroupName == null)
 333            {
 0334                throw new ArgumentNullException(nameof(resourceGroupName));
 335            }
 336
 337            Page<NetworkInterface> FirstPageFunc(int? pageSizeHint)
 338            {
 22339                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.List");
 22340                scope.Start();
 341                try
 342                {
 22343                    var response = RestClient.List(resourceGroupName, cancellationToken);
 22344                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 345                }
 0346                catch (Exception e)
 347                {
 0348                    scope.Failed(e);
 0349                    throw;
 350                }
 22351            }
 352            Page<NetworkInterface> NextPageFunc(string nextLink, int? pageSizeHint)
 353            {
 0354                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.List");
 0355                scope.Start();
 356                try
 357                {
 0358                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0359                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 360                }
 0361                catch (Exception e)
 362                {
 0363                    scope.Failed(e);
 0364                    throw;
 365                }
 0366            }
 22367            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 368        }
 369
 370        /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
 371        /// <param name="resourceGroupName"> The name of the resource group. </param>
 372        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 373        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 374        /// <param name="cancellationToken"> The cancellation token to use. </param>
 375        public virtual AsyncPageable<NetworkInterface> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(string resourc
 376        {
 2377            if (resourceGroupName == null)
 378            {
 0379                throw new ArgumentNullException(nameof(resourceGroupName));
 380            }
 2381            if (virtualMachineScaleSetName == null)
 382            {
 0383                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 384            }
 2385            if (virtualmachineIndex == null)
 386            {
 0387                throw new ArgumentNullException(nameof(virtualmachineIndex));
 388            }
 389
 390            async Task<Page<NetworkInterface>> FirstPageFunc(int? pageSizeHint)
 391            {
 2392                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 2393                scope.Start();
 394                try
 395                {
 2396                    var response = await RestClient.ListVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName
 2397                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 398                }
 0399                catch (Exception e)
 400                {
 0401                    scope.Failed(e);
 0402                    throw;
 403                }
 2404            }
 405            async Task<Page<NetworkInterface>> NextPageFunc(string nextLink, int? pageSizeHint)
 406            {
 0407                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0408                scope.Start();
 409                try
 410                {
 0411                    var response = await RestClient.ListVirtualMachineScaleSetVMNetworkInterfacesNextPageAsync(nextLink,
 0412                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 413                }
 0414                catch (Exception e)
 415                {
 0416                    scope.Failed(e);
 0417                    throw;
 418                }
 0419            }
 2420            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 421        }
 422
 423        /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
 424        /// <param name="resourceGroupName"> The name of the resource group. </param>
 425        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 426        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 427        /// <param name="cancellationToken"> The cancellation token to use. </param>
 428        public virtual Pageable<NetworkInterface> ListVirtualMachineScaleSetVMNetworkInterfaces(string resourceGroupName
 429        {
 2430            if (resourceGroupName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(resourceGroupName));
 433            }
 2434            if (virtualMachineScaleSetName == null)
 435            {
 0436                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 437            }
 2438            if (virtualmachineIndex == null)
 439            {
 0440                throw new ArgumentNullException(nameof(virtualmachineIndex));
 441            }
 442
 443            Page<NetworkInterface> FirstPageFunc(int? pageSizeHint)
 444            {
 2445                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 2446                scope.Start();
 447                try
 448                {
 2449                    var response = RestClient.ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMa
 2450                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 451                }
 0452                catch (Exception e)
 453                {
 0454                    scope.Failed(e);
 0455                    throw;
 456                }
 2457            }
 458            Page<NetworkInterface> NextPageFunc(string nextLink, int? pageSizeHint)
 459            {
 0460                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0461                scope.Start();
 462                try
 463                {
 0464                    var response = RestClient.ListVirtualMachineScaleSetVMNetworkInterfacesNextPage(nextLink, resourceGr
 0465                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 466                }
 0467                catch (Exception e)
 468                {
 0469                    scope.Failed(e);
 0470                    throw;
 471                }
 0472            }
 2473            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 474        }
 475
 476        /// <summary> Gets all network interfaces in a virtual machine scale set. </summary>
 477        /// <param name="resourceGroupName"> The name of the resource group. </param>
 478        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 479        /// <param name="cancellationToken"> The cancellation token to use. </param>
 480        public virtual AsyncPageable<NetworkInterface> ListVirtualMachineScaleSetNetworkInterfacesAsync(string resourceG
 481        {
 2482            if (resourceGroupName == null)
 483            {
 0484                throw new ArgumentNullException(nameof(resourceGroupName));
 485            }
 2486            if (virtualMachineScaleSetName == null)
 487            {
 0488                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 489            }
 490
 491            async Task<Page<NetworkInterface>> FirstPageFunc(int? pageSizeHint)
 492            {
 2493                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 2494                scope.Start();
 495                try
 496                {
 2497                    var response = await RestClient.ListVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, 
 2498                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 499                }
 0500                catch (Exception e)
 501                {
 0502                    scope.Failed(e);
 0503                    throw;
 504                }
 2505            }
 506            async Task<Page<NetworkInterface>> NextPageFunc(string nextLink, int? pageSizeHint)
 507            {
 0508                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0509                scope.Start();
 510                try
 511                {
 0512                    var response = await RestClient.ListVirtualMachineScaleSetNetworkInterfacesNextPageAsync(nextLink, r
 0513                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 514                }
 0515                catch (Exception e)
 516                {
 0517                    scope.Failed(e);
 0518                    throw;
 519                }
 0520            }
 2521            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 522        }
 523
 524        /// <summary> Gets all network interfaces in a virtual machine scale set. </summary>
 525        /// <param name="resourceGroupName"> The name of the resource group. </param>
 526        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 527        /// <param name="cancellationToken"> The cancellation token to use. </param>
 528        public virtual Pageable<NetworkInterface> ListVirtualMachineScaleSetNetworkInterfaces(string resourceGroupName, 
 529        {
 2530            if (resourceGroupName == null)
 531            {
 0532                throw new ArgumentNullException(nameof(resourceGroupName));
 533            }
 2534            if (virtualMachineScaleSetName == null)
 535            {
 0536                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 537            }
 538
 539            Page<NetworkInterface> FirstPageFunc(int? pageSizeHint)
 540            {
 2541                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 2542                scope.Start();
 543                try
 544                {
 2545                    var response = RestClient.ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMach
 2546                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 547                }
 0548                catch (Exception e)
 549                {
 0550                    scope.Failed(e);
 0551                    throw;
 552                }
 2553            }
 554            Page<NetworkInterface> NextPageFunc(string nextLink, int? pageSizeHint)
 555            {
 0556                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0557                scope.Start();
 558                try
 559                {
 0560                    var response = RestClient.ListVirtualMachineScaleSetNetworkInterfacesNextPage(nextLink, resourceGrou
 0561                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 562                }
 0563                catch (Exception e)
 564                {
 0565                    scope.Failed(e);
 0566                    throw;
 567                }
 0568            }
 2569            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 570        }
 571
 572        /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary>
 573        /// <param name="resourceGroupName"> The name of the resource group. </param>
 574        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 575        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 576        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 577        /// <param name="expand"> Expands referenced resources. </param>
 578        /// <param name="cancellationToken"> The cancellation token to use. </param>
 579        public virtual AsyncPageable<NetworkInterfaceIPConfiguration> ListVirtualMachineScaleSetIpConfigurationsAsync(st
 580        {
 0581            if (resourceGroupName == null)
 582            {
 0583                throw new ArgumentNullException(nameof(resourceGroupName));
 584            }
 0585            if (virtualMachineScaleSetName == null)
 586            {
 0587                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 588            }
 0589            if (virtualmachineIndex == null)
 590            {
 0591                throw new ArgumentNullException(nameof(virtualmachineIndex));
 592            }
 0593            if (networkInterfaceName == null)
 594            {
 0595                throw new ArgumentNullException(nameof(networkInterfaceName));
 596            }
 597
 598            async Task<Page<NetworkInterfaceIPConfiguration>> FirstPageFunc(int? pageSizeHint)
 599            {
 0600                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0601                scope.Start();
 602                try
 603                {
 0604                    var response = await RestClient.ListVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, v
 0605                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 606                }
 0607                catch (Exception e)
 608                {
 0609                    scope.Failed(e);
 0610                    throw;
 611                }
 0612            }
 613            async Task<Page<NetworkInterfaceIPConfiguration>> NextPageFunc(string nextLink, int? pageSizeHint)
 614            {
 0615                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0616                scope.Start();
 617                try
 618                {
 0619                    var response = await RestClient.ListVirtualMachineScaleSetIpConfigurationsNextPageAsync(nextLink, re
 0620                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 621                }
 0622                catch (Exception e)
 623                {
 0624                    scope.Failed(e);
 0625                    throw;
 626                }
 0627            }
 0628            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 629        }
 630
 631        /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary>
 632        /// <param name="resourceGroupName"> The name of the resource group. </param>
 633        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 634        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 635        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 636        /// <param name="expand"> Expands referenced resources. </param>
 637        /// <param name="cancellationToken"> The cancellation token to use. </param>
 638        public virtual Pageable<NetworkInterfaceIPConfiguration> ListVirtualMachineScaleSetIpConfigurations(string resou
 639        {
 0640            if (resourceGroupName == null)
 641            {
 0642                throw new ArgumentNullException(nameof(resourceGroupName));
 643            }
 0644            if (virtualMachineScaleSetName == null)
 645            {
 0646                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 647            }
 0648            if (virtualmachineIndex == null)
 649            {
 0650                throw new ArgumentNullException(nameof(virtualmachineIndex));
 651            }
 0652            if (networkInterfaceName == null)
 653            {
 0654                throw new ArgumentNullException(nameof(networkInterfaceName));
 655            }
 656
 657            Page<NetworkInterfaceIPConfiguration> FirstPageFunc(int? pageSizeHint)
 658            {
 0659                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0660                scope.Start();
 661                try
 662                {
 0663                    var response = RestClient.ListVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachi
 0664                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 665                }
 0666                catch (Exception e)
 667                {
 0668                    scope.Failed(e);
 0669                    throw;
 670                }
 0671            }
 672            Page<NetworkInterfaceIPConfiguration> NextPageFunc(string nextLink, int? pageSizeHint)
 673            {
 0674                using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.ListVirtualMachineScaleSet
 0675                scope.Start();
 676                try
 677                {
 0678                    var response = RestClient.ListVirtualMachineScaleSetIpConfigurationsNextPage(nextLink, resourceGroup
 0679                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 680                }
 0681                catch (Exception e)
 682                {
 0683                    scope.Failed(e);
 0684                    throw;
 685                }
 0686            }
 0687            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 688        }
 689
 690        /// <summary> Deletes the specified network interface. </summary>
 691        /// <param name="resourceGroupName"> The name of the resource group. </param>
 692        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 693        /// <param name="cancellationToken"> The cancellation token to use. </param>
 694        public virtual async Task<NetworkInterfacesDeleteOperation> StartDeleteAsync(string resourceGroupName, string ne
 695        {
 32696            if (resourceGroupName == null)
 697            {
 0698                throw new ArgumentNullException(nameof(resourceGroupName));
 699            }
 32700            if (networkInterfaceName == null)
 701            {
 0702                throw new ArgumentNullException(nameof(networkInterfaceName));
 703            }
 704
 32705            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartDelete");
 32706            scope.Start();
 707            try
 708            {
 32709                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, networkInterfaceName, cancellatio
 32710                return new NetworkInterfacesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques
 711            }
 0712            catch (Exception e)
 713            {
 0714                scope.Failed(e);
 0715                throw;
 716            }
 32717        }
 718
 719        /// <summary> Deletes the specified network interface. </summary>
 720        /// <param name="resourceGroupName"> The name of the resource group. </param>
 721        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 722        /// <param name="cancellationToken"> The cancellation token to use. </param>
 723        public virtual NetworkInterfacesDeleteOperation StartDelete(string resourceGroupName, string networkInterfaceNam
 724        {
 32725            if (resourceGroupName == null)
 726            {
 0727                throw new ArgumentNullException(nameof(resourceGroupName));
 728            }
 32729            if (networkInterfaceName == null)
 730            {
 0731                throw new ArgumentNullException(nameof(networkInterfaceName));
 732            }
 733
 32734            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartDelete");
 32735            scope.Start();
 736            try
 737            {
 32738                var originalResponse = RestClient.Delete(resourceGroupName, networkInterfaceName, cancellationToken);
 32739                return new NetworkInterfacesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques
 740            }
 0741            catch (Exception e)
 742            {
 0743                scope.Failed(e);
 0744                throw;
 745            }
 32746        }
 747
 748        /// <summary> Creates or updates a network interface. </summary>
 749        /// <param name="resourceGroupName"> The name of the resource group. </param>
 750        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 751        /// <param name="parameters"> Parameters supplied to the create or update network interface operation. </param>
 752        /// <param name="cancellationToken"> The cancellation token to use. </param>
 753        public virtual async Task<NetworkInterfacesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGrou
 754        {
 48755            if (resourceGroupName == null)
 756            {
 0757                throw new ArgumentNullException(nameof(resourceGroupName));
 758            }
 48759            if (networkInterfaceName == null)
 760            {
 0761                throw new ArgumentNullException(nameof(networkInterfaceName));
 762            }
 48763            if (parameters == null)
 764            {
 0765                throw new ArgumentNullException(nameof(parameters));
 766            }
 767
 48768            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartCreateOrUpdate");
 48769            scope.Start();
 770            try
 771            {
 48772                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, networkInterfaceName, par
 46773                return new NetworkInterfacesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea
 774            }
 2775            catch (Exception e)
 776            {
 2777                scope.Failed(e);
 2778                throw;
 779            }
 46780        }
 781
 782        /// <summary> Creates or updates a network interface. </summary>
 783        /// <param name="resourceGroupName"> The name of the resource group. </param>
 784        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 785        /// <param name="parameters"> Parameters supplied to the create or update network interface operation. </param>
 786        /// <param name="cancellationToken"> The cancellation token to use. </param>
 787        public virtual NetworkInterfacesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string net
 788        {
 48789            if (resourceGroupName == null)
 790            {
 0791                throw new ArgumentNullException(nameof(resourceGroupName));
 792            }
 48793            if (networkInterfaceName == null)
 794            {
 0795                throw new ArgumentNullException(nameof(networkInterfaceName));
 796            }
 48797            if (parameters == null)
 798            {
 0799                throw new ArgumentNullException(nameof(parameters));
 800            }
 801
 48802            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartCreateOrUpdate");
 48803            scope.Start();
 804            try
 805            {
 48806                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, ca
 46807                return new NetworkInterfacesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea
 808            }
 2809            catch (Exception e)
 810            {
 2811                scope.Failed(e);
 2812                throw;
 813            }
 46814        }
 815
 816        /// <summary> Gets all route tables applied to a network interface. </summary>
 817        /// <param name="resourceGroupName"> The name of the resource group. </param>
 818        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 819        /// <param name="cancellationToken"> The cancellation token to use. </param>
 820        public virtual async Task<NetworkInterfacesGetEffectiveRouteTableOperation> StartGetEffectiveRouteTableAsync(str
 821        {
 0822            if (resourceGroupName == null)
 823            {
 0824                throw new ArgumentNullException(nameof(resourceGroupName));
 825            }
 0826            if (networkInterfaceName == null)
 827            {
 0828                throw new ArgumentNullException(nameof(networkInterfaceName));
 829            }
 830
 0831            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartGetEffectiveRouteTable");
 0832            scope.Start();
 833            try
 834            {
 0835                var originalResponse = await RestClient.GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceN
 0836                return new NetworkInterfacesGetEffectiveRouteTableOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 837            }
 0838            catch (Exception e)
 839            {
 0840                scope.Failed(e);
 0841                throw;
 842            }
 0843        }
 844
 845        /// <summary> Gets all route tables applied to a network interface. </summary>
 846        /// <param name="resourceGroupName"> The name of the resource group. </param>
 847        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 848        /// <param name="cancellationToken"> The cancellation token to use. </param>
 849        public virtual NetworkInterfacesGetEffectiveRouteTableOperation StartGetEffectiveRouteTable(string resourceGroup
 850        {
 0851            if (resourceGroupName == null)
 852            {
 0853                throw new ArgumentNullException(nameof(resourceGroupName));
 854            }
 0855            if (networkInterfaceName == null)
 856            {
 0857                throw new ArgumentNullException(nameof(networkInterfaceName));
 858            }
 859
 0860            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartGetEffectiveRouteTable");
 0861            scope.Start();
 862            try
 863            {
 0864                var originalResponse = RestClient.GetEffectiveRouteTable(resourceGroupName, networkInterfaceName, cancel
 0865                return new NetworkInterfacesGetEffectiveRouteTableOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 866            }
 0867            catch (Exception e)
 868            {
 0869                scope.Failed(e);
 0870                throw;
 871            }
 0872        }
 873
 874        /// <summary> Gets all network security groups applied to a network interface. </summary>
 875        /// <param name="resourceGroupName"> The name of the resource group. </param>
 876        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 877        /// <param name="cancellationToken"> The cancellation token to use. </param>
 878        public virtual async Task<NetworkInterfacesListEffectiveNetworkSecurityGroupsOperation> StartListEffectiveNetwor
 879        {
 0880            if (resourceGroupName == null)
 881            {
 0882                throw new ArgumentNullException(nameof(resourceGroupName));
 883            }
 0884            if (networkInterfaceName == null)
 885            {
 0886                throw new ArgumentNullException(nameof(networkInterfaceName));
 887            }
 888
 0889            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartListEffectiveNetworkSecur
 0890            scope.Start();
 891            try
 892            {
 0893                var originalResponse = await RestClient.ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, netwo
 0894                return new NetworkInterfacesListEffectiveNetworkSecurityGroupsOperation(_clientDiagnostics, _pipeline, R
 895            }
 0896            catch (Exception e)
 897            {
 0898                scope.Failed(e);
 0899                throw;
 900            }
 0901        }
 902
 903        /// <summary> Gets all network security groups applied to a network interface. </summary>
 904        /// <param name="resourceGroupName"> The name of the resource group. </param>
 905        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 906        /// <param name="cancellationToken"> The cancellation token to use. </param>
 907        public virtual NetworkInterfacesListEffectiveNetworkSecurityGroupsOperation StartListEffectiveNetworkSecurityGro
 908        {
 0909            if (resourceGroupName == null)
 910            {
 0911                throw new ArgumentNullException(nameof(resourceGroupName));
 912            }
 0913            if (networkInterfaceName == null)
 914            {
 0915                throw new ArgumentNullException(nameof(networkInterfaceName));
 916            }
 917
 0918            using var scope = _clientDiagnostics.CreateScope("NetworkInterfacesOperations.StartListEffectiveNetworkSecur
 0919            scope.Start();
 920            try
 921            {
 0922                var originalResponse = RestClient.ListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterface
 0923                return new NetworkInterfacesListEffectiveNetworkSecurityGroupsOperation(_clientDiagnostics, _pipeline, R
 924            }
 0925            catch (Exception e)
 926            {
 0927                scope.Failed(e);
 0928                throw;
 929            }
 0930        }
 931    }
 932}