< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateGetRequest(...)-0%100%
GetAsync()-0%0%
Get(...)-0%0%
CreateCreateOrUpdateRequest(...)-0%100%
CreateOrUpdateAsync()-0%0%
CreateOrUpdate(...)-0%0%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateListByResourceGroupRequest(...)-0%100%
ListByResourceGroupAsync()-0%0%
ListByResourceGroup(...)-0%0%
CreateListRequest()-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateGenerateVpnProfileRequest(...)-0%100%
GenerateVpnProfileAsync()-0%0%
GenerateVpnProfile(...)-0%0%
CreateGetP2SVpnConnectionHealthRequest(...)-0%100%
GetP2SVpnConnectionHealthAsync()-0%0%
GetP2SVpnConnectionHealth(...)-0%0%
CreateGetP2SVpnConnectionHealthDetailedRequest(...)-0%100%
GetP2SVpnConnectionHealthDetailedAsync()-0%0%
GetP2SVpnConnectionHealthDetailed(...)-0%0%
CreateDisconnectP2SVpnConnectionsRequest(...)-0%100%
DisconnectP2SVpnConnectionsAsync()-0%0%
DisconnectP2SVpnConnections(...)-0%0%
CreateListByResourceGroupNextPageRequest(...)-0%100%
ListByResourceGroupNextPageAsync()-0%0%
ListByResourceGroupNextPage(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\P2SVpnGatewaysRestOperations.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.Text.Json;
 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    internal partial class P2SVpnGatewaysRestOperations
 20    {
 21        private string subscriptionId;
 22        private Uri endpoint;
 23        private ClientDiagnostics _clientDiagnostics;
 24        private HttpPipeline _pipeline;
 25
 26        /// <summary> Initializes a new instance of P2SVpnGatewaysRestOperations. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 032        public P2SVpnGatewaysRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscript
 33        {
 034            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 038            endpoint ??= new Uri("https://management.azure.com");
 39
 040            this.subscriptionId = subscriptionId;
 041            this.endpoint = endpoint;
 042            _clientDiagnostics = clientDiagnostics;
 043            _pipeline = pipeline;
 044        }
 45
 46        internal HttpMessage CreateGetRequest(string resourceGroupName, string gatewayName)
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 058            uri.AppendPath(gatewayName, true);
 059            uri.AppendQuery("api-version", "2020-04-01", true);
 060            request.Uri = uri;
 061            return message;
 62        }
 63
 64        /// <summary> Retrieves the details of a virtual wan p2s vpn gateway. </summary>
 65        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 66        /// <param name="gatewayName"> The name of the gateway. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response<P2SVpnGateway>> GetAsync(string resourceGroupName, string gatewayName, CancellationTo
 69        {
 070            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 074            if (gatewayName == null)
 75            {
 076                throw new ArgumentNullException(nameof(gatewayName));
 77            }
 78
 079            using var message = CreateGetRequest(resourceGroupName, gatewayName);
 080            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 081            switch (message.Response.Status)
 82            {
 83                case 200:
 84                    {
 085                        P2SVpnGateway value = default;
 086                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 087                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 88                        {
 089                            value = null;
 90                        }
 91                        else
 92                        {
 093                            value = P2SVpnGateway.DeserializeP2SVpnGateway(document.RootElement);
 94                        }
 095                        return Response.FromValue(value, message.Response);
 96                    }
 97                default:
 098                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 99            }
 0100        }
 101
 102        /// <summary> Retrieves the details of a virtual wan p2s vpn gateway. </summary>
 103        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 104        /// <param name="gatewayName"> The name of the gateway. </param>
 105        /// <param name="cancellationToken"> The cancellation token to use. </param>
 106        public Response<P2SVpnGateway> Get(string resourceGroupName, string gatewayName, CancellationToken cancellationT
 107        {
 0108            if (resourceGroupName == null)
 109            {
 0110                throw new ArgumentNullException(nameof(resourceGroupName));
 111            }
 0112            if (gatewayName == null)
 113            {
 0114                throw new ArgumentNullException(nameof(gatewayName));
 115            }
 116
 0117            using var message = CreateGetRequest(resourceGroupName, gatewayName);
 0118            _pipeline.Send(message, cancellationToken);
 0119            switch (message.Response.Status)
 120            {
 121                case 200:
 122                    {
 0123                        P2SVpnGateway value = default;
 0124                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0125                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 126                        {
 0127                            value = null;
 128                        }
 129                        else
 130                        {
 0131                            value = P2SVpnGateway.DeserializeP2SVpnGateway(document.RootElement);
 132                        }
 0133                        return Response.FromValue(value, message.Response);
 134                    }
 135                default:
 0136                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 137            }
 0138        }
 139
 140        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string gatewayName, P2SVpnGateway p2S
 141        {
 0142            var message = _pipeline.CreateMessage();
 0143            var request = message.Request;
 0144            request.Method = RequestMethod.Put;
 0145            var uri = new RawRequestUriBuilder();
 0146            uri.Reset(endpoint);
 0147            uri.AppendPath("/subscriptions/", false);
 0148            uri.AppendPath(subscriptionId, true);
 0149            uri.AppendPath("/resourceGroups/", false);
 0150            uri.AppendPath(resourceGroupName, true);
 0151            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0152            uri.AppendPath(gatewayName, true);
 0153            uri.AppendQuery("api-version", "2020-04-01", true);
 0154            request.Uri = uri;
 0155            request.Headers.Add("Content-Type", "application/json");
 0156            var content = new Utf8JsonRequestContent();
 0157            content.JsonWriter.WriteObjectValue(p2SVpnGatewayParameters);
 0158            request.Content = content;
 0159            return message;
 160        }
 161
 162        /// <summary> Creates a virtual wan p2s vpn gateway if it doesn&apos;t exist else updates the existing gateway. 
 163        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 164        /// <param name="gatewayName"> The name of the gateway. </param>
 165        /// <param name="p2SVpnGatewayParameters"> Parameters supplied to create or Update a virtual wan p2s vpn gateway
 166        /// <param name="cancellationToken"> The cancellation token to use. </param>
 167        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SV
 168        {
 0169            if (resourceGroupName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(resourceGroupName));
 172            }
 0173            if (gatewayName == null)
 174            {
 0175                throw new ArgumentNullException(nameof(gatewayName));
 176            }
 0177            if (p2SVpnGatewayParameters == null)
 178            {
 0179                throw new ArgumentNullException(nameof(p2SVpnGatewayParameters));
 180            }
 181
 0182            using var message = CreateCreateOrUpdateRequest(resourceGroupName, gatewayName, p2SVpnGatewayParameters);
 0183            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0184            switch (message.Response.Status)
 185            {
 186                case 200:
 187                case 201:
 0188                    return message.Response;
 189                default:
 0190                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 191            }
 0192        }
 193
 194        /// <summary> Creates a virtual wan p2s vpn gateway if it doesn&apos;t exist else updates the existing gateway. 
 195        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 196        /// <param name="gatewayName"> The name of the gateway. </param>
 197        /// <param name="p2SVpnGatewayParameters"> Parameters supplied to create or Update a virtual wan p2s vpn gateway
 198        /// <param name="cancellationToken"> The cancellation token to use. </param>
 199        public Response CreateOrUpdate(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParamete
 200        {
 0201            if (resourceGroupName == null)
 202            {
 0203                throw new ArgumentNullException(nameof(resourceGroupName));
 204            }
 0205            if (gatewayName == null)
 206            {
 0207                throw new ArgumentNullException(nameof(gatewayName));
 208            }
 0209            if (p2SVpnGatewayParameters == null)
 210            {
 0211                throw new ArgumentNullException(nameof(p2SVpnGatewayParameters));
 212            }
 213
 0214            using var message = CreateCreateOrUpdateRequest(resourceGroupName, gatewayName, p2SVpnGatewayParameters);
 0215            _pipeline.Send(message, cancellationToken);
 0216            switch (message.Response.Status)
 217            {
 218                case 200:
 219                case 201:
 0220                    return message.Response;
 221                default:
 0222                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 223            }
 0224        }
 225
 226        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string gatewayName, TagsObject p2SVpnGate
 227        {
 0228            var message = _pipeline.CreateMessage();
 0229            var request = message.Request;
 0230            request.Method = RequestMethod.Patch;
 0231            var uri = new RawRequestUriBuilder();
 0232            uri.Reset(endpoint);
 0233            uri.AppendPath("/subscriptions/", false);
 0234            uri.AppendPath(subscriptionId, true);
 0235            uri.AppendPath("/resourceGroups/", false);
 0236            uri.AppendPath(resourceGroupName, true);
 0237            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0238            uri.AppendPath(gatewayName, true);
 0239            uri.AppendQuery("api-version", "2020-04-01", true);
 0240            request.Uri = uri;
 0241            request.Headers.Add("Content-Type", "application/json");
 0242            var content = new Utf8JsonRequestContent();
 0243            content.JsonWriter.WriteObjectValue(p2SVpnGatewayParameters);
 0244            request.Content = content;
 0245            return message;
 246        }
 247
 248        /// <summary> Updates virtual wan p2s vpn gateway tags. </summary>
 249        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 250        /// <param name="gatewayName"> The name of the gateway. </param>
 251        /// <param name="p2SVpnGatewayParameters"> Parameters supplied to update a virtual wan p2s vpn gateway tags. </p
 252        /// <param name="cancellationToken"> The cancellation token to use. </param>
 253        public async Task<Response<P2SVpnGateway>> UpdateTagsAsync(string resourceGroupName, string gatewayName, TagsObj
 254        {
 0255            if (resourceGroupName == null)
 256            {
 0257                throw new ArgumentNullException(nameof(resourceGroupName));
 258            }
 0259            if (gatewayName == null)
 260            {
 0261                throw new ArgumentNullException(nameof(gatewayName));
 262            }
 0263            if (p2SVpnGatewayParameters == null)
 264            {
 0265                throw new ArgumentNullException(nameof(p2SVpnGatewayParameters));
 266            }
 267
 0268            using var message = CreateUpdateTagsRequest(resourceGroupName, gatewayName, p2SVpnGatewayParameters);
 0269            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0270            switch (message.Response.Status)
 271            {
 272                case 200:
 273                    {
 0274                        P2SVpnGateway value = default;
 0275                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0276                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 277                        {
 0278                            value = null;
 279                        }
 280                        else
 281                        {
 0282                            value = P2SVpnGateway.DeserializeP2SVpnGateway(document.RootElement);
 283                        }
 0284                        return Response.FromValue(value, message.Response);
 285                    }
 286                default:
 0287                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 288            }
 0289        }
 290
 291        /// <summary> Updates virtual wan p2s vpn gateway tags. </summary>
 292        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 293        /// <param name="gatewayName"> The name of the gateway. </param>
 294        /// <param name="p2SVpnGatewayParameters"> Parameters supplied to update a virtual wan p2s vpn gateway tags. </p
 295        /// <param name="cancellationToken"> The cancellation token to use. </param>
 296        public Response<P2SVpnGateway> UpdateTags(string resourceGroupName, string gatewayName, TagsObject p2SVpnGateway
 297        {
 0298            if (resourceGroupName == null)
 299            {
 0300                throw new ArgumentNullException(nameof(resourceGroupName));
 301            }
 0302            if (gatewayName == null)
 303            {
 0304                throw new ArgumentNullException(nameof(gatewayName));
 305            }
 0306            if (p2SVpnGatewayParameters == null)
 307            {
 0308                throw new ArgumentNullException(nameof(p2SVpnGatewayParameters));
 309            }
 310
 0311            using var message = CreateUpdateTagsRequest(resourceGroupName, gatewayName, p2SVpnGatewayParameters);
 0312            _pipeline.Send(message, cancellationToken);
 0313            switch (message.Response.Status)
 314            {
 315                case 200:
 316                    {
 0317                        P2SVpnGateway value = default;
 0318                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0319                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 320                        {
 0321                            value = null;
 322                        }
 323                        else
 324                        {
 0325                            value = P2SVpnGateway.DeserializeP2SVpnGateway(document.RootElement);
 326                        }
 0327                        return Response.FromValue(value, message.Response);
 328                    }
 329                default:
 0330                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 331            }
 0332        }
 333
 334        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string gatewayName)
 335        {
 0336            var message = _pipeline.CreateMessage();
 0337            var request = message.Request;
 0338            request.Method = RequestMethod.Delete;
 0339            var uri = new RawRequestUriBuilder();
 0340            uri.Reset(endpoint);
 0341            uri.AppendPath("/subscriptions/", false);
 0342            uri.AppendPath(subscriptionId, true);
 0343            uri.AppendPath("/resourceGroups/", false);
 0344            uri.AppendPath(resourceGroupName, true);
 0345            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0346            uri.AppendPath(gatewayName, true);
 0347            uri.AppendQuery("api-version", "2020-04-01", true);
 0348            request.Uri = uri;
 0349            return message;
 350        }
 351
 352        /// <summary> Deletes a virtual wan p2s vpn gateway. </summary>
 353        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 354        /// <param name="gatewayName"> The name of the gateway. </param>
 355        /// <param name="cancellationToken"> The cancellation token to use. </param>
 356        public async Task<Response> DeleteAsync(string resourceGroupName, string gatewayName, CancellationToken cancella
 357        {
 0358            if (resourceGroupName == null)
 359            {
 0360                throw new ArgumentNullException(nameof(resourceGroupName));
 361            }
 0362            if (gatewayName == null)
 363            {
 0364                throw new ArgumentNullException(nameof(gatewayName));
 365            }
 366
 0367            using var message = CreateDeleteRequest(resourceGroupName, gatewayName);
 0368            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0369            switch (message.Response.Status)
 370            {
 371                case 200:
 372                case 202:
 373                case 204:
 0374                    return message.Response;
 375                default:
 0376                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 377            }
 0378        }
 379
 380        /// <summary> Deletes a virtual wan p2s vpn gateway. </summary>
 381        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 382        /// <param name="gatewayName"> The name of the gateway. </param>
 383        /// <param name="cancellationToken"> The cancellation token to use. </param>
 384        public Response Delete(string resourceGroupName, string gatewayName, CancellationToken cancellationToken = defau
 385        {
 0386            if (resourceGroupName == null)
 387            {
 0388                throw new ArgumentNullException(nameof(resourceGroupName));
 389            }
 0390            if (gatewayName == null)
 391            {
 0392                throw new ArgumentNullException(nameof(gatewayName));
 393            }
 394
 0395            using var message = CreateDeleteRequest(resourceGroupName, gatewayName);
 0396            _pipeline.Send(message, cancellationToken);
 0397            switch (message.Response.Status)
 398            {
 399                case 200:
 400                case 202:
 401                case 204:
 0402                    return message.Response;
 403                default:
 0404                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 405            }
 0406        }
 407
 408        internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
 409        {
 0410            var message = _pipeline.CreateMessage();
 0411            var request = message.Request;
 0412            request.Method = RequestMethod.Get;
 0413            var uri = new RawRequestUriBuilder();
 0414            uri.Reset(endpoint);
 0415            uri.AppendPath("/subscriptions/", false);
 0416            uri.AppendPath(subscriptionId, true);
 0417            uri.AppendPath("/resourceGroups/", false);
 0418            uri.AppendPath(resourceGroupName, true);
 0419            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways", false);
 0420            uri.AppendQuery("api-version", "2020-04-01", true);
 0421            request.Uri = uri;
 0422            return message;
 423        }
 424
 425        /// <summary> Lists all the P2SVpnGateways in a resource group. </summary>
 426        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 427        /// <param name="cancellationToken"> The cancellation token to use. </param>
 428        public async Task<Response<ListP2SVpnGatewaysResult>> ListByResourceGroupAsync(string resourceGroupName, Cancell
 429        {
 0430            if (resourceGroupName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(resourceGroupName));
 433            }
 434
 0435            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0436            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0437            switch (message.Response.Status)
 438            {
 439                case 200:
 440                    {
 0441                        ListP2SVpnGatewaysResult value = default;
 0442                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0443                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 444                        {
 0445                            value = null;
 446                        }
 447                        else
 448                        {
 0449                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 450                        }
 0451                        return Response.FromValue(value, message.Response);
 452                    }
 453                default:
 0454                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 455            }
 0456        }
 457
 458        /// <summary> Lists all the P2SVpnGateways in a resource group. </summary>
 459        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 460        /// <param name="cancellationToken"> The cancellation token to use. </param>
 461        public Response<ListP2SVpnGatewaysResult> ListByResourceGroup(string resourceGroupName, CancellationToken cancel
 462        {
 0463            if (resourceGroupName == null)
 464            {
 0465                throw new ArgumentNullException(nameof(resourceGroupName));
 466            }
 467
 0468            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0469            _pipeline.Send(message, cancellationToken);
 0470            switch (message.Response.Status)
 471            {
 472                case 200:
 473                    {
 0474                        ListP2SVpnGatewaysResult value = default;
 0475                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0476                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 477                        {
 0478                            value = null;
 479                        }
 480                        else
 481                        {
 0482                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 483                        }
 0484                        return Response.FromValue(value, message.Response);
 485                    }
 486                default:
 0487                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 488            }
 0489        }
 490
 491        internal HttpMessage CreateListRequest()
 492        {
 0493            var message = _pipeline.CreateMessage();
 0494            var request = message.Request;
 0495            request.Method = RequestMethod.Get;
 0496            var uri = new RawRequestUriBuilder();
 0497            uri.Reset(endpoint);
 0498            uri.AppendPath("/subscriptions/", false);
 0499            uri.AppendPath(subscriptionId, true);
 0500            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways", false);
 0501            uri.AppendQuery("api-version", "2020-04-01", true);
 0502            request.Uri = uri;
 0503            return message;
 504        }
 505
 506        /// <summary> Lists all the P2SVpnGateways in a subscription. </summary>
 507        /// <param name="cancellationToken"> The cancellation token to use. </param>
 508        public async Task<Response<ListP2SVpnGatewaysResult>> ListAsync(CancellationToken cancellationToken = default)
 509        {
 0510            using var message = CreateListRequest();
 0511            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0512            switch (message.Response.Status)
 513            {
 514                case 200:
 515                    {
 0516                        ListP2SVpnGatewaysResult value = default;
 0517                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0518                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 519                        {
 0520                            value = null;
 521                        }
 522                        else
 523                        {
 0524                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 525                        }
 0526                        return Response.FromValue(value, message.Response);
 527                    }
 528                default:
 0529                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 530            }
 0531        }
 532
 533        /// <summary> Lists all the P2SVpnGateways in a subscription. </summary>
 534        /// <param name="cancellationToken"> The cancellation token to use. </param>
 535        public Response<ListP2SVpnGatewaysResult> List(CancellationToken cancellationToken = default)
 536        {
 0537            using var message = CreateListRequest();
 0538            _pipeline.Send(message, cancellationToken);
 0539            switch (message.Response.Status)
 540            {
 541                case 200:
 542                    {
 0543                        ListP2SVpnGatewaysResult value = default;
 0544                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0545                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 546                        {
 0547                            value = null;
 548                        }
 549                        else
 550                        {
 0551                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 552                        }
 0553                        return Response.FromValue(value, message.Response);
 554                    }
 555                default:
 0556                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 557            }
 0558        }
 559
 560        internal HttpMessage CreateGenerateVpnProfileRequest(string resourceGroupName, string gatewayName, P2SVpnProfile
 561        {
 0562            var message = _pipeline.CreateMessage();
 0563            var request = message.Request;
 0564            request.Method = RequestMethod.Post;
 0565            var uri = new RawRequestUriBuilder();
 0566            uri.Reset(endpoint);
 0567            uri.AppendPath("/subscriptions/", false);
 0568            uri.AppendPath(subscriptionId, true);
 0569            uri.AppendPath("/resourceGroups/", false);
 0570            uri.AppendPath(resourceGroupName, true);
 0571            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0572            uri.AppendPath(gatewayName, true);
 0573            uri.AppendPath("/generatevpnprofile", false);
 0574            uri.AppendQuery("api-version", "2020-04-01", true);
 0575            request.Uri = uri;
 0576            request.Headers.Add("Content-Type", "application/json");
 0577            var content = new Utf8JsonRequestContent();
 0578            content.JsonWriter.WriteObjectValue(parameters);
 0579            request.Content = content;
 0580            return message;
 581        }
 582
 583        /// <summary> Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. </summa
 584        /// <param name="resourceGroupName"> The name of the resource group. </param>
 585        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 586        /// <param name="parameters"> Parameters supplied to the generate P2SVpnGateway VPN client package operation. </
 587        /// <param name="cancellationToken"> The cancellation token to use. </param>
 588        public async Task<Response> GenerateVpnProfileAsync(string resourceGroupName, string gatewayName, P2SVpnProfileP
 589        {
 0590            if (resourceGroupName == null)
 591            {
 0592                throw new ArgumentNullException(nameof(resourceGroupName));
 593            }
 0594            if (gatewayName == null)
 595            {
 0596                throw new ArgumentNullException(nameof(gatewayName));
 597            }
 0598            if (parameters == null)
 599            {
 0600                throw new ArgumentNullException(nameof(parameters));
 601            }
 602
 0603            using var message = CreateGenerateVpnProfileRequest(resourceGroupName, gatewayName, parameters);
 0604            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0605            switch (message.Response.Status)
 606            {
 607                case 200:
 608                case 202:
 0609                    return message.Response;
 610                default:
 0611                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 612            }
 0613        }
 614
 615        /// <summary> Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. </summa
 616        /// <param name="resourceGroupName"> The name of the resource group. </param>
 617        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 618        /// <param name="parameters"> Parameters supplied to the generate P2SVpnGateway VPN client package operation. </
 619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 620        public Response GenerateVpnProfile(string resourceGroupName, string gatewayName, P2SVpnProfileParameters paramet
 621        {
 0622            if (resourceGroupName == null)
 623            {
 0624                throw new ArgumentNullException(nameof(resourceGroupName));
 625            }
 0626            if (gatewayName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(gatewayName));
 629            }
 0630            if (parameters == null)
 631            {
 0632                throw new ArgumentNullException(nameof(parameters));
 633            }
 634
 0635            using var message = CreateGenerateVpnProfileRequest(resourceGroupName, gatewayName, parameters);
 0636            _pipeline.Send(message, cancellationToken);
 0637            switch (message.Response.Status)
 638            {
 639                case 200:
 640                case 202:
 0641                    return message.Response;
 642                default:
 0643                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 644            }
 0645        }
 646
 647        internal HttpMessage CreateGetP2SVpnConnectionHealthRequest(string resourceGroupName, string gatewayName)
 648        {
 0649            var message = _pipeline.CreateMessage();
 0650            var request = message.Request;
 0651            request.Method = RequestMethod.Post;
 0652            var uri = new RawRequestUriBuilder();
 0653            uri.Reset(endpoint);
 0654            uri.AppendPath("/subscriptions/", false);
 0655            uri.AppendPath(subscriptionId, true);
 0656            uri.AppendPath("/resourceGroups/", false);
 0657            uri.AppendPath(resourceGroupName, true);
 0658            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0659            uri.AppendPath(gatewayName, true);
 0660            uri.AppendPath("/getP2sVpnConnectionHealth", false);
 0661            uri.AppendQuery("api-version", "2020-04-01", true);
 0662            request.Uri = uri;
 0663            return message;
 664        }
 665
 666        /// <summary> Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resour
 667        /// <param name="resourceGroupName"> The name of the resource group. </param>
 668        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 669        /// <param name="cancellationToken"> The cancellation token to use. </param>
 670        public async Task<Response> GetP2SVpnConnectionHealthAsync(string resourceGroupName, string gatewayName, Cancell
 671        {
 0672            if (resourceGroupName == null)
 673            {
 0674                throw new ArgumentNullException(nameof(resourceGroupName));
 675            }
 0676            if (gatewayName == null)
 677            {
 0678                throw new ArgumentNullException(nameof(gatewayName));
 679            }
 680
 0681            using var message = CreateGetP2SVpnConnectionHealthRequest(resourceGroupName, gatewayName);
 0682            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0683            switch (message.Response.Status)
 684            {
 685                case 200:
 686                case 202:
 0687                    return message.Response;
 688                default:
 0689                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 690            }
 0691        }
 692
 693        /// <summary> Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resour
 694        /// <param name="resourceGroupName"> The name of the resource group. </param>
 695        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 696        /// <param name="cancellationToken"> The cancellation token to use. </param>
 697        public Response GetP2SVpnConnectionHealth(string resourceGroupName, string gatewayName, CancellationToken cancel
 698        {
 0699            if (resourceGroupName == null)
 700            {
 0701                throw new ArgumentNullException(nameof(resourceGroupName));
 702            }
 0703            if (gatewayName == null)
 704            {
 0705                throw new ArgumentNullException(nameof(gatewayName));
 706            }
 707
 0708            using var message = CreateGetP2SVpnConnectionHealthRequest(resourceGroupName, gatewayName);
 0709            _pipeline.Send(message, cancellationToken);
 0710            switch (message.Response.Status)
 711            {
 712                case 200:
 713                case 202:
 0714                    return message.Response;
 715                default:
 0716                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 717            }
 0718        }
 719
 720        internal HttpMessage CreateGetP2SVpnConnectionHealthDetailedRequest(string resourceGroupName, string gatewayName
 721        {
 0722            var message = _pipeline.CreateMessage();
 0723            var request0 = message.Request;
 0724            request0.Method = RequestMethod.Post;
 0725            var uri = new RawRequestUriBuilder();
 0726            uri.Reset(endpoint);
 0727            uri.AppendPath("/subscriptions/", false);
 0728            uri.AppendPath(subscriptionId, true);
 0729            uri.AppendPath("/resourceGroups/", false);
 0730            uri.AppendPath(resourceGroupName, true);
 0731            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0732            uri.AppendPath(gatewayName, true);
 0733            uri.AppendPath("/getP2sVpnConnectionHealthDetailed", false);
 0734            uri.AppendQuery("api-version", "2020-04-01", true);
 0735            request0.Uri = uri;
 0736            request0.Headers.Add("Content-Type", "application/json");
 0737            var content = new Utf8JsonRequestContent();
 0738            content.JsonWriter.WriteObjectValue(request);
 0739            request0.Content = content;
 0740            return message;
 741        }
 742
 743        /// <summary> Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGatew
 744        /// <param name="resourceGroupName"> The name of the resource group. </param>
 745        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 746        /// <param name="request"> Request parameters supplied to get p2s vpn connections detailed health. </param>
 747        /// <param name="cancellationToken"> The cancellation token to use. </param>
 748        public async Task<Response> GetP2SVpnConnectionHealthDetailedAsync(string resourceGroupName, string gatewayName,
 749        {
 0750            if (resourceGroupName == null)
 751            {
 0752                throw new ArgumentNullException(nameof(resourceGroupName));
 753            }
 0754            if (gatewayName == null)
 755            {
 0756                throw new ArgumentNullException(nameof(gatewayName));
 757            }
 0758            if (request == null)
 759            {
 0760                throw new ArgumentNullException(nameof(request));
 761            }
 762
 0763            using var message = CreateGetP2SVpnConnectionHealthDetailedRequest(resourceGroupName, gatewayName, request);
 0764            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0765            switch (message.Response.Status)
 766            {
 767                case 200:
 768                case 202:
 0769                    return message.Response;
 770                default:
 0771                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 772            }
 0773        }
 774
 775        /// <summary> Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGatew
 776        /// <param name="resourceGroupName"> The name of the resource group. </param>
 777        /// <param name="gatewayName"> The name of the P2SVpnGateway. </param>
 778        /// <param name="request"> Request parameters supplied to get p2s vpn connections detailed health. </param>
 779        /// <param name="cancellationToken"> The cancellation token to use. </param>
 780        public Response GetP2SVpnConnectionHealthDetailed(string resourceGroupName, string gatewayName, P2SVpnConnection
 781        {
 0782            if (resourceGroupName == null)
 783            {
 0784                throw new ArgumentNullException(nameof(resourceGroupName));
 785            }
 0786            if (gatewayName == null)
 787            {
 0788                throw new ArgumentNullException(nameof(gatewayName));
 789            }
 0790            if (request == null)
 791            {
 0792                throw new ArgumentNullException(nameof(request));
 793            }
 794
 0795            using var message = CreateGetP2SVpnConnectionHealthDetailedRequest(resourceGroupName, gatewayName, request);
 0796            _pipeline.Send(message, cancellationToken);
 0797            switch (message.Response.Status)
 798            {
 799                case 200:
 800                case 202:
 0801                    return message.Response;
 802                default:
 0803                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 804            }
 0805        }
 806
 807        internal HttpMessage CreateDisconnectP2SVpnConnectionsRequest(string resourceGroupName, string p2SVpnGatewayName
 808        {
 0809            var message = _pipeline.CreateMessage();
 0810            var request0 = message.Request;
 0811            request0.Method = RequestMethod.Post;
 0812            var uri = new RawRequestUriBuilder();
 0813            uri.Reset(endpoint);
 0814            uri.AppendPath("/subscriptions/", false);
 0815            uri.AppendPath(subscriptionId, true);
 0816            uri.AppendPath("/resourceGroups/", false);
 0817            uri.AppendPath(resourceGroupName, true);
 0818            uri.AppendPath("/providers/Microsoft.Network/p2svpnGateways/", false);
 0819            uri.AppendPath(p2SVpnGatewayName, true);
 0820            uri.AppendPath("/disconnectP2sVpnConnections", false);
 0821            uri.AppendQuery("api-version", "2020-04-01", true);
 0822            request0.Uri = uri;
 0823            request0.Headers.Add("Content-Type", "application/json");
 0824            var content = new Utf8JsonRequestContent();
 0825            content.JsonWriter.WriteObjectValue(request);
 0826            request0.Content = content;
 0827            return message;
 828        }
 829
 830        /// <summary> Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. <
 831        /// <param name="resourceGroupName"> The name of the resource group. </param>
 832        /// <param name="p2SVpnGatewayName"> The name of the P2S Vpn Gateway. </param>
 833        /// <param name="request"> The parameters are supplied to disconnect p2s vpn connections. </param>
 834        /// <param name="cancellationToken"> The cancellation token to use. </param>
 835        public async Task<Response> DisconnectP2SVpnConnectionsAsync(string resourceGroupName, string p2SVpnGatewayName,
 836        {
 0837            if (resourceGroupName == null)
 838            {
 0839                throw new ArgumentNullException(nameof(resourceGroupName));
 840            }
 0841            if (p2SVpnGatewayName == null)
 842            {
 0843                throw new ArgumentNullException(nameof(p2SVpnGatewayName));
 844            }
 0845            if (request == null)
 846            {
 0847                throw new ArgumentNullException(nameof(request));
 848            }
 849
 0850            using var message = CreateDisconnectP2SVpnConnectionsRequest(resourceGroupName, p2SVpnGatewayName, request);
 0851            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0852            switch (message.Response.Status)
 853            {
 854                case 200:
 855                case 202:
 0856                    return message.Response;
 857                default:
 0858                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 859            }
 0860        }
 861
 862        /// <summary> Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. <
 863        /// <param name="resourceGroupName"> The name of the resource group. </param>
 864        /// <param name="p2SVpnGatewayName"> The name of the P2S Vpn Gateway. </param>
 865        /// <param name="request"> The parameters are supplied to disconnect p2s vpn connections. </param>
 866        /// <param name="cancellationToken"> The cancellation token to use. </param>
 867        public Response DisconnectP2SVpnConnections(string resourceGroupName, string p2SVpnGatewayName, P2SVpnConnection
 868        {
 0869            if (resourceGroupName == null)
 870            {
 0871                throw new ArgumentNullException(nameof(resourceGroupName));
 872            }
 0873            if (p2SVpnGatewayName == null)
 874            {
 0875                throw new ArgumentNullException(nameof(p2SVpnGatewayName));
 876            }
 0877            if (request == null)
 878            {
 0879                throw new ArgumentNullException(nameof(request));
 880            }
 881
 0882            using var message = CreateDisconnectP2SVpnConnectionsRequest(resourceGroupName, p2SVpnGatewayName, request);
 0883            _pipeline.Send(message, cancellationToken);
 0884            switch (message.Response.Status)
 885            {
 886                case 200:
 887                case 202:
 0888                    return message.Response;
 889                default:
 0890                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 891            }
 0892        }
 893
 894        internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName)
 895        {
 0896            var message = _pipeline.CreateMessage();
 0897            var request = message.Request;
 0898            request.Method = RequestMethod.Get;
 0899            var uri = new RawRequestUriBuilder();
 0900            uri.Reset(endpoint);
 0901            uri.AppendRawNextLink(nextLink, false);
 0902            request.Uri = uri;
 0903            return message;
 904        }
 905
 906        /// <summary> Lists all the P2SVpnGateways in a resource group. </summary>
 907        /// <param name="nextLink"> The URL to the next page of results. </param>
 908        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 909        /// <param name="cancellationToken"> The cancellation token to use. </param>
 910        public async Task<Response<ListP2SVpnGatewaysResult>> ListByResourceGroupNextPageAsync(string nextLink, string r
 911        {
 0912            if (nextLink == null)
 913            {
 0914                throw new ArgumentNullException(nameof(nextLink));
 915            }
 0916            if (resourceGroupName == null)
 917            {
 0918                throw new ArgumentNullException(nameof(resourceGroupName));
 919            }
 920
 0921            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0922            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0923            switch (message.Response.Status)
 924            {
 925                case 200:
 926                    {
 0927                        ListP2SVpnGatewaysResult value = default;
 0928                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0929                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 930                        {
 0931                            value = null;
 932                        }
 933                        else
 934                        {
 0935                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 936                        }
 0937                        return Response.FromValue(value, message.Response);
 938                    }
 939                default:
 0940                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 941            }
 0942        }
 943
 944        /// <summary> Lists all the P2SVpnGateways in a resource group. </summary>
 945        /// <param name="nextLink"> The URL to the next page of results. </param>
 946        /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param>
 947        /// <param name="cancellationToken"> The cancellation token to use. </param>
 948        public Response<ListP2SVpnGatewaysResult> ListByResourceGroupNextPage(string nextLink, string resourceGroupName,
 949        {
 0950            if (nextLink == null)
 951            {
 0952                throw new ArgumentNullException(nameof(nextLink));
 953            }
 0954            if (resourceGroupName == null)
 955            {
 0956                throw new ArgumentNullException(nameof(resourceGroupName));
 957            }
 958
 0959            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0960            _pipeline.Send(message, cancellationToken);
 0961            switch (message.Response.Status)
 962            {
 963                case 200:
 964                    {
 0965                        ListP2SVpnGatewaysResult value = default;
 0966                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0967                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 968                        {
 0969                            value = null;
 970                        }
 971                        else
 972                        {
 0973                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 974                        }
 0975                        return Response.FromValue(value, message.Response);
 976                    }
 977                default:
 0978                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 979            }
 0980        }
 981
 982        internal HttpMessage CreateListNextPageRequest(string nextLink)
 983        {
 0984            var message = _pipeline.CreateMessage();
 0985            var request = message.Request;
 0986            request.Method = RequestMethod.Get;
 0987            var uri = new RawRequestUriBuilder();
 0988            uri.Reset(endpoint);
 0989            uri.AppendRawNextLink(nextLink, false);
 0990            request.Uri = uri;
 0991            return message;
 992        }
 993
 994        /// <summary> Lists all the P2SVpnGateways in a subscription. </summary>
 995        /// <param name="nextLink"> The URL to the next page of results. </param>
 996        /// <param name="cancellationToken"> The cancellation token to use. </param>
 997        public async Task<Response<ListP2SVpnGatewaysResult>> ListNextPageAsync(string nextLink, CancellationToken cance
 998        {
 0999            if (nextLink == null)
 1000            {
 01001                throw new ArgumentNullException(nameof(nextLink));
 1002            }
 1003
 01004            using var message = CreateListNextPageRequest(nextLink);
 01005            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01006            switch (message.Response.Status)
 1007            {
 1008                case 200:
 1009                    {
 01010                        ListP2SVpnGatewaysResult value = default;
 01011                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01012                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1013                        {
 01014                            value = null;
 1015                        }
 1016                        else
 1017                        {
 01018                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 1019                        }
 01020                        return Response.FromValue(value, message.Response);
 1021                    }
 1022                default:
 01023                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1024            }
 01025        }
 1026
 1027        /// <summary> Lists all the P2SVpnGateways in a subscription. </summary>
 1028        /// <param name="nextLink"> The URL to the next page of results. </param>
 1029        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1030        public Response<ListP2SVpnGatewaysResult> ListNextPage(string nextLink, CancellationToken cancellationToken = de
 1031        {
 01032            if (nextLink == null)
 1033            {
 01034                throw new ArgumentNullException(nameof(nextLink));
 1035            }
 1036
 01037            using var message = CreateListNextPageRequest(nextLink);
 01038            _pipeline.Send(message, cancellationToken);
 01039            switch (message.Response.Status)
 1040            {
 1041                case 200:
 1042                    {
 01043                        ListP2SVpnGatewaysResult value = default;
 01044                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01045                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1046                        {
 01047                            value = null;
 1048                        }
 1049                        else
 1050                        {
 01051                            value = ListP2SVpnGatewaysResult.DeserializeListP2SVpnGatewaysResult(document.RootElement);
 1052                        }
 01053                        return Response.FromValue(value, message.Response);
 1054                    }
 1055                default:
 01056                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1057            }
 01058        }
 1059    }
 1060}