< Summary

Class:Azure.ResourceManager.Network.ApplicationSecurityGroupsOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ApplicationSecurityGroupsOperations.cs
Covered lines:0
Uncovered lines:160
Coverable lines:160
Total lines:404
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%
UpdateTagsAsync()-0%100%
UpdateTags(...)-0%100%
<ListAllAsync()-0%100%
<ListAllAsync()-0%100%
ListAllAsync(...)-0%100%
ListAll(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ApplicationSecurityGroupsOperations.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 ApplicationSecurityGroups service client. </summary>
 19    public partial class ApplicationSecurityGroupsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal ApplicationSecurityGroupsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ApplicationSecurityGroupsOperations for mocking. </summary>
 025        protected ApplicationSecurityGroupsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of ApplicationSecurityGroupsOperations. </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 ApplicationSecurityGroupsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string 
 34        {
 035            RestClient = new ApplicationSecurityGroupsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoi
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets information about the specified application security group. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<ApplicationSecurityGroup>> GetAsync(string resourceGroupName, string applicat
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.Get");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.GetAsync(resourceGroupName, applicationSecurityGroupName, cancellationToken).Con
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> Gets information about the specified application security group. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<ApplicationSecurityGroup> Get(string resourceGroupName, string applicationSecurityGroupN
 64        {
 065            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.Get");
 066            scope.Start();
 67            try
 68            {
 069                return RestClient.Get(resourceGroupName, applicationSecurityGroupName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 076        }
 77
 78        /// <summary> Updates an application security group&apos;s tags. </summary>
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 81        /// <param name="parameters"> Parameters supplied to update application security group tags. </param>
 82        /// <param name="cancellationToken"> The cancellation token to use. </param>
 83        public virtual async Task<Response<ApplicationSecurityGroup>> UpdateTagsAsync(string resourceGroupName, string a
 84        {
 085            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.UpdateTags");
 086            scope.Start();
 87            try
 88            {
 089                return await RestClient.UpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters, can
 90            }
 091            catch (Exception e)
 92            {
 093                scope.Failed(e);
 094                throw;
 95            }
 096        }
 97
 98        /// <summary> Updates an application security group&apos;s tags. </summary>
 99        /// <param name="resourceGroupName"> The name of the resource group. </param>
 100        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 101        /// <param name="parameters"> Parameters supplied to update application security group tags. </param>
 102        /// <param name="cancellationToken"> The cancellation token to use. </param>
 103        public virtual Response<ApplicationSecurityGroup> UpdateTags(string resourceGroupName, string applicationSecurit
 104        {
 0105            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.UpdateTags");
 0106            scope.Start();
 107            try
 108            {
 0109                return RestClient.UpdateTags(resourceGroupName, applicationSecurityGroupName, parameters, cancellationTo
 110            }
 0111            catch (Exception e)
 112            {
 0113                scope.Failed(e);
 0114                throw;
 115            }
 0116        }
 117
 118        /// <summary> Gets all application security groups in a subscription. </summary>
 119        /// <param name="cancellationToken"> The cancellation token to use. </param>
 120        public virtual AsyncPageable<ApplicationSecurityGroup> ListAllAsync(CancellationToken cancellationToken = defaul
 121        {
 122            async Task<Page<ApplicationSecurityGroup>> FirstPageFunc(int? pageSizeHint)
 123            {
 0124                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.ListAll");
 0125                scope.Start();
 126                try
 127                {
 0128                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 0129                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 130                }
 0131                catch (Exception e)
 132                {
 0133                    scope.Failed(e);
 0134                    throw;
 135                }
 0136            }
 137            async Task<Page<ApplicationSecurityGroup>> NextPageFunc(string nextLink, int? pageSizeHint)
 138            {
 0139                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.ListAll");
 0140                scope.Start();
 141                try
 142                {
 0143                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0144                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 145                }
 0146                catch (Exception e)
 147                {
 0148                    scope.Failed(e);
 0149                    throw;
 150                }
 0151            }
 0152            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 153        }
 154
 155        /// <summary> Gets all application security groups in a subscription. </summary>
 156        /// <param name="cancellationToken"> The cancellation token to use. </param>
 157        public virtual Pageable<ApplicationSecurityGroup> ListAll(CancellationToken cancellationToken = default)
 158        {
 159            Page<ApplicationSecurityGroup> FirstPageFunc(int? pageSizeHint)
 160            {
 0161                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.ListAll");
 0162                scope.Start();
 163                try
 164                {
 0165                    var response = RestClient.ListAll(cancellationToken);
 0166                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 167                }
 0168                catch (Exception e)
 169                {
 0170                    scope.Failed(e);
 0171                    throw;
 172                }
 0173            }
 174            Page<ApplicationSecurityGroup> NextPageFunc(string nextLink, int? pageSizeHint)
 175            {
 0176                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.ListAll");
 0177                scope.Start();
 178                try
 179                {
 0180                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0181                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 182                }
 0183                catch (Exception e)
 184                {
 0185                    scope.Failed(e);
 0186                    throw;
 187                }
 0188            }
 0189            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 190        }
 191
 192        /// <summary> Gets all the application security groups in a resource group. </summary>
 193        /// <param name="resourceGroupName"> The name of the resource group. </param>
 194        /// <param name="cancellationToken"> The cancellation token to use. </param>
 195        public virtual AsyncPageable<ApplicationSecurityGroup> ListAsync(string resourceGroupName, CancellationToken can
 196        {
 0197            if (resourceGroupName == null)
 198            {
 0199                throw new ArgumentNullException(nameof(resourceGroupName));
 200            }
 201
 202            async Task<Page<ApplicationSecurityGroup>> FirstPageFunc(int? pageSizeHint)
 203            {
 0204                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.List");
 0205                scope.Start();
 206                try
 207                {
 0208                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 0209                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 210                }
 0211                catch (Exception e)
 212                {
 0213                    scope.Failed(e);
 0214                    throw;
 215                }
 0216            }
 217            async Task<Page<ApplicationSecurityGroup>> NextPageFunc(string nextLink, int? pageSizeHint)
 218            {
 0219                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.List");
 0220                scope.Start();
 221                try
 222                {
 0223                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0224                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 225                }
 0226                catch (Exception e)
 227                {
 0228                    scope.Failed(e);
 0229                    throw;
 230                }
 0231            }
 0232            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 233        }
 234
 235        /// <summary> Gets all the application security groups in a resource group. </summary>
 236        /// <param name="resourceGroupName"> The name of the resource group. </param>
 237        /// <param name="cancellationToken"> The cancellation token to use. </param>
 238        public virtual Pageable<ApplicationSecurityGroup> List(string resourceGroupName, CancellationToken cancellationT
 239        {
 0240            if (resourceGroupName == null)
 241            {
 0242                throw new ArgumentNullException(nameof(resourceGroupName));
 243            }
 244
 245            Page<ApplicationSecurityGroup> FirstPageFunc(int? pageSizeHint)
 246            {
 0247                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.List");
 0248                scope.Start();
 249                try
 250                {
 0251                    var response = RestClient.List(resourceGroupName, cancellationToken);
 0252                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 253                }
 0254                catch (Exception e)
 255                {
 0256                    scope.Failed(e);
 0257                    throw;
 258                }
 0259            }
 260            Page<ApplicationSecurityGroup> NextPageFunc(string nextLink, int? pageSizeHint)
 261            {
 0262                using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.List");
 0263                scope.Start();
 264                try
 265                {
 0266                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0267                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 268                }
 0269                catch (Exception e)
 270                {
 0271                    scope.Failed(e);
 0272                    throw;
 273                }
 0274            }
 0275            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 276        }
 277
 278        /// <summary> Deletes the specified application security group. </summary>
 279        /// <param name="resourceGroupName"> The name of the resource group. </param>
 280        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 281        /// <param name="cancellationToken"> The cancellation token to use. </param>
 282        public virtual async Task<ApplicationSecurityGroupsDeleteOperation> StartDeleteAsync(string resourceGroupName, s
 283        {
 0284            if (resourceGroupName == null)
 285            {
 0286                throw new ArgumentNullException(nameof(resourceGroupName));
 287            }
 0288            if (applicationSecurityGroupName == null)
 289            {
 0290                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 291            }
 292
 0293            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.StartDelete");
 0294            scope.Start();
 295            try
 296            {
 0297                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, applicationSecurityGroupName, can
 0298                return new ApplicationSecurityGroupsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele
 299            }
 0300            catch (Exception e)
 301            {
 0302                scope.Failed(e);
 0303                throw;
 304            }
 0305        }
 306
 307        /// <summary> Deletes the specified application security group. </summary>
 308        /// <param name="resourceGroupName"> The name of the resource group. </param>
 309        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 310        /// <param name="cancellationToken"> The cancellation token to use. </param>
 311        public virtual ApplicationSecurityGroupsDeleteOperation StartDelete(string resourceGroupName, string application
 312        {
 0313            if (resourceGroupName == null)
 314            {
 0315                throw new ArgumentNullException(nameof(resourceGroupName));
 316            }
 0317            if (applicationSecurityGroupName == null)
 318            {
 0319                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 320            }
 321
 0322            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.StartDelete");
 0323            scope.Start();
 324            try
 325            {
 0326                var originalResponse = RestClient.Delete(resourceGroupName, applicationSecurityGroupName, cancellationTo
 0327                return new ApplicationSecurityGroupsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele
 328            }
 0329            catch (Exception e)
 330            {
 0331                scope.Failed(e);
 0332                throw;
 333            }
 0334        }
 335
 336        /// <summary> Creates or updates an application security group. </summary>
 337        /// <param name="resourceGroupName"> The name of the resource group. </param>
 338        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 339        /// <param name="parameters"> Parameters supplied to the create or update ApplicationSecurityGroup operation. </
 340        /// <param name="cancellationToken"> The cancellation token to use. </param>
 341        public virtual async Task<ApplicationSecurityGroupsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string reso
 342        {
 0343            if (resourceGroupName == null)
 344            {
 0345                throw new ArgumentNullException(nameof(resourceGroupName));
 346            }
 0347            if (applicationSecurityGroupName == null)
 348            {
 0349                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 350            }
 0351            if (parameters == null)
 352            {
 0353                throw new ArgumentNullException(nameof(parameters));
 354            }
 355
 0356            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.StartCreateOrUpdate");
 0357            scope.Start();
 358            try
 359            {
 0360                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupN
 0361                return new ApplicationSecurityGroupsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 362            }
 0363            catch (Exception e)
 364            {
 0365                scope.Failed(e);
 0366                throw;
 367            }
 0368        }
 369
 370        /// <summary> Creates or updates an application security group. </summary>
 371        /// <param name="resourceGroupName"> The name of the resource group. </param>
 372        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 373        /// <param name="parameters"> Parameters supplied to the create or update ApplicationSecurityGroup operation. </
 374        /// <param name="cancellationToken"> The cancellation token to use. </param>
 375        public virtual ApplicationSecurityGroupsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, st
 376        {
 0377            if (resourceGroupName == null)
 378            {
 0379                throw new ArgumentNullException(nameof(resourceGroupName));
 380            }
 0381            if (applicationSecurityGroupName == null)
 382            {
 0383                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 384            }
 0385            if (parameters == null)
 386            {
 0387                throw new ArgumentNullException(nameof(parameters));
 388            }
 389
 0390            using var scope = _clientDiagnostics.CreateScope("ApplicationSecurityGroupsOperations.StartCreateOrUpdate");
 0391            scope.Start();
 392            try
 393            {
 0394                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parame
 0395                return new ApplicationSecurityGroupsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 396            }
 0397            catch (Exception e)
 398            {
 0399                scope.Failed(e);
 0400                throw;
 401            }
 0402        }
 403    }
 404}