< Summary

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

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%
ListAvailableServerVariablesAsync()-0%100%
ListAvailableServerVariables(...)-0%100%
ListAvailableRequestHeadersAsync()-0%100%
ListAvailableRequestHeaders(...)-0%100%
ListAvailableResponseHeadersAsync()-0%100%
ListAvailableResponseHeaders(...)-0%100%
ListAvailableWafRuleSetsAsync()-0%100%
ListAvailableWafRuleSets(...)-0%100%
ListAvailableSslOptionsAsync()-0%100%
ListAvailableSslOptions(...)-0%100%
GetSslPredefinedPolicyAsync()-0%100%
GetSslPredefinedPolicy(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%
<ListAllAsync()-0%100%
<ListAllAsync()-0%100%
ListAllAsync(...)-0%100%
ListAll(...)-0%100%
<ListAvailableSslPredefinedPoliciesAsync()-0%100%
<ListAvailableSslPredefinedPoliciesAsync()-0%100%
ListAvailableSslPredefinedPoliciesAsync(...)-0%100%
ListAvailableSslPredefinedPolicies(...)-0%100%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartStartAsync()-0%0%
StartStart(...)-0%0%
StartStopAsync()-0%0%
StartStop(...)-0%0%
StartBackendHealthAsync()-0%0%
StartBackendHealth(...)-0%0%
StartBackendHealthOnDemandAsync()-0%0%
StartBackendHealthOnDemand(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ApplicationGatewaysOperations.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.Collections.Generic;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.ResourceManager.Network.Models;
 16
 17namespace Azure.ResourceManager.Network
 18{
 19    /// <summary> The ApplicationGateways service client. </summary>
 20    public partial class ApplicationGatewaysOperations
 21    {
 22        private readonly ClientDiagnostics _clientDiagnostics;
 23        private readonly HttpPipeline _pipeline;
 024        internal ApplicationGatewaysRestOperations RestClient { get; }
 25        /// <summary> Initializes a new instance of ApplicationGatewaysOperations for mocking. </summary>
 026        protected ApplicationGatewaysOperations()
 27        {
 028        }
 29        /// <summary> Initializes a new instance of ApplicationGatewaysOperations. </summary>
 30        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 31        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 32        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 33        /// <param name="endpoint"> server parameter. </param>
 034        internal ApplicationGatewaysOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr
 35        {
 036            RestClient = new ApplicationGatewaysRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 037            _clientDiagnostics = clientDiagnostics;
 038            _pipeline = pipeline;
 039        }
 40
 41        /// <summary> Gets the specified application gateway. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group. </param>
 43        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<ApplicationGateway>> GetAsync(string resourceGroupName, string applicationGat
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, applicationGatewayName, cancellationToken).Configure
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> Gets the specified application gateway. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 63        /// <param name="cancellationToken"> The cancellation token to use. </param>
 64        public virtual Response<ApplicationGateway> Get(string resourceGroupName, string applicationGatewayName, Cancell
 65        {
 066            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.Get");
 067            scope.Start();
 68            try
 69            {
 070                return RestClient.Get(resourceGroupName, applicationGatewayName, cancellationToken);
 71            }
 072            catch (Exception e)
 73            {
 074                scope.Failed(e);
 075                throw;
 76            }
 077        }
 78
 79        /// <summary> Updates the specified application gateway tags. </summary>
 80        /// <param name="resourceGroupName"> The name of the resource group. </param>
 81        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 82        /// <param name="parameters"> Parameters supplied to update application gateway tags. </param>
 83        /// <param name="cancellationToken"> The cancellation token to use. </param>
 84        public virtual async Task<Response<ApplicationGateway>> UpdateTagsAsync(string resourceGroupName, string applica
 85        {
 086            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.UpdateTags");
 087            scope.Start();
 88            try
 89            {
 090                return await RestClient.UpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters, cancellat
 91            }
 092            catch (Exception e)
 93            {
 094                scope.Failed(e);
 095                throw;
 96            }
 097        }
 98
 99        /// <summary> Updates the specified application gateway tags. </summary>
 100        /// <param name="resourceGroupName"> The name of the resource group. </param>
 101        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 102        /// <param name="parameters"> Parameters supplied to update application gateway tags. </param>
 103        /// <param name="cancellationToken"> The cancellation token to use. </param>
 104        public virtual Response<ApplicationGateway> UpdateTags(string resourceGroupName, string applicationGatewayName, 
 105        {
 0106            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.UpdateTags");
 0107            scope.Start();
 108            try
 109            {
 0110                return RestClient.UpdateTags(resourceGroupName, applicationGatewayName, parameters, cancellationToken);
 111            }
 0112            catch (Exception e)
 113            {
 0114                scope.Failed(e);
 0115                throw;
 116            }
 0117        }
 118
 119        /// <summary> Lists all available server variables. </summary>
 120        /// <param name="cancellationToken"> The cancellation token to use. </param>
 121        public virtual async Task<Response<IReadOnlyList<string>>> ListAvailableServerVariablesAsync(CancellationToken c
 122        {
 0123            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableServerVariables
 0124            scope.Start();
 125            try
 126            {
 0127                return await RestClient.ListAvailableServerVariablesAsync(cancellationToken).ConfigureAwait(false);
 128            }
 0129            catch (Exception e)
 130            {
 0131                scope.Failed(e);
 0132                throw;
 133            }
 0134        }
 135
 136        /// <summary> Lists all available server variables. </summary>
 137        /// <param name="cancellationToken"> The cancellation token to use. </param>
 138        public virtual Response<IReadOnlyList<string>> ListAvailableServerVariables(CancellationToken cancellationToken 
 139        {
 0140            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableServerVariables
 0141            scope.Start();
 142            try
 143            {
 0144                return RestClient.ListAvailableServerVariables(cancellationToken);
 145            }
 0146            catch (Exception e)
 147            {
 0148                scope.Failed(e);
 0149                throw;
 150            }
 0151        }
 152
 153        /// <summary> Lists all available request headers. </summary>
 154        /// <param name="cancellationToken"> The cancellation token to use. </param>
 155        public virtual async Task<Response<IReadOnlyList<string>>> ListAvailableRequestHeadersAsync(CancellationToken ca
 156        {
 0157            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableRequestHeaders"
 0158            scope.Start();
 159            try
 160            {
 0161                return await RestClient.ListAvailableRequestHeadersAsync(cancellationToken).ConfigureAwait(false);
 162            }
 0163            catch (Exception e)
 164            {
 0165                scope.Failed(e);
 0166                throw;
 167            }
 0168        }
 169
 170        /// <summary> Lists all available request headers. </summary>
 171        /// <param name="cancellationToken"> The cancellation token to use. </param>
 172        public virtual Response<IReadOnlyList<string>> ListAvailableRequestHeaders(CancellationToken cancellationToken =
 173        {
 0174            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableRequestHeaders"
 0175            scope.Start();
 176            try
 177            {
 0178                return RestClient.ListAvailableRequestHeaders(cancellationToken);
 179            }
 0180            catch (Exception e)
 181            {
 0182                scope.Failed(e);
 0183                throw;
 184            }
 0185        }
 186
 187        /// <summary> Lists all available response headers. </summary>
 188        /// <param name="cancellationToken"> The cancellation token to use. </param>
 189        public virtual async Task<Response<IReadOnlyList<string>>> ListAvailableResponseHeadersAsync(CancellationToken c
 190        {
 0191            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableResponseHeaders
 0192            scope.Start();
 193            try
 194            {
 0195                return await RestClient.ListAvailableResponseHeadersAsync(cancellationToken).ConfigureAwait(false);
 196            }
 0197            catch (Exception e)
 198            {
 0199                scope.Failed(e);
 0200                throw;
 201            }
 0202        }
 203
 204        /// <summary> Lists all available response headers. </summary>
 205        /// <param name="cancellationToken"> The cancellation token to use. </param>
 206        public virtual Response<IReadOnlyList<string>> ListAvailableResponseHeaders(CancellationToken cancellationToken 
 207        {
 0208            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableResponseHeaders
 0209            scope.Start();
 210            try
 211            {
 0212                return RestClient.ListAvailableResponseHeaders(cancellationToken);
 213            }
 0214            catch (Exception e)
 215            {
 0216                scope.Failed(e);
 0217                throw;
 218            }
 0219        }
 220
 221        /// <summary> Lists all available web application firewall rule sets. </summary>
 222        /// <param name="cancellationToken"> The cancellation token to use. </param>
 223        public virtual async Task<Response<ApplicationGatewayAvailableWafRuleSetsResult>> ListAvailableWafRuleSetsAsync(
 224        {
 0225            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableWafRuleSets");
 0226            scope.Start();
 227            try
 228            {
 0229                return await RestClient.ListAvailableWafRuleSetsAsync(cancellationToken).ConfigureAwait(false);
 230            }
 0231            catch (Exception e)
 232            {
 0233                scope.Failed(e);
 0234                throw;
 235            }
 0236        }
 237
 238        /// <summary> Lists all available web application firewall rule sets. </summary>
 239        /// <param name="cancellationToken"> The cancellation token to use. </param>
 240        public virtual Response<ApplicationGatewayAvailableWafRuleSetsResult> ListAvailableWafRuleSets(CancellationToken
 241        {
 0242            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableWafRuleSets");
 0243            scope.Start();
 244            try
 245            {
 0246                return RestClient.ListAvailableWafRuleSets(cancellationToken);
 247            }
 0248            catch (Exception e)
 249            {
 0250                scope.Failed(e);
 0251                throw;
 252            }
 0253        }
 254
 255        /// <summary> Lists available Ssl options for configuring Ssl policy. </summary>
 256        /// <param name="cancellationToken"> The cancellation token to use. </param>
 257        public virtual async Task<Response<ApplicationGatewayAvailableSslOptions>> ListAvailableSslOptionsAsync(Cancella
 258        {
 0259            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslOptions");
 0260            scope.Start();
 261            try
 262            {
 0263                return await RestClient.ListAvailableSslOptionsAsync(cancellationToken).ConfigureAwait(false);
 264            }
 0265            catch (Exception e)
 266            {
 0267                scope.Failed(e);
 0268                throw;
 269            }
 0270        }
 271
 272        /// <summary> Lists available Ssl options for configuring Ssl policy. </summary>
 273        /// <param name="cancellationToken"> The cancellation token to use. </param>
 274        public virtual Response<ApplicationGatewayAvailableSslOptions> ListAvailableSslOptions(CancellationToken cancell
 275        {
 0276            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslOptions");
 0277            scope.Start();
 278            try
 279            {
 0280                return RestClient.ListAvailableSslOptions(cancellationToken);
 281            }
 0282            catch (Exception e)
 283            {
 0284                scope.Failed(e);
 0285                throw;
 286            }
 0287        }
 288
 289        /// <summary> Gets Ssl predefined policy with the specified policy name. </summary>
 290        /// <param name="predefinedPolicyName"> Name of Ssl predefined policy. </param>
 291        /// <param name="cancellationToken"> The cancellation token to use. </param>
 292        public virtual async Task<Response<ApplicationGatewaySslPredefinedPolicy>> GetSslPredefinedPolicyAsync(string pr
 293        {
 0294            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.GetSslPredefinedPolicy");
 0295            scope.Start();
 296            try
 297            {
 0298                return await RestClient.GetSslPredefinedPolicyAsync(predefinedPolicyName, cancellationToken).ConfigureAw
 299            }
 0300            catch (Exception e)
 301            {
 0302                scope.Failed(e);
 0303                throw;
 304            }
 0305        }
 306
 307        /// <summary> Gets Ssl predefined policy with the specified policy name. </summary>
 308        /// <param name="predefinedPolicyName"> Name of Ssl predefined policy. </param>
 309        /// <param name="cancellationToken"> The cancellation token to use. </param>
 310        public virtual Response<ApplicationGatewaySslPredefinedPolicy> GetSslPredefinedPolicy(string predefinedPolicyNam
 311        {
 0312            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.GetSslPredefinedPolicy");
 0313            scope.Start();
 314            try
 315            {
 0316                return RestClient.GetSslPredefinedPolicy(predefinedPolicyName, cancellationToken);
 317            }
 0318            catch (Exception e)
 319            {
 0320                scope.Failed(e);
 0321                throw;
 322            }
 0323        }
 324
 325        /// <summary> Lists all application gateways in a resource group. </summary>
 326        /// <param name="resourceGroupName"> The name of the resource group. </param>
 327        /// <param name="cancellationToken"> The cancellation token to use. </param>
 328        public virtual AsyncPageable<ApplicationGateway> ListAsync(string resourceGroupName, CancellationToken cancellat
 329        {
 0330            if (resourceGroupName == null)
 331            {
 0332                throw new ArgumentNullException(nameof(resourceGroupName));
 333            }
 334
 335            async Task<Page<ApplicationGateway>> FirstPageFunc(int? pageSizeHint)
 336            {
 0337                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.List");
 0338                scope.Start();
 339                try
 340                {
 0341                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 0342                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 343                }
 0344                catch (Exception e)
 345                {
 0346                    scope.Failed(e);
 0347                    throw;
 348                }
 0349            }
 350            async Task<Page<ApplicationGateway>> NextPageFunc(string nextLink, int? pageSizeHint)
 351            {
 0352                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.List");
 0353                scope.Start();
 354                try
 355                {
 0356                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0357                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 358                }
 0359                catch (Exception e)
 360                {
 0361                    scope.Failed(e);
 0362                    throw;
 363                }
 0364            }
 0365            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 366        }
 367
 368        /// <summary> Lists all application gateways in a resource group. </summary>
 369        /// <param name="resourceGroupName"> The name of the resource group. </param>
 370        /// <param name="cancellationToken"> The cancellation token to use. </param>
 371        public virtual Pageable<ApplicationGateway> List(string resourceGroupName, CancellationToken cancellationToken =
 372        {
 0373            if (resourceGroupName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(resourceGroupName));
 376            }
 377
 378            Page<ApplicationGateway> FirstPageFunc(int? pageSizeHint)
 379            {
 0380                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.List");
 0381                scope.Start();
 382                try
 383                {
 0384                    var response = RestClient.List(resourceGroupName, cancellationToken);
 0385                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 386                }
 0387                catch (Exception e)
 388                {
 0389                    scope.Failed(e);
 0390                    throw;
 391                }
 0392            }
 393            Page<ApplicationGateway> NextPageFunc(string nextLink, int? pageSizeHint)
 394            {
 0395                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.List");
 0396                scope.Start();
 397                try
 398                {
 0399                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0400                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 401                }
 0402                catch (Exception e)
 403                {
 0404                    scope.Failed(e);
 0405                    throw;
 406                }
 0407            }
 0408            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 409        }
 410
 411        /// <summary> Gets all the application gateways in a subscription. </summary>
 412        /// <param name="cancellationToken"> The cancellation token to use. </param>
 413        public virtual AsyncPageable<ApplicationGateway> ListAllAsync(CancellationToken cancellationToken = default)
 414        {
 415            async Task<Page<ApplicationGateway>> FirstPageFunc(int? pageSizeHint)
 416            {
 0417                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAll");
 0418                scope.Start();
 419                try
 420                {
 0421                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 0422                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 423                }
 0424                catch (Exception e)
 425                {
 0426                    scope.Failed(e);
 0427                    throw;
 428                }
 0429            }
 430            async Task<Page<ApplicationGateway>> NextPageFunc(string nextLink, int? pageSizeHint)
 431            {
 0432                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAll");
 0433                scope.Start();
 434                try
 435                {
 0436                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0437                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 438                }
 0439                catch (Exception e)
 440                {
 0441                    scope.Failed(e);
 0442                    throw;
 443                }
 0444            }
 0445            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 446        }
 447
 448        /// <summary> Gets all the application gateways in a subscription. </summary>
 449        /// <param name="cancellationToken"> The cancellation token to use. </param>
 450        public virtual Pageable<ApplicationGateway> ListAll(CancellationToken cancellationToken = default)
 451        {
 452            Page<ApplicationGateway> FirstPageFunc(int? pageSizeHint)
 453            {
 0454                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAll");
 0455                scope.Start();
 456                try
 457                {
 0458                    var response = RestClient.ListAll(cancellationToken);
 0459                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 460                }
 0461                catch (Exception e)
 462                {
 0463                    scope.Failed(e);
 0464                    throw;
 465                }
 0466            }
 467            Page<ApplicationGateway> NextPageFunc(string nextLink, int? pageSizeHint)
 468            {
 0469                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAll");
 0470                scope.Start();
 471                try
 472                {
 0473                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0474                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 475                }
 0476                catch (Exception e)
 477                {
 0478                    scope.Failed(e);
 0479                    throw;
 480                }
 0481            }
 0482            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 483        }
 484
 485        /// <summary> Lists all SSL predefined policies for configuring Ssl policy. </summary>
 486        /// <param name="cancellationToken"> The cancellation token to use. </param>
 487        public virtual AsyncPageable<ApplicationGatewaySslPredefinedPolicy> ListAvailableSslPredefinedPoliciesAsync(Canc
 488        {
 489            async Task<Page<ApplicationGatewaySslPredefinedPolicy>> FirstPageFunc(int? pageSizeHint)
 490            {
 0491                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslPredefin
 0492                scope.Start();
 493                try
 494                {
 0495                    var response = await RestClient.ListAvailableSslPredefinedPoliciesAsync(cancellationToken).Configure
 0496                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 497                }
 0498                catch (Exception e)
 499                {
 0500                    scope.Failed(e);
 0501                    throw;
 502                }
 0503            }
 504            async Task<Page<ApplicationGatewaySslPredefinedPolicy>> NextPageFunc(string nextLink, int? pageSizeHint)
 505            {
 0506                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslPredefin
 0507                scope.Start();
 508                try
 509                {
 0510                    var response = await RestClient.ListAvailableSslPredefinedPoliciesNextPageAsync(nextLink, cancellati
 0511                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 512                }
 0513                catch (Exception e)
 514                {
 0515                    scope.Failed(e);
 0516                    throw;
 517                }
 0518            }
 0519            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 520        }
 521
 522        /// <summary> Lists all SSL predefined policies for configuring Ssl policy. </summary>
 523        /// <param name="cancellationToken"> The cancellation token to use. </param>
 524        public virtual Pageable<ApplicationGatewaySslPredefinedPolicy> ListAvailableSslPredefinedPolicies(CancellationTo
 525        {
 526            Page<ApplicationGatewaySslPredefinedPolicy> FirstPageFunc(int? pageSizeHint)
 527            {
 0528                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslPredefin
 0529                scope.Start();
 530                try
 531                {
 0532                    var response = RestClient.ListAvailableSslPredefinedPolicies(cancellationToken);
 0533                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 534                }
 0535                catch (Exception e)
 536                {
 0537                    scope.Failed(e);
 0538                    throw;
 539                }
 0540            }
 541            Page<ApplicationGatewaySslPredefinedPolicy> NextPageFunc(string nextLink, int? pageSizeHint)
 542            {
 0543                using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.ListAvailableSslPredefin
 0544                scope.Start();
 545                try
 546                {
 0547                    var response = RestClient.ListAvailableSslPredefinedPoliciesNextPage(nextLink, cancellationToken);
 0548                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 549                }
 0550                catch (Exception e)
 551                {
 0552                    scope.Failed(e);
 0553                    throw;
 554                }
 0555            }
 0556            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 557        }
 558
 559        /// <summary> Deletes the specified application gateway. </summary>
 560        /// <param name="resourceGroupName"> The name of the resource group. </param>
 561        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 562        /// <param name="cancellationToken"> The cancellation token to use. </param>
 563        public virtual async Task<ApplicationGatewaysDeleteOperation> StartDeleteAsync(string resourceGroupName, string 
 564        {
 0565            if (resourceGroupName == null)
 566            {
 0567                throw new ArgumentNullException(nameof(resourceGroupName));
 568            }
 0569            if (applicationGatewayName == null)
 570            {
 0571                throw new ArgumentNullException(nameof(applicationGatewayName));
 572            }
 573
 0574            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartDelete");
 0575            scope.Start();
 576            try
 577            {
 0578                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, applicationGatewayName, cancellat
 0579                return new ApplicationGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ
 580            }
 0581            catch (Exception e)
 582            {
 0583                scope.Failed(e);
 0584                throw;
 585            }
 0586        }
 587
 588        /// <summary> Deletes the specified application gateway. </summary>
 589        /// <param name="resourceGroupName"> The name of the resource group. </param>
 590        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 591        /// <param name="cancellationToken"> The cancellation token to use. </param>
 592        public virtual ApplicationGatewaysDeleteOperation StartDelete(string resourceGroupName, string applicationGatewa
 593        {
 0594            if (resourceGroupName == null)
 595            {
 0596                throw new ArgumentNullException(nameof(resourceGroupName));
 597            }
 0598            if (applicationGatewayName == null)
 599            {
 0600                throw new ArgumentNullException(nameof(applicationGatewayName));
 601            }
 602
 0603            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartDelete");
 0604            scope.Start();
 605            try
 606            {
 0607                var originalResponse = RestClient.Delete(resourceGroupName, applicationGatewayName, cancellationToken);
 0608                return new ApplicationGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ
 609            }
 0610            catch (Exception e)
 611            {
 0612                scope.Failed(e);
 0613                throw;
 614            }
 0615        }
 616
 617        /// <summary> Creates or updates the specified application gateway. </summary>
 618        /// <param name="resourceGroupName"> The name of the resource group. </param>
 619        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 620        /// <param name="parameters"> Parameters supplied to the create or update application gateway operation. </param
 621        /// <param name="cancellationToken"> The cancellation token to use. </param>
 622        public virtual async Task<ApplicationGatewaysCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGr
 623        {
 0624            if (resourceGroupName == null)
 625            {
 0626                throw new ArgumentNullException(nameof(resourceGroupName));
 627            }
 0628            if (applicationGatewayName == null)
 629            {
 0630                throw new ArgumentNullException(nameof(applicationGatewayName));
 631            }
 0632            if (parameters == null)
 633            {
 0634                throw new ArgumentNullException(nameof(parameters));
 635            }
 636
 0637            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartCreateOrUpdate");
 0638            scope.Start();
 639            try
 640            {
 0641                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, p
 0642                return new ApplicationGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr
 643            }
 0644            catch (Exception e)
 645            {
 0646                scope.Failed(e);
 0647                throw;
 648            }
 0649        }
 650
 651        /// <summary> Creates or updates the specified application gateway. </summary>
 652        /// <param name="resourceGroupName"> The name of the resource group. </param>
 653        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 654        /// <param name="parameters"> Parameters supplied to the create or update application gateway operation. </param
 655        /// <param name="cancellationToken"> The cancellation token to use. </param>
 656        public virtual ApplicationGatewaysCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string a
 657        {
 0658            if (resourceGroupName == null)
 659            {
 0660                throw new ArgumentNullException(nameof(resourceGroupName));
 661            }
 0662            if (applicationGatewayName == null)
 663            {
 0664                throw new ArgumentNullException(nameof(applicationGatewayName));
 665            }
 0666            if (parameters == null)
 667            {
 0668                throw new ArgumentNullException(nameof(parameters));
 669            }
 670
 0671            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartCreateOrUpdate");
 0672            scope.Start();
 673            try
 674            {
 0675                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 
 0676                return new ApplicationGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr
 677            }
 0678            catch (Exception e)
 679            {
 0680                scope.Failed(e);
 0681                throw;
 682            }
 0683        }
 684
 685        /// <summary> Starts the specified application gateway. </summary>
 686        /// <param name="resourceGroupName"> The name of the resource group. </param>
 687        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 688        /// <param name="cancellationToken"> The cancellation token to use. </param>
 689        public virtual async Task<ApplicationGatewaysStartOperation> StartStartAsync(string resourceGroupName, string ap
 690        {
 0691            if (resourceGroupName == null)
 692            {
 0693                throw new ArgumentNullException(nameof(resourceGroupName));
 694            }
 0695            if (applicationGatewayName == null)
 696            {
 0697                throw new ArgumentNullException(nameof(applicationGatewayName));
 698            }
 699
 0700            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartStart");
 0701            scope.Start();
 702            try
 703            {
 0704                var originalResponse = await RestClient.StartAsync(resourceGroupName, applicationGatewayName, cancellati
 0705                return new ApplicationGatewaysStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartReques
 706            }
 0707            catch (Exception e)
 708            {
 0709                scope.Failed(e);
 0710                throw;
 711            }
 0712        }
 713
 714        /// <summary> Starts the specified application gateway. </summary>
 715        /// <param name="resourceGroupName"> The name of the resource group. </param>
 716        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 717        /// <param name="cancellationToken"> The cancellation token to use. </param>
 718        public virtual ApplicationGatewaysStartOperation StartStart(string resourceGroupName, string applicationGatewayN
 719        {
 0720            if (resourceGroupName == null)
 721            {
 0722                throw new ArgumentNullException(nameof(resourceGroupName));
 723            }
 0724            if (applicationGatewayName == null)
 725            {
 0726                throw new ArgumentNullException(nameof(applicationGatewayName));
 727            }
 728
 0729            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartStart");
 0730            scope.Start();
 731            try
 732            {
 0733                var originalResponse = RestClient.Start(resourceGroupName, applicationGatewayName, cancellationToken);
 0734                return new ApplicationGatewaysStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartReques
 735            }
 0736            catch (Exception e)
 737            {
 0738                scope.Failed(e);
 0739                throw;
 740            }
 0741        }
 742
 743        /// <summary> Stops the specified application gateway in a resource group. </summary>
 744        /// <param name="resourceGroupName"> The name of the resource group. </param>
 745        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 746        /// <param name="cancellationToken"> The cancellation token to use. </param>
 747        public virtual async Task<ApplicationGatewaysStopOperation> StartStopAsync(string resourceGroupName, string appl
 748        {
 0749            if (resourceGroupName == null)
 750            {
 0751                throw new ArgumentNullException(nameof(resourceGroupName));
 752            }
 0753            if (applicationGatewayName == null)
 754            {
 0755                throw new ArgumentNullException(nameof(applicationGatewayName));
 756            }
 757
 0758            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartStop");
 0759            scope.Start();
 760            try
 761            {
 0762                var originalResponse = await RestClient.StopAsync(resourceGroupName, applicationGatewayName, cancellatio
 0763                return new ApplicationGatewaysStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(
 764            }
 0765            catch (Exception e)
 766            {
 0767                scope.Failed(e);
 0768                throw;
 769            }
 0770        }
 771
 772        /// <summary> Stops the specified application gateway in a resource group. </summary>
 773        /// <param name="resourceGroupName"> The name of the resource group. </param>
 774        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 775        /// <param name="cancellationToken"> The cancellation token to use. </param>
 776        public virtual ApplicationGatewaysStopOperation StartStop(string resourceGroupName, string applicationGatewayNam
 777        {
 0778            if (resourceGroupName == null)
 779            {
 0780                throw new ArgumentNullException(nameof(resourceGroupName));
 781            }
 0782            if (applicationGatewayName == null)
 783            {
 0784                throw new ArgumentNullException(nameof(applicationGatewayName));
 785            }
 786
 0787            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartStop");
 0788            scope.Start();
 789            try
 790            {
 0791                var originalResponse = RestClient.Stop(resourceGroupName, applicationGatewayName, cancellationToken);
 0792                return new ApplicationGatewaysStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(
 793            }
 0794            catch (Exception e)
 795            {
 0796                scope.Failed(e);
 0797                throw;
 798            }
 0799        }
 800
 801        /// <summary> Gets the backend health of the specified application gateway in a resource group. </summary>
 802        /// <param name="resourceGroupName"> The name of the resource group. </param>
 803        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 804        /// <param name="expand"> Expands BackendAddressPool and BackendHttpSettings referenced in backend health. </par
 805        /// <param name="cancellationToken"> The cancellation token to use. </param>
 806        public virtual async Task<ApplicationGatewaysBackendHealthOperation> StartBackendHealthAsync(string resourceGrou
 807        {
 0808            if (resourceGroupName == null)
 809            {
 0810                throw new ArgumentNullException(nameof(resourceGroupName));
 811            }
 0812            if (applicationGatewayName == null)
 813            {
 0814                throw new ArgumentNullException(nameof(applicationGatewayName));
 815            }
 816
 0817            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartBackendHealth");
 0818            scope.Start();
 819            try
 820            {
 0821                var originalResponse = await RestClient.BackendHealthAsync(resourceGroupName, applicationGatewayName, ex
 0822                return new ApplicationGatewaysBackendHealthOperation(_clientDiagnostics, _pipeline, RestClient.CreateBac
 823            }
 0824            catch (Exception e)
 825            {
 0826                scope.Failed(e);
 0827                throw;
 828            }
 0829        }
 830
 831        /// <summary> Gets the backend health of the specified application gateway in a resource group. </summary>
 832        /// <param name="resourceGroupName"> The name of the resource group. </param>
 833        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 834        /// <param name="expand"> Expands BackendAddressPool and BackendHttpSettings referenced in backend health. </par
 835        /// <param name="cancellationToken"> The cancellation token to use. </param>
 836        public virtual ApplicationGatewaysBackendHealthOperation StartBackendHealth(string resourceGroupName, string app
 837        {
 0838            if (resourceGroupName == null)
 839            {
 0840                throw new ArgumentNullException(nameof(resourceGroupName));
 841            }
 0842            if (applicationGatewayName == null)
 843            {
 0844                throw new ArgumentNullException(nameof(applicationGatewayName));
 845            }
 846
 0847            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartBackendHealth");
 0848            scope.Start();
 849            try
 850            {
 0851                var originalResponse = RestClient.BackendHealth(resourceGroupName, applicationGatewayName, expand, cance
 0852                return new ApplicationGatewaysBackendHealthOperation(_clientDiagnostics, _pipeline, RestClient.CreateBac
 853            }
 0854            catch (Exception e)
 855            {
 0856                scope.Failed(e);
 0857                throw;
 858            }
 0859        }
 860
 861        /// <summary> Gets the backend health for given combination of backend pool and http setting of the specified ap
 862        /// <param name="resourceGroupName"> The name of the resource group. </param>
 863        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 864        /// <param name="probeRequest"> Request body for on-demand test probe operation. </param>
 865        /// <param name="expand"> Expands BackendAddressPool and BackendHttpSettings referenced in backend health. </par
 866        /// <param name="cancellationToken"> The cancellation token to use. </param>
 867        public virtual async Task<ApplicationGatewaysBackendHealthOnDemandOperation> StartBackendHealthOnDemandAsync(str
 868        {
 0869            if (resourceGroupName == null)
 870            {
 0871                throw new ArgumentNullException(nameof(resourceGroupName));
 872            }
 0873            if (applicationGatewayName == null)
 874            {
 0875                throw new ArgumentNullException(nameof(applicationGatewayName));
 876            }
 0877            if (probeRequest == null)
 878            {
 0879                throw new ArgumentNullException(nameof(probeRequest));
 880            }
 881
 0882            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartBackendHealthOnDemand")
 0883            scope.Start();
 884            try
 885            {
 0886                var originalResponse = await RestClient.BackendHealthOnDemandAsync(resourceGroupName, applicationGateway
 0887                return new ApplicationGatewaysBackendHealthOnDemandOperation(_clientDiagnostics, _pipeline, RestClient.C
 888            }
 0889            catch (Exception e)
 890            {
 0891                scope.Failed(e);
 0892                throw;
 893            }
 0894        }
 895
 896        /// <summary> Gets the backend health for given combination of backend pool and http setting of the specified ap
 897        /// <param name="resourceGroupName"> The name of the resource group. </param>
 898        /// <param name="applicationGatewayName"> The name of the application gateway. </param>
 899        /// <param name="probeRequest"> Request body for on-demand test probe operation. </param>
 900        /// <param name="expand"> Expands BackendAddressPool and BackendHttpSettings referenced in backend health. </par
 901        /// <param name="cancellationToken"> The cancellation token to use. </param>
 902        public virtual ApplicationGatewaysBackendHealthOnDemandOperation StartBackendHealthOnDemand(string resourceGroup
 903        {
 0904            if (resourceGroupName == null)
 905            {
 0906                throw new ArgumentNullException(nameof(resourceGroupName));
 907            }
 0908            if (applicationGatewayName == null)
 909            {
 0910                throw new ArgumentNullException(nameof(applicationGatewayName));
 911            }
 0912            if (probeRequest == null)
 913            {
 0914                throw new ArgumentNullException(nameof(probeRequest));
 915            }
 916
 0917            using var scope = _clientDiagnostics.CreateScope("ApplicationGatewaysOperations.StartBackendHealthOnDemand")
 0918            scope.Start();
 919            try
 920            {
 0921                var originalResponse = RestClient.BackendHealthOnDemand(resourceGroupName, applicationGatewayName, probe
 0922                return new ApplicationGatewaysBackendHealthOnDemandOperation(_clientDiagnostics, _pipeline, RestClient.C
 923            }
 0924            catch (Exception e)
 925            {
 0926                scope.Failed(e);
 0927                throw;
 928            }
 0929        }
 930    }
 931}