< Summary

Class:Azure.ResourceManager.Resources.ResourcesOperations
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ResourcesOperations.cs
Covered lines:150
Uncovered lines:242
Coverable lines:392
Total lines:1004
Line coverage:38.2% (150 of 392)
Covered branches:42
Total branches:132
Branch coverage:31.8% (42 of 132)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
CheckExistenceAsync()-100%100%
CheckExistence(...)-100%100%
GetAsync()-100%100%
Get(...)-100%100%
CheckExistenceByIdAsync()-0%100%
CheckExistenceById(...)-0%100%
GetByIdAsync()-57.14%100%
GetById(...)-57.14%100%
ListByResourceGroupAsync(...)-36.84%50%
<ListByResourceGroupAsync()-62.5%100%
<ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-36.84%50%
<ListAsync()-62.5%100%
<ListAsync()-0%100%
ListAsync(...)-100%100%
List(...)-100%100%
StartMoveResourcesAsync()-0%0%
StartMoveResources(...)-0%0%
StartValidateMoveResourcesAsync()-0%0%
StartValidateMoveResources(...)-0%0%
StartDeleteAsync()-60%58.33%
StartDelete(...)-60%58.33%
StartCreateOrUpdateAsync()-59.09%57.14%
StartCreateOrUpdate(...)-59.09%57.14%
StartUpdateAsync()-0%0%
StartUpdate(...)-0%0%
StartDeleteByIdAsync()-58.33%50%
StartDeleteById(...)-58.33%50%
StartCreateOrUpdateByIdAsync()-57.14%50%
StartCreateOrUpdateById(...)-57.14%50%
StartUpdateByIdAsync()-0%0%
StartUpdateById(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ResourcesOperations.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.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Resources.Models;
 15
 16namespace Azure.ResourceManager.Resources
 17{
 18    /// <summary> The Resources service client. </summary>
 19    public partial class ResourcesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 23623        internal ResourcesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ResourcesOperations for mocking. </summary>
 33625        protected ResourcesOperations()
 26        {
 33627        }
 28        /// <summary> Initializes a new instance of ResourcesOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33633        internal ResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, 
 34        {
 33635            RestClient = new ResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 33636            _clientDiagnostics = clientDiagnostics;
 33637            _pipeline = pipeline;
 33638        }
 39
 40        /// <summary> Checks whether a resource exists. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group containing the resource to check. The name i
 42        /// <param name="resourceProviderNamespace"> The resource provider of the resource to check. </param>
 43        /// <param name="parentResourcePath"> The parent resource identity. </param>
 44        /// <param name="resourceType"> The resource type. </param>
 45        /// <param name="resourceName"> The name of the resource to check whether it exists. </param>
 46        /// <param name="apiVersion"> The API version to use for the operation. </param>
 47        /// <param name="cancellationToken"> The cancellation token to use. </param>
 48        public virtual async Task<Response> CheckExistenceAsync(string resourceGroupName, string resourceProviderNamespa
 49        {
 850            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistence");
 851            scope.Start();
 52            try
 53            {
 854                return await RestClient.CheckExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResource
 55            }
 256            catch (Exception e)
 57            {
 258                scope.Failed(e);
 259                throw;
 60            }
 661        }
 62
 63        /// <summary> Checks whether a resource exists. </summary>
 64        /// <param name="resourceGroupName"> The name of the resource group containing the resource to check. The name i
 65        /// <param name="resourceProviderNamespace"> The resource provider of the resource to check. </param>
 66        /// <param name="parentResourcePath"> The parent resource identity. </param>
 67        /// <param name="resourceType"> The resource type. </param>
 68        /// <param name="resourceName"> The name of the resource to check whether it exists. </param>
 69        /// <param name="apiVersion"> The API version to use for the operation. </param>
 70        /// <param name="cancellationToken"> The cancellation token to use. </param>
 71        public virtual Response CheckExistence(string resourceGroupName, string resourceProviderNamespace, string parent
 72        {
 873            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistence");
 874            scope.Start();
 75            try
 76            {
 877                return RestClient.CheckExistence(resourceGroupName, resourceProviderNamespace, parentResourcePath, resou
 78            }
 279            catch (Exception e)
 80            {
 281                scope.Failed(e);
 282                throw;
 83            }
 684        }
 85
 86        /// <summary> Gets a resource. </summary>
 87        /// <param name="resourceGroupName"> The name of the resource group containing the resource to get. The name is 
 88        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 89        /// <param name="parentResourcePath"> The parent resource identity. </param>
 90        /// <param name="resourceType"> The resource type of the resource. </param>
 91        /// <param name="resourceName"> The name of the resource to get. </param>
 92        /// <param name="apiVersion"> The API version to use for the operation. </param>
 93        /// <param name="cancellationToken"> The cancellation token to use. </param>
 94        public virtual async Task<Response<GenericResource>> GetAsync(string resourceGroupName, string resourceProviderN
 95        {
 1496            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.Get");
 1497            scope.Start();
 98            try
 99            {
 14100                return await RestClient.GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resou
 101            }
 4102            catch (Exception e)
 103            {
 4104                scope.Failed(e);
 4105                throw;
 106            }
 10107        }
 108
 109        /// <summary> Gets a resource. </summary>
 110        /// <param name="resourceGroupName"> The name of the resource group containing the resource to get. The name is 
 111        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 112        /// <param name="parentResourcePath"> The parent resource identity. </param>
 113        /// <param name="resourceType"> The resource type of the resource. </param>
 114        /// <param name="resourceName"> The name of the resource to get. </param>
 115        /// <param name="apiVersion"> The API version to use for the operation. </param>
 116        /// <param name="cancellationToken"> The cancellation token to use. </param>
 117        public virtual Response<GenericResource> Get(string resourceGroupName, string resourceProviderNamespace, string 
 118        {
 14119            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.Get");
 14120            scope.Start();
 121            try
 122            {
 14123                return RestClient.Get(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, re
 124            }
 4125            catch (Exception e)
 126            {
 4127                scope.Failed(e);
 4128                throw;
 129            }
 10130        }
 131
 132        /// <summary> Checks by ID whether a resource exists. </summary>
 133        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 134        /// <param name="apiVersion"> The API version to use for the operation. </param>
 135        /// <param name="cancellationToken"> The cancellation token to use. </param>
 136        public virtual async Task<Response> CheckExistenceByIdAsync(string resourceId, string apiVersion, CancellationTo
 137        {
 0138            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistenceById");
 0139            scope.Start();
 140            try
 141            {
 0142                return await RestClient.CheckExistenceByIdAsync(resourceId, apiVersion, cancellationToken).ConfigureAwai
 143            }
 0144            catch (Exception e)
 145            {
 0146                scope.Failed(e);
 0147                throw;
 148            }
 0149        }
 150
 151        /// <summary> Checks by ID whether a resource exists. </summary>
 152        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 153        /// <param name="apiVersion"> The API version to use for the operation. </param>
 154        /// <param name="cancellationToken"> The cancellation token to use. </param>
 155        public virtual Response CheckExistenceById(string resourceId, string apiVersion, CancellationToken cancellationT
 156        {
 0157            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistenceById");
 0158            scope.Start();
 159            try
 160            {
 0161                return RestClient.CheckExistenceById(resourceId, apiVersion, cancellationToken);
 162            }
 0163            catch (Exception e)
 164            {
 0165                scope.Failed(e);
 0166                throw;
 167            }
 0168        }
 169
 170        /// <summary> Gets a resource by ID. </summary>
 171        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 172        /// <param name="apiVersion"> The API version to use for the operation. </param>
 173        /// <param name="cancellationToken"> The cancellation token to use. </param>
 174        public virtual async Task<Response<GenericResource>> GetByIdAsync(string resourceId, string apiVersion, Cancella
 175        {
 2176            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.GetById");
 2177            scope.Start();
 178            try
 179            {
 2180                return await RestClient.GetByIdAsync(resourceId, apiVersion, cancellationToken).ConfigureAwait(false);
 181            }
 0182            catch (Exception e)
 183            {
 0184                scope.Failed(e);
 0185                throw;
 186            }
 2187        }
 188
 189        /// <summary> Gets a resource by ID. </summary>
 190        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 191        /// <param name="apiVersion"> The API version to use for the operation. </param>
 192        /// <param name="cancellationToken"> The cancellation token to use. </param>
 193        public virtual Response<GenericResource> GetById(string resourceId, string apiVersion, CancellationToken cancell
 194        {
 2195            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.GetById");
 2196            scope.Start();
 197            try
 198            {
 2199                return RestClient.GetById(resourceId, apiVersion, cancellationToken);
 200            }
 0201            catch (Exception e)
 202            {
 0203                scope.Failed(e);
 0204                throw;
 205            }
 2206        }
 207
 208        /// <summary> Get all the resources for a resource group. </summary>
 209        /// <param name="resourceGroupName"> The resource group with the resources to get. </param>
 210        /// <param name="filter"> The filter to apply on the operation.&lt;br&gt;&lt;br&gt;The properties you can use fo
 211        /// <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid va
 212        /// <param name="top"> The number of results to return. If null is passed, returns all resources. </param>
 213        /// <param name="cancellationToken"> The cancellation token to use. </param>
 214        public virtual AsyncPageable<GenericResourceExpanded> ListByResourceGroupAsync(string resourceGroupName, string 
 215        {
 16216            if (resourceGroupName == null)
 217            {
 0218                throw new ArgumentNullException(nameof(resourceGroupName));
 219            }
 220
 221            async Task<Page<GenericResourceExpanded>> FirstPageFunc(int? pageSizeHint)
 222            {
 16223                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup");
 16224                scope.Start();
 225                try
 226                {
 16227                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, filter, expand, top, can
 16228                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 229                }
 0230                catch (Exception e)
 231                {
 0232                    scope.Failed(e);
 0233                    throw;
 234                }
 16235            }
 236            async Task<Page<GenericResourceExpanded>> NextPageFunc(string nextLink, int? pageSizeHint)
 237            {
 0238                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup");
 0239                scope.Start();
 240                try
 241                {
 0242                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, filter
 0243                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 244                }
 0245                catch (Exception e)
 246                {
 0247                    scope.Failed(e);
 0248                    throw;
 249                }
 0250            }
 16251            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 252        }
 253
 254        /// <summary> Get all the resources for a resource group. </summary>
 255        /// <param name="resourceGroupName"> The resource group with the resources to get. </param>
 256        /// <param name="filter"> The filter to apply on the operation.&lt;br&gt;&lt;br&gt;The properties you can use fo
 257        /// <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid va
 258        /// <param name="top"> The number of results to return. If null is passed, returns all resources. </param>
 259        /// <param name="cancellationToken"> The cancellation token to use. </param>
 260        public virtual Pageable<GenericResourceExpanded> ListByResourceGroup(string resourceGroupName, string filter = n
 261        {
 16262            if (resourceGroupName == null)
 263            {
 0264                throw new ArgumentNullException(nameof(resourceGroupName));
 265            }
 266
 267            Page<GenericResourceExpanded> FirstPageFunc(int? pageSizeHint)
 268            {
 16269                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup");
 16270                scope.Start();
 271                try
 272                {
 16273                    var response = RestClient.ListByResourceGroup(resourceGroupName, filter, expand, top, cancellationTo
 16274                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 275                }
 0276                catch (Exception e)
 277                {
 0278                    scope.Failed(e);
 0279                    throw;
 280                }
 16281            }
 282            Page<GenericResourceExpanded> NextPageFunc(string nextLink, int? pageSizeHint)
 283            {
 0284                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup");
 0285                scope.Start();
 286                try
 287                {
 0288                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, filter, expand, t
 0289                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 290                }
 0291                catch (Exception e)
 292                {
 0293                    scope.Failed(e);
 0294                    throw;
 295                }
 0296            }
 16297            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 298        }
 299
 300        /// <summary> Get all the resources in a subscription. </summary>
 301        /// <param name="filter"> The filter to apply on the operation.&lt;br&gt;&lt;br&gt;The properties you can use fo
 302        /// <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid va
 303        /// <param name="top"> The number of results to return. If null is passed, returns all resource groups. </param>
 304        /// <param name="cancellationToken"> The cancellation token to use. </param>
 305        public virtual AsyncPageable<GenericResourceExpanded> ListAsync(string filter = null, string expand = null, int?
 306        {
 307            async Task<Page<GenericResourceExpanded>> FirstPageFunc(int? pageSizeHint)
 308            {
 2309                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List");
 2310                scope.Start();
 311                try
 312                {
 2313                    var response = await RestClient.ListAsync(filter, expand, top, cancellationToken).ConfigureAwait(fal
 2314                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 315                }
 0316                catch (Exception e)
 317                {
 0318                    scope.Failed(e);
 0319                    throw;
 320                }
 2321            }
 322            async Task<Page<GenericResourceExpanded>> NextPageFunc(string nextLink, int? pageSizeHint)
 323            {
 0324                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List");
 0325                scope.Start();
 326                try
 327                {
 0328                    var response = await RestClient.ListNextPageAsync(nextLink, filter, expand, top, cancellationToken).
 0329                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 330                }
 0331                catch (Exception e)
 332                {
 0333                    scope.Failed(e);
 0334                    throw;
 335                }
 0336            }
 2337            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 338        }
 339
 340        /// <summary> Get all the resources in a subscription. </summary>
 341        /// <param name="filter"> The filter to apply on the operation.&lt;br&gt;&lt;br&gt;The properties you can use fo
 342        /// <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid va
 343        /// <param name="top"> The number of results to return. If null is passed, returns all resource groups. </param>
 344        /// <param name="cancellationToken"> The cancellation token to use. </param>
 345        public virtual Pageable<GenericResourceExpanded> List(string filter = null, string expand = null, int? top = nul
 346        {
 347            Page<GenericResourceExpanded> FirstPageFunc(int? pageSizeHint)
 348            {
 2349                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List");
 2350                scope.Start();
 351                try
 352                {
 2353                    var response = RestClient.List(filter, expand, top, cancellationToken);
 2354                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 355                }
 0356                catch (Exception e)
 357                {
 0358                    scope.Failed(e);
 0359                    throw;
 360                }
 2361            }
 362            Page<GenericResourceExpanded> NextPageFunc(string nextLink, int? pageSizeHint)
 363            {
 0364                using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List");
 0365                scope.Start();
 366                try
 367                {
 0368                    var response = RestClient.ListNextPage(nextLink, filter, expand, top, cancellationToken);
 0369                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 370                }
 0371                catch (Exception e)
 372                {
 0373                    scope.Failed(e);
 0374                    throw;
 375                }
 0376            }
 2377            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 378        }
 379
 380        /// <summary> The resources to move must be in the same source resource group. The target resource group may be 
 381        /// <param name="sourceResourceGroupName"> The name of the resource group containing the resources to move. </pa
 382        /// <param name="parameters"> Parameters for moving resources. </param>
 383        /// <param name="cancellationToken"> The cancellation token to use. </param>
 384        public virtual async Task<ResourcesMoveResourcesOperation> StartMoveResourcesAsync(string sourceResourceGroupNam
 385        {
 0386            if (sourceResourceGroupName == null)
 387            {
 0388                throw new ArgumentNullException(nameof(sourceResourceGroupName));
 389            }
 0390            if (parameters == null)
 391            {
 0392                throw new ArgumentNullException(nameof(parameters));
 393            }
 394
 0395            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartMoveResources");
 0396            scope.Start();
 397            try
 398            {
 0399                var originalResponse = await RestClient.MoveResourcesAsync(sourceResourceGroupName, parameters, cancella
 0400                return new ResourcesMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateMoveResources
 401            }
 0402            catch (Exception e)
 403            {
 0404                scope.Failed(e);
 0405                throw;
 406            }
 0407        }
 408
 409        /// <summary> The resources to move must be in the same source resource group. The target resource group may be 
 410        /// <param name="sourceResourceGroupName"> The name of the resource group containing the resources to move. </pa
 411        /// <param name="parameters"> Parameters for moving resources. </param>
 412        /// <param name="cancellationToken"> The cancellation token to use. </param>
 413        public virtual ResourcesMoveResourcesOperation StartMoveResources(string sourceResourceGroupName, ResourcesMoveI
 414        {
 0415            if (sourceResourceGroupName == null)
 416            {
 0417                throw new ArgumentNullException(nameof(sourceResourceGroupName));
 418            }
 0419            if (parameters == null)
 420            {
 0421                throw new ArgumentNullException(nameof(parameters));
 422            }
 423
 0424            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartMoveResources");
 0425            scope.Start();
 426            try
 427            {
 0428                var originalResponse = RestClient.MoveResources(sourceResourceGroupName, parameters, cancellationToken);
 0429                return new ResourcesMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateMoveResources
 430            }
 0431            catch (Exception e)
 432            {
 0433                scope.Failed(e);
 0434                throw;
 435            }
 0436        }
 437
 438        /// <summary> This operation checks whether the specified resources can be moved to the target. The resources to
 439        /// <param name="sourceResourceGroupName"> The name of the resource group containing the resources to validate f
 440        /// <param name="parameters"> Parameters for moving resources. </param>
 441        /// <param name="cancellationToken"> The cancellation token to use. </param>
 442        public virtual async Task<ResourcesValidateMoveResourcesOperation> StartValidateMoveResourcesAsync(string source
 443        {
 0444            if (sourceResourceGroupName == null)
 445            {
 0446                throw new ArgumentNullException(nameof(sourceResourceGroupName));
 447            }
 0448            if (parameters == null)
 449            {
 0450                throw new ArgumentNullException(nameof(parameters));
 451            }
 452
 0453            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartValidateMoveResources");
 0454            scope.Start();
 455            try
 456            {
 0457                var originalResponse = await RestClient.ValidateMoveResourcesAsync(sourceResourceGroupName, parameters, 
 0458                return new ResourcesValidateMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateValid
 459            }
 0460            catch (Exception e)
 461            {
 0462                scope.Failed(e);
 0463                throw;
 464            }
 0465        }
 466
 467        /// <summary> This operation checks whether the specified resources can be moved to the target. The resources to
 468        /// <param name="sourceResourceGroupName"> The name of the resource group containing the resources to validate f
 469        /// <param name="parameters"> Parameters for moving resources. </param>
 470        /// <param name="cancellationToken"> The cancellation token to use. </param>
 471        public virtual ResourcesValidateMoveResourcesOperation StartValidateMoveResources(string sourceResourceGroupName
 472        {
 0473            if (sourceResourceGroupName == null)
 474            {
 0475                throw new ArgumentNullException(nameof(sourceResourceGroupName));
 476            }
 0477            if (parameters == null)
 478            {
 0479                throw new ArgumentNullException(nameof(parameters));
 480            }
 481
 0482            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartValidateMoveResources");
 0483            scope.Start();
 484            try
 485            {
 0486                var originalResponse = RestClient.ValidateMoveResources(sourceResourceGroupName, parameters, cancellatio
 0487                return new ResourcesValidateMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateValid
 488            }
 0489            catch (Exception e)
 490            {
 0491                scope.Failed(e);
 0492                throw;
 493            }
 0494        }
 495
 496        /// <summary> Deletes a resource. </summary>
 497        /// <param name="resourceGroupName"> The name of the resource group that contains the resource to delete. The na
 498        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 499        /// <param name="parentResourcePath"> The parent resource identity. </param>
 500        /// <param name="resourceType"> The resource type. </param>
 501        /// <param name="resourceName"> The name of the resource to delete. </param>
 502        /// <param name="apiVersion"> The API version to use for the operation. </param>
 503        /// <param name="cancellationToken"> The cancellation token to use. </param>
 504        public virtual async Task<ResourcesDeleteOperation> StartDeleteAsync(string resourceGroupName, string resourcePr
 505        {
 8506            if (resourceGroupName == null)
 507            {
 0508                throw new ArgumentNullException(nameof(resourceGroupName));
 509            }
 8510            if (resourceProviderNamespace == null)
 511            {
 0512                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 513            }
 8514            if (parentResourcePath == null)
 515            {
 0516                throw new ArgumentNullException(nameof(parentResourcePath));
 517            }
 8518            if (resourceType == null)
 519            {
 0520                throw new ArgumentNullException(nameof(resourceType));
 521            }
 8522            if (resourceName == null)
 523            {
 0524                throw new ArgumentNullException(nameof(resourceName));
 525            }
 8526            if (apiVersion == null)
 527            {
 2528                throw new ArgumentNullException(nameof(apiVersion));
 529            }
 530
 6531            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDelete");
 6532            scope.Start();
 533            try
 534            {
 6535                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, resourceProviderNamespace, parent
 6536                return new ResourcesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour
 537            }
 0538            catch (Exception e)
 539            {
 0540                scope.Failed(e);
 0541                throw;
 542            }
 6543        }
 544
 545        /// <summary> Deletes a resource. </summary>
 546        /// <param name="resourceGroupName"> The name of the resource group that contains the resource to delete. The na
 547        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 548        /// <param name="parentResourcePath"> The parent resource identity. </param>
 549        /// <param name="resourceType"> The resource type. </param>
 550        /// <param name="resourceName"> The name of the resource to delete. </param>
 551        /// <param name="apiVersion"> The API version to use for the operation. </param>
 552        /// <param name="cancellationToken"> The cancellation token to use. </param>
 553        public virtual ResourcesDeleteOperation StartDelete(string resourceGroupName, string resourceProviderNamespace, 
 554        {
 8555            if (resourceGroupName == null)
 556            {
 0557                throw new ArgumentNullException(nameof(resourceGroupName));
 558            }
 8559            if (resourceProviderNamespace == null)
 560            {
 0561                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 562            }
 8563            if (parentResourcePath == null)
 564            {
 0565                throw new ArgumentNullException(nameof(parentResourcePath));
 566            }
 8567            if (resourceType == null)
 568            {
 0569                throw new ArgumentNullException(nameof(resourceType));
 570            }
 8571            if (resourceName == null)
 572            {
 0573                throw new ArgumentNullException(nameof(resourceName));
 574            }
 8575            if (apiVersion == null)
 576            {
 2577                throw new ArgumentNullException(nameof(apiVersion));
 578            }
 579
 6580            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDelete");
 6581            scope.Start();
 582            try
 583            {
 6584                var originalResponse = RestClient.Delete(resourceGroupName, resourceProviderNamespace, parentResourcePat
 6585                return new ResourcesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour
 586            }
 0587            catch (Exception e)
 588            {
 0589                scope.Failed(e);
 0590                throw;
 591            }
 6592        }
 593
 594        /// <summary> Creates a resource. </summary>
 595        /// <param name="resourceGroupName"> The name of the resource group for the resource. The name is case insensiti
 596        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 597        /// <param name="parentResourcePath"> The parent resource identity. </param>
 598        /// <param name="resourceType"> The resource type of the resource to create. </param>
 599        /// <param name="resourceName"> The name of the resource to create. </param>
 600        /// <param name="apiVersion"> The API version to use for the operation. </param>
 601        /// <param name="parameters"> Parameters for creating or updating the resource. </param>
 602        /// <param name="cancellationToken"> The cancellation token to use. </param>
 603        public virtual async Task<ResourcesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName, s
 604        {
 26605            if (resourceGroupName == null)
 606            {
 0607                throw new ArgumentNullException(nameof(resourceGroupName));
 608            }
 26609            if (resourceProviderNamespace == null)
 610            {
 0611                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 612            }
 26613            if (parentResourcePath == null)
 614            {
 0615                throw new ArgumentNullException(nameof(parentResourcePath));
 616            }
 26617            if (resourceType == null)
 618            {
 0619                throw new ArgumentNullException(nameof(resourceType));
 620            }
 26621            if (resourceName == null)
 622            {
 0623                throw new ArgumentNullException(nameof(resourceName));
 624            }
 26625            if (apiVersion == null)
 626            {
 2627                throw new ArgumentNullException(nameof(apiVersion));
 628            }
 24629            if (parameters == null)
 630            {
 0631                throw new ArgumentNullException(nameof(parameters));
 632            }
 633
 24634            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdate");
 24635            scope.Start();
 636            try
 637            {
 24638                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace
 24639                return new ResourcesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda
 640            }
 0641            catch (Exception e)
 642            {
 0643                scope.Failed(e);
 0644                throw;
 645            }
 24646        }
 647
 648        /// <summary> Creates a resource. </summary>
 649        /// <param name="resourceGroupName"> The name of the resource group for the resource. The name is case insensiti
 650        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 651        /// <param name="parentResourcePath"> The parent resource identity. </param>
 652        /// <param name="resourceType"> The resource type of the resource to create. </param>
 653        /// <param name="resourceName"> The name of the resource to create. </param>
 654        /// <param name="apiVersion"> The API version to use for the operation. </param>
 655        /// <param name="parameters"> Parameters for creating or updating the resource. </param>
 656        /// <param name="cancellationToken"> The cancellation token to use. </param>
 657        public virtual ResourcesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string resourcePro
 658        {
 26659            if (resourceGroupName == null)
 660            {
 0661                throw new ArgumentNullException(nameof(resourceGroupName));
 662            }
 26663            if (resourceProviderNamespace == null)
 664            {
 0665                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 666            }
 26667            if (parentResourcePath == null)
 668            {
 0669                throw new ArgumentNullException(nameof(parentResourcePath));
 670            }
 26671            if (resourceType == null)
 672            {
 0673                throw new ArgumentNullException(nameof(resourceType));
 674            }
 26675            if (resourceName == null)
 676            {
 0677                throw new ArgumentNullException(nameof(resourceName));
 678            }
 26679            if (apiVersion == null)
 680            {
 2681                throw new ArgumentNullException(nameof(apiVersion));
 682            }
 24683            if (parameters == null)
 684            {
 0685                throw new ArgumentNullException(nameof(parameters));
 686            }
 687
 24688            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdate");
 24689            scope.Start();
 690            try
 691            {
 24692                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, resourceProviderNamespace, parentRes
 24693                return new ResourcesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda
 694            }
 0695            catch (Exception e)
 696            {
 0697                scope.Failed(e);
 0698                throw;
 699            }
 24700        }
 701
 702        /// <summary> Updates a resource. </summary>
 703        /// <param name="resourceGroupName"> The name of the resource group for the resource. The name is case insensiti
 704        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 705        /// <param name="parentResourcePath"> The parent resource identity. </param>
 706        /// <param name="resourceType"> The resource type of the resource to update. </param>
 707        /// <param name="resourceName"> The name of the resource to update. </param>
 708        /// <param name="apiVersion"> The API version to use for the operation. </param>
 709        /// <param name="parameters"> Parameters for updating the resource. </param>
 710        /// <param name="cancellationToken"> The cancellation token to use. </param>
 711        public virtual async Task<ResourcesUpdateOperation> StartUpdateAsync(string resourceGroupName, string resourcePr
 712        {
 0713            if (resourceGroupName == null)
 714            {
 0715                throw new ArgumentNullException(nameof(resourceGroupName));
 716            }
 0717            if (resourceProviderNamespace == null)
 718            {
 0719                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 720            }
 0721            if (parentResourcePath == null)
 722            {
 0723                throw new ArgumentNullException(nameof(parentResourcePath));
 724            }
 0725            if (resourceType == null)
 726            {
 0727                throw new ArgumentNullException(nameof(resourceType));
 728            }
 0729            if (resourceName == null)
 730            {
 0731                throw new ArgumentNullException(nameof(resourceName));
 732            }
 0733            if (apiVersion == null)
 734            {
 0735                throw new ArgumentNullException(nameof(apiVersion));
 736            }
 0737            if (parameters == null)
 738            {
 0739                throw new ArgumentNullException(nameof(parameters));
 740            }
 741
 0742            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdate");
 0743            scope.Start();
 744            try
 745            {
 0746                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, resourceProviderNamespace, parent
 0747                return new ResourcesUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour
 748            }
 0749            catch (Exception e)
 750            {
 0751                scope.Failed(e);
 0752                throw;
 753            }
 0754        }
 755
 756        /// <summary> Updates a resource. </summary>
 757        /// <param name="resourceGroupName"> The name of the resource group for the resource. The name is case insensiti
 758        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 759        /// <param name="parentResourcePath"> The parent resource identity. </param>
 760        /// <param name="resourceType"> The resource type of the resource to update. </param>
 761        /// <param name="resourceName"> The name of the resource to update. </param>
 762        /// <param name="apiVersion"> The API version to use for the operation. </param>
 763        /// <param name="parameters"> Parameters for updating the resource. </param>
 764        /// <param name="cancellationToken"> The cancellation token to use. </param>
 765        public virtual ResourcesUpdateOperation StartUpdate(string resourceGroupName, string resourceProviderNamespace, 
 766        {
 0767            if (resourceGroupName == null)
 768            {
 0769                throw new ArgumentNullException(nameof(resourceGroupName));
 770            }
 0771            if (resourceProviderNamespace == null)
 772            {
 0773                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 774            }
 0775            if (parentResourcePath == null)
 776            {
 0777                throw new ArgumentNullException(nameof(parentResourcePath));
 778            }
 0779            if (resourceType == null)
 780            {
 0781                throw new ArgumentNullException(nameof(resourceType));
 782            }
 0783            if (resourceName == null)
 784            {
 0785                throw new ArgumentNullException(nameof(resourceName));
 786            }
 0787            if (apiVersion == null)
 788            {
 0789                throw new ArgumentNullException(nameof(apiVersion));
 790            }
 0791            if (parameters == null)
 792            {
 0793                throw new ArgumentNullException(nameof(parameters));
 794            }
 795
 0796            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdate");
 0797            scope.Start();
 798            try
 799            {
 0800                var originalResponse = RestClient.Update(resourceGroupName, resourceProviderNamespace, parentResourcePat
 0801                return new ResourcesUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour
 802            }
 0803            catch (Exception e)
 804            {
 0805                scope.Failed(e);
 0806                throw;
 807            }
 0808        }
 809
 810        /// <summary> Deletes a resource by ID. </summary>
 811        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 812        /// <param name="apiVersion"> The API version to use for the operation. </param>
 813        /// <param name="cancellationToken"> The cancellation token to use. </param>
 814        public virtual async Task<ResourcesDeleteByIdOperation> StartDeleteByIdAsync(string resourceId, string apiVersio
 815        {
 4816            if (resourceId == null)
 817            {
 0818                throw new ArgumentNullException(nameof(resourceId));
 819            }
 4820            if (apiVersion == null)
 821            {
 0822                throw new ArgumentNullException(nameof(apiVersion));
 823            }
 824
 4825            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDeleteById");
 4826            scope.Start();
 827            try
 828            {
 4829                var originalResponse = await RestClient.DeleteByIdAsync(resourceId, apiVersion, cancellationToken).Confi
 4830                return new ResourcesDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteByIdReques
 831            }
 0832            catch (Exception e)
 833            {
 0834                scope.Failed(e);
 0835                throw;
 836            }
 4837        }
 838
 839        /// <summary> Deletes a resource by ID. </summary>
 840        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 841        /// <param name="apiVersion"> The API version to use for the operation. </param>
 842        /// <param name="cancellationToken"> The cancellation token to use. </param>
 843        public virtual ResourcesDeleteByIdOperation StartDeleteById(string resourceId, string apiVersion, CancellationTo
 844        {
 4845            if (resourceId == null)
 846            {
 0847                throw new ArgumentNullException(nameof(resourceId));
 848            }
 4849            if (apiVersion == null)
 850            {
 0851                throw new ArgumentNullException(nameof(apiVersion));
 852            }
 853
 4854            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDeleteById");
 4855            scope.Start();
 856            try
 857            {
 4858                var originalResponse = RestClient.DeleteById(resourceId, apiVersion, cancellationToken);
 4859                return new ResourcesDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteByIdReques
 860            }
 0861            catch (Exception e)
 862            {
 0863                scope.Failed(e);
 0864                throw;
 865            }
 4866        }
 867
 868        /// <summary> Create a resource by ID. </summary>
 869        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 870        /// <param name="apiVersion"> The API version to use for the operation. </param>
 871        /// <param name="parameters"> Create or update resource parameters. </param>
 872        /// <param name="cancellationToken"> The cancellation token to use. </param>
 873        public virtual async Task<ResourcesCreateOrUpdateByIdOperation> StartCreateOrUpdateByIdAsync(string resourceId, 
 874        {
 4875            if (resourceId == null)
 876            {
 0877                throw new ArgumentNullException(nameof(resourceId));
 878            }
 4879            if (apiVersion == null)
 880            {
 0881                throw new ArgumentNullException(nameof(apiVersion));
 882            }
 4883            if (parameters == null)
 884            {
 0885                throw new ArgumentNullException(nameof(parameters));
 886            }
 887
 4888            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdateById");
 4889            scope.Start();
 890            try
 891            {
 4892                var originalResponse = await RestClient.CreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, canc
 4893                return new ResourcesCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOr
 894            }
 0895            catch (Exception e)
 896            {
 0897                scope.Failed(e);
 0898                throw;
 899            }
 4900        }
 901
 902        /// <summary> Create a resource by ID. </summary>
 903        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 904        /// <param name="apiVersion"> The API version to use for the operation. </param>
 905        /// <param name="parameters"> Create or update resource parameters. </param>
 906        /// <param name="cancellationToken"> The cancellation token to use. </param>
 907        public virtual ResourcesCreateOrUpdateByIdOperation StartCreateOrUpdateById(string resourceId, string apiVersion
 908        {
 4909            if (resourceId == null)
 910            {
 0911                throw new ArgumentNullException(nameof(resourceId));
 912            }
 4913            if (apiVersion == null)
 914            {
 0915                throw new ArgumentNullException(nameof(apiVersion));
 916            }
 4917            if (parameters == null)
 918            {
 0919                throw new ArgumentNullException(nameof(parameters));
 920            }
 921
 4922            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdateById");
 4923            scope.Start();
 924            try
 925            {
 4926                var originalResponse = RestClient.CreateOrUpdateById(resourceId, apiVersion, parameters, cancellationTok
 4927                return new ResourcesCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOr
 928            }
 0929            catch (Exception e)
 930            {
 0931                scope.Failed(e);
 0932                throw;
 933            }
 4934        }
 935
 936        /// <summary> Updates a resource by ID. </summary>
 937        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 938        /// <param name="apiVersion"> The API version to use for the operation. </param>
 939        /// <param name="parameters"> Update resource parameters. </param>
 940        /// <param name="cancellationToken"> The cancellation token to use. </param>
 941        public virtual async Task<ResourcesUpdateByIdOperation> StartUpdateByIdAsync(string resourceId, string apiVersio
 942        {
 0943            if (resourceId == null)
 944            {
 0945                throw new ArgumentNullException(nameof(resourceId));
 946            }
 0947            if (apiVersion == null)
 948            {
 0949                throw new ArgumentNullException(nameof(apiVersion));
 950            }
 0951            if (parameters == null)
 952            {
 0953                throw new ArgumentNullException(nameof(parameters));
 954            }
 955
 0956            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdateById");
 0957            scope.Start();
 958            try
 959            {
 0960                var originalResponse = await RestClient.UpdateByIdAsync(resourceId, apiVersion, parameters, cancellation
 0961                return new ResourcesUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateByIdReques
 962            }
 0963            catch (Exception e)
 964            {
 0965                scope.Failed(e);
 0966                throw;
 967            }
 0968        }
 969
 970        /// <summary> Updates a resource by ID. </summary>
 971        /// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource t
 972        /// <param name="apiVersion"> The API version to use for the operation. </param>
 973        /// <param name="parameters"> Update resource parameters. </param>
 974        /// <param name="cancellationToken"> The cancellation token to use. </param>
 975        public virtual ResourcesUpdateByIdOperation StartUpdateById(string resourceId, string apiVersion, GenericResourc
 976        {
 0977            if (resourceId == null)
 978            {
 0979                throw new ArgumentNullException(nameof(resourceId));
 980            }
 0981            if (apiVersion == null)
 982            {
 0983                throw new ArgumentNullException(nameof(apiVersion));
 984            }
 0985            if (parameters == null)
 986            {
 0987                throw new ArgumentNullException(nameof(parameters));
 988            }
 989
 0990            using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdateById");
 0991            scope.Start();
 992            try
 993            {
 0994                var originalResponse = RestClient.UpdateById(resourceId, apiVersion, parameters, cancellationToken);
 0995                return new ResourcesUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateByIdReques
 996            }
 0997            catch (Exception e)
 998            {
 0999                scope.Failed(e);
 01000                throw;
 1001            }
 01002        }
 1003    }
 1004}