| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Collections.Generic; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.DigitalTwins.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.DigitalTwins |
| | 18 | | { |
| | 19 | | /// <summary> The DigitalTwins service client. </summary> |
| | 20 | | public partial class DigitalTwinsOperations |
| | 21 | | { |
| | 22 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 23 | | private readonly HttpPipeline _pipeline; |
| 28 | 24 | | internal DigitalTwinsRestOperations RestClient { get; } |
| | 25 | | /// <summary> Initializes a new instance of DigitalTwinsOperations for mocking. </summary> |
| 20 | 26 | | protected DigitalTwinsOperations() |
| | 27 | | { |
| 20 | 28 | | } |
| | 29 | | /// <summary> Initializes a new instance of DigitalTwinsOperations. </summary> |
| | 30 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 31 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 32 | | /// <param name="subscriptionId"> The subscription identifier. </param> |
| | 33 | | /// <param name="endpoint"> server parameter. </param> |
| | 34 | | /// <param name="apiVersion"> Api Version. </param> |
| 20 | 35 | | internal DigitalTwinsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI |
| | 36 | | { |
| 20 | 37 | | RestClient = new DigitalTwinsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersio |
| 20 | 38 | | _clientDiagnostics = clientDiagnostics; |
| 20 | 39 | | _pipeline = pipeline; |
| 20 | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> Get DigitalTwinsInstances resource. </summary> |
| | 43 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 44 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 46 | | public virtual async Task<Response<DigitalTwinsDescription>> GetAsync(string resourceGroupName, string resourceN |
| | 47 | | { |
| 2 | 48 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.Get"); |
| 2 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 2 | 52 | | return await RestClient.GetAsync(resourceGroupName, resourceName, cancellationToken).ConfigureAwait(fals |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 2 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Get DigitalTwinsInstances resource. </summary> |
| | 62 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 63 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 65 | | public virtual Response<DigitalTwinsDescription> Get(string resourceGroupName, string resourceName, Cancellation |
| | 66 | | { |
| 2 | 67 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.Get"); |
| 2 | 68 | | scope.Start(); |
| | 69 | | try |
| | 70 | | { |
| 2 | 71 | | return RestClient.Get(resourceGroupName, resourceName, cancellationToken); |
| | 72 | | } |
| 0 | 73 | | catch (Exception e) |
| | 74 | | { |
| 0 | 75 | | scope.Failed(e); |
| 0 | 76 | | throw; |
| | 77 | | } |
| 2 | 78 | | } |
| | 79 | |
|
| | 80 | | /// <summary> Check if a DigitalTwinsInstance name is available. </summary> |
| | 81 | | /// <param name="location"> Location of DigitalTwinsInstance. </param> |
| | 82 | | /// <param name="name"> Resource name. </param> |
| | 83 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 84 | | public virtual async Task<Response<CheckNameResult>> CheckNameAvailabilityAsync(string location, string name, Ca |
| | 85 | | { |
| 2 | 86 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.CheckNameAvailability"); |
| 2 | 87 | | scope.Start(); |
| | 88 | | try |
| | 89 | | { |
| 2 | 90 | | return await RestClient.CheckNameAvailabilityAsync(location, name, cancellationToken).ConfigureAwait(fal |
| | 91 | | } |
| 0 | 92 | | catch (Exception e) |
| | 93 | | { |
| 0 | 94 | | scope.Failed(e); |
| 0 | 95 | | throw; |
| | 96 | | } |
| 2 | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> Check if a DigitalTwinsInstance name is available. </summary> |
| | 100 | | /// <param name="location"> Location of DigitalTwinsInstance. </param> |
| | 101 | | /// <param name="name"> Resource name. </param> |
| | 102 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 103 | | public virtual Response<CheckNameResult> CheckNameAvailability(string location, string name, CancellationToken c |
| | 104 | | { |
| 2 | 105 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.CheckNameAvailability"); |
| 2 | 106 | | scope.Start(); |
| | 107 | | try |
| | 108 | | { |
| 2 | 109 | | return RestClient.CheckNameAvailability(location, name, cancellationToken); |
| | 110 | | } |
| 0 | 111 | | catch (Exception e) |
| | 112 | | { |
| 0 | 113 | | scope.Failed(e); |
| 0 | 114 | | throw; |
| | 115 | | } |
| 2 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> Get all the DigitalTwinsInstances in a subscription. </summary> |
| | 119 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 120 | | public virtual AsyncPageable<DigitalTwinsDescription> ListAsync(CancellationToken cancellationToken = default) |
| | 121 | | { |
| | 122 | | async Task<Page<DigitalTwinsDescription>> FirstPageFunc(int? pageSizeHint) |
| | 123 | | { |
| 2 | 124 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.List"); |
| 2 | 125 | | scope.Start(); |
| | 126 | | try |
| | 127 | | { |
| 2 | 128 | | var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); |
| 2 | 129 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 130 | | } |
| 0 | 131 | | catch (Exception e) |
| | 132 | | { |
| 0 | 133 | | scope.Failed(e); |
| 0 | 134 | | throw; |
| | 135 | | } |
| 2 | 136 | | } |
| | 137 | | async Task<Page<DigitalTwinsDescription>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 138 | | { |
| 0 | 139 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.List"); |
| 0 | 140 | | scope.Start(); |
| | 141 | | try |
| | 142 | | { |
| 0 | 143 | | var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false) |
| 0 | 144 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 145 | | } |
| 0 | 146 | | catch (Exception e) |
| | 147 | | { |
| 0 | 148 | | scope.Failed(e); |
| 0 | 149 | | throw; |
| | 150 | | } |
| 0 | 151 | | } |
| 2 | 152 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 153 | | } |
| | 154 | |
|
| | 155 | | /// <summary> Get all the DigitalTwinsInstances in a subscription. </summary> |
| | 156 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 157 | | public virtual Pageable<DigitalTwinsDescription> List(CancellationToken cancellationToken = default) |
| | 158 | | { |
| | 159 | | Page<DigitalTwinsDescription> FirstPageFunc(int? pageSizeHint) |
| | 160 | | { |
| 2 | 161 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.List"); |
| 2 | 162 | | scope.Start(); |
| | 163 | | try |
| | 164 | | { |
| 2 | 165 | | var response = RestClient.List(cancellationToken); |
| 2 | 166 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 167 | | } |
| 0 | 168 | | catch (Exception e) |
| | 169 | | { |
| 0 | 170 | | scope.Failed(e); |
| 0 | 171 | | throw; |
| | 172 | | } |
| 2 | 173 | | } |
| | 174 | | Page<DigitalTwinsDescription> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 175 | | { |
| 0 | 176 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.List"); |
| 0 | 177 | | scope.Start(); |
| | 178 | | try |
| | 179 | | { |
| 0 | 180 | | var response = RestClient.ListNextPage(nextLink, cancellationToken); |
| 0 | 181 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 182 | | } |
| 0 | 183 | | catch (Exception e) |
| | 184 | | { |
| 0 | 185 | | scope.Failed(e); |
| 0 | 186 | | throw; |
| | 187 | | } |
| 0 | 188 | | } |
| 2 | 189 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 190 | | } |
| | 191 | |
|
| | 192 | | /// <summary> Get all the DigitalTwinsInstances in a resource group. </summary> |
| | 193 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 194 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 195 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> is null. </exception> |
| | 196 | | public virtual AsyncPageable<DigitalTwinsDescription> ListByResourceGroupAsync(string resourceGroupName, Cancell |
| | 197 | | { |
| 0 | 198 | | if (resourceGroupName == null) |
| | 199 | | { |
| 0 | 200 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 201 | | } |
| | 202 | |
|
| | 203 | | async Task<Page<DigitalTwinsDescription>> FirstPageFunc(int? pageSizeHint) |
| | 204 | | { |
| 0 | 205 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.ListByResourceGroup"); |
| 0 | 206 | | scope.Start(); |
| | 207 | | try |
| | 208 | | { |
| 0 | 209 | | var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi |
| 0 | 210 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 211 | | } |
| 0 | 212 | | catch (Exception e) |
| | 213 | | { |
| 0 | 214 | | scope.Failed(e); |
| 0 | 215 | | throw; |
| | 216 | | } |
| 0 | 217 | | } |
| | 218 | | async Task<Page<DigitalTwinsDescription>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 219 | | { |
| 0 | 220 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.ListByResourceGroup"); |
| 0 | 221 | | scope.Start(); |
| | 222 | | try |
| | 223 | | { |
| 0 | 224 | | var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel |
| 0 | 225 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 226 | | } |
| 0 | 227 | | catch (Exception e) |
| | 228 | | { |
| 0 | 229 | | scope.Failed(e); |
| 0 | 230 | | throw; |
| | 231 | | } |
| 0 | 232 | | } |
| 0 | 233 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 234 | | } |
| | 235 | |
|
| | 236 | | /// <summary> Get all the DigitalTwinsInstances in a resource group. </summary> |
| | 237 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 238 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 239 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> is null. </exception> |
| | 240 | | public virtual Pageable<DigitalTwinsDescription> ListByResourceGroup(string resourceGroupName, CancellationToken |
| | 241 | | { |
| 0 | 242 | | if (resourceGroupName == null) |
| | 243 | | { |
| 0 | 244 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 245 | | } |
| | 246 | |
|
| | 247 | | Page<DigitalTwinsDescription> FirstPageFunc(int? pageSizeHint) |
| | 248 | | { |
| 0 | 249 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.ListByResourceGroup"); |
| 0 | 250 | | scope.Start(); |
| | 251 | | try |
| | 252 | | { |
| 0 | 253 | | var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken); |
| 0 | 254 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 255 | | } |
| 0 | 256 | | catch (Exception e) |
| | 257 | | { |
| 0 | 258 | | scope.Failed(e); |
| 0 | 259 | | throw; |
| | 260 | | } |
| 0 | 261 | | } |
| | 262 | | Page<DigitalTwinsDescription> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 263 | | { |
| 0 | 264 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.ListByResourceGroup"); |
| 0 | 265 | | scope.Start(); |
| | 266 | | try |
| | 267 | | { |
| 0 | 268 | | var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken |
| 0 | 269 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 270 | | } |
| 0 | 271 | | catch (Exception e) |
| | 272 | | { |
| 0 | 273 | | scope.Failed(e); |
| 0 | 274 | | throw; |
| | 275 | | } |
| 0 | 276 | | } |
| 0 | 277 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 278 | | } |
| | 279 | |
|
| | 280 | | /// <summary> Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is |
| | 281 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 282 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 283 | | /// <param name="digitalTwinsCreate"> The DigitalTwinsInstance and security metadata. </param> |
| | 284 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 285 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName" |
| | 286 | | public virtual async Task<DigitalTwinsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName |
| | 287 | | { |
| 2 | 288 | | if (resourceGroupName == null) |
| | 289 | | { |
| 0 | 290 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 291 | | } |
| 2 | 292 | | if (resourceName == null) |
| | 293 | | { |
| 0 | 294 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 295 | | } |
| 2 | 296 | | if (digitalTwinsCreate == null) |
| | 297 | | { |
| 0 | 298 | | throw new ArgumentNullException(nameof(digitalTwinsCreate)); |
| | 299 | | } |
| | 300 | |
|
| 2 | 301 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartCreateOrUpdate"); |
| 2 | 302 | | scope.Start(); |
| | 303 | | try |
| | 304 | | { |
| 2 | 305 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, resourceName, digitalTwin |
| 2 | 306 | | return new DigitalTwinsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrU |
| | 307 | | } |
| 0 | 308 | | catch (Exception e) |
| | 309 | | { |
| 0 | 310 | | scope.Failed(e); |
| 0 | 311 | | throw; |
| | 312 | | } |
| 2 | 313 | | } |
| | 314 | |
|
| | 315 | | /// <summary> Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is |
| | 316 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 317 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 318 | | /// <param name="digitalTwinsCreate"> The DigitalTwinsInstance and security metadata. </param> |
| | 319 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 320 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName" |
| | 321 | | public virtual DigitalTwinsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string resource |
| | 322 | | { |
| 2 | 323 | | if (resourceGroupName == null) |
| | 324 | | { |
| 0 | 325 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 326 | | } |
| 2 | 327 | | if (resourceName == null) |
| | 328 | | { |
| 0 | 329 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 330 | | } |
| 2 | 331 | | if (digitalTwinsCreate == null) |
| | 332 | | { |
| 0 | 333 | | throw new ArgumentNullException(nameof(digitalTwinsCreate)); |
| | 334 | | } |
| | 335 | |
|
| 2 | 336 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartCreateOrUpdate"); |
| 2 | 337 | | scope.Start(); |
| | 338 | | try |
| | 339 | | { |
| 2 | 340 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, resourceName, digitalTwinsCreate, ca |
| 2 | 341 | | return new DigitalTwinsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrU |
| | 342 | | } |
| 0 | 343 | | catch (Exception e) |
| | 344 | | { |
| 0 | 345 | | scope.Failed(e); |
| 0 | 346 | | throw; |
| | 347 | | } |
| 2 | 348 | | } |
| | 349 | |
|
| | 350 | | /// <summary> Update metadata of DigitalTwinsInstance. </summary> |
| | 351 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 352 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 353 | | /// <param name="tags"> Instance tags. </param> |
| | 354 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 355 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam |
| | 356 | | public virtual async Task<DigitalTwinsUpdateOperation> StartUpdateAsync(string resourceGroupName, string resourc |
| | 357 | | { |
| 0 | 358 | | if (resourceGroupName == null) |
| | 359 | | { |
| 0 | 360 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 361 | | } |
| 0 | 362 | | if (resourceName == null) |
| | 363 | | { |
| 0 | 364 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 365 | | } |
| | 366 | |
|
| 0 | 367 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartUpdate"); |
| 0 | 368 | | scope.Start(); |
| | 369 | | try |
| | 370 | | { |
| 0 | 371 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, resourceName, tags, cancellationT |
| 0 | 372 | | return new DigitalTwinsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(res |
| | 373 | | } |
| 0 | 374 | | catch (Exception e) |
| | 375 | | { |
| 0 | 376 | | scope.Failed(e); |
| 0 | 377 | | throw; |
| | 378 | | } |
| 0 | 379 | | } |
| | 380 | |
|
| | 381 | | /// <summary> Update metadata of DigitalTwinsInstance. </summary> |
| | 382 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 383 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 384 | | /// <param name="tags"> Instance tags. </param> |
| | 385 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 386 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam |
| | 387 | | public virtual DigitalTwinsUpdateOperation StartUpdate(string resourceGroupName, string resourceName, IDictionar |
| | 388 | | { |
| 0 | 389 | | if (resourceGroupName == null) |
| | 390 | | { |
| 0 | 391 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 392 | | } |
| 0 | 393 | | if (resourceName == null) |
| | 394 | | { |
| 0 | 395 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 396 | | } |
| | 397 | |
|
| 0 | 398 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartUpdate"); |
| 0 | 399 | | scope.Start(); |
| | 400 | | try |
| | 401 | | { |
| 0 | 402 | | var originalResponse = RestClient.Update(resourceGroupName, resourceName, tags, cancellationToken); |
| 0 | 403 | | return new DigitalTwinsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(res |
| | 404 | | } |
| 0 | 405 | | catch (Exception e) |
| | 406 | | { |
| 0 | 407 | | scope.Failed(e); |
| 0 | 408 | | throw; |
| | 409 | | } |
| 0 | 410 | | } |
| | 411 | |
|
| | 412 | | /// <summary> Delete a DigitalTwinsInstance. </summary> |
| | 413 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 414 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 415 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 416 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam |
| | 417 | | public virtual async Task<DigitalTwinsDeleteOperation> StartDeleteAsync(string resourceGroupName, string resourc |
| | 418 | | { |
| 2 | 419 | | if (resourceGroupName == null) |
| | 420 | | { |
| 0 | 421 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 422 | | } |
| 2 | 423 | | if (resourceName == null) |
| | 424 | | { |
| 0 | 425 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 426 | | } |
| | 427 | |
|
| 2 | 428 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartDelete"); |
| 2 | 429 | | scope.Start(); |
| | 430 | | try |
| | 431 | | { |
| 2 | 432 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, resourceName, cancellationToken). |
| 2 | 433 | | return new DigitalTwinsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(res |
| | 434 | | } |
| 0 | 435 | | catch (Exception e) |
| | 436 | | { |
| 0 | 437 | | scope.Failed(e); |
| 0 | 438 | | throw; |
| | 439 | | } |
| 2 | 440 | | } |
| | 441 | |
|
| | 442 | | /// <summary> Delete a DigitalTwinsInstance. </summary> |
| | 443 | | /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa |
| | 444 | | /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param> |
| | 445 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 446 | | /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam |
| | 447 | | public virtual DigitalTwinsDeleteOperation StartDelete(string resourceGroupName, string resourceName, Cancellati |
| | 448 | | { |
| 2 | 449 | | if (resourceGroupName == null) |
| | 450 | | { |
| 0 | 451 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 452 | | } |
| 2 | 453 | | if (resourceName == null) |
| | 454 | | { |
| 0 | 455 | | throw new ArgumentNullException(nameof(resourceName)); |
| | 456 | | } |
| | 457 | |
|
| 2 | 458 | | using var scope = _clientDiagnostics.CreateScope("DigitalTwinsOperations.StartDelete"); |
| 2 | 459 | | scope.Start(); |
| | 460 | | try |
| | 461 | | { |
| 2 | 462 | | var originalResponse = RestClient.Delete(resourceGroupName, resourceName, cancellationToken); |
| 2 | 463 | | return new DigitalTwinsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(res |
| | 464 | | } |
| 0 | 465 | | catch (Exception e) |
| | 466 | | { |
| 0 | 467 | | scope.Failed(e); |
| 0 | 468 | | throw; |
| | 469 | | } |
| 2 | 470 | | } |
| | 471 | | } |
| | 472 | | } |