< Summary

Class:Azure.ResourceManager.Compute.SnapshotsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\SnapshotsOperations.cs
Covered lines:124
Uncovered lines:102
Coverable lines:226
Total lines:558
Line coverage:54.8% (124 of 226)
Covered branches:28
Total branches:56
Branch coverage:50% (28 of 56)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-100%100%
Get(...)-100%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%
StartCreateOrUpdateAsync()-57.14%50%
StartCreateOrUpdate(...)-57.14%50%
StartUpdateAsync()-57.14%50%
StartUpdate(...)-57.14%50%
StartDeleteAsync()-58.33%50%
StartDelete(...)-58.33%50%
StartGrantAccessAsync()-57.14%50%
StartGrantAccess(...)-57.14%50%
StartRevokeAccessAsync()-58.33%50%
StartRevokeAccess(...)-58.33%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\SnapshotsOperations.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.Compute.Models;
 15
 16namespace Azure.ResourceManager.Compute
 17{
 18    /// <summary> The Snapshots service client. </summary>
 19    public partial class SnapshotsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 15623        internal SnapshotsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of SnapshotsOperations for mocking. </summary>
 39625        protected SnapshotsOperations()
 26        {
 39627        }
 28        /// <summary> Initializes a new instance of SnapshotsOperations. </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"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 32        /// <param name="endpoint"> server parameter. </param>
 39633        internal SnapshotsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, 
 34        {
 39635            RestClient = new SnapshotsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 39636            _clientDiagnostics = clientDiagnostics;
 39637            _pipeline = pipeline;
 39638        }
 39
 40        /// <summary> Gets information about a snapshot. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<Snapshot>> GetAsync(string resourceGroupName, string snapshotName, Cancellati
 45        {
 1646            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.Get");
 1647            scope.Start();
 48            try
 49            {
 1650                return await RestClient.GetAsync(resourceGroupName, snapshotName, cancellationToken).ConfigureAwait(fals
 51            }
 452            catch (Exception e)
 53            {
 454                scope.Failed(e);
 455                throw;
 56            }
 1257        }
 58
 59        /// <summary> Gets information about a snapshot. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<Snapshot> Get(string resourceGroupName, string snapshotName, CancellationToken cancellat
 64        {
 1665            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.Get");
 1666            scope.Start();
 67            try
 68            {
 1669                return RestClient.Get(resourceGroupName, snapshotName, cancellationToken);
 70            }
 471            catch (Exception e)
 72            {
 473                scope.Failed(e);
 474                throw;
 75            }
 1276        }
 77
 78        /// <summary> Lists snapshots under a resource group. </summary>
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="cancellationToken"> The cancellation token to use. </param>
 81        public virtual AsyncPageable<Snapshot> ListByResourceGroupAsync(string resourceGroupName, CancellationToken canc
 82        {
 483            if (resourceGroupName == null)
 84            {
 085                throw new ArgumentNullException(nameof(resourceGroupName));
 86            }
 87
 88            async Task<Page<Snapshot>> FirstPageFunc(int? pageSizeHint)
 89            {
 490                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.ListByResourceGroup");
 491                scope.Start();
 92                try
 93                {
 494                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi
 495                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 96                }
 097                catch (Exception e)
 98                {
 099                    scope.Failed(e);
 0100                    throw;
 101                }
 4102            }
 103            async Task<Page<Snapshot>> NextPageFunc(string nextLink, int? pageSizeHint)
 104            {
 0105                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.ListByResourceGroup");
 0106                scope.Start();
 107                try
 108                {
 0109                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel
 0110                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 111                }
 0112                catch (Exception e)
 113                {
 0114                    scope.Failed(e);
 0115                    throw;
 116                }
 0117            }
 4118            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 119        }
 120
 121        /// <summary> Lists snapshots under a resource group. </summary>
 122        /// <param name="resourceGroupName"> The name of the resource group. </param>
 123        /// <param name="cancellationToken"> The cancellation token to use. </param>
 124        public virtual Pageable<Snapshot> ListByResourceGroup(string resourceGroupName, CancellationToken cancellationTo
 125        {
 4126            if (resourceGroupName == null)
 127            {
 0128                throw new ArgumentNullException(nameof(resourceGroupName));
 129            }
 130
 131            Page<Snapshot> FirstPageFunc(int? pageSizeHint)
 132            {
 4133                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.ListByResourceGroup");
 4134                scope.Start();
 135                try
 136                {
 4137                    var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 4138                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 139                }
 0140                catch (Exception e)
 141                {
 0142                    scope.Failed(e);
 0143                    throw;
 144                }
 4145            }
 146            Page<Snapshot> NextPageFunc(string nextLink, int? pageSizeHint)
 147            {
 0148                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.ListByResourceGroup");
 0149                scope.Start();
 150                try
 151                {
 0152                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken
 0153                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 154                }
 0155                catch (Exception e)
 156                {
 0157                    scope.Failed(e);
 0158                    throw;
 159                }
 0160            }
 4161            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 162        }
 163
 164        /// <summary> Lists snapshots under a subscription. </summary>
 165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 166        public virtual AsyncPageable<Snapshot> ListAsync(CancellationToken cancellationToken = default)
 167        {
 168            async Task<Page<Snapshot>> FirstPageFunc(int? pageSizeHint)
 169            {
 2170                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.List");
 2171                scope.Start();
 172                try
 173                {
 2174                    var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false);
 2175                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 176                }
 0177                catch (Exception e)
 178                {
 0179                    scope.Failed(e);
 0180                    throw;
 181                }
 2182            }
 183            async Task<Page<Snapshot>> NextPageFunc(string nextLink, int? pageSizeHint)
 184            {
 0185                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.List");
 0186                scope.Start();
 187                try
 188                {
 0189                    var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false)
 0190                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 191                }
 0192                catch (Exception e)
 193                {
 0194                    scope.Failed(e);
 0195                    throw;
 196                }
 0197            }
 2198            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 199        }
 200
 201        /// <summary> Lists snapshots under a subscription. </summary>
 202        /// <param name="cancellationToken"> The cancellation token to use. </param>
 203        public virtual Pageable<Snapshot> List(CancellationToken cancellationToken = default)
 204        {
 205            Page<Snapshot> FirstPageFunc(int? pageSizeHint)
 206            {
 2207                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.List");
 2208                scope.Start();
 209                try
 210                {
 2211                    var response = RestClient.List(cancellationToken);
 2212                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 213                }
 0214                catch (Exception e)
 215                {
 0216                    scope.Failed(e);
 0217                    throw;
 218                }
 2219            }
 220            Page<Snapshot> NextPageFunc(string nextLink, int? pageSizeHint)
 221            {
 0222                using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.List");
 0223                scope.Start();
 224                try
 225                {
 0226                    var response = RestClient.ListNextPage(nextLink, cancellationToken);
 0227                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 228                }
 0229                catch (Exception e)
 230                {
 0231                    scope.Failed(e);
 0232                    throw;
 233                }
 0234            }
 2235            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 236        }
 237
 238        /// <summary> Creates or updates a snapshot. </summary>
 239        /// <param name="resourceGroupName"> The name of the resource group. </param>
 240        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 241        /// <param name="snapshot"> Snapshot object supplied in the body of the Put disk operation. </param>
 242        /// <param name="cancellationToken"> The cancellation token to use. </param>
 243        public virtual async Task<SnapshotsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName, s
 244        {
 12245            if (resourceGroupName == null)
 246            {
 0247                throw new ArgumentNullException(nameof(resourceGroupName));
 248            }
 12249            if (snapshotName == null)
 250            {
 0251                throw new ArgumentNullException(nameof(snapshotName));
 252            }
 12253            if (snapshot == null)
 254            {
 0255                throw new ArgumentNullException(nameof(snapshot));
 256            }
 257
 12258            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartCreateOrUpdate");
 12259            scope.Start();
 260            try
 261            {
 12262                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, c
 12263                return new SnapshotsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda
 264            }
 0265            catch (Exception e)
 266            {
 0267                scope.Failed(e);
 0268                throw;
 269            }
 12270        }
 271
 272        /// <summary> Creates or updates a snapshot. </summary>
 273        /// <param name="resourceGroupName"> The name of the resource group. </param>
 274        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 275        /// <param name="snapshot"> Snapshot object supplied in the body of the Put disk operation. </param>
 276        /// <param name="cancellationToken"> The cancellation token to use. </param>
 277        public virtual SnapshotsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string snapshotNam
 278        {
 12279            if (resourceGroupName == null)
 280            {
 0281                throw new ArgumentNullException(nameof(resourceGroupName));
 282            }
 12283            if (snapshotName == null)
 284            {
 0285                throw new ArgumentNullException(nameof(snapshotName));
 286            }
 12287            if (snapshot == null)
 288            {
 0289                throw new ArgumentNullException(nameof(snapshot));
 290            }
 291
 12292            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartCreateOrUpdate");
 12293            scope.Start();
 294            try
 295            {
 12296                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, snapshotName, snapshot, cancellation
 12297                return new SnapshotsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda
 298            }
 0299            catch (Exception e)
 300            {
 0301                scope.Failed(e);
 0302                throw;
 303            }
 12304        }
 305
 306        /// <summary> Updates (patches) a snapshot. </summary>
 307        /// <param name="resourceGroupName"> The name of the resource group. </param>
 308        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 309        /// <param name="snapshot"> Snapshot object supplied in the body of the Patch snapshot operation. </param>
 310        /// <param name="cancellationToken"> The cancellation token to use. </param>
 311        public virtual async Task<SnapshotsUpdateOperation> StartUpdateAsync(string resourceGroupName, string snapshotNa
 312        {
 4313            if (resourceGroupName == null)
 314            {
 0315                throw new ArgumentNullException(nameof(resourceGroupName));
 316            }
 4317            if (snapshotName == null)
 318            {
 0319                throw new ArgumentNullException(nameof(snapshotName));
 320            }
 4321            if (snapshot == null)
 322            {
 0323                throw new ArgumentNullException(nameof(snapshot));
 324            }
 325
 4326            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartUpdate");
 4327            scope.Start();
 328            try
 329            {
 4330                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, snapshotName, snapshot, cancellat
 4331                return new SnapshotsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour
 332            }
 0333            catch (Exception e)
 334            {
 0335                scope.Failed(e);
 0336                throw;
 337            }
 4338        }
 339
 340        /// <summary> Updates (patches) a snapshot. </summary>
 341        /// <param name="resourceGroupName"> The name of the resource group. </param>
 342        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 343        /// <param name="snapshot"> Snapshot object supplied in the body of the Patch snapshot operation. </param>
 344        /// <param name="cancellationToken"> The cancellation token to use. </param>
 345        public virtual SnapshotsUpdateOperation StartUpdate(string resourceGroupName, string snapshotName, SnapshotUpdat
 346        {
 4347            if (resourceGroupName == null)
 348            {
 0349                throw new ArgumentNullException(nameof(resourceGroupName));
 350            }
 4351            if (snapshotName == null)
 352            {
 0353                throw new ArgumentNullException(nameof(snapshotName));
 354            }
 4355            if (snapshot == null)
 356            {
 0357                throw new ArgumentNullException(nameof(snapshot));
 358            }
 359
 4360            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartUpdate");
 4361            scope.Start();
 362            try
 363            {
 4364                var originalResponse = RestClient.Update(resourceGroupName, snapshotName, snapshot, cancellationToken);
 4365                return new SnapshotsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour
 366            }
 0367            catch (Exception e)
 368            {
 0369                scope.Failed(e);
 0370                throw;
 371            }
 4372        }
 373
 374        /// <summary> Deletes a snapshot. </summary>
 375        /// <param name="resourceGroupName"> The name of the resource group. </param>
 376        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 377        /// <param name="cancellationToken"> The cancellation token to use. </param>
 378        public virtual async Task<SnapshotsDeleteOperation> StartDeleteAsync(string resourceGroupName, string snapshotNa
 379        {
 4380            if (resourceGroupName == null)
 381            {
 0382                throw new ArgumentNullException(nameof(resourceGroupName));
 383            }
 4384            if (snapshotName == null)
 385            {
 0386                throw new ArgumentNullException(nameof(snapshotName));
 387            }
 388
 4389            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartDelete");
 4390            scope.Start();
 391            try
 392            {
 4393                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, snapshotName, cancellationToken).
 4394                return new SnapshotsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour
 395            }
 0396            catch (Exception e)
 397            {
 0398                scope.Failed(e);
 0399                throw;
 400            }
 4401        }
 402
 403        /// <summary> Deletes a snapshot. </summary>
 404        /// <param name="resourceGroupName"> The name of the resource group. </param>
 405        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 406        /// <param name="cancellationToken"> The cancellation token to use. </param>
 407        public virtual SnapshotsDeleteOperation StartDelete(string resourceGroupName, string snapshotName, CancellationT
 408        {
 4409            if (resourceGroupName == null)
 410            {
 0411                throw new ArgumentNullException(nameof(resourceGroupName));
 412            }
 4413            if (snapshotName == null)
 414            {
 0415                throw new ArgumentNullException(nameof(snapshotName));
 416            }
 417
 4418            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartDelete");
 4419            scope.Start();
 420            try
 421            {
 4422                var originalResponse = RestClient.Delete(resourceGroupName, snapshotName, cancellationToken);
 4423                return new SnapshotsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour
 424            }
 0425            catch (Exception e)
 426            {
 0427                scope.Failed(e);
 0428                throw;
 429            }
 4430        }
 431
 432        /// <summary> Grants access to a snapshot. </summary>
 433        /// <param name="resourceGroupName"> The name of the resource group. </param>
 434        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 435        /// <param name="grantAccessData"> Access data object supplied in the body of the get snapshot access operation.
 436        /// <param name="cancellationToken"> The cancellation token to use. </param>
 437        public virtual async Task<SnapshotsGrantAccessOperation> StartGrantAccessAsync(string resourceGroupName, string 
 438        {
 4439            if (resourceGroupName == null)
 440            {
 0441                throw new ArgumentNullException(nameof(resourceGroupName));
 442            }
 4443            if (snapshotName == null)
 444            {
 0445                throw new ArgumentNullException(nameof(snapshotName));
 446            }
 4447            if (grantAccessData == null)
 448            {
 0449                throw new ArgumentNullException(nameof(grantAccessData));
 450            }
 451
 4452            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartGrantAccess");
 4453            scope.Start();
 454            try
 455            {
 4456                var originalResponse = await RestClient.GrantAccessAsync(resourceGroupName, snapshotName, grantAccessDat
 4457                return new SnapshotsGrantAccessOperation(_clientDiagnostics, _pipeline, RestClient.CreateGrantAccessRequ
 458            }
 0459            catch (Exception e)
 460            {
 0461                scope.Failed(e);
 0462                throw;
 463            }
 4464        }
 465
 466        /// <summary> Grants access to a snapshot. </summary>
 467        /// <param name="resourceGroupName"> The name of the resource group. </param>
 468        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 469        /// <param name="grantAccessData"> Access data object supplied in the body of the get snapshot access operation.
 470        /// <param name="cancellationToken"> The cancellation token to use. </param>
 471        public virtual SnapshotsGrantAccessOperation StartGrantAccess(string resourceGroupName, string snapshotName, Gra
 472        {
 4473            if (resourceGroupName == null)
 474            {
 0475                throw new ArgumentNullException(nameof(resourceGroupName));
 476            }
 4477            if (snapshotName == null)
 478            {
 0479                throw new ArgumentNullException(nameof(snapshotName));
 480            }
 4481            if (grantAccessData == null)
 482            {
 0483                throw new ArgumentNullException(nameof(grantAccessData));
 484            }
 485
 4486            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartGrantAccess");
 4487            scope.Start();
 488            try
 489            {
 4490                var originalResponse = RestClient.GrantAccess(resourceGroupName, snapshotName, grantAccessData, cancella
 4491                return new SnapshotsGrantAccessOperation(_clientDiagnostics, _pipeline, RestClient.CreateGrantAccessRequ
 492            }
 0493            catch (Exception e)
 494            {
 0495                scope.Failed(e);
 0496                throw;
 497            }
 4498        }
 499
 500        /// <summary> Revokes access to a snapshot. </summary>
 501        /// <param name="resourceGroupName"> The name of the resource group. </param>
 502        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 503        /// <param name="cancellationToken"> The cancellation token to use. </param>
 504        public virtual async Task<SnapshotsRevokeAccessOperation> StartRevokeAccessAsync(string resourceGroupName, strin
 505        {
 4506            if (resourceGroupName == null)
 507            {
 0508                throw new ArgumentNullException(nameof(resourceGroupName));
 509            }
 4510            if (snapshotName == null)
 511            {
 0512                throw new ArgumentNullException(nameof(snapshotName));
 513            }
 514
 4515            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartRevokeAccess");
 4516            scope.Start();
 517            try
 518            {
 4519                var originalResponse = await RestClient.RevokeAccessAsync(resourceGroupName, snapshotName, cancellationT
 4520                return new SnapshotsRevokeAccessOperation(_clientDiagnostics, _pipeline, RestClient.CreateRevokeAccessRe
 521            }
 0522            catch (Exception e)
 523            {
 0524                scope.Failed(e);
 0525                throw;
 526            }
 4527        }
 528
 529        /// <summary> Revokes access to a snapshot. </summary>
 530        /// <param name="resourceGroupName"> The name of the resource group. </param>
 531        /// <param name="snapshotName"> The name of the snapshot that is being created. The name can&apos;t be changed a
 532        /// <param name="cancellationToken"> The cancellation token to use. </param>
 533        public virtual SnapshotsRevokeAccessOperation StartRevokeAccess(string resourceGroupName, string snapshotName, C
 534        {
 4535            if (resourceGroupName == null)
 536            {
 0537                throw new ArgumentNullException(nameof(resourceGroupName));
 538            }
 4539            if (snapshotName == null)
 540            {
 0541                throw new ArgumentNullException(nameof(snapshotName));
 542            }
 543
 4544            using var scope = _clientDiagnostics.CreateScope("SnapshotsOperations.StartRevokeAccess");
 4545            scope.Start();
 546            try
 547            {
 4548                var originalResponse = RestClient.RevokeAccess(resourceGroupName, snapshotName, cancellationToken);
 4549                return new SnapshotsRevokeAccessOperation(_clientDiagnostics, _pipeline, RestClient.CreateRevokeAccessRe
 550            }
 0551            catch (Exception e)
 552            {
 0553                scope.Failed(e);
 0554                throw;
 555            }
 4556        }
 557    }
 558}