< Summary

Class:Azure.ResourceManager.Network.ServiceRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceRestOperations.cs
Covered lines:44
Uncovered lines:487
Coverable lines:531
Total lines:1164
Line coverage:8.2% (44 of 531)
Covered branches:10
Total branches:236
Branch coverage:4.2% (10 of 236)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreatePutBastionShareableLinkRequest(...)-0%100%
PutBastionShareableLinkAsync()-0%0%
PutBastionShareableLink(...)-0%0%
CreateDeleteBastionShareableLinkRequest(...)-0%100%
DeleteBastionShareableLinkAsync()-0%0%
DeleteBastionShareableLink(...)-0%0%
CreateGetBastionShareableLinkRequest(...)-0%100%
GetBastionShareableLinkAsync()-0%0%
GetBastionShareableLink(...)-0%0%
CreateGetActiveSessionsRequest(...)-0%100%
GetActiveSessionsAsync()-0%0%
GetActiveSessions(...)-0%0%
CreateDisconnectActiveSessionsRequest(...)-0%100%
DisconnectActiveSessionsAsync()-0%0%
DisconnectActiveSessions(...)-0%0%
CreateCheckDnsNameAvailabilityRequest(...)-100%100%
CheckDnsNameAvailabilityAsync()-73.33%50%
CheckDnsNameAvailability(...)-73.33%50%
CreateSupportedSecurityProvidersRequest(...)-0%100%
SupportedSecurityProvidersAsync()-0%0%
SupportedSecurityProviders(...)-0%0%
CreateGeneratevirtualwanvpnserverconfigurationvpnprofileRequest(...)-0%100%
GeneratevirtualwanvpnserverconfigurationvpnprofileAsync()-0%0%
Generatevirtualwanvpnserverconfigurationvpnprofile(...)-0%0%
CreatePutBastionShareableLinkNextPageRequest(...)-0%100%
PutBastionShareableLinkNextPageAsync()-0%0%
PutBastionShareableLinkNextPage(...)-0%0%
CreateGetBastionShareableLinkNextPageRequest(...)-0%100%
GetBastionShareableLinkNextPageAsync()-0%0%
GetBastionShareableLinkNextPage(...)-0%0%
CreateGetActiveSessionsNextPageRequest(...)-0%100%
GetActiveSessionsNextPageAsync()-0%0%
GetActiveSessionsNextPage(...)-0%0%
CreateDisconnectActiveSessionsNextPageRequest(...)-0%100%
DisconnectActiveSessionsNextPageAsync()-0%0%
DisconnectActiveSessionsNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceRestOperations.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 ServiceRestOperations
 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 ServiceRestOperations. </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
 20432        public ServiceRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, 
 33        {
 20434            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 20438            endpoint ??= new Uri("https://management.azure.com");
 39
 20440            this.subscriptionId = subscriptionId;
 20441            this.endpoint = endpoint;
 20442            _clientDiagnostics = clientDiagnostics;
 20443            _pipeline = pipeline;
 20444        }
 45
 46        internal HttpMessage CreatePutBastionShareableLinkRequest(string resourceGroupName, string bastionHostName, Bast
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Post;
 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/bastionHosts/", false);
 058            uri.AppendPath(bastionHostName, true);
 059            uri.AppendPath("/createShareableLinks", false);
 060            uri.AppendQuery("api-version", "2020-04-01", true);
 061            request.Uri = uri;
 062            request.Headers.Add("Content-Type", "application/json");
 063            var content = new Utf8JsonRequestContent();
 064            content.JsonWriter.WriteObjectValue(bslRequest);
 065            request.Content = content;
 066            return message;
 67        }
 68
 69        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 70        /// <param name="resourceGroupName"> The name of the resource group. </param>
 71        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 72        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 73        /// <param name="cancellationToken"> The cancellation token to use. </param>
 74        public async Task<Response> PutBastionShareableLinkAsync(string resourceGroupName, string bastionHostName, Basti
 75        {
 076            if (resourceGroupName == null)
 77            {
 078                throw new ArgumentNullException(nameof(resourceGroupName));
 79            }
 080            if (bastionHostName == null)
 81            {
 082                throw new ArgumentNullException(nameof(bastionHostName));
 83            }
 084            if (bslRequest == null)
 85            {
 086                throw new ArgumentNullException(nameof(bslRequest));
 87            }
 88
 089            using var message = CreatePutBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 090            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 091            switch (message.Response.Status)
 92            {
 93                case 200:
 94                case 202:
 095                    return message.Response;
 96                default:
 097                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 98            }
 099        }
 100
 101        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 102        /// <param name="resourceGroupName"> The name of the resource group. </param>
 103        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 104        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 105        /// <param name="cancellationToken"> The cancellation token to use. </param>
 106        public Response PutBastionShareableLink(string resourceGroupName, string bastionHostName, BastionShareableLinkLi
 107        {
 0108            if (resourceGroupName == null)
 109            {
 0110                throw new ArgumentNullException(nameof(resourceGroupName));
 111            }
 0112            if (bastionHostName == null)
 113            {
 0114                throw new ArgumentNullException(nameof(bastionHostName));
 115            }
 0116            if (bslRequest == null)
 117            {
 0118                throw new ArgumentNullException(nameof(bslRequest));
 119            }
 120
 0121            using var message = CreatePutBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 0122            _pipeline.Send(message, cancellationToken);
 0123            switch (message.Response.Status)
 124            {
 125                case 200:
 126                case 202:
 0127                    return message.Response;
 128                default:
 0129                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 130            }
 0131        }
 132
 133        internal HttpMessage CreateDeleteBastionShareableLinkRequest(string resourceGroupName, string bastionHostName, B
 134        {
 0135            var message = _pipeline.CreateMessage();
 0136            var request = message.Request;
 0137            request.Method = RequestMethod.Post;
 0138            var uri = new RawRequestUriBuilder();
 0139            uri.Reset(endpoint);
 0140            uri.AppendPath("/subscriptions/", false);
 0141            uri.AppendPath(subscriptionId, true);
 0142            uri.AppendPath("/resourceGroups/", false);
 0143            uri.AppendPath(resourceGroupName, true);
 0144            uri.AppendPath("/providers/Microsoft.Network/bastionHosts/", false);
 0145            uri.AppendPath(bastionHostName, true);
 0146            uri.AppendPath("/deleteShareableLinks", false);
 0147            uri.AppendQuery("api-version", "2020-04-01", true);
 0148            request.Uri = uri;
 0149            request.Headers.Add("Content-Type", "application/json");
 0150            var content = new Utf8JsonRequestContent();
 0151            content.JsonWriter.WriteObjectValue(bslRequest);
 0152            request.Content = content;
 0153            return message;
 154        }
 155
 156        /// <summary> Deletes the Bastion Shareable Links for all the VMs specified in the request. </summary>
 157        /// <param name="resourceGroupName"> The name of the resource group. </param>
 158        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 159        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 160        /// <param name="cancellationToken"> The cancellation token to use. </param>
 161        public async Task<Response> DeleteBastionShareableLinkAsync(string resourceGroupName, string bastionHostName, Ba
 162        {
 0163            if (resourceGroupName == null)
 164            {
 0165                throw new ArgumentNullException(nameof(resourceGroupName));
 166            }
 0167            if (bastionHostName == null)
 168            {
 0169                throw new ArgumentNullException(nameof(bastionHostName));
 170            }
 0171            if (bslRequest == null)
 172            {
 0173                throw new ArgumentNullException(nameof(bslRequest));
 174            }
 175
 0176            using var message = CreateDeleteBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 0177            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0178            switch (message.Response.Status)
 179            {
 180                case 200:
 181                case 202:
 0182                    return message.Response;
 183                default:
 0184                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 185            }
 0186        }
 187
 188        /// <summary> Deletes the Bastion Shareable Links for all the VMs specified in the request. </summary>
 189        /// <param name="resourceGroupName"> The name of the resource group. </param>
 190        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 191        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 192        /// <param name="cancellationToken"> The cancellation token to use. </param>
 193        public Response DeleteBastionShareableLink(string resourceGroupName, string bastionHostName, BastionShareableLin
 194        {
 0195            if (resourceGroupName == null)
 196            {
 0197                throw new ArgumentNullException(nameof(resourceGroupName));
 198            }
 0199            if (bastionHostName == null)
 200            {
 0201                throw new ArgumentNullException(nameof(bastionHostName));
 202            }
 0203            if (bslRequest == null)
 204            {
 0205                throw new ArgumentNullException(nameof(bslRequest));
 206            }
 207
 0208            using var message = CreateDeleteBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 0209            _pipeline.Send(message, cancellationToken);
 0210            switch (message.Response.Status)
 211            {
 212                case 200:
 213                case 202:
 0214                    return message.Response;
 215                default:
 0216                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 217            }
 0218        }
 219
 220        internal HttpMessage CreateGetBastionShareableLinkRequest(string resourceGroupName, string bastionHostName, Bast
 221        {
 0222            var message = _pipeline.CreateMessage();
 0223            var request = message.Request;
 0224            request.Method = RequestMethod.Post;
 0225            var uri = new RawRequestUriBuilder();
 0226            uri.Reset(endpoint);
 0227            uri.AppendPath("/subscriptions/", false);
 0228            uri.AppendPath(subscriptionId, true);
 0229            uri.AppendPath("/resourceGroups/", false);
 0230            uri.AppendPath(resourceGroupName, true);
 0231            uri.AppendPath("/providers/Microsoft.Network/bastionHosts/", false);
 0232            uri.AppendPath(bastionHostName, true);
 0233            uri.AppendPath("/getShareableLinks", false);
 0234            uri.AppendQuery("api-version", "2020-04-01", true);
 0235            request.Uri = uri;
 0236            request.Headers.Add("Content-Type", "application/json");
 0237            var content = new Utf8JsonRequestContent();
 0238            content.JsonWriter.WriteObjectValue(bslRequest);
 0239            request.Content = content;
 0240            return message;
 241        }
 242
 243        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 244        /// <param name="resourceGroupName"> The name of the resource group. </param>
 245        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 246        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 247        /// <param name="cancellationToken"> The cancellation token to use. </param>
 248        public async Task<Response<BastionShareableLinkListResult>> GetBastionShareableLinkAsync(string resourceGroupNam
 249        {
 0250            if (resourceGroupName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(resourceGroupName));
 253            }
 0254            if (bastionHostName == null)
 255            {
 0256                throw new ArgumentNullException(nameof(bastionHostName));
 257            }
 0258            if (bslRequest == null)
 259            {
 0260                throw new ArgumentNullException(nameof(bslRequest));
 261            }
 262
 0263            using var message = CreateGetBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 0264            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0265            switch (message.Response.Status)
 266            {
 267                case 200:
 268                    {
 0269                        BastionShareableLinkListResult value = default;
 0270                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0271                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 272                        {
 0273                            value = null;
 274                        }
 275                        else
 276                        {
 0277                            value = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Ro
 278                        }
 0279                        return Response.FromValue(value, message.Response);
 280                    }
 281                default:
 0282                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 283            }
 0284        }
 285
 286        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 287        /// <param name="resourceGroupName"> The name of the resource group. </param>
 288        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 289        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 290        /// <param name="cancellationToken"> The cancellation token to use. </param>
 291        public Response<BastionShareableLinkListResult> GetBastionShareableLink(string resourceGroupName, string bastion
 292        {
 0293            if (resourceGroupName == null)
 294            {
 0295                throw new ArgumentNullException(nameof(resourceGroupName));
 296            }
 0297            if (bastionHostName == null)
 298            {
 0299                throw new ArgumentNullException(nameof(bastionHostName));
 300            }
 0301            if (bslRequest == null)
 302            {
 0303                throw new ArgumentNullException(nameof(bslRequest));
 304            }
 305
 0306            using var message = CreateGetBastionShareableLinkRequest(resourceGroupName, bastionHostName, bslRequest);
 0307            _pipeline.Send(message, cancellationToken);
 0308            switch (message.Response.Status)
 309            {
 310                case 200:
 311                    {
 0312                        BastionShareableLinkListResult value = default;
 0313                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0314                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 315                        {
 0316                            value = null;
 317                        }
 318                        else
 319                        {
 0320                            value = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Ro
 321                        }
 0322                        return Response.FromValue(value, message.Response);
 323                    }
 324                default:
 0325                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 326            }
 0327        }
 328
 329        internal HttpMessage CreateGetActiveSessionsRequest(string resourceGroupName, string bastionHostName)
 330        {
 0331            var message = _pipeline.CreateMessage();
 0332            var request = message.Request;
 0333            request.Method = RequestMethod.Post;
 0334            var uri = new RawRequestUriBuilder();
 0335            uri.Reset(endpoint);
 0336            uri.AppendPath("/subscriptions/", false);
 0337            uri.AppendPath(subscriptionId, true);
 0338            uri.AppendPath("/resourceGroups/", false);
 0339            uri.AppendPath(resourceGroupName, true);
 0340            uri.AppendPath("/providers/Microsoft.Network/bastionHosts/", false);
 0341            uri.AppendPath(bastionHostName, true);
 0342            uri.AppendPath("/getActiveSessions", false);
 0343            uri.AppendQuery("api-version", "2020-04-01", true);
 0344            request.Uri = uri;
 0345            return message;
 346        }
 347
 348        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 349        /// <param name="resourceGroupName"> The name of the resource group. </param>
 350        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 351        /// <param name="cancellationToken"> The cancellation token to use. </param>
 352        public async Task<Response> GetActiveSessionsAsync(string resourceGroupName, string bastionHostName, Cancellatio
 353        {
 0354            if (resourceGroupName == null)
 355            {
 0356                throw new ArgumentNullException(nameof(resourceGroupName));
 357            }
 0358            if (bastionHostName == null)
 359            {
 0360                throw new ArgumentNullException(nameof(bastionHostName));
 361            }
 362
 0363            using var message = CreateGetActiveSessionsRequest(resourceGroupName, bastionHostName);
 0364            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0365            switch (message.Response.Status)
 366            {
 367                case 200:
 368                case 202:
 0369                    return message.Response;
 370                default:
 0371                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 372            }
 0373        }
 374
 375        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 376        /// <param name="resourceGroupName"> The name of the resource group. </param>
 377        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 378        /// <param name="cancellationToken"> The cancellation token to use. </param>
 379        public Response GetActiveSessions(string resourceGroupName, string bastionHostName, CancellationToken cancellati
 380        {
 0381            if (resourceGroupName == null)
 382            {
 0383                throw new ArgumentNullException(nameof(resourceGroupName));
 384            }
 0385            if (bastionHostName == null)
 386            {
 0387                throw new ArgumentNullException(nameof(bastionHostName));
 388            }
 389
 0390            using var message = CreateGetActiveSessionsRequest(resourceGroupName, bastionHostName);
 0391            _pipeline.Send(message, cancellationToken);
 0392            switch (message.Response.Status)
 393            {
 394                case 200:
 395                case 202:
 0396                    return message.Response;
 397                default:
 0398                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 399            }
 0400        }
 401
 402        internal HttpMessage CreateDisconnectActiveSessionsRequest(string resourceGroupName, string bastionHostName, Ses
 403        {
 0404            var message = _pipeline.CreateMessage();
 0405            var request = message.Request;
 0406            request.Method = RequestMethod.Post;
 0407            var uri = new RawRequestUriBuilder();
 0408            uri.Reset(endpoint);
 0409            uri.AppendPath("/subscriptions/", false);
 0410            uri.AppendPath(subscriptionId, true);
 0411            uri.AppendPath("/resourceGroups/", false);
 0412            uri.AppendPath(resourceGroupName, true);
 0413            uri.AppendPath("/providers/Microsoft.Network/bastionHosts/", false);
 0414            uri.AppendPath(bastionHostName, true);
 0415            uri.AppendPath("/disconnectActiveSessions", false);
 0416            uri.AppendQuery("api-version", "2020-04-01", true);
 0417            request.Uri = uri;
 0418            request.Headers.Add("Content-Type", "application/json");
 0419            var content = new Utf8JsonRequestContent();
 0420            content.JsonWriter.WriteObjectValue(sessionIds);
 0421            request.Content = content;
 0422            return message;
 423        }
 424
 425        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 426        /// <param name="resourceGroupName"> The name of the resource group. </param>
 427        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 428        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 429        /// <param name="cancellationToken"> The cancellation token to use. </param>
 430        public async Task<Response<BastionSessionDeleteResult>> DisconnectActiveSessionsAsync(string resourceGroupName, 
 431        {
 0432            if (resourceGroupName == null)
 433            {
 0434                throw new ArgumentNullException(nameof(resourceGroupName));
 435            }
 0436            if (bastionHostName == null)
 437            {
 0438                throw new ArgumentNullException(nameof(bastionHostName));
 439            }
 0440            if (sessionIds == null)
 441            {
 0442                throw new ArgumentNullException(nameof(sessionIds));
 443            }
 444
 0445            using var message = CreateDisconnectActiveSessionsRequest(resourceGroupName, bastionHostName, sessionIds);
 0446            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0447            switch (message.Response.Status)
 448            {
 449                case 200:
 450                    {
 0451                        BastionSessionDeleteResult value = default;
 0452                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0453                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 454                        {
 0455                            value = null;
 456                        }
 457                        else
 458                        {
 0459                            value = BastionSessionDeleteResult.DeserializeBastionSessionDeleteResult(document.RootElemen
 460                        }
 0461                        return Response.FromValue(value, message.Response);
 462                    }
 463                default:
 0464                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 465            }
 0466        }
 467
 468        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 469        /// <param name="resourceGroupName"> The name of the resource group. </param>
 470        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 471        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 472        /// <param name="cancellationToken"> The cancellation token to use. </param>
 473        public Response<BastionSessionDeleteResult> DisconnectActiveSessions(string resourceGroupName, string bastionHos
 474        {
 0475            if (resourceGroupName == null)
 476            {
 0477                throw new ArgumentNullException(nameof(resourceGroupName));
 478            }
 0479            if (bastionHostName == null)
 480            {
 0481                throw new ArgumentNullException(nameof(bastionHostName));
 482            }
 0483            if (sessionIds == null)
 484            {
 0485                throw new ArgumentNullException(nameof(sessionIds));
 486            }
 487
 0488            using var message = CreateDisconnectActiveSessionsRequest(resourceGroupName, bastionHostName, sessionIds);
 0489            _pipeline.Send(message, cancellationToken);
 0490            switch (message.Response.Status)
 491            {
 492                case 200:
 493                    {
 0494                        BastionSessionDeleteResult value = default;
 0495                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0496                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 497                        {
 0498                            value = null;
 499                        }
 500                        else
 501                        {
 0502                            value = BastionSessionDeleteResult.DeserializeBastionSessionDeleteResult(document.RootElemen
 503                        }
 0504                        return Response.FromValue(value, message.Response);
 505                    }
 506                default:
 0507                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 508            }
 0509        }
 510
 511        internal HttpMessage CreateCheckDnsNameAvailabilityRequest(string location, string domainNameLabel)
 512        {
 4513            var message = _pipeline.CreateMessage();
 4514            var request = message.Request;
 4515            request.Method = RequestMethod.Get;
 4516            var uri = new RawRequestUriBuilder();
 4517            uri.Reset(endpoint);
 4518            uri.AppendPath("/subscriptions/", false);
 4519            uri.AppendPath(subscriptionId, true);
 4520            uri.AppendPath("/providers/Microsoft.Network/locations/", false);
 4521            uri.AppendPath(location, true);
 4522            uri.AppendPath("/CheckDnsNameAvailability", false);
 4523            uri.AppendQuery("domainNameLabel", domainNameLabel, true);
 4524            uri.AppendQuery("api-version", "2020-04-01", true);
 4525            request.Uri = uri;
 4526            return message;
 527        }
 528
 529        /// <summary> Checks whether a domain name in the cloudapp.azure.com zone is available for use. </summary>
 530        /// <param name="location"> The location of the domain name. </param>
 531        /// <param name="domainNameLabel"> The domain name to be verified. It must conform to the following regular expr
 532        /// <param name="cancellationToken"> The cancellation token to use. </param>
 533        public async Task<Response<DnsNameAvailabilityResult>> CheckDnsNameAvailabilityAsync(string location, string dom
 534        {
 2535            if (location == null)
 536            {
 0537                throw new ArgumentNullException(nameof(location));
 538            }
 2539            if (domainNameLabel == null)
 540            {
 0541                throw new ArgumentNullException(nameof(domainNameLabel));
 542            }
 543
 2544            using var message = CreateCheckDnsNameAvailabilityRequest(location, domainNameLabel);
 2545            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2546            switch (message.Response.Status)
 547            {
 548                case 200:
 549                    {
 2550                        DnsNameAvailabilityResult value = default;
 2551                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2552                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 553                        {
 0554                            value = null;
 555                        }
 556                        else
 557                        {
 2558                            value = DnsNameAvailabilityResult.DeserializeDnsNameAvailabilityResult(document.RootElement)
 559                        }
 2560                        return Response.FromValue(value, message.Response);
 561                    }
 562                default:
 0563                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 564            }
 2565        }
 566
 567        /// <summary> Checks whether a domain name in the cloudapp.azure.com zone is available for use. </summary>
 568        /// <param name="location"> The location of the domain name. </param>
 569        /// <param name="domainNameLabel"> The domain name to be verified. It must conform to the following regular expr
 570        /// <param name="cancellationToken"> The cancellation token to use. </param>
 571        public Response<DnsNameAvailabilityResult> CheckDnsNameAvailability(string location, string domainNameLabel, Can
 572        {
 2573            if (location == null)
 574            {
 0575                throw new ArgumentNullException(nameof(location));
 576            }
 2577            if (domainNameLabel == null)
 578            {
 0579                throw new ArgumentNullException(nameof(domainNameLabel));
 580            }
 581
 2582            using var message = CreateCheckDnsNameAvailabilityRequest(location, domainNameLabel);
 2583            _pipeline.Send(message, cancellationToken);
 2584            switch (message.Response.Status)
 585            {
 586                case 200:
 587                    {
 2588                        DnsNameAvailabilityResult value = default;
 2589                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2590                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 591                        {
 0592                            value = null;
 593                        }
 594                        else
 595                        {
 2596                            value = DnsNameAvailabilityResult.DeserializeDnsNameAvailabilityResult(document.RootElement)
 597                        }
 2598                        return Response.FromValue(value, message.Response);
 599                    }
 600                default:
 0601                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 602            }
 2603        }
 604
 605        internal HttpMessage CreateSupportedSecurityProvidersRequest(string resourceGroupName, string virtualWANName)
 606        {
 0607            var message = _pipeline.CreateMessage();
 0608            var request = message.Request;
 0609            request.Method = RequestMethod.Get;
 0610            var uri = new RawRequestUriBuilder();
 0611            uri.Reset(endpoint);
 0612            uri.AppendPath("/subscriptions/", false);
 0613            uri.AppendPath(subscriptionId, true);
 0614            uri.AppendPath("/resourceGroups/", false);
 0615            uri.AppendPath(resourceGroupName, true);
 0616            uri.AppendPath("/providers/Microsoft.Network/virtualWans/", false);
 0617            uri.AppendPath(virtualWANName, true);
 0618            uri.AppendPath("/supportedSecurityProviders", false);
 0619            uri.AppendQuery("api-version", "2020-04-01", true);
 0620            request.Uri = uri;
 0621            return message;
 622        }
 623
 624        /// <summary> Gives the supported security providers for the virtual wan. </summary>
 625        /// <param name="resourceGroupName"> The resource group name. </param>
 626        /// <param name="virtualWANName"> The name of the VirtualWAN for which supported security providers are needed. 
 627        /// <param name="cancellationToken"> The cancellation token to use. </param>
 628        public async Task<Response<VirtualWanSecurityProviders>> SupportedSecurityProvidersAsync(string resourceGroupNam
 629        {
 0630            if (resourceGroupName == null)
 631            {
 0632                throw new ArgumentNullException(nameof(resourceGroupName));
 633            }
 0634            if (virtualWANName == null)
 635            {
 0636                throw new ArgumentNullException(nameof(virtualWANName));
 637            }
 638
 0639            using var message = CreateSupportedSecurityProvidersRequest(resourceGroupName, virtualWANName);
 0640            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0641            switch (message.Response.Status)
 642            {
 643                case 200:
 644                    {
 0645                        VirtualWanSecurityProviders value = default;
 0646                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0647                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 648                        {
 0649                            value = null;
 650                        }
 651                        else
 652                        {
 0653                            value = VirtualWanSecurityProviders.DeserializeVirtualWanSecurityProviders(document.RootElem
 654                        }
 0655                        return Response.FromValue(value, message.Response);
 656                    }
 657                default:
 0658                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 659            }
 0660        }
 661
 662        /// <summary> Gives the supported security providers for the virtual wan. </summary>
 663        /// <param name="resourceGroupName"> The resource group name. </param>
 664        /// <param name="virtualWANName"> The name of the VirtualWAN for which supported security providers are needed. 
 665        /// <param name="cancellationToken"> The cancellation token to use. </param>
 666        public Response<VirtualWanSecurityProviders> SupportedSecurityProviders(string resourceGroupName, string virtual
 667        {
 0668            if (resourceGroupName == null)
 669            {
 0670                throw new ArgumentNullException(nameof(resourceGroupName));
 671            }
 0672            if (virtualWANName == null)
 673            {
 0674                throw new ArgumentNullException(nameof(virtualWANName));
 675            }
 676
 0677            using var message = CreateSupportedSecurityProvidersRequest(resourceGroupName, virtualWANName);
 0678            _pipeline.Send(message, cancellationToken);
 0679            switch (message.Response.Status)
 680            {
 681                case 200:
 682                    {
 0683                        VirtualWanSecurityProviders value = default;
 0684                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0685                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 686                        {
 0687                            value = null;
 688                        }
 689                        else
 690                        {
 0691                            value = VirtualWanSecurityProviders.DeserializeVirtualWanSecurityProviders(document.RootElem
 692                        }
 0693                        return Response.FromValue(value, message.Response);
 694                    }
 695                default:
 0696                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 697            }
 0698        }
 699
 700        internal HttpMessage CreateGeneratevirtualwanvpnserverconfigurationvpnprofileRequest(string resourceGroupName, s
 701        {
 0702            var message = _pipeline.CreateMessage();
 0703            var request = message.Request;
 0704            request.Method = RequestMethod.Post;
 0705            var uri = new RawRequestUriBuilder();
 0706            uri.Reset(endpoint);
 0707            uri.AppendPath("/subscriptions/", false);
 0708            uri.AppendPath(subscriptionId, true);
 0709            uri.AppendPath("/resourceGroups/", false);
 0710            uri.AppendPath(resourceGroupName, true);
 0711            uri.AppendPath("/providers/Microsoft.Network/virtualWans/", false);
 0712            uri.AppendPath(virtualWANName, true);
 0713            uri.AppendPath("/GenerateVpnProfile", false);
 0714            uri.AppendQuery("api-version", "2020-04-01", true);
 0715            request.Uri = uri;
 0716            request.Headers.Add("Content-Type", "application/json");
 0717            var content = new Utf8JsonRequestContent();
 0718            content.JsonWriter.WriteObjectValue(vpnClientParams);
 0719            request.Content = content;
 0720            return message;
 721        }
 722
 723        /// <summary> Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguratio
 724        /// <param name="resourceGroupName"> The resource group name. </param>
 725        /// <param name="virtualWANName"> The name of the VirtualWAN whose associated VpnServerConfigurations is needed.
 726        /// <param name="vpnClientParams"> Parameters supplied to the generate VirtualWan VPN profile generation operati
 727        /// <param name="cancellationToken"> The cancellation token to use. </param>
 728        public async Task<Response> GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(string resourceGroupName, st
 729        {
 0730            if (resourceGroupName == null)
 731            {
 0732                throw new ArgumentNullException(nameof(resourceGroupName));
 733            }
 0734            if (virtualWANName == null)
 735            {
 0736                throw new ArgumentNullException(nameof(virtualWANName));
 737            }
 0738            if (vpnClientParams == null)
 739            {
 0740                throw new ArgumentNullException(nameof(vpnClientParams));
 741            }
 742
 0743            using var message = CreateGeneratevirtualwanvpnserverconfigurationvpnprofileRequest(resourceGroupName, virtu
 0744            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0745            switch (message.Response.Status)
 746            {
 747                case 200:
 748                case 202:
 0749                    return message.Response;
 750                default:
 0751                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 752            }
 0753        }
 754
 755        /// <summary> Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguratio
 756        /// <param name="resourceGroupName"> The resource group name. </param>
 757        /// <param name="virtualWANName"> The name of the VirtualWAN whose associated VpnServerConfigurations is needed.
 758        /// <param name="vpnClientParams"> Parameters supplied to the generate VirtualWan VPN profile generation operati
 759        /// <param name="cancellationToken"> The cancellation token to use. </param>
 760        public Response Generatevirtualwanvpnserverconfigurationvpnprofile(string resourceGroupName, string virtualWANNa
 761        {
 0762            if (resourceGroupName == null)
 763            {
 0764                throw new ArgumentNullException(nameof(resourceGroupName));
 765            }
 0766            if (virtualWANName == null)
 767            {
 0768                throw new ArgumentNullException(nameof(virtualWANName));
 769            }
 0770            if (vpnClientParams == null)
 771            {
 0772                throw new ArgumentNullException(nameof(vpnClientParams));
 773            }
 774
 0775            using var message = CreateGeneratevirtualwanvpnserverconfigurationvpnprofileRequest(resourceGroupName, virtu
 0776            _pipeline.Send(message, cancellationToken);
 0777            switch (message.Response.Status)
 778            {
 779                case 200:
 780                case 202:
 0781                    return message.Response;
 782                default:
 0783                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 784            }
 0785        }
 786
 787        internal HttpMessage CreatePutBastionShareableLinkNextPageRequest(string nextLink, string resourceGroupName, str
 788        {
 0789            var message = _pipeline.CreateMessage();
 0790            var request = message.Request;
 0791            request.Method = RequestMethod.Get;
 0792            var uri = new RawRequestUriBuilder();
 0793            uri.Reset(endpoint);
 0794            uri.AppendRawNextLink(nextLink, false);
 0795            request.Uri = uri;
 0796            request.Headers.Add("Content-Type", "application/json");
 0797            return message;
 798        }
 799
 800        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 801        /// <param name="nextLink"> The URL to the next page of results. </param>
 802        /// <param name="resourceGroupName"> The name of the resource group. </param>
 803        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 804        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 805        /// <param name="cancellationToken"> The cancellation token to use. </param>
 806        public async Task<Response> PutBastionShareableLinkNextPageAsync(string nextLink, string resourceGroupName, stri
 807        {
 0808            if (nextLink == null)
 809            {
 0810                throw new ArgumentNullException(nameof(nextLink));
 811            }
 0812            if (resourceGroupName == null)
 813            {
 0814                throw new ArgumentNullException(nameof(resourceGroupName));
 815            }
 0816            if (bastionHostName == null)
 817            {
 0818                throw new ArgumentNullException(nameof(bastionHostName));
 819            }
 0820            if (bslRequest == null)
 821            {
 0822                throw new ArgumentNullException(nameof(bslRequest));
 823            }
 824
 0825            using var message = CreatePutBastionShareableLinkNextPageRequest(nextLink, resourceGroupName, bastionHostNam
 0826            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0827            switch (message.Response.Status)
 828            {
 829                case 200:
 0830                    return message.Response;
 831                default:
 0832                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 833            }
 0834        }
 835
 836        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 837        /// <param name="nextLink"> The URL to the next page of results. </param>
 838        /// <param name="resourceGroupName"> The name of the resource group. </param>
 839        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 840        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 841        /// <param name="cancellationToken"> The cancellation token to use. </param>
 842        public Response PutBastionShareableLinkNextPage(string nextLink, string resourceGroupName, string bastionHostNam
 843        {
 0844            if (nextLink == null)
 845            {
 0846                throw new ArgumentNullException(nameof(nextLink));
 847            }
 0848            if (resourceGroupName == null)
 849            {
 0850                throw new ArgumentNullException(nameof(resourceGroupName));
 851            }
 0852            if (bastionHostName == null)
 853            {
 0854                throw new ArgumentNullException(nameof(bastionHostName));
 855            }
 0856            if (bslRequest == null)
 857            {
 0858                throw new ArgumentNullException(nameof(bslRequest));
 859            }
 860
 0861            using var message = CreatePutBastionShareableLinkNextPageRequest(nextLink, resourceGroupName, bastionHostNam
 0862            _pipeline.Send(message, cancellationToken);
 0863            switch (message.Response.Status)
 864            {
 865                case 200:
 0866                    return message.Response;
 867                default:
 0868                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 869            }
 0870        }
 871
 872        internal HttpMessage CreateGetBastionShareableLinkNextPageRequest(string nextLink, string resourceGroupName, str
 873        {
 0874            var message = _pipeline.CreateMessage();
 0875            var request = message.Request;
 0876            request.Method = RequestMethod.Get;
 0877            var uri = new RawRequestUriBuilder();
 0878            uri.Reset(endpoint);
 0879            uri.AppendRawNextLink(nextLink, false);
 0880            request.Uri = uri;
 0881            request.Headers.Add("Content-Type", "application/json");
 0882            return message;
 883        }
 884
 885        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 886        /// <param name="nextLink"> The URL to the next page of results. </param>
 887        /// <param name="resourceGroupName"> The name of the resource group. </param>
 888        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 889        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 890        /// <param name="cancellationToken"> The cancellation token to use. </param>
 891        public async Task<Response<BastionShareableLinkListResult>> GetBastionShareableLinkNextPageAsync(string nextLink
 892        {
 0893            if (nextLink == null)
 894            {
 0895                throw new ArgumentNullException(nameof(nextLink));
 896            }
 0897            if (resourceGroupName == null)
 898            {
 0899                throw new ArgumentNullException(nameof(resourceGroupName));
 900            }
 0901            if (bastionHostName == null)
 902            {
 0903                throw new ArgumentNullException(nameof(bastionHostName));
 904            }
 0905            if (bslRequest == null)
 906            {
 0907                throw new ArgumentNullException(nameof(bslRequest));
 908            }
 909
 0910            using var message = CreateGetBastionShareableLinkNextPageRequest(nextLink, resourceGroupName, bastionHostNam
 0911            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0912            switch (message.Response.Status)
 913            {
 914                case 200:
 915                    {
 0916                        BastionShareableLinkListResult value = default;
 0917                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0918                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 919                        {
 0920                            value = null;
 921                        }
 922                        else
 923                        {
 0924                            value = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Ro
 925                        }
 0926                        return Response.FromValue(value, message.Response);
 927                    }
 928                default:
 0929                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 930            }
 0931        }
 932
 933        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 934        /// <param name="nextLink"> The URL to the next page of results. </param>
 935        /// <param name="resourceGroupName"> The name of the resource group. </param>
 936        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 937        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 938        /// <param name="cancellationToken"> The cancellation token to use. </param>
 939        public Response<BastionShareableLinkListResult> GetBastionShareableLinkNextPage(string nextLink, string resource
 940        {
 0941            if (nextLink == null)
 942            {
 0943                throw new ArgumentNullException(nameof(nextLink));
 944            }
 0945            if (resourceGroupName == null)
 946            {
 0947                throw new ArgumentNullException(nameof(resourceGroupName));
 948            }
 0949            if (bastionHostName == null)
 950            {
 0951                throw new ArgumentNullException(nameof(bastionHostName));
 952            }
 0953            if (bslRequest == null)
 954            {
 0955                throw new ArgumentNullException(nameof(bslRequest));
 956            }
 957
 0958            using var message = CreateGetBastionShareableLinkNextPageRequest(nextLink, resourceGroupName, bastionHostNam
 0959            _pipeline.Send(message, cancellationToken);
 0960            switch (message.Response.Status)
 961            {
 962                case 200:
 963                    {
 0964                        BastionShareableLinkListResult value = default;
 0965                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0966                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 967                        {
 0968                            value = null;
 969                        }
 970                        else
 971                        {
 0972                            value = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Ro
 973                        }
 0974                        return Response.FromValue(value, message.Response);
 975                    }
 976                default:
 0977                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 978            }
 0979        }
 980
 981        internal HttpMessage CreateGetActiveSessionsNextPageRequest(string nextLink, string resourceGroupName, string ba
 982        {
 0983            var message = _pipeline.CreateMessage();
 0984            var request = message.Request;
 0985            request.Method = RequestMethod.Get;
 0986            var uri = new RawRequestUriBuilder();
 0987            uri.Reset(endpoint);
 0988            uri.AppendRawNextLink(nextLink, false);
 0989            request.Uri = uri;
 0990            return message;
 991        }
 992
 993        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 994        /// <param name="nextLink"> The URL to the next page of results. </param>
 995        /// <param name="resourceGroupName"> The name of the resource group. </param>
 996        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 997        /// <param name="cancellationToken"> The cancellation token to use. </param>
 998        public async Task<Response> GetActiveSessionsNextPageAsync(string nextLink, string resourceGroupName, string bas
 999        {
 01000            if (nextLink == null)
 1001            {
 01002                throw new ArgumentNullException(nameof(nextLink));
 1003            }
 01004            if (resourceGroupName == null)
 1005            {
 01006                throw new ArgumentNullException(nameof(resourceGroupName));
 1007            }
 01008            if (bastionHostName == null)
 1009            {
 01010                throw new ArgumentNullException(nameof(bastionHostName));
 1011            }
 1012
 01013            using var message = CreateGetActiveSessionsNextPageRequest(nextLink, resourceGroupName, bastionHostName);
 01014            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01015            switch (message.Response.Status)
 1016            {
 1017                case 200:
 01018                    return message.Response;
 1019                default:
 01020                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1021            }
 01022        }
 1023
 1024        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 1025        /// <param name="nextLink"> The URL to the next page of results. </param>
 1026        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1027        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 1028        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1029        public Response GetActiveSessionsNextPage(string nextLink, string resourceGroupName, string bastionHostName, Can
 1030        {
 01031            if (nextLink == null)
 1032            {
 01033                throw new ArgumentNullException(nameof(nextLink));
 1034            }
 01035            if (resourceGroupName == null)
 1036            {
 01037                throw new ArgumentNullException(nameof(resourceGroupName));
 1038            }
 01039            if (bastionHostName == null)
 1040            {
 01041                throw new ArgumentNullException(nameof(bastionHostName));
 1042            }
 1043
 01044            using var message = CreateGetActiveSessionsNextPageRequest(nextLink, resourceGroupName, bastionHostName);
 01045            _pipeline.Send(message, cancellationToken);
 01046            switch (message.Response.Status)
 1047            {
 1048                case 200:
 01049                    return message.Response;
 1050                default:
 01051                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1052            }
 01053        }
 1054
 1055        internal HttpMessage CreateDisconnectActiveSessionsNextPageRequest(string nextLink, string resourceGroupName, st
 1056        {
 01057            var message = _pipeline.CreateMessage();
 01058            var request = message.Request;
 01059            request.Method = RequestMethod.Get;
 01060            var uri = new RawRequestUriBuilder();
 01061            uri.Reset(endpoint);
 01062            uri.AppendRawNextLink(nextLink, false);
 01063            request.Uri = uri;
 01064            request.Headers.Add("Content-Type", "application/json");
 01065            return message;
 1066        }
 1067
 1068        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 1069        /// <param name="nextLink"> The URL to the next page of results. </param>
 1070        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1071        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 1072        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 1073        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1074        public async Task<Response<BastionSessionDeleteResult>> DisconnectActiveSessionsNextPageAsync(string nextLink, s
 1075        {
 01076            if (nextLink == null)
 1077            {
 01078                throw new ArgumentNullException(nameof(nextLink));
 1079            }
 01080            if (resourceGroupName == null)
 1081            {
 01082                throw new ArgumentNullException(nameof(resourceGroupName));
 1083            }
 01084            if (bastionHostName == null)
 1085            {
 01086                throw new ArgumentNullException(nameof(bastionHostName));
 1087            }
 01088            if (sessionIds == null)
 1089            {
 01090                throw new ArgumentNullException(nameof(sessionIds));
 1091            }
 1092
 01093            using var message = CreateDisconnectActiveSessionsNextPageRequest(nextLink, resourceGroupName, bastionHostNa
 01094            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01095            switch (message.Response.Status)
 1096            {
 1097                case 200:
 1098                    {
 01099                        BastionSessionDeleteResult value = default;
 01100                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01101                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1102                        {
 01103                            value = null;
 1104                        }
 1105                        else
 1106                        {
 01107                            value = BastionSessionDeleteResult.DeserializeBastionSessionDeleteResult(document.RootElemen
 1108                        }
 01109                        return Response.FromValue(value, message.Response);
 1110                    }
 1111                default:
 01112                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1113            }
 01114        }
 1115
 1116        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 1117        /// <param name="nextLink"> The URL to the next page of results. </param>
 1118        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1119        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 1120        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 1121        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1122        public Response<BastionSessionDeleteResult> DisconnectActiveSessionsNextPage(string nextLink, string resourceGro
 1123        {
 01124            if (nextLink == null)
 1125            {
 01126                throw new ArgumentNullException(nameof(nextLink));
 1127            }
 01128            if (resourceGroupName == null)
 1129            {
 01130                throw new ArgumentNullException(nameof(resourceGroupName));
 1131            }
 01132            if (bastionHostName == null)
 1133            {
 01134                throw new ArgumentNullException(nameof(bastionHostName));
 1135            }
 01136            if (sessionIds == null)
 1137            {
 01138                throw new ArgumentNullException(nameof(sessionIds));
 1139            }
 1140
 01141            using var message = CreateDisconnectActiveSessionsNextPageRequest(nextLink, resourceGroupName, bastionHostNa
 01142            _pipeline.Send(message, cancellationToken);
 01143            switch (message.Response.Status)
 1144            {
 1145                case 200:
 1146                    {
 01147                        BastionSessionDeleteResult value = default;
 01148                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01149                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1150                        {
 01151                            value = null;
 1152                        }
 1153                        else
 1154                        {
 01155                            value = BastionSessionDeleteResult.DeserializeBastionSessionDeleteResult(document.RootElemen
 1156                        }
 01157                        return Response.FromValue(value, message.Response);
 1158                    }
 1159                default:
 01160                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1161            }
 01162        }
 1163    }
 1164}