< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
UpdateGroupsAsync()-0%100%
UpdateGroups(...)-0%100%
ListByResourceGroupAsync(...)-0%0%
<ListByResourceGroupAsync()-0%100%
<ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
ListAsync(...)-0%100%
List(...)-0%100%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\IpGroupsOperations.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 IpGroups service client. </summary>
 19    public partial class IpGroupsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal IpGroupsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of IpGroupsOperations for mocking. </summary>
 025        protected IpGroupsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of IpGroupsOperations. </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 IpGroupsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, U
 34        {
 035            RestClient = new IpGroupsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the specified ipGroups. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 43        /// <param name="expand"> Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<IpGroup>> GetAsync(string resourceGroupName, string ipGroupsName, string expa
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, ipGroupsName, expand, cancellationToken).ConfigureAw
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> Gets the specified ipGroups. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 63        /// <param name="expand"> Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<IpGroup> Get(string resourceGroupName, string ipGroupsName, string expand = null, Cancel
 66        {
 067            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.Get");
 068            scope.Start();
 69            try
 70            {
 071                return RestClient.Get(resourceGroupName, ipGroupsName, expand, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 078        }
 79
 80        /// <summary> Updates tags of an IpGroups resource. </summary>
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 83        /// <param name="parameters"> Parameters supplied to the update ipGroups operation. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual async Task<Response<IpGroup>> UpdateGroupsAsync(string resourceGroupName, string ipGroupsName, Ta
 86        {
 087            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.UpdateGroups");
 088            scope.Start();
 89            try
 90            {
 091                return await RestClient.UpdateGroupsAsync(resourceGroupName, ipGroupsName, parameters, cancellationToken
 92            }
 093            catch (Exception e)
 94            {
 095                scope.Failed(e);
 096                throw;
 97            }
 098        }
 99
 100        /// <summary> Updates tags of an IpGroups resource. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 103        /// <param name="parameters"> Parameters supplied to the update ipGroups operation. </param>
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public virtual Response<IpGroup> UpdateGroups(string resourceGroupName, string ipGroupsName, TagsObject paramete
 106        {
 0107            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.UpdateGroups");
 0108            scope.Start();
 109            try
 110            {
 0111                return RestClient.UpdateGroups(resourceGroupName, ipGroupsName, parameters, cancellationToken);
 112            }
 0113            catch (Exception e)
 114            {
 0115                scope.Failed(e);
 0116                throw;
 117            }
 0118        }
 119
 120        /// <summary> Gets all IpGroups in a resource group. </summary>
 121        /// <param name="resourceGroupName"> The name of the resource group. </param>
 122        /// <param name="cancellationToken"> The cancellation token to use. </param>
 123        public virtual AsyncPageable<IpGroup> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cance
 124        {
 0125            if (resourceGroupName == null)
 126            {
 0127                throw new ArgumentNullException(nameof(resourceGroupName));
 128            }
 129
 130            async Task<Page<IpGroup>> FirstPageFunc(int? pageSizeHint)
 131            {
 0132                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.ListByResourceGroup");
 0133                scope.Start();
 134                try
 135                {
 0136                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi
 0137                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 138                }
 0139                catch (Exception e)
 140                {
 0141                    scope.Failed(e);
 0142                    throw;
 143                }
 0144            }
 145            async Task<Page<IpGroup>> NextPageFunc(string nextLink, int? pageSizeHint)
 146            {
 0147                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.ListByResourceGroup");
 0148                scope.Start();
 149                try
 150                {
 0151                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel
 0152                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 153                }
 0154                catch (Exception e)
 155                {
 0156                    scope.Failed(e);
 0157                    throw;
 158                }
 0159            }
 0160            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 161        }
 162
 163        /// <summary> Gets all IpGroups in a resource group. </summary>
 164        /// <param name="resourceGroupName"> The name of the resource group. </param>
 165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 166        public virtual Pageable<IpGroup> ListByResourceGroup(string resourceGroupName, CancellationToken cancellationTok
 167        {
 0168            if (resourceGroupName == null)
 169            {
 0170                throw new ArgumentNullException(nameof(resourceGroupName));
 171            }
 172
 173            Page<IpGroup> FirstPageFunc(int? pageSizeHint)
 174            {
 0175                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.ListByResourceGroup");
 0176                scope.Start();
 177                try
 178                {
 0179                    var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 0180                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 181                }
 0182                catch (Exception e)
 183                {
 0184                    scope.Failed(e);
 0185                    throw;
 186                }
 0187            }
 188            Page<IpGroup> NextPageFunc(string nextLink, int? pageSizeHint)
 189            {
 0190                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.ListByResourceGroup");
 0191                scope.Start();
 192                try
 193                {
 0194                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken
 0195                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 196                }
 0197                catch (Exception e)
 198                {
 0199                    scope.Failed(e);
 0200                    throw;
 201                }
 0202            }
 0203            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 204        }
 205
 206        /// <summary> Gets all IpGroups in a subscription. </summary>
 207        /// <param name="cancellationToken"> The cancellation token to use. </param>
 208        public virtual AsyncPageable<IpGroup> ListAsync(CancellationToken cancellationToken = default)
 209        {
 210            async Task<Page<IpGroup>> FirstPageFunc(int? pageSizeHint)
 211            {
 0212                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.List");
 0213                scope.Start();
 214                try
 215                {
 0216                    var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false);
 0217                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 218                }
 0219                catch (Exception e)
 220                {
 0221                    scope.Failed(e);
 0222                    throw;
 223                }
 0224            }
 225            async Task<Page<IpGroup>> NextPageFunc(string nextLink, int? pageSizeHint)
 226            {
 0227                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.List");
 0228                scope.Start();
 229                try
 230                {
 0231                    var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false)
 0232                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 233                }
 0234                catch (Exception e)
 235                {
 0236                    scope.Failed(e);
 0237                    throw;
 238                }
 0239            }
 0240            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 241        }
 242
 243        /// <summary> Gets all IpGroups in a subscription. </summary>
 244        /// <param name="cancellationToken"> The cancellation token to use. </param>
 245        public virtual Pageable<IpGroup> List(CancellationToken cancellationToken = default)
 246        {
 247            Page<IpGroup> FirstPageFunc(int? pageSizeHint)
 248            {
 0249                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.List");
 0250                scope.Start();
 251                try
 252                {
 0253                    var response = RestClient.List(cancellationToken);
 0254                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 255                }
 0256                catch (Exception e)
 257                {
 0258                    scope.Failed(e);
 0259                    throw;
 260                }
 0261            }
 262            Page<IpGroup> NextPageFunc(string nextLink, int? pageSizeHint)
 263            {
 0264                using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.List");
 0265                scope.Start();
 266                try
 267                {
 0268                    var response = RestClient.ListNextPage(nextLink, cancellationToken);
 0269                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 270                }
 0271                catch (Exception e)
 272                {
 0273                    scope.Failed(e);
 0274                    throw;
 275                }
 0276            }
 0277            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 278        }
 279
 280        /// <summary> Creates or updates an ipGroups in a specified resource group. </summary>
 281        /// <param name="resourceGroupName"> The name of the resource group. </param>
 282        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 283        /// <param name="parameters"> Parameters supplied to the create or update IpGroups operation. </param>
 284        /// <param name="cancellationToken"> The cancellation token to use. </param>
 285        public virtual async Task<IpGroupsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName, st
 286        {
 0287            if (resourceGroupName == null)
 288            {
 0289                throw new ArgumentNullException(nameof(resourceGroupName));
 290            }
 0291            if (ipGroupsName == null)
 292            {
 0293                throw new ArgumentNullException(nameof(ipGroupsName));
 294            }
 0295            if (parameters == null)
 296            {
 0297                throw new ArgumentNullException(nameof(parameters));
 298            }
 299
 0300            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.StartCreateOrUpdate");
 0301            scope.Start();
 302            try
 303            {
 0304                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters,
 0305                return new IpGroupsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdat
 306            }
 0307            catch (Exception e)
 308            {
 0309                scope.Failed(e);
 0310                throw;
 311            }
 0312        }
 313
 314        /// <summary> Creates or updates an ipGroups in a specified resource group. </summary>
 315        /// <param name="resourceGroupName"> The name of the resource group. </param>
 316        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 317        /// <param name="parameters"> Parameters supplied to the create or update IpGroups operation. </param>
 318        /// <param name="cancellationToken"> The cancellation token to use. </param>
 319        public virtual IpGroupsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string ipGroupsName
 320        {
 0321            if (resourceGroupName == null)
 322            {
 0323                throw new ArgumentNullException(nameof(resourceGroupName));
 324            }
 0325            if (ipGroupsName == null)
 326            {
 0327                throw new ArgumentNullException(nameof(ipGroupsName));
 328            }
 0329            if (parameters == null)
 330            {
 0331                throw new ArgumentNullException(nameof(parameters));
 332            }
 333
 0334            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.StartCreateOrUpdate");
 0335            scope.Start();
 336            try
 337            {
 0338                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, ipGroupsName, parameters, cancellati
 0339                return new IpGroupsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdat
 340            }
 0341            catch (Exception e)
 342            {
 0343                scope.Failed(e);
 0344                throw;
 345            }
 0346        }
 347
 348        /// <summary> Deletes the specified ipGroups. </summary>
 349        /// <param name="resourceGroupName"> The name of the resource group. </param>
 350        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 351        /// <param name="cancellationToken"> The cancellation token to use. </param>
 352        public virtual async Task<IpGroupsDeleteOperation> StartDeleteAsync(string resourceGroupName, string ipGroupsNam
 353        {
 0354            if (resourceGroupName == null)
 355            {
 0356                throw new ArgumentNullException(nameof(resourceGroupName));
 357            }
 0358            if (ipGroupsName == null)
 359            {
 0360                throw new ArgumentNullException(nameof(ipGroupsName));
 361            }
 362
 0363            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.StartDelete");
 0364            scope.Start();
 365            try
 366            {
 0367                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, ipGroupsName, cancellationToken).
 0368                return new IpGroupsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourc
 369            }
 0370            catch (Exception e)
 371            {
 0372                scope.Failed(e);
 0373                throw;
 374            }
 0375        }
 376
 377        /// <summary> Deletes the specified ipGroups. </summary>
 378        /// <param name="resourceGroupName"> The name of the resource group. </param>
 379        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 380        /// <param name="cancellationToken"> The cancellation token to use. </param>
 381        public virtual IpGroupsDeleteOperation StartDelete(string resourceGroupName, string ipGroupsName, CancellationTo
 382        {
 0383            if (resourceGroupName == null)
 384            {
 0385                throw new ArgumentNullException(nameof(resourceGroupName));
 386            }
 0387            if (ipGroupsName == null)
 388            {
 0389                throw new ArgumentNullException(nameof(ipGroupsName));
 390            }
 391
 0392            using var scope = _clientDiagnostics.CreateScope("IpGroupsOperations.StartDelete");
 0393            scope.Start();
 394            try
 395            {
 0396                var originalResponse = RestClient.Delete(resourceGroupName, ipGroupsName, cancellationToken);
 0397                return new IpGroupsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourc
 398            }
 0399            catch (Exception e)
 400            {
 0401                scope.Failed(e);
 0402                throw;
 403            }
 0404        }
 405    }
 406}