< Summary

Class:Azure.ResourceManager.Resources.DeploymentRestOperations
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\DeploymentRestOperations.cs
Covered lines:122
Uncovered lines:538
Coverable lines:660
Total lines:1501
Line coverage:18.4% (122 of 660)
Covered branches:30
Total branches:270
Branch coverage:11.1% (30 of 270)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateGetAtScopeRequest(...)-0%100%
GetAtScopeAsync()-0%0%
GetAtScope(...)-0%0%
CreateListAtScopeRequest(...)-93.33%50%
ListAtScopeAsync()-73.33%50%
ListAtScope(...)-73.33%50%
CreateGetAtTenantScopeRequest(...)-0%100%
GetAtTenantScopeAsync()-0%0%
GetAtTenantScope(...)-0%0%
CreateListAtTenantScopeRequest(...)-0%0%
ListAtTenantScopeAsync()-0%0%
ListAtTenantScope(...)-0%0%
CreateGetAtManagementGroupScopeRequest(...)-0%100%
GetAtManagementGroupScopeAsync()-0%0%
GetAtManagementGroupScope(...)-0%0%
CreateListAtManagementGroupScopeRequest(...)-0%0%
ListAtManagementGroupScopeAsync()-0%0%
ListAtManagementGroupScope(...)-0%0%
CreateGetAtSubscriptionScopeRequest(...)-0%100%
GetAtSubscriptionScopeAsync()-0%0%
GetAtSubscriptionScope(...)-0%0%
CreateListAtSubscriptionScopeRequest(...)-0%0%
ListAtSubscriptionScopeAsync()-0%0%
ListAtSubscriptionScope(...)-0%0%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateListRequest(...)-94.12%50%
ListAsync()-73.33%50%
List(...)-73.33%50%
CreateListAtScopeNextPageRequest(...)-0%100%
ListAtScopeNextPageAsync()-0%0%
ListAtScopeNextPage(...)-0%0%
CreateListAtTenantScopeNextPageRequest(...)-0%100%
ListAtTenantScopeNextPageAsync()-0%0%
ListAtTenantScopeNextPage(...)-0%0%
CreateListAtManagementGroupScopeNextPageRequest(...)-0%100%
ListAtManagementGroupScopeNextPageAsync()-0%0%
ListAtManagementGroupScopeNextPage(...)-0%0%
CreateListAtSubscriptionScopeNextPageRequest(...)-0%100%
ListAtSubscriptionScopeNextPageAsync()-0%0%
ListAtSubscriptionScopeNextPage(...)-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\DeploymentRestOperations.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 DeploymentRestOperations
 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 DeploymentRestOperations. </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
 27232        public DeploymentRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI
 33        {
 27234            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 27238            endpoint ??= new Uri("https://management.azure.com");
 39
 27240            this.subscriptionId = subscriptionId;
 27241            this.endpoint = endpoint;
 27242            _clientDiagnostics = clientDiagnostics;
 27243            _pipeline = pipeline;
 27244        }
 45
 46        internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymentName, string operationId)
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/", false);
 054            uri.AppendPath(scope, false);
 055            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 056            uri.AppendPath(deploymentName, true);
 057            uri.AppendPath("/operations/", false);
 058            uri.AppendPath(operationId, true);
 059            uri.AppendQuery("api-version", "2019-10-01", true);
 060            request.Uri = uri;
 061            return message;
 62        }
 63
 64        /// <summary> Gets a deployments operation. </summary>
 65        /// <param name="scope"> The resource scope. </param>
 66        /// <param name="deploymentName"> The name of the deployment. </param>
 67        /// <param name="operationId"> The ID of the operation to get. </param>
 68        /// <param name="cancellationToken"> The cancellation token to use. </param>
 69        public async Task<Response<DeploymentOperation>> GetAtScopeAsync(string scope, string deploymentName, string ope
 70        {
 071            if (scope == null)
 72            {
 073                throw new ArgumentNullException(nameof(scope));
 74            }
 075            if (deploymentName == null)
 76            {
 077                throw new ArgumentNullException(nameof(deploymentName));
 78            }
 079            if (operationId == null)
 80            {
 081                throw new ArgumentNullException(nameof(operationId));
 82            }
 83
 084            using var message = CreateGetAtScopeRequest(scope, deploymentName, operationId);
 085            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 086            switch (message.Response.Status)
 87            {
 88                case 200:
 89                    {
 090                        DeploymentOperation value = default;
 091                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 092                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 93                        {
 094                            value = null;
 95                        }
 96                        else
 97                        {
 098                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 99                        }
 0100                        return Response.FromValue(value, message.Response);
 101                    }
 102                default:
 0103                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 104            }
 0105        }
 106
 107        /// <summary> Gets a deployments operation. </summary>
 108        /// <param name="scope"> The resource scope. </param>
 109        /// <param name="deploymentName"> The name of the deployment. </param>
 110        /// <param name="operationId"> The ID of the operation to get. </param>
 111        /// <param name="cancellationToken"> The cancellation token to use. </param>
 112        public Response<DeploymentOperation> GetAtScope(string scope, string deploymentName, string operationId, Cancell
 113        {
 0114            if (scope == null)
 115            {
 0116                throw new ArgumentNullException(nameof(scope));
 117            }
 0118            if (deploymentName == null)
 119            {
 0120                throw new ArgumentNullException(nameof(deploymentName));
 121            }
 0122            if (operationId == null)
 123            {
 0124                throw new ArgumentNullException(nameof(operationId));
 125            }
 126
 0127            using var message = CreateGetAtScopeRequest(scope, deploymentName, operationId);
 0128            _pipeline.Send(message, cancellationToken);
 0129            switch (message.Response.Status)
 130            {
 131                case 200:
 132                    {
 0133                        DeploymentOperation value = default;
 0134                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0135                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 136                        {
 0137                            value = null;
 138                        }
 139                        else
 140                        {
 0141                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 142                        }
 0143                        return Response.FromValue(value, message.Response);
 144                    }
 145                default:
 0146                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 147            }
 0148        }
 149
 150        internal Core.HttpMessage CreateListAtScopeRequest(string scope, string deploymentName, int? top)
 151        {
 12152            var message = _pipeline.CreateMessage();
 12153            var request = message.Request;
 12154            request.Method = RequestMethod.Get;
 12155            var uri = new RawRequestUriBuilder();
 12156            uri.Reset(endpoint);
 12157            uri.AppendPath("/", false);
 12158            uri.AppendPath(scope, false);
 12159            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 12160            uri.AppendPath(deploymentName, true);
 12161            uri.AppendPath("/operations", false);
 12162            if (top != null)
 163            {
 0164                uri.AppendQuery("$top", top.Value, true);
 165            }
 12166            uri.AppendQuery("api-version", "2019-10-01", true);
 12167            request.Uri = uri;
 12168            return message;
 169        }
 170
 171        /// <summary> Gets all deployments operations for a deployment. </summary>
 172        /// <param name="scope"> The resource scope. </param>
 173        /// <param name="deploymentName"> The name of the deployment. </param>
 174        /// <param name="top"> The number of results to return. </param>
 175        /// <param name="cancellationToken"> The cancellation token to use. </param>
 176        public async Task<Response<DeploymentOperationsListResult>> ListAtScopeAsync(string scope, string deploymentName
 177        {
 6178            if (scope == null)
 179            {
 0180                throw new ArgumentNullException(nameof(scope));
 181            }
 6182            if (deploymentName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(deploymentName));
 185            }
 186
 6187            using var message = CreateListAtScopeRequest(scope, deploymentName, top);
 6188            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6189            switch (message.Response.Status)
 190            {
 191                case 200:
 192                    {
 6193                        DeploymentOperationsListResult value = default;
 6194                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6195                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 196                        {
 0197                            value = null;
 198                        }
 199                        else
 200                        {
 6201                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 202                        }
 6203                        return Response.FromValue(value, message.Response);
 204                    }
 205                default:
 0206                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 207            }
 6208        }
 209
 210        /// <summary> Gets all deployments operations for a deployment. </summary>
 211        /// <param name="scope"> The resource scope. </param>
 212        /// <param name="deploymentName"> The name of the deployment. </param>
 213        /// <param name="top"> The number of results to return. </param>
 214        /// <param name="cancellationToken"> The cancellation token to use. </param>
 215        public Response<DeploymentOperationsListResult> ListAtScope(string scope, string deploymentName, int? top = null
 216        {
 6217            if (scope == null)
 218            {
 0219                throw new ArgumentNullException(nameof(scope));
 220            }
 6221            if (deploymentName == null)
 222            {
 0223                throw new ArgumentNullException(nameof(deploymentName));
 224            }
 225
 6226            using var message = CreateListAtScopeRequest(scope, deploymentName, top);
 6227            _pipeline.Send(message, cancellationToken);
 6228            switch (message.Response.Status)
 229            {
 230                case 200:
 231                    {
 6232                        DeploymentOperationsListResult value = default;
 6233                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6234                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 235                        {
 0236                            value = null;
 237                        }
 238                        else
 239                        {
 6240                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 241                        }
 6242                        return Response.FromValue(value, message.Response);
 243                    }
 244                default:
 0245                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 246            }
 6247        }
 248
 249        internal Core.HttpMessage CreateGetAtTenantScopeRequest(string deploymentName, string operationId)
 250        {
 0251            var message = _pipeline.CreateMessage();
 0252            var request = message.Request;
 0253            request.Method = RequestMethod.Get;
 0254            var uri = new RawRequestUriBuilder();
 0255            uri.Reset(endpoint);
 0256            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0257            uri.AppendPath(deploymentName, true);
 0258            uri.AppendPath("/operations/", false);
 0259            uri.AppendPath(operationId, true);
 0260            uri.AppendQuery("api-version", "2019-10-01", true);
 0261            request.Uri = uri;
 0262            return message;
 263        }
 264
 265        /// <summary> Gets a deployments operation. </summary>
 266        /// <param name="deploymentName"> The name of the deployment. </param>
 267        /// <param name="operationId"> The ID of the operation to get. </param>
 268        /// <param name="cancellationToken"> The cancellation token to use. </param>
 269        public async Task<Response<DeploymentOperation>> GetAtTenantScopeAsync(string deploymentName, string operationId
 270        {
 0271            if (deploymentName == null)
 272            {
 0273                throw new ArgumentNullException(nameof(deploymentName));
 274            }
 0275            if (operationId == null)
 276            {
 0277                throw new ArgumentNullException(nameof(operationId));
 278            }
 279
 0280            using var message = CreateGetAtTenantScopeRequest(deploymentName, operationId);
 0281            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0282            switch (message.Response.Status)
 283            {
 284                case 200:
 285                    {
 0286                        DeploymentOperation value = default;
 0287                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0288                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 289                        {
 0290                            value = null;
 291                        }
 292                        else
 293                        {
 0294                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 295                        }
 0296                        return Response.FromValue(value, message.Response);
 297                    }
 298                default:
 0299                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 300            }
 0301        }
 302
 303        /// <summary> Gets a deployments operation. </summary>
 304        /// <param name="deploymentName"> The name of the deployment. </param>
 305        /// <param name="operationId"> The ID of the operation to get. </param>
 306        /// <param name="cancellationToken"> The cancellation token to use. </param>
 307        public Response<DeploymentOperation> GetAtTenantScope(string deploymentName, string operationId, CancellationTok
 308        {
 0309            if (deploymentName == null)
 310            {
 0311                throw new ArgumentNullException(nameof(deploymentName));
 312            }
 0313            if (operationId == null)
 314            {
 0315                throw new ArgumentNullException(nameof(operationId));
 316            }
 317
 0318            using var message = CreateGetAtTenantScopeRequest(deploymentName, operationId);
 0319            _pipeline.Send(message, cancellationToken);
 0320            switch (message.Response.Status)
 321            {
 322                case 200:
 323                    {
 0324                        DeploymentOperation value = default;
 0325                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0326                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 327                        {
 0328                            value = null;
 329                        }
 330                        else
 331                        {
 0332                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 333                        }
 0334                        return Response.FromValue(value, message.Response);
 335                    }
 336                default:
 0337                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 338            }
 0339        }
 340
 341        internal Core.HttpMessage CreateListAtTenantScopeRequest(string deploymentName, int? top)
 342        {
 0343            var message = _pipeline.CreateMessage();
 0344            var request = message.Request;
 0345            request.Method = RequestMethod.Get;
 0346            var uri = new RawRequestUriBuilder();
 0347            uri.Reset(endpoint);
 0348            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0349            uri.AppendPath(deploymentName, true);
 0350            uri.AppendPath("/operations", false);
 0351            if (top != null)
 352            {
 0353                uri.AppendQuery("$top", top.Value, true);
 354            }
 0355            uri.AppendQuery("api-version", "2019-10-01", true);
 0356            request.Uri = uri;
 0357            return message;
 358        }
 359
 360        /// <summary> Gets all deployments operations for a deployment. </summary>
 361        /// <param name="deploymentName"> The name of the deployment. </param>
 362        /// <param name="top"> The number of results to return. </param>
 363        /// <param name="cancellationToken"> The cancellation token to use. </param>
 364        public async Task<Response<DeploymentOperationsListResult>> ListAtTenantScopeAsync(string deploymentName, int? t
 365        {
 0366            if (deploymentName == null)
 367            {
 0368                throw new ArgumentNullException(nameof(deploymentName));
 369            }
 370
 0371            using var message = CreateListAtTenantScopeRequest(deploymentName, top);
 0372            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0373            switch (message.Response.Status)
 374            {
 375                case 200:
 376                    {
 0377                        DeploymentOperationsListResult value = default;
 0378                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0379                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 380                        {
 0381                            value = null;
 382                        }
 383                        else
 384                        {
 0385                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 386                        }
 0387                        return Response.FromValue(value, message.Response);
 388                    }
 389                default:
 0390                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 391            }
 0392        }
 393
 394        /// <summary> Gets all deployments operations for a deployment. </summary>
 395        /// <param name="deploymentName"> The name of the deployment. </param>
 396        /// <param name="top"> The number of results to return. </param>
 397        /// <param name="cancellationToken"> The cancellation token to use. </param>
 398        public Response<DeploymentOperationsListResult> ListAtTenantScope(string deploymentName, int? top = null, Cancel
 399        {
 0400            if (deploymentName == null)
 401            {
 0402                throw new ArgumentNullException(nameof(deploymentName));
 403            }
 404
 0405            using var message = CreateListAtTenantScopeRequest(deploymentName, top);
 0406            _pipeline.Send(message, cancellationToken);
 0407            switch (message.Response.Status)
 408            {
 409                case 200:
 410                    {
 0411                        DeploymentOperationsListResult value = default;
 0412                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0413                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 414                        {
 0415                            value = null;
 416                        }
 417                        else
 418                        {
 0419                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 420                        }
 0421                        return Response.FromValue(value, message.Response);
 422                    }
 423                default:
 0424                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 425            }
 0426        }
 427
 428        internal Core.HttpMessage CreateGetAtManagementGroupScopeRequest(string groupId, string deploymentName, string o
 429        {
 0430            var message = _pipeline.CreateMessage();
 0431            var request = message.Request;
 0432            request.Method = RequestMethod.Get;
 0433            var uri = new RawRequestUriBuilder();
 0434            uri.Reset(endpoint);
 0435            uri.AppendPath("/providers/Microsoft.Management/managementGroups/", false);
 0436            uri.AppendPath(groupId, true);
 0437            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0438            uri.AppendPath(deploymentName, true);
 0439            uri.AppendPath("/operations/", false);
 0440            uri.AppendPath(operationId, true);
 0441            uri.AppendQuery("api-version", "2019-10-01", true);
 0442            request.Uri = uri;
 0443            return message;
 444        }
 445
 446        /// <summary> Gets a deployments operation. </summary>
 447        /// <param name="groupId"> The management group ID. </param>
 448        /// <param name="deploymentName"> The name of the deployment. </param>
 449        /// <param name="operationId"> The ID of the operation to get. </param>
 450        /// <param name="cancellationToken"> The cancellation token to use. </param>
 451        public async Task<Response<DeploymentOperation>> GetAtManagementGroupScopeAsync(string groupId, string deploymen
 452        {
 0453            if (groupId == null)
 454            {
 0455                throw new ArgumentNullException(nameof(groupId));
 456            }
 0457            if (deploymentName == null)
 458            {
 0459                throw new ArgumentNullException(nameof(deploymentName));
 460            }
 0461            if (operationId == null)
 462            {
 0463                throw new ArgumentNullException(nameof(operationId));
 464            }
 465
 0466            using var message = CreateGetAtManagementGroupScopeRequest(groupId, deploymentName, operationId);
 0467            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0468            switch (message.Response.Status)
 469            {
 470                case 200:
 471                    {
 0472                        DeploymentOperation value = default;
 0473                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0474                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 475                        {
 0476                            value = null;
 477                        }
 478                        else
 479                        {
 0480                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 481                        }
 0482                        return Response.FromValue(value, message.Response);
 483                    }
 484                default:
 0485                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 486            }
 0487        }
 488
 489        /// <summary> Gets a deployments operation. </summary>
 490        /// <param name="groupId"> The management group ID. </param>
 491        /// <param name="deploymentName"> The name of the deployment. </param>
 492        /// <param name="operationId"> The ID of the operation to get. </param>
 493        /// <param name="cancellationToken"> The cancellation token to use. </param>
 494        public Response<DeploymentOperation> GetAtManagementGroupScope(string groupId, string deploymentName, string ope
 495        {
 0496            if (groupId == null)
 497            {
 0498                throw new ArgumentNullException(nameof(groupId));
 499            }
 0500            if (deploymentName == null)
 501            {
 0502                throw new ArgumentNullException(nameof(deploymentName));
 503            }
 0504            if (operationId == null)
 505            {
 0506                throw new ArgumentNullException(nameof(operationId));
 507            }
 508
 0509            using var message = CreateGetAtManagementGroupScopeRequest(groupId, deploymentName, operationId);
 0510            _pipeline.Send(message, cancellationToken);
 0511            switch (message.Response.Status)
 512            {
 513                case 200:
 514                    {
 0515                        DeploymentOperation value = default;
 0516                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0517                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 518                        {
 0519                            value = null;
 520                        }
 521                        else
 522                        {
 0523                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 524                        }
 0525                        return Response.FromValue(value, message.Response);
 526                    }
 527                default:
 0528                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 529            }
 0530        }
 531
 532        internal Core.HttpMessage CreateListAtManagementGroupScopeRequest(string groupId, string deploymentName, int? to
 533        {
 0534            var message = _pipeline.CreateMessage();
 0535            var request = message.Request;
 0536            request.Method = RequestMethod.Get;
 0537            var uri = new RawRequestUriBuilder();
 0538            uri.Reset(endpoint);
 0539            uri.AppendPath("/providers/Microsoft.Management/managementGroups/", false);
 0540            uri.AppendPath(groupId, true);
 0541            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0542            uri.AppendPath(deploymentName, true);
 0543            uri.AppendPath("/operations", false);
 0544            if (top != null)
 545            {
 0546                uri.AppendQuery("$top", top.Value, true);
 547            }
 0548            uri.AppendQuery("api-version", "2019-10-01", true);
 0549            request.Uri = uri;
 0550            return message;
 551        }
 552
 553        /// <summary> Gets all deployments operations for a deployment. </summary>
 554        /// <param name="groupId"> The management group ID. </param>
 555        /// <param name="deploymentName"> The name of the deployment. </param>
 556        /// <param name="top"> The number of results to return. </param>
 557        /// <param name="cancellationToken"> The cancellation token to use. </param>
 558        public async Task<Response<DeploymentOperationsListResult>> ListAtManagementGroupScopeAsync(string groupId, stri
 559        {
 0560            if (groupId == null)
 561            {
 0562                throw new ArgumentNullException(nameof(groupId));
 563            }
 0564            if (deploymentName == null)
 565            {
 0566                throw new ArgumentNullException(nameof(deploymentName));
 567            }
 568
 0569            using var message = CreateListAtManagementGroupScopeRequest(groupId, deploymentName, top);
 0570            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0571            switch (message.Response.Status)
 572            {
 573                case 200:
 574                    {
 0575                        DeploymentOperationsListResult value = default;
 0576                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0577                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 578                        {
 0579                            value = null;
 580                        }
 581                        else
 582                        {
 0583                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 584                        }
 0585                        return Response.FromValue(value, message.Response);
 586                    }
 587                default:
 0588                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 589            }
 0590        }
 591
 592        /// <summary> Gets all deployments operations for a deployment. </summary>
 593        /// <param name="groupId"> The management group ID. </param>
 594        /// <param name="deploymentName"> The name of the deployment. </param>
 595        /// <param name="top"> The number of results to return. </param>
 596        /// <param name="cancellationToken"> The cancellation token to use. </param>
 597        public Response<DeploymentOperationsListResult> ListAtManagementGroupScope(string groupId, string deploymentName
 598        {
 0599            if (groupId == null)
 600            {
 0601                throw new ArgumentNullException(nameof(groupId));
 602            }
 0603            if (deploymentName == null)
 604            {
 0605                throw new ArgumentNullException(nameof(deploymentName));
 606            }
 607
 0608            using var message = CreateListAtManagementGroupScopeRequest(groupId, deploymentName, top);
 0609            _pipeline.Send(message, cancellationToken);
 0610            switch (message.Response.Status)
 611            {
 612                case 200:
 613                    {
 0614                        DeploymentOperationsListResult value = default;
 0615                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0616                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 617                        {
 0618                            value = null;
 619                        }
 620                        else
 621                        {
 0622                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 623                        }
 0624                        return Response.FromValue(value, message.Response);
 625                    }
 626                default:
 0627                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 628            }
 0629        }
 630
 631        internal Core.HttpMessage CreateGetAtSubscriptionScopeRequest(string deploymentName, string operationId)
 632        {
 0633            var message = _pipeline.CreateMessage();
 0634            var request = message.Request;
 0635            request.Method = RequestMethod.Get;
 0636            var uri = new RawRequestUriBuilder();
 0637            uri.Reset(endpoint);
 0638            uri.AppendPath("/subscriptions/", false);
 0639            uri.AppendPath(subscriptionId, true);
 0640            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0641            uri.AppendPath(deploymentName, true);
 0642            uri.AppendPath("/operations/", false);
 0643            uri.AppendPath(operationId, true);
 0644            uri.AppendQuery("api-version", "2019-10-01", true);
 0645            request.Uri = uri;
 0646            return message;
 647        }
 648
 649        /// <summary> Gets a deployments operation. </summary>
 650        /// <param name="deploymentName"> The name of the deployment. </param>
 651        /// <param name="operationId"> The ID of the operation to get. </param>
 652        /// <param name="cancellationToken"> The cancellation token to use. </param>
 653        public async Task<Response<DeploymentOperation>> GetAtSubscriptionScopeAsync(string deploymentName, string opera
 654        {
 0655            if (deploymentName == null)
 656            {
 0657                throw new ArgumentNullException(nameof(deploymentName));
 658            }
 0659            if (operationId == null)
 660            {
 0661                throw new ArgumentNullException(nameof(operationId));
 662            }
 663
 0664            using var message = CreateGetAtSubscriptionScopeRequest(deploymentName, operationId);
 0665            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0666            switch (message.Response.Status)
 667            {
 668                case 200:
 669                    {
 0670                        DeploymentOperation value = default;
 0671                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0672                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 673                        {
 0674                            value = null;
 675                        }
 676                        else
 677                        {
 0678                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 679                        }
 0680                        return Response.FromValue(value, message.Response);
 681                    }
 682                default:
 0683                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 684            }
 0685        }
 686
 687        /// <summary> Gets a deployments operation. </summary>
 688        /// <param name="deploymentName"> The name of the deployment. </param>
 689        /// <param name="operationId"> The ID of the operation to get. </param>
 690        /// <param name="cancellationToken"> The cancellation token to use. </param>
 691        public Response<DeploymentOperation> GetAtSubscriptionScope(string deploymentName, string operationId, Cancellat
 692        {
 0693            if (deploymentName == null)
 694            {
 0695                throw new ArgumentNullException(nameof(deploymentName));
 696            }
 0697            if (operationId == null)
 698            {
 0699                throw new ArgumentNullException(nameof(operationId));
 700            }
 701
 0702            using var message = CreateGetAtSubscriptionScopeRequest(deploymentName, operationId);
 0703            _pipeline.Send(message, cancellationToken);
 0704            switch (message.Response.Status)
 705            {
 706                case 200:
 707                    {
 0708                        DeploymentOperation value = default;
 0709                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0710                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 711                        {
 0712                            value = null;
 713                        }
 714                        else
 715                        {
 0716                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 717                        }
 0718                        return Response.FromValue(value, message.Response);
 719                    }
 720                default:
 0721                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 722            }
 0723        }
 724
 725        internal Core.HttpMessage CreateListAtSubscriptionScopeRequest(string deploymentName, int? top)
 726        {
 0727            var message = _pipeline.CreateMessage();
 0728            var request = message.Request;
 0729            request.Method = RequestMethod.Get;
 0730            var uri = new RawRequestUriBuilder();
 0731            uri.Reset(endpoint);
 0732            uri.AppendPath("/subscriptions/", false);
 0733            uri.AppendPath(subscriptionId, true);
 0734            uri.AppendPath("/providers/Microsoft.Resources/deployments/", false);
 0735            uri.AppendPath(deploymentName, true);
 0736            uri.AppendPath("/operations", false);
 0737            if (top != null)
 738            {
 0739                uri.AppendQuery("$top", top.Value, true);
 740            }
 0741            uri.AppendQuery("api-version", "2019-10-01", true);
 0742            request.Uri = uri;
 0743            return message;
 744        }
 745
 746        /// <summary> Gets all deployments operations for a deployment. </summary>
 747        /// <param name="deploymentName"> The name of the deployment. </param>
 748        /// <param name="top"> The number of results to return. </param>
 749        /// <param name="cancellationToken"> The cancellation token to use. </param>
 750        public async Task<Response<DeploymentOperationsListResult>> ListAtSubscriptionScopeAsync(string deploymentName, 
 751        {
 0752            if (deploymentName == null)
 753            {
 0754                throw new ArgumentNullException(nameof(deploymentName));
 755            }
 756
 0757            using var message = CreateListAtSubscriptionScopeRequest(deploymentName, top);
 0758            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0759            switch (message.Response.Status)
 760            {
 761                case 200:
 762                    {
 0763                        DeploymentOperationsListResult value = default;
 0764                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0765                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 766                        {
 0767                            value = null;
 768                        }
 769                        else
 770                        {
 0771                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 772                        }
 0773                        return Response.FromValue(value, message.Response);
 774                    }
 775                default:
 0776                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 777            }
 0778        }
 779
 780        /// <summary> Gets all deployments operations for a deployment. </summary>
 781        /// <param name="deploymentName"> The name of the deployment. </param>
 782        /// <param name="top"> The number of results to return. </param>
 783        /// <param name="cancellationToken"> The cancellation token to use. </param>
 784        public Response<DeploymentOperationsListResult> ListAtSubscriptionScope(string deploymentName, int? top = null, 
 785        {
 0786            if (deploymentName == null)
 787            {
 0788                throw new ArgumentNullException(nameof(deploymentName));
 789            }
 790
 0791            using var message = CreateListAtSubscriptionScopeRequest(deploymentName, top);
 0792            _pipeline.Send(message, cancellationToken);
 0793            switch (message.Response.Status)
 794            {
 795                case 200:
 796                    {
 0797                        DeploymentOperationsListResult value = default;
 0798                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0799                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 800                        {
 0801                            value = null;
 802                        }
 803                        else
 804                        {
 0805                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 806                        }
 0807                        return Response.FromValue(value, message.Response);
 808                    }
 809                default:
 0810                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 811            }
 0812        }
 813
 814        internal Core.HttpMessage CreateGetRequest(string resourceGroupName, string deploymentName, string operationId)
 815        {
 4816            var message = _pipeline.CreateMessage();
 4817            var request = message.Request;
 4818            request.Method = RequestMethod.Get;
 4819            var uri = new RawRequestUriBuilder();
 4820            uri.Reset(endpoint);
 4821            uri.AppendPath("/subscriptions/", false);
 4822            uri.AppendPath(subscriptionId, true);
 4823            uri.AppendPath("/resourcegroups/", false);
 4824            uri.AppendPath(resourceGroupName, true);
 4825            uri.AppendPath("/deployments/", false);
 4826            uri.AppendPath(deploymentName, true);
 4827            uri.AppendPath("/operations/", false);
 4828            uri.AppendPath(operationId, true);
 4829            uri.AppendQuery("api-version", "2019-10-01", true);
 4830            request.Uri = uri;
 4831            return message;
 832        }
 833
 834        /// <summary> Gets a deployments operation. </summary>
 835        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 836        /// <param name="deploymentName"> The name of the deployment. </param>
 837        /// <param name="operationId"> The ID of the operation to get. </param>
 838        /// <param name="cancellationToken"> The cancellation token to use. </param>
 839        public async Task<Response<DeploymentOperation>> GetAsync(string resourceGroupName, string deploymentName, strin
 840        {
 2841            if (resourceGroupName == null)
 842            {
 0843                throw new ArgumentNullException(nameof(resourceGroupName));
 844            }
 2845            if (deploymentName == null)
 846            {
 0847                throw new ArgumentNullException(nameof(deploymentName));
 848            }
 2849            if (operationId == null)
 850            {
 0851                throw new ArgumentNullException(nameof(operationId));
 852            }
 853
 2854            using var message = CreateGetRequest(resourceGroupName, deploymentName, operationId);
 2855            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2856            switch (message.Response.Status)
 857            {
 858                case 200:
 859                    {
 2860                        DeploymentOperation value = default;
 2861                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2862                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 863                        {
 0864                            value = null;
 865                        }
 866                        else
 867                        {
 2868                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 869                        }
 2870                        return Response.FromValue(value, message.Response);
 871                    }
 872                default:
 0873                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 874            }
 2875        }
 876
 877        /// <summary> Gets a deployments operation. </summary>
 878        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 879        /// <param name="deploymentName"> The name of the deployment. </param>
 880        /// <param name="operationId"> The ID of the operation to get. </param>
 881        /// <param name="cancellationToken"> The cancellation token to use. </param>
 882        public Response<DeploymentOperation> Get(string resourceGroupName, string deploymentName, string operationId, Ca
 883        {
 2884            if (resourceGroupName == null)
 885            {
 0886                throw new ArgumentNullException(nameof(resourceGroupName));
 887            }
 2888            if (deploymentName == null)
 889            {
 0890                throw new ArgumentNullException(nameof(deploymentName));
 891            }
 2892            if (operationId == null)
 893            {
 0894                throw new ArgumentNullException(nameof(operationId));
 895            }
 896
 2897            using var message = CreateGetRequest(resourceGroupName, deploymentName, operationId);
 2898            _pipeline.Send(message, cancellationToken);
 2899            switch (message.Response.Status)
 900            {
 901                case 200:
 902                    {
 2903                        DeploymentOperation value = default;
 2904                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2905                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 906                        {
 0907                            value = null;
 908                        }
 909                        else
 910                        {
 2911                            value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement);
 912                        }
 2913                        return Response.FromValue(value, message.Response);
 914                    }
 915                default:
 0916                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 917            }
 2918        }
 919
 920        internal Core.HttpMessage CreateListRequest(string resourceGroupName, string deploymentName, int? top)
 921        {
 16922            var message = _pipeline.CreateMessage();
 16923            var request = message.Request;
 16924            request.Method = RequestMethod.Get;
 16925            var uri = new RawRequestUriBuilder();
 16926            uri.Reset(endpoint);
 16927            uri.AppendPath("/subscriptions/", false);
 16928            uri.AppendPath(subscriptionId, true);
 16929            uri.AppendPath("/resourcegroups/", false);
 16930            uri.AppendPath(resourceGroupName, true);
 16931            uri.AppendPath("/deployments/", false);
 16932            uri.AppendPath(deploymentName, true);
 16933            uri.AppendPath("/operations", false);
 16934            if (top != null)
 935            {
 0936                uri.AppendQuery("$top", top.Value, true);
 937            }
 16938            uri.AppendQuery("api-version", "2019-10-01", true);
 16939            request.Uri = uri;
 16940            return message;
 941        }
 942
 943        /// <summary> Gets all deployments operations for a deployment. </summary>
 944        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 945        /// <param name="deploymentName"> The name of the deployment. </param>
 946        /// <param name="top"> The number of results to return. </param>
 947        /// <param name="cancellationToken"> The cancellation token to use. </param>
 948        public async Task<Response<DeploymentOperationsListResult>> ListAsync(string resourceGroupName, string deploymen
 949        {
 8950            if (resourceGroupName == null)
 951            {
 0952                throw new ArgumentNullException(nameof(resourceGroupName));
 953            }
 8954            if (deploymentName == null)
 955            {
 0956                throw new ArgumentNullException(nameof(deploymentName));
 957            }
 958
 8959            using var message = CreateListRequest(resourceGroupName, deploymentName, top);
 8960            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 8961            switch (message.Response.Status)
 962            {
 963                case 200:
 964                    {
 8965                        DeploymentOperationsListResult value = default;
 8966                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 8967                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 968                        {
 0969                            value = null;
 970                        }
 971                        else
 972                        {
 8973                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 974                        }
 8975                        return Response.FromValue(value, message.Response);
 976                    }
 977                default:
 0978                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 979            }
 8980        }
 981
 982        /// <summary> Gets all deployments operations for a deployment. </summary>
 983        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 984        /// <param name="deploymentName"> The name of the deployment. </param>
 985        /// <param name="top"> The number of results to return. </param>
 986        /// <param name="cancellationToken"> The cancellation token to use. </param>
 987        public Response<DeploymentOperationsListResult> List(string resourceGroupName, string deploymentName, int? top =
 988        {
 8989            if (resourceGroupName == null)
 990            {
 0991                throw new ArgumentNullException(nameof(resourceGroupName));
 992            }
 8993            if (deploymentName == null)
 994            {
 0995                throw new ArgumentNullException(nameof(deploymentName));
 996            }
 997
 8998            using var message = CreateListRequest(resourceGroupName, deploymentName, top);
 8999            _pipeline.Send(message, cancellationToken);
 81000            switch (message.Response.Status)
 1001            {
 1002                case 200:
 1003                    {
 81004                        DeploymentOperationsListResult value = default;
 81005                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 81006                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1007                        {
 01008                            value = null;
 1009                        }
 1010                        else
 1011                        {
 81012                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1013                        }
 81014                        return Response.FromValue(value, message.Response);
 1015                    }
 1016                default:
 01017                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1018            }
 81019        }
 1020
 1021        internal Core.HttpMessage CreateListAtScopeNextPageRequest(string nextLink, string scope, string deploymentName,
 1022        {
 01023            var message = _pipeline.CreateMessage();
 01024            var request = message.Request;
 01025            request.Method = RequestMethod.Get;
 01026            var uri = new RawRequestUriBuilder();
 01027            uri.Reset(endpoint);
 01028            uri.AppendRawNextLink(nextLink, false);
 01029            request.Uri = uri;
 01030            return message;
 1031        }
 1032
 1033        /// <summary> Gets all deployments operations for a deployment. </summary>
 1034        /// <param name="nextLink"> The URL to the next page of results. </param>
 1035        /// <param name="scope"> The resource scope. </param>
 1036        /// <param name="deploymentName"> The name of the deployment. </param>
 1037        /// <param name="top"> The number of results to return. </param>
 1038        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1039        public async Task<Response<DeploymentOperationsListResult>> ListAtScopeNextPageAsync(string nextLink, string sco
 1040        {
 01041            if (nextLink == null)
 1042            {
 01043                throw new ArgumentNullException(nameof(nextLink));
 1044            }
 01045            if (scope == null)
 1046            {
 01047                throw new ArgumentNullException(nameof(scope));
 1048            }
 01049            if (deploymentName == null)
 1050            {
 01051                throw new ArgumentNullException(nameof(deploymentName));
 1052            }
 1053
 01054            using var message = CreateListAtScopeNextPageRequest(nextLink, scope, deploymentName, top);
 01055            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01056            switch (message.Response.Status)
 1057            {
 1058                case 200:
 1059                    {
 01060                        DeploymentOperationsListResult value = default;
 01061                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01062                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1063                        {
 01064                            value = null;
 1065                        }
 1066                        else
 1067                        {
 01068                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1069                        }
 01070                        return Response.FromValue(value, message.Response);
 1071                    }
 1072                default:
 01073                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1074            }
 01075        }
 1076
 1077        /// <summary> Gets all deployments operations for a deployment. </summary>
 1078        /// <param name="nextLink"> The URL to the next page of results. </param>
 1079        /// <param name="scope"> The resource scope. </param>
 1080        /// <param name="deploymentName"> The name of the deployment. </param>
 1081        /// <param name="top"> The number of results to return. </param>
 1082        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1083        public Response<DeploymentOperationsListResult> ListAtScopeNextPage(string nextLink, string scope, string deploy
 1084        {
 01085            if (nextLink == null)
 1086            {
 01087                throw new ArgumentNullException(nameof(nextLink));
 1088            }
 01089            if (scope == null)
 1090            {
 01091                throw new ArgumentNullException(nameof(scope));
 1092            }
 01093            if (deploymentName == null)
 1094            {
 01095                throw new ArgumentNullException(nameof(deploymentName));
 1096            }
 1097
 01098            using var message = CreateListAtScopeNextPageRequest(nextLink, scope, deploymentName, top);
 01099            _pipeline.Send(message, cancellationToken);
 01100            switch (message.Response.Status)
 1101            {
 1102                case 200:
 1103                    {
 01104                        DeploymentOperationsListResult value = default;
 01105                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01106                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1107                        {
 01108                            value = null;
 1109                        }
 1110                        else
 1111                        {
 01112                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1113                        }
 01114                        return Response.FromValue(value, message.Response);
 1115                    }
 1116                default:
 01117                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1118            }
 01119        }
 1120
 1121        internal Core.HttpMessage CreateListAtTenantScopeNextPageRequest(string nextLink, string deploymentName, int? to
 1122        {
 01123            var message = _pipeline.CreateMessage();
 01124            var request = message.Request;
 01125            request.Method = RequestMethod.Get;
 01126            var uri = new RawRequestUriBuilder();
 01127            uri.Reset(endpoint);
 01128            uri.AppendRawNextLink(nextLink, false);
 01129            request.Uri = uri;
 01130            return message;
 1131        }
 1132
 1133        /// <summary> Gets all deployments operations for a deployment. </summary>
 1134        /// <param name="nextLink"> The URL to the next page of results. </param>
 1135        /// <param name="deploymentName"> The name of the deployment. </param>
 1136        /// <param name="top"> The number of results to return. </param>
 1137        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1138        public async Task<Response<DeploymentOperationsListResult>> ListAtTenantScopeNextPageAsync(string nextLink, stri
 1139        {
 01140            if (nextLink == null)
 1141            {
 01142                throw new ArgumentNullException(nameof(nextLink));
 1143            }
 01144            if (deploymentName == null)
 1145            {
 01146                throw new ArgumentNullException(nameof(deploymentName));
 1147            }
 1148
 01149            using var message = CreateListAtTenantScopeNextPageRequest(nextLink, deploymentName, top);
 01150            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01151            switch (message.Response.Status)
 1152            {
 1153                case 200:
 1154                    {
 01155                        DeploymentOperationsListResult value = default;
 01156                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01157                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1158                        {
 01159                            value = null;
 1160                        }
 1161                        else
 1162                        {
 01163                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1164                        }
 01165                        return Response.FromValue(value, message.Response);
 1166                    }
 1167                default:
 01168                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1169            }
 01170        }
 1171
 1172        /// <summary> Gets all deployments operations for a deployment. </summary>
 1173        /// <param name="nextLink"> The URL to the next page of results. </param>
 1174        /// <param name="deploymentName"> The name of the deployment. </param>
 1175        /// <param name="top"> The number of results to return. </param>
 1176        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1177        public Response<DeploymentOperationsListResult> ListAtTenantScopeNextPage(string nextLink, string deploymentName
 1178        {
 01179            if (nextLink == null)
 1180            {
 01181                throw new ArgumentNullException(nameof(nextLink));
 1182            }
 01183            if (deploymentName == null)
 1184            {
 01185                throw new ArgumentNullException(nameof(deploymentName));
 1186            }
 1187
 01188            using var message = CreateListAtTenantScopeNextPageRequest(nextLink, deploymentName, top);
 01189            _pipeline.Send(message, cancellationToken);
 01190            switch (message.Response.Status)
 1191            {
 1192                case 200:
 1193                    {
 01194                        DeploymentOperationsListResult value = default;
 01195                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01196                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1197                        {
 01198                            value = null;
 1199                        }
 1200                        else
 1201                        {
 01202                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1203                        }
 01204                        return Response.FromValue(value, message.Response);
 1205                    }
 1206                default:
 01207                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1208            }
 01209        }
 1210
 1211        internal Core.HttpMessage CreateListAtManagementGroupScopeNextPageRequest(string nextLink, string groupId, strin
 1212        {
 01213            var message = _pipeline.CreateMessage();
 01214            var request = message.Request;
 01215            request.Method = RequestMethod.Get;
 01216            var uri = new RawRequestUriBuilder();
 01217            uri.Reset(endpoint);
 01218            uri.AppendRawNextLink(nextLink, false);
 01219            request.Uri = uri;
 01220            return message;
 1221        }
 1222
 1223        /// <summary> Gets all deployments operations for a deployment. </summary>
 1224        /// <param name="nextLink"> The URL to the next page of results. </param>
 1225        /// <param name="groupId"> The management group ID. </param>
 1226        /// <param name="deploymentName"> The name of the deployment. </param>
 1227        /// <param name="top"> The number of results to return. </param>
 1228        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1229        public async Task<Response<DeploymentOperationsListResult>> ListAtManagementGroupScopeNextPageAsync(string nextL
 1230        {
 01231            if (nextLink == null)
 1232            {
 01233                throw new ArgumentNullException(nameof(nextLink));
 1234            }
 01235            if (groupId == null)
 1236            {
 01237                throw new ArgumentNullException(nameof(groupId));
 1238            }
 01239            if (deploymentName == null)
 1240            {
 01241                throw new ArgumentNullException(nameof(deploymentName));
 1242            }
 1243
 01244            using var message = CreateListAtManagementGroupScopeNextPageRequest(nextLink, groupId, deploymentName, top);
 01245            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01246            switch (message.Response.Status)
 1247            {
 1248                case 200:
 1249                    {
 01250                        DeploymentOperationsListResult value = default;
 01251                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01252                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1253                        {
 01254                            value = null;
 1255                        }
 1256                        else
 1257                        {
 01258                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1259                        }
 01260                        return Response.FromValue(value, message.Response);
 1261                    }
 1262                default:
 01263                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1264            }
 01265        }
 1266
 1267        /// <summary> Gets all deployments operations for a deployment. </summary>
 1268        /// <param name="nextLink"> The URL to the next page of results. </param>
 1269        /// <param name="groupId"> The management group ID. </param>
 1270        /// <param name="deploymentName"> The name of the deployment. </param>
 1271        /// <param name="top"> The number of results to return. </param>
 1272        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1273        public Response<DeploymentOperationsListResult> ListAtManagementGroupScopeNextPage(string nextLink, string group
 1274        {
 01275            if (nextLink == null)
 1276            {
 01277                throw new ArgumentNullException(nameof(nextLink));
 1278            }
 01279            if (groupId == null)
 1280            {
 01281                throw new ArgumentNullException(nameof(groupId));
 1282            }
 01283            if (deploymentName == null)
 1284            {
 01285                throw new ArgumentNullException(nameof(deploymentName));
 1286            }
 1287
 01288            using var message = CreateListAtManagementGroupScopeNextPageRequest(nextLink, groupId, deploymentName, top);
 01289            _pipeline.Send(message, cancellationToken);
 01290            switch (message.Response.Status)
 1291            {
 1292                case 200:
 1293                    {
 01294                        DeploymentOperationsListResult value = default;
 01295                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01296                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1297                        {
 01298                            value = null;
 1299                        }
 1300                        else
 1301                        {
 01302                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1303                        }
 01304                        return Response.FromValue(value, message.Response);
 1305                    }
 1306                default:
 01307                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1308            }
 01309        }
 1310
 1311        internal Core.HttpMessage CreateListAtSubscriptionScopeNextPageRequest(string nextLink, string deploymentName, i
 1312        {
 01313            var message = _pipeline.CreateMessage();
 01314            var request = message.Request;
 01315            request.Method = RequestMethod.Get;
 01316            var uri = new RawRequestUriBuilder();
 01317            uri.Reset(endpoint);
 01318            uri.AppendRawNextLink(nextLink, false);
 01319            request.Uri = uri;
 01320            return message;
 1321        }
 1322
 1323        /// <summary> Gets all deployments operations for a deployment. </summary>
 1324        /// <param name="nextLink"> The URL to the next page of results. </param>
 1325        /// <param name="deploymentName"> The name of the deployment. </param>
 1326        /// <param name="top"> The number of results to return. </param>
 1327        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1328        public async Task<Response<DeploymentOperationsListResult>> ListAtSubscriptionScopeNextPageAsync(string nextLink
 1329        {
 01330            if (nextLink == null)
 1331            {
 01332                throw new ArgumentNullException(nameof(nextLink));
 1333            }
 01334            if (deploymentName == null)
 1335            {
 01336                throw new ArgumentNullException(nameof(deploymentName));
 1337            }
 1338
 01339            using var message = CreateListAtSubscriptionScopeNextPageRequest(nextLink, deploymentName, top);
 01340            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01341            switch (message.Response.Status)
 1342            {
 1343                case 200:
 1344                    {
 01345                        DeploymentOperationsListResult value = default;
 01346                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01347                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1348                        {
 01349                            value = null;
 1350                        }
 1351                        else
 1352                        {
 01353                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1354                        }
 01355                        return Response.FromValue(value, message.Response);
 1356                    }
 1357                default:
 01358                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1359            }
 01360        }
 1361
 1362        /// <summary> Gets all deployments operations for a deployment. </summary>
 1363        /// <param name="nextLink"> The URL to the next page of results. </param>
 1364        /// <param name="deploymentName"> The name of the deployment. </param>
 1365        /// <param name="top"> The number of results to return. </param>
 1366        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1367        public Response<DeploymentOperationsListResult> ListAtSubscriptionScopeNextPage(string nextLink, string deployme
 1368        {
 01369            if (nextLink == null)
 1370            {
 01371                throw new ArgumentNullException(nameof(nextLink));
 1372            }
 01373            if (deploymentName == null)
 1374            {
 01375                throw new ArgumentNullException(nameof(deploymentName));
 1376            }
 1377
 01378            using var message = CreateListAtSubscriptionScopeNextPageRequest(nextLink, deploymentName, top);
 01379            _pipeline.Send(message, cancellationToken);
 01380            switch (message.Response.Status)
 1381            {
 1382                case 200:
 1383                    {
 01384                        DeploymentOperationsListResult value = default;
 01385                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01386                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1387                        {
 01388                            value = null;
 1389                        }
 1390                        else
 1391                        {
 01392                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1393                        }
 01394                        return Response.FromValue(value, message.Response);
 1395                    }
 1396                default:
 01397                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1398            }
 01399        }
 1400
 1401        internal Core.HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string deployment
 1402        {
 01403            var message = _pipeline.CreateMessage();
 01404            var request = message.Request;
 01405            request.Method = RequestMethod.Get;
 01406            var uri = new RawRequestUriBuilder();
 01407            uri.Reset(endpoint);
 01408            uri.AppendRawNextLink(nextLink, false);
 01409            request.Uri = uri;
 01410            return message;
 1411        }
 1412
 1413        /// <summary> Gets all deployments operations for a deployment. </summary>
 1414        /// <param name="nextLink"> The URL to the next page of results. </param>
 1415        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 1416        /// <param name="deploymentName"> The name of the deployment. </param>
 1417        /// <param name="top"> The number of results to return. </param>
 1418        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1419        public async Task<Response<DeploymentOperationsListResult>> ListNextPageAsync(string nextLink, string resourceGr
 1420        {
 01421            if (nextLink == null)
 1422            {
 01423                throw new ArgumentNullException(nameof(nextLink));
 1424            }
 01425            if (resourceGroupName == null)
 1426            {
 01427                throw new ArgumentNullException(nameof(resourceGroupName));
 1428            }
 01429            if (deploymentName == null)
 1430            {
 01431                throw new ArgumentNullException(nameof(deploymentName));
 1432            }
 1433
 01434            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, deploymentName, top);
 01435            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01436            switch (message.Response.Status)
 1437            {
 1438                case 200:
 1439                    {
 01440                        DeploymentOperationsListResult value = default;
 01441                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01442                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1443                        {
 01444                            value = null;
 1445                        }
 1446                        else
 1447                        {
 01448                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1449                        }
 01450                        return Response.FromValue(value, message.Response);
 1451                    }
 1452                default:
 01453                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1454            }
 01455        }
 1456
 1457        /// <summary> Gets all deployments operations for a deployment. </summary>
 1458        /// <param name="nextLink"> The URL to the next page of results. </param>
 1459        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 1460        /// <param name="deploymentName"> The name of the deployment. </param>
 1461        /// <param name="top"> The number of results to return. </param>
 1462        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1463        public Response<DeploymentOperationsListResult> ListNextPage(string nextLink, string resourceGroupName, string d
 1464        {
 01465            if (nextLink == null)
 1466            {
 01467                throw new ArgumentNullException(nameof(nextLink));
 1468            }
 01469            if (resourceGroupName == null)
 1470            {
 01471                throw new ArgumentNullException(nameof(resourceGroupName));
 1472            }
 01473            if (deploymentName == null)
 1474            {
 01475                throw new ArgumentNullException(nameof(deploymentName));
 1476            }
 1477
 01478            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, deploymentName, top);
 01479            _pipeline.Send(message, cancellationToken);
 01480            switch (message.Response.Status)
 1481            {
 1482                case 200:
 1483                    {
 01484                        DeploymentOperationsListResult value = default;
 01485                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01486                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1487                        {
 01488                            value = null;
 1489                        }
 1490                        else
 1491                        {
 01492                            value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro
 1493                        }
 01494                        return Response.FromValue(value, message.Response);
 1495                    }
 1496                default:
 01497                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1498            }
 01499        }
 1500    }
 1501}