< Summary

Class:Azure.ResourceManager.Network.PublicIPAddressesOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PublicIPAddressesOperations.cs
Covered lines:118
Uncovered lines:152
Coverable lines:270
Total lines:676
Line coverage:43.7% (118 of 270)
Covered branches:26
Total branches:52
Branch coverage:50% (26 of 52)

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%
GetVirtualMachineScaleSetPublicIPAddressAsync()-57.14%100%
GetVirtualMachineScaleSetPublicIPAddress(...)-57.14%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%
ListVirtualMachineScaleSetPublicIPAddressesAsync(...)-38.1%50%
<ListVirtualMachineScaleSetPublicIPAddressesAsync()-62.5%100%
<ListVirtualMachineScaleSetPublicIPAddressesAsync()-0%100%
ListVirtualMachineScaleSetPublicIPAddresses(...)-38.1%50%
ListVirtualMachineScaleSetVMPublicIPAddressesAsync(...)-40.74%50%
<ListVirtualMachineScaleSetVMPublicIPAddressesAsync()-62.5%100%
<ListVirtualMachineScaleSetVMPublicIPAddressesAsync()-0%100%
ListVirtualMachineScaleSetVMPublicIPAddresses(...)-40.74%50%
StartDeleteAsync()-58.33%50%
StartDelete(...)-58.33%50%
StartCreateOrUpdateAsync()-57.14%50%
StartCreateOrUpdate(...)-57.14%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PublicIPAddressesOperations.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 PublicIPAddresses service client. </summary>
 19    public partial class PublicIPAddressesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 32423        internal PublicIPAddressesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PublicIPAddressesOperations for mocking. </summary>
 22025        protected PublicIPAddressesOperations()
 26        {
 22027        }
 28        /// <summary> Initializes a new instance of PublicIPAddressesOperations. </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>
 22033        internal PublicIPAddressesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscrip
 34        {
 22035            RestClient = new PublicIPAddressesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 22036            _clientDiagnostics = clientDiagnostics;
 22037            _pipeline = pipeline;
 22038        }
 39
 40        /// <summary> Gets the specified public IP address in a specified resource group. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="publicIpAddressName"> The name of the subnet. </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<PublicIPAddress>> GetAsync(string resourceGroupName, string publicIpAddressNa
 46        {
 3247            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.Get");
 3248            scope.Start();
 49            try
 50            {
 3251                return await RestClient.GetAsync(resourceGroupName, publicIpAddressName, expand, cancellationToken).Conf
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 3258        }
 59
 60        /// <summary> Gets the specified public IP address in a specified resource group. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 63        /// <param name="expand"> Expands referenced resources. </param>
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<PublicIPAddress> Get(string resourceGroupName, string publicIpAddressName, string expand
 66        {
 3267            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.Get");
 3268            scope.Start();
 69            try
 70            {
 3271                return RestClient.Get(resourceGroupName, publicIpAddressName, expand, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 3278        }
 79
 80        /// <summary> Updates public IP address tags. </summary>
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 83        /// <param name="parameters"> Parameters supplied to update public IP address tags. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual async Task<Response<PublicIPAddress>> UpdateTagsAsync(string resourceGroupName, string publicIpAd
 86        {
 087            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.UpdateTags");
 088            scope.Start();
 89            try
 90            {
 091                return await RestClient.UpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters, cancellation
 92            }
 093            catch (Exception e)
 94            {
 095                scope.Failed(e);
 096                throw;
 97            }
 098        }
 99
 100        /// <summary> Updates public IP address tags. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 103        /// <param name="parameters"> Parameters supplied to update public IP address tags. </param>
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public virtual Response<PublicIPAddress> UpdateTags(string resourceGroupName, string publicIpAddressName, TagsOb
 106        {
 0107            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.UpdateTags");
 0108            scope.Start();
 109            try
 110            {
 0111                return RestClient.UpdateTags(resourceGroupName, publicIpAddressName, parameters, cancellationToken);
 112            }
 0113            catch (Exception e)
 114            {
 0115                scope.Failed(e);
 0116                throw;
 117            }
 0118        }
 119
 120        /// <summary> Get the specified public IP address 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="ipConfigurationName"> The name of the IP configuration. </param>
 126        /// <param name="publicIpAddressName"> The name of the public IP Address. </param>
 127        /// <param name="expand"> Expands referenced resources. </param>
 128        /// <param name="cancellationToken"> The cancellation token to use. </param>
 129        public virtual async Task<Response<PublicIPAddress>> GetVirtualMachineScaleSetPublicIPAddressAsync(string resour
 130        {
 2131            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.GetVirtualMachineScaleSetPubli
 2132            scope.Start();
 133            try
 134            {
 2135                return await RestClient.GetVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineS
 136            }
 0137            catch (Exception e)
 138            {
 0139                scope.Failed(e);
 0140                throw;
 141            }
 2142        }
 143
 144        /// <summary> Get the specified public IP address in a virtual machine scale set. </summary>
 145        /// <param name="resourceGroupName"> The name of the resource group. </param>
 146        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 147        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 148        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 149        /// <param name="ipConfigurationName"> The name of the IP configuration. </param>
 150        /// <param name="publicIpAddressName"> The name of the public IP Address. </param>
 151        /// <param name="expand"> Expands referenced resources. </param>
 152        /// <param name="cancellationToken"> The cancellation token to use. </param>
 153        public virtual Response<PublicIPAddress> GetVirtualMachineScaleSetPublicIPAddress(string resourceGroupName, stri
 154        {
 2155            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.GetVirtualMachineScaleSetPubli
 2156            scope.Start();
 157            try
 158            {
 2159                return RestClient.GetVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName
 160            }
 0161            catch (Exception e)
 162            {
 0163                scope.Failed(e);
 0164                throw;
 165            }
 2166        }
 167
 168        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 169        /// <param name="cancellationToken"> The cancellation token to use. </param>
 170        public virtual AsyncPageable<PublicIPAddress> ListAllAsync(CancellationToken cancellationToken = default)
 171        {
 172            async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint)
 173            {
 6174                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll");
 6175                scope.Start();
 176                try
 177                {
 6178                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 6179                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 180                }
 0181                catch (Exception e)
 182                {
 0183                    scope.Failed(e);
 0184                    throw;
 185                }
 6186            }
 187            async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint)
 188            {
 0189                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll");
 0190                scope.Start();
 191                try
 192                {
 0193                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0194                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 195                }
 0196                catch (Exception e)
 197                {
 0198                    scope.Failed(e);
 0199                    throw;
 200                }
 0201            }
 6202            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 203        }
 204
 205        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 206        /// <param name="cancellationToken"> The cancellation token to use. </param>
 207        public virtual Pageable<PublicIPAddress> ListAll(CancellationToken cancellationToken = default)
 208        {
 209            Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint)
 210            {
 6211                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll");
 6212                scope.Start();
 213                try
 214                {
 6215                    var response = RestClient.ListAll(cancellationToken);
 6216                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 217                }
 0218                catch (Exception e)
 219                {
 0220                    scope.Failed(e);
 0221                    throw;
 222                }
 6223            }
 224            Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint)
 225            {
 0226                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll");
 0227                scope.Start();
 228                try
 229                {
 0230                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0231                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 232                }
 0233                catch (Exception e)
 234                {
 0235                    scope.Failed(e);
 0236                    throw;
 237                }
 0238            }
 6239            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 240        }
 241
 242        /// <summary> Gets all public IP addresses in a resource group. </summary>
 243        /// <param name="resourceGroupName"> The name of the resource group. </param>
 244        /// <param name="cancellationToken"> The cancellation token to use. </param>
 245        public virtual AsyncPageable<PublicIPAddress> ListAsync(string resourceGroupName, CancellationToken cancellation
 246        {
 12247            if (resourceGroupName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(resourceGroupName));
 250            }
 251
 252            async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint)
 253            {
 12254                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List");
 12255                scope.Start();
 256                try
 257                {
 12258                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 12259                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 260                }
 0261                catch (Exception e)
 262                {
 0263                    scope.Failed(e);
 0264                    throw;
 265                }
 12266            }
 267            async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint)
 268            {
 0269                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List");
 0270                scope.Start();
 271                try
 272                {
 0273                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0274                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 275                }
 0276                catch (Exception e)
 277                {
 0278                    scope.Failed(e);
 0279                    throw;
 280                }
 0281            }
 12282            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 283        }
 284
 285        /// <summary> Gets all public IP addresses in a resource group. </summary>
 286        /// <param name="resourceGroupName"> The name of the resource group. </param>
 287        /// <param name="cancellationToken"> The cancellation token to use. </param>
 288        public virtual Pageable<PublicIPAddress> List(string resourceGroupName, CancellationToken cancellationToken = de
 289        {
 12290            if (resourceGroupName == null)
 291            {
 0292                throw new ArgumentNullException(nameof(resourceGroupName));
 293            }
 294
 295            Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint)
 296            {
 12297                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List");
 12298                scope.Start();
 299                try
 300                {
 12301                    var response = RestClient.List(resourceGroupName, cancellationToken);
 12302                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 303                }
 0304                catch (Exception e)
 305                {
 0306                    scope.Failed(e);
 0307                    throw;
 308                }
 12309            }
 310            Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint)
 311            {
 0312                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List");
 0313                scope.Start();
 314                try
 315                {
 0316                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0317                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 318                }
 0319                catch (Exception e)
 320                {
 0321                    scope.Failed(e);
 0322                    throw;
 323                }
 0324            }
 12325            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 326        }
 327
 328        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 329        /// <param name="resourceGroupName"> The name of the resource group. </param>
 330        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 331        /// <param name="cancellationToken"> The cancellation token to use. </param>
 332        public virtual AsyncPageable<PublicIPAddress> ListVirtualMachineScaleSetPublicIPAddressesAsync(string resourceGr
 333        {
 4334            if (resourceGroupName == null)
 335            {
 0336                throw new ArgumentNullException(nameof(resourceGroupName));
 337            }
 4338            if (virtualMachineScaleSetName == null)
 339            {
 0340                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 341            }
 342
 343            async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint)
 344            {
 4345                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 4346                scope.Start();
 347                try
 348                {
 4349                    var response = await RestClient.ListVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, 
 4350                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 351                }
 0352                catch (Exception e)
 353                {
 0354                    scope.Failed(e);
 0355                    throw;
 356                }
 4357            }
 358            async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint)
 359            {
 0360                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 0361                scope.Start();
 362                try
 363                {
 0364                    var response = await RestClient.ListVirtualMachineScaleSetPublicIPAddressesNextPageAsync(nextLink, r
 0365                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 366                }
 0367                catch (Exception e)
 368                {
 0369                    scope.Failed(e);
 0370                    throw;
 371                }
 0372            }
 4373            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 374        }
 375
 376        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 377        /// <param name="resourceGroupName"> The name of the resource group. </param>
 378        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 379        /// <param name="cancellationToken"> The cancellation token to use. </param>
 380        public virtual Pageable<PublicIPAddress> ListVirtualMachineScaleSetPublicIPAddresses(string resourceGroupName, s
 381        {
 4382            if (resourceGroupName == null)
 383            {
 0384                throw new ArgumentNullException(nameof(resourceGroupName));
 385            }
 4386            if (virtualMachineScaleSetName == null)
 387            {
 0388                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 389            }
 390
 391            Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint)
 392            {
 4393                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 4394                scope.Start();
 395                try
 396                {
 4397                    var response = RestClient.ListVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMach
 4398                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 399                }
 0400                catch (Exception e)
 401                {
 0402                    scope.Failed(e);
 0403                    throw;
 404                }
 4405            }
 406            Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint)
 407            {
 0408                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 0409                scope.Start();
 410                try
 411                {
 0412                    var response = RestClient.ListVirtualMachineScaleSetPublicIPAddressesNextPage(nextLink, resourceGrou
 0413                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 414                }
 0415                catch (Exception e)
 416                {
 0417                    scope.Failed(e);
 0418                    throw;
 419                }
 0420            }
 4421            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 422        }
 423
 424        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 425        /// <param name="resourceGroupName"> The name of the resource group. </param>
 426        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 427        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 428        /// <param name="networkInterfaceName"> The network interface name. </param>
 429        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 430        /// <param name="cancellationToken"> The cancellation token to use. </param>
 431        public virtual AsyncPageable<PublicIPAddress> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(string resource
 432        {
 2433            if (resourceGroupName == null)
 434            {
 0435                throw new ArgumentNullException(nameof(resourceGroupName));
 436            }
 2437            if (virtualMachineScaleSetName == null)
 438            {
 0439                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 440            }
 2441            if (virtualmachineIndex == null)
 442            {
 0443                throw new ArgumentNullException(nameof(virtualmachineIndex));
 444            }
 2445            if (networkInterfaceName == null)
 446            {
 0447                throw new ArgumentNullException(nameof(networkInterfaceName));
 448            }
 2449            if (ipConfigurationName == null)
 450            {
 0451                throw new ArgumentNullException(nameof(ipConfigurationName));
 452            }
 453
 454            async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint)
 455            {
 2456                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 2457                scope.Start();
 458                try
 459                {
 2460                    var response = await RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName
 2461                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 462                }
 0463                catch (Exception e)
 464                {
 0465                    scope.Failed(e);
 0466                    throw;
 467                }
 2468            }
 469            async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint)
 470            {
 0471                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 0472                scope.Start();
 473                try
 474                {
 0475                    var response = await RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesNextPageAsync(nextLink,
 0476                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 477                }
 0478                catch (Exception e)
 479                {
 0480                    scope.Failed(e);
 0481                    throw;
 482                }
 0483            }
 2484            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 485        }
 486
 487        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 488        /// <param name="resourceGroupName"> The name of the resource group. </param>
 489        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 490        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 491        /// <param name="networkInterfaceName"> The network interface name. </param>
 492        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 493        /// <param name="cancellationToken"> The cancellation token to use. </param>
 494        public virtual Pageable<PublicIPAddress> ListVirtualMachineScaleSetVMPublicIPAddresses(string resourceGroupName,
 495        {
 2496            if (resourceGroupName == null)
 497            {
 0498                throw new ArgumentNullException(nameof(resourceGroupName));
 499            }
 2500            if (virtualMachineScaleSetName == null)
 501            {
 0502                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 503            }
 2504            if (virtualmachineIndex == null)
 505            {
 0506                throw new ArgumentNullException(nameof(virtualmachineIndex));
 507            }
 2508            if (networkInterfaceName == null)
 509            {
 0510                throw new ArgumentNullException(nameof(networkInterfaceName));
 511            }
 2512            if (ipConfigurationName == null)
 513            {
 0514                throw new ArgumentNullException(nameof(ipConfigurationName));
 515            }
 516
 517            Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint)
 518            {
 2519                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 2520                scope.Start();
 521                try
 522                {
 2523                    var response = RestClient.ListVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMa
 2524                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 525                }
 0526                catch (Exception e)
 527                {
 0528                    scope.Failed(e);
 0529                    throw;
 530                }
 2531            }
 532            Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint)
 533            {
 0534                using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet
 0535                scope.Start();
 536                try
 537                {
 0538                    var response = RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesNextPage(nextLink, resourceGr
 0539                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 540                }
 0541                catch (Exception e)
 542                {
 0543                    scope.Failed(e);
 0544                    throw;
 545                }
 0546            }
 2547            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 548        }
 549
 550        /// <summary> Deletes the specified public IP address. </summary>
 551        /// <param name="resourceGroupName"> The name of the resource group. </param>
 552        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 553        /// <param name="cancellationToken"> The cancellation token to use. </param>
 554        public virtual async Task<PublicIPAddressesDeleteOperation> StartDeleteAsync(string resourceGroupName, string pu
 555        {
 22556            if (resourceGroupName == null)
 557            {
 0558                throw new ArgumentNullException(nameof(resourceGroupName));
 559            }
 22560            if (publicIpAddressName == null)
 561            {
 0562                throw new ArgumentNullException(nameof(publicIpAddressName));
 563            }
 564
 22565            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartDelete");
 22566            scope.Start();
 567            try
 568            {
 22569                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, publicIpAddressName, cancellation
 22570                return new PublicIPAddressesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques
 571            }
 0572            catch (Exception e)
 573            {
 0574                scope.Failed(e);
 0575                throw;
 576            }
 22577        }
 578
 579        /// <summary> Deletes the specified public IP address. </summary>
 580        /// <param name="resourceGroupName"> The name of the resource group. </param>
 581        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 582        /// <param name="cancellationToken"> The cancellation token to use. </param>
 583        public virtual PublicIPAddressesDeleteOperation StartDelete(string resourceGroupName, string publicIpAddressName
 584        {
 22585            if (resourceGroupName == null)
 586            {
 0587                throw new ArgumentNullException(nameof(resourceGroupName));
 588            }
 22589            if (publicIpAddressName == null)
 590            {
 0591                throw new ArgumentNullException(nameof(publicIpAddressName));
 592            }
 593
 22594            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartDelete");
 22595            scope.Start();
 596            try
 597            {
 22598                var originalResponse = RestClient.Delete(resourceGroupName, publicIpAddressName, cancellationToken);
 22599                return new PublicIPAddressesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques
 600            }
 0601            catch (Exception e)
 602            {
 0603                scope.Failed(e);
 0604                throw;
 605            }
 22606        }
 607
 608        /// <summary> Creates or updates a static or dynamic public IP address. </summary>
 609        /// <param name="resourceGroupName"> The name of the resource group. </param>
 610        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 611        /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param>
 612        /// <param name="cancellationToken"> The cancellation token to use. </param>
 613        public virtual async Task<PublicIPAddressesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGrou
 614        {
 30615            if (resourceGroupName == null)
 616            {
 0617                throw new ArgumentNullException(nameof(resourceGroupName));
 618            }
 30619            if (publicIpAddressName == null)
 620            {
 0621                throw new ArgumentNullException(nameof(publicIpAddressName));
 622            }
 30623            if (parameters == null)
 624            {
 0625                throw new ArgumentNullException(nameof(parameters));
 626            }
 627
 30628            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartCreateOrUpdate");
 30629            scope.Start();
 630            try
 631            {
 30632                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, para
 30633                return new PublicIPAddressesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea
 634            }
 0635            catch (Exception e)
 636            {
 0637                scope.Failed(e);
 0638                throw;
 639            }
 30640        }
 641
 642        /// <summary> Creates or updates a static or dynamic public IP address. </summary>
 643        /// <param name="resourceGroupName"> The name of the resource group. </param>
 644        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 645        /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param>
 646        /// <param name="cancellationToken"> The cancellation token to use. </param>
 647        public virtual PublicIPAddressesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string pub
 648        {
 30649            if (resourceGroupName == null)
 650            {
 0651                throw new ArgumentNullException(nameof(resourceGroupName));
 652            }
 30653            if (publicIpAddressName == null)
 654            {
 0655                throw new ArgumentNullException(nameof(publicIpAddressName));
 656            }
 30657            if (parameters == null)
 658            {
 0659                throw new ArgumentNullException(nameof(parameters));
 660            }
 661
 30662            using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartCreateOrUpdate");
 30663            scope.Start();
 664            try
 665            {
 30666                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, can
 30667                return new PublicIPAddressesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea
 668            }
 0669            catch (Exception e)
 670            {
 0671                scope.Failed(e);
 0672                throw;
 673            }
 30674        }
 675    }
 676}