< Summary

Class:Azure.ResourceManager.Resources.FeaturesRestOperations
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\FeaturesRestOperations.cs
Covered lines:143
Uncovered lines:144
Coverable lines:287
Total lines:648
Line coverage:49.8% (143 of 287)
Covered branches:28
Total branches:100
Branch coverage:28% (28 of 100)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateListAllRequest()-100%100%
ListAllAsync()-81.82%50%
ListAll(...)-81.82%50%
CreateListRequest(...)-100%100%
ListAsync()-76.92%50%
List(...)-76.92%50%
CreateGetRequest(...)-100%100%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateRegisterRequest(...)-100%100%
RegisterAsync()-73.33%50%
Register(...)-73.33%50%
CreateUnregisterRequest(...)-0%100%
UnregisterAsync()-0%0%
Unregister(...)-0%0%
CreateListAllNextPageRequest(...)-0%100%
ListAllNextPageAsync()-0%0%
ListAllNextPage(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\FeaturesRestOperations.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.Resources.Models;
 16
 17namespace Azure.ResourceManager.Resources
 18{
 19    internal partial class FeaturesRestOperations
 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 FeaturesRestOperations. </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 ID of the target subscription. </param>
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 1632        public FeaturesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId,
 33        {
 1634            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 1638            endpoint ??= new Uri("https://management.azure.com");
 39
 1640            this.subscriptionId = subscriptionId;
 1641            this.endpoint = endpoint;
 1642            _clientDiagnostics = clientDiagnostics;
 1643            _pipeline = pipeline;
 1644        }
 45
 46        internal Core.HttpMessage CreateListAllRequest()
 47        {
 448            var message = _pipeline.CreateMessage();
 449            var request = message.Request;
 450            request.Method = RequestMethod.Get;
 451            var uri = new RawRequestUriBuilder();
 452            uri.Reset(endpoint);
 453            uri.AppendPath("/subscriptions/", false);
 454            uri.AppendPath(subscriptionId, true);
 455            uri.AppendPath("/providers/Microsoft.Features/features", false);
 456            uri.AppendQuery("api-version", "2015-12-01", true);
 457            request.Uri = uri;
 458            return message;
 59        }
 60
 61        /// <summary> Gets all the preview features that are available through AFEC for the subscription. </summary>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public async Task<Response<FeatureOperationsListResult>> ListAllAsync(CancellationToken cancellationToken = defa
 64        {
 265            using var message = CreateListAllRequest();
 266            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 267            switch (message.Response.Status)
 68            {
 69                case 200:
 70                    {
 271                        FeatureOperationsListResult value = default;
 272                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 273                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 74                        {
 075                            value = null;
 76                        }
 77                        else
 78                        {
 279                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 80                        }
 281                        return Response.FromValue(value, message.Response);
 82                    }
 83                default:
 084                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 85            }
 286        }
 87
 88        /// <summary> Gets all the preview features that are available through AFEC for the subscription. </summary>
 89        /// <param name="cancellationToken"> The cancellation token to use. </param>
 90        public Response<FeatureOperationsListResult> ListAll(CancellationToken cancellationToken = default)
 91        {
 292            using var message = CreateListAllRequest();
 293            _pipeline.Send(message, cancellationToken);
 294            switch (message.Response.Status)
 95            {
 96                case 200:
 97                    {
 298                        FeatureOperationsListResult value = default;
 299                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2100                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 101                        {
 0102                            value = null;
 103                        }
 104                        else
 105                        {
 2106                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 107                        }
 2108                        return Response.FromValue(value, message.Response);
 109                    }
 110                default:
 0111                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 112            }
 2113        }
 114
 115        internal Core.HttpMessage CreateListRequest(string resourceProviderNamespace)
 116        {
 4117            var message = _pipeline.CreateMessage();
 4118            var request = message.Request;
 4119            request.Method = RequestMethod.Get;
 4120            var uri = new RawRequestUriBuilder();
 4121            uri.Reset(endpoint);
 4122            uri.AppendPath("/subscriptions/", false);
 4123            uri.AppendPath(subscriptionId, true);
 4124            uri.AppendPath("/providers/Microsoft.Features/providers/", false);
 4125            uri.AppendPath(resourceProviderNamespace, true);
 4126            uri.AppendPath("/features", false);
 4127            uri.AppendQuery("api-version", "2015-12-01", true);
 4128            request.Uri = uri;
 4129            return message;
 130        }
 131
 132        /// <summary> Gets all the preview features in a provider namespace that are available through AFEC for the subs
 133        /// <param name="resourceProviderNamespace"> The namespace of the resource provider for getting features. </para
 134        /// <param name="cancellationToken"> The cancellation token to use. </param>
 135        public async Task<Response<FeatureOperationsListResult>> ListAsync(string resourceProviderNamespace, Cancellatio
 136        {
 2137            if (resourceProviderNamespace == null)
 138            {
 0139                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 140            }
 141
 2142            using var message = CreateListRequest(resourceProviderNamespace);
 2143            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2144            switch (message.Response.Status)
 145            {
 146                case 200:
 147                    {
 2148                        FeatureOperationsListResult value = default;
 2149                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2150                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 151                        {
 0152                            value = null;
 153                        }
 154                        else
 155                        {
 2156                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 157                        }
 2158                        return Response.FromValue(value, message.Response);
 159                    }
 160                default:
 0161                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 162            }
 2163        }
 164
 165        /// <summary> Gets all the preview features in a provider namespace that are available through AFEC for the subs
 166        /// <param name="resourceProviderNamespace"> The namespace of the resource provider for getting features. </para
 167        /// <param name="cancellationToken"> The cancellation token to use. </param>
 168        public Response<FeatureOperationsListResult> List(string resourceProviderNamespace, CancellationToken cancellati
 169        {
 2170            if (resourceProviderNamespace == null)
 171            {
 0172                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 173            }
 174
 2175            using var message = CreateListRequest(resourceProviderNamespace);
 2176            _pipeline.Send(message, cancellationToken);
 2177            switch (message.Response.Status)
 178            {
 179                case 200:
 180                    {
 2181                        FeatureOperationsListResult value = default;
 2182                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2183                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 184                        {
 0185                            value = null;
 186                        }
 187                        else
 188                        {
 2189                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 190                        }
 2191                        return Response.FromValue(value, message.Response);
 192                    }
 193                default:
 0194                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 195            }
 2196        }
 197
 198        internal Core.HttpMessage CreateGetRequest(string resourceProviderNamespace, string featureName)
 199        {
 4200            var message = _pipeline.CreateMessage();
 4201            var request = message.Request;
 4202            request.Method = RequestMethod.Get;
 4203            var uri = new RawRequestUriBuilder();
 4204            uri.Reset(endpoint);
 4205            uri.AppendPath("/subscriptions/", false);
 4206            uri.AppendPath(subscriptionId, true);
 4207            uri.AppendPath("/providers/Microsoft.Features/providers/", false);
 4208            uri.AppendPath(resourceProviderNamespace, true);
 4209            uri.AppendPath("/features/", false);
 4210            uri.AppendPath(featureName, true);
 4211            uri.AppendQuery("api-version", "2015-12-01", true);
 4212            request.Uri = uri;
 4213            return message;
 214        }
 215
 216        /// <summary> Gets the preview feature with the specified name. </summary>
 217        /// <param name="resourceProviderNamespace"> The resource provider namespace for the feature. </param>
 218        /// <param name="featureName"> The name of the feature to get. </param>
 219        /// <param name="cancellationToken"> The cancellation token to use. </param>
 220        public async Task<Response<FeatureResult>> GetAsync(string resourceProviderNamespace, string featureName, Cancel
 221        {
 2222            if (resourceProviderNamespace == null)
 223            {
 0224                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 225            }
 2226            if (featureName == null)
 227            {
 0228                throw new ArgumentNullException(nameof(featureName));
 229            }
 230
 2231            using var message = CreateGetRequest(resourceProviderNamespace, featureName);
 2232            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2233            switch (message.Response.Status)
 234            {
 235                case 200:
 236                    {
 2237                        FeatureResult value = default;
 2238                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2239                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 240                        {
 0241                            value = null;
 242                        }
 243                        else
 244                        {
 2245                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 246                        }
 2247                        return Response.FromValue(value, message.Response);
 248                    }
 249                default:
 0250                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 251            }
 2252        }
 253
 254        /// <summary> Gets the preview feature with the specified name. </summary>
 255        /// <param name="resourceProviderNamespace"> The resource provider namespace for the feature. </param>
 256        /// <param name="featureName"> The name of the feature to get. </param>
 257        /// <param name="cancellationToken"> The cancellation token to use. </param>
 258        public Response<FeatureResult> Get(string resourceProviderNamespace, string featureName, CancellationToken cance
 259        {
 2260            if (resourceProviderNamespace == null)
 261            {
 0262                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 263            }
 2264            if (featureName == null)
 265            {
 0266                throw new ArgumentNullException(nameof(featureName));
 267            }
 268
 2269            using var message = CreateGetRequest(resourceProviderNamespace, featureName);
 2270            _pipeline.Send(message, cancellationToken);
 2271            switch (message.Response.Status)
 272            {
 273                case 200:
 274                    {
 2275                        FeatureResult value = default;
 2276                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2277                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 278                        {
 0279                            value = null;
 280                        }
 281                        else
 282                        {
 2283                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 284                        }
 2285                        return Response.FromValue(value, message.Response);
 286                    }
 287                default:
 0288                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 289            }
 2290        }
 291
 292        internal Core.HttpMessage CreateRegisterRequest(string resourceProviderNamespace, string featureName)
 293        {
 4294            var message = _pipeline.CreateMessage();
 4295            var request = message.Request;
 4296            request.Method = RequestMethod.Post;
 4297            var uri = new RawRequestUriBuilder();
 4298            uri.Reset(endpoint);
 4299            uri.AppendPath("/subscriptions/", false);
 4300            uri.AppendPath(subscriptionId, true);
 4301            uri.AppendPath("/providers/Microsoft.Features/providers/", false);
 4302            uri.AppendPath(resourceProviderNamespace, true);
 4303            uri.AppendPath("/features/", false);
 4304            uri.AppendPath(featureName, true);
 4305            uri.AppendPath("/register", false);
 4306            uri.AppendQuery("api-version", "2015-12-01", true);
 4307            request.Uri = uri;
 4308            return message;
 309        }
 310
 311        /// <summary> Registers the preview feature for the subscription. </summary>
 312        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 313        /// <param name="featureName"> The name of the feature to register. </param>
 314        /// <param name="cancellationToken"> The cancellation token to use. </param>
 315        public async Task<Response<FeatureResult>> RegisterAsync(string resourceProviderNamespace, string featureName, C
 316        {
 2317            if (resourceProviderNamespace == null)
 318            {
 0319                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 320            }
 2321            if (featureName == null)
 322            {
 0323                throw new ArgumentNullException(nameof(featureName));
 324            }
 325
 2326            using var message = CreateRegisterRequest(resourceProviderNamespace, featureName);
 2327            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2328            switch (message.Response.Status)
 329            {
 330                case 200:
 331                    {
 2332                        FeatureResult value = default;
 2333                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2334                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 335                        {
 0336                            value = null;
 337                        }
 338                        else
 339                        {
 2340                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 341                        }
 2342                        return Response.FromValue(value, message.Response);
 343                    }
 344                default:
 0345                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 346            }
 2347        }
 348
 349        /// <summary> Registers the preview feature for the subscription. </summary>
 350        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 351        /// <param name="featureName"> The name of the feature to register. </param>
 352        /// <param name="cancellationToken"> The cancellation token to use. </param>
 353        public Response<FeatureResult> Register(string resourceProviderNamespace, string featureName, CancellationToken 
 354        {
 2355            if (resourceProviderNamespace == null)
 356            {
 0357                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 358            }
 2359            if (featureName == null)
 360            {
 0361                throw new ArgumentNullException(nameof(featureName));
 362            }
 363
 2364            using var message = CreateRegisterRequest(resourceProviderNamespace, featureName);
 2365            _pipeline.Send(message, cancellationToken);
 2366            switch (message.Response.Status)
 367            {
 368                case 200:
 369                    {
 2370                        FeatureResult value = default;
 2371                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2372                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 373                        {
 0374                            value = null;
 375                        }
 376                        else
 377                        {
 2378                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 379                        }
 2380                        return Response.FromValue(value, message.Response);
 381                    }
 382                default:
 0383                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 384            }
 2385        }
 386
 387        internal Core.HttpMessage CreateUnregisterRequest(string resourceProviderNamespace, string featureName)
 388        {
 0389            var message = _pipeline.CreateMessage();
 0390            var request = message.Request;
 0391            request.Method = RequestMethod.Post;
 0392            var uri = new RawRequestUriBuilder();
 0393            uri.Reset(endpoint);
 0394            uri.AppendPath("/subscriptions/", false);
 0395            uri.AppendPath(subscriptionId, true);
 0396            uri.AppendPath("/providers/Microsoft.Features/providers/", false);
 0397            uri.AppendPath(resourceProviderNamespace, true);
 0398            uri.AppendPath("/features/", false);
 0399            uri.AppendPath(featureName, true);
 0400            uri.AppendPath("/unregister", false);
 0401            uri.AppendQuery("api-version", "2015-12-01", true);
 0402            request.Uri = uri;
 0403            return message;
 404        }
 405
 406        /// <summary> Unregisters the preview feature for the subscription. </summary>
 407        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 408        /// <param name="featureName"> The name of the feature to unregister. </param>
 409        /// <param name="cancellationToken"> The cancellation token to use. </param>
 410        public async Task<Response<FeatureResult>> UnregisterAsync(string resourceProviderNamespace, string featureName,
 411        {
 0412            if (resourceProviderNamespace == null)
 413            {
 0414                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 415            }
 0416            if (featureName == null)
 417            {
 0418                throw new ArgumentNullException(nameof(featureName));
 419            }
 420
 0421            using var message = CreateUnregisterRequest(resourceProviderNamespace, featureName);
 0422            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0423            switch (message.Response.Status)
 424            {
 425                case 200:
 426                    {
 0427                        FeatureResult value = default;
 0428                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0429                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 430                        {
 0431                            value = null;
 432                        }
 433                        else
 434                        {
 0435                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 436                        }
 0437                        return Response.FromValue(value, message.Response);
 438                    }
 439                default:
 0440                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 441            }
 0442        }
 443
 444        /// <summary> Unregisters the preview feature for the subscription. </summary>
 445        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 446        /// <param name="featureName"> The name of the feature to unregister. </param>
 447        /// <param name="cancellationToken"> The cancellation token to use. </param>
 448        public Response<FeatureResult> Unregister(string resourceProviderNamespace, string featureName, CancellationToke
 449        {
 0450            if (resourceProviderNamespace == null)
 451            {
 0452                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 453            }
 0454            if (featureName == null)
 455            {
 0456                throw new ArgumentNullException(nameof(featureName));
 457            }
 458
 0459            using var message = CreateUnregisterRequest(resourceProviderNamespace, featureName);
 0460            _pipeline.Send(message, cancellationToken);
 0461            switch (message.Response.Status)
 462            {
 463                case 200:
 464                    {
 0465                        FeatureResult value = default;
 0466                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0467                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 468                        {
 0469                            value = null;
 470                        }
 471                        else
 472                        {
 0473                            value = FeatureResult.DeserializeFeatureResult(document.RootElement);
 474                        }
 0475                        return Response.FromValue(value, message.Response);
 476                    }
 477                default:
 0478                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 479            }
 0480        }
 481
 482        internal Core.HttpMessage CreateListAllNextPageRequest(string nextLink)
 483        {
 0484            var message = _pipeline.CreateMessage();
 0485            var request = message.Request;
 0486            request.Method = RequestMethod.Get;
 0487            var uri = new RawRequestUriBuilder();
 0488            uri.Reset(endpoint);
 0489            uri.AppendRawNextLink(nextLink, false);
 0490            request.Uri = uri;
 0491            return message;
 492        }
 493
 494        /// <summary> Gets all the preview features that are available through AFEC for the subscription. </summary>
 495        /// <param name="nextLink"> The URL to the next page of results. </param>
 496        /// <param name="cancellationToken"> The cancellation token to use. </param>
 497        public async Task<Response<FeatureOperationsListResult>> ListAllNextPageAsync(string nextLink, CancellationToken
 498        {
 0499            if (nextLink == null)
 500            {
 0501                throw new ArgumentNullException(nameof(nextLink));
 502            }
 503
 0504            using var message = CreateListAllNextPageRequest(nextLink);
 0505            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0506            switch (message.Response.Status)
 507            {
 508                case 200:
 509                    {
 0510                        FeatureOperationsListResult value = default;
 0511                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0512                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 513                        {
 0514                            value = null;
 515                        }
 516                        else
 517                        {
 0518                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 519                        }
 0520                        return Response.FromValue(value, message.Response);
 521                    }
 522                default:
 0523                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 524            }
 0525        }
 526
 527        /// <summary> Gets all the preview features that are available through AFEC for the subscription. </summary>
 528        /// <param name="nextLink"> The URL to the next page of results. </param>
 529        /// <param name="cancellationToken"> The cancellation token to use. </param>
 530        public Response<FeatureOperationsListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToke
 531        {
 0532            if (nextLink == null)
 533            {
 0534                throw new ArgumentNullException(nameof(nextLink));
 535            }
 536
 0537            using var message = CreateListAllNextPageRequest(nextLink);
 0538            _pipeline.Send(message, cancellationToken);
 0539            switch (message.Response.Status)
 540            {
 541                case 200:
 542                    {
 0543                        FeatureOperationsListResult 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 = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 552                        }
 0553                        return Response.FromValue(value, message.Response);
 554                    }
 555                default:
 0556                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 557            }
 0558        }
 559
 560        internal Core.HttpMessage CreateListNextPageRequest(string nextLink, string resourceProviderNamespace)
 561        {
 0562            var message = _pipeline.CreateMessage();
 0563            var request = message.Request;
 0564            request.Method = RequestMethod.Get;
 0565            var uri = new RawRequestUriBuilder();
 0566            uri.Reset(endpoint);
 0567            uri.AppendRawNextLink(nextLink, false);
 0568            request.Uri = uri;
 0569            return message;
 570        }
 571
 572        /// <summary> Gets all the preview features in a provider namespace that are available through AFEC for the subs
 573        /// <param name="nextLink"> The URL to the next page of results. </param>
 574        /// <param name="resourceProviderNamespace"> The namespace of the resource provider for getting features. </para
 575        /// <param name="cancellationToken"> The cancellation token to use. </param>
 576        public async Task<Response<FeatureOperationsListResult>> ListNextPageAsync(string nextLink, string resourceProvi
 577        {
 0578            if (nextLink == null)
 579            {
 0580                throw new ArgumentNullException(nameof(nextLink));
 581            }
 0582            if (resourceProviderNamespace == null)
 583            {
 0584                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 585            }
 586
 0587            using var message = CreateListNextPageRequest(nextLink, resourceProviderNamespace);
 0588            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0589            switch (message.Response.Status)
 590            {
 591                case 200:
 592                    {
 0593                        FeatureOperationsListResult value = default;
 0594                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0595                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 596                        {
 0597                            value = null;
 598                        }
 599                        else
 600                        {
 0601                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 602                        }
 0603                        return Response.FromValue(value, message.Response);
 604                    }
 605                default:
 0606                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 607            }
 0608        }
 609
 610        /// <summary> Gets all the preview features in a provider namespace that are available through AFEC for the subs
 611        /// <param name="nextLink"> The URL to the next page of results. </param>
 612        /// <param name="resourceProviderNamespace"> The namespace of the resource provider for getting features. </para
 613        /// <param name="cancellationToken"> The cancellation token to use. </param>
 614        public Response<FeatureOperationsListResult> ListNextPage(string nextLink, string resourceProviderNamespace, Can
 615        {
 0616            if (nextLink == null)
 617            {
 0618                throw new ArgumentNullException(nameof(nextLink));
 619            }
 0620            if (resourceProviderNamespace == null)
 621            {
 0622                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 623            }
 624
 0625            using var message = CreateListNextPageRequest(nextLink, resourceProviderNamespace);
 0626            _pipeline.Send(message, cancellationToken);
 0627            switch (message.Response.Status)
 628            {
 629                case 200:
 630                    {
 0631                        FeatureOperationsListResult value = default;
 0632                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0633                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 634                        {
 0635                            value = null;
 636                        }
 637                        else
 638                        {
 0639                            value = FeatureOperationsListResult.DeserializeFeatureOperationsListResult(document.RootElem
 640                        }
 0641                        return Response.FromValue(value, message.Response);
 642                    }
 643                default:
 0644                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 645            }
 0646        }
 647    }
 648}