| | | 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.Threading; |
| | | 10 | | using System.Threading.Tasks; |
| | | 11 | | using Azure; |
| | | 12 | | using Azure.Core; |
| | | 13 | | using Azure.Core.Pipeline; |
| | | 14 | | using Azure.ResourceManager.Resources.Models; |
| | | 15 | | |
| | | 16 | | namespace 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; |
| | 236 | 23 | | internal ResourcesRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of ResourcesOperations for mocking. </summary> |
| | 336 | 25 | | protected ResourcesOperations() |
| | | 26 | | { |
| | 336 | 27 | | } |
| | | 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> |
| | 336 | 33 | | internal ResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, |
| | | 34 | | { |
| | 336 | 35 | | RestClient = new ResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| | 336 | 36 | | _clientDiagnostics = clientDiagnostics; |
| | 336 | 37 | | _pipeline = pipeline; |
| | 336 | 38 | | } |
| | | 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 | | { |
| | 8 | 50 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistence"); |
| | 8 | 51 | | scope.Start(); |
| | | 52 | | try |
| | | 53 | | { |
| | 8 | 54 | | return await RestClient.CheckExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResource |
| | | 55 | | } |
| | 2 | 56 | | catch (Exception e) |
| | | 57 | | { |
| | 2 | 58 | | scope.Failed(e); |
| | 2 | 59 | | throw; |
| | | 60 | | } |
| | 6 | 61 | | } |
| | | 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 | | { |
| | 8 | 73 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistence"); |
| | 8 | 74 | | scope.Start(); |
| | | 75 | | try |
| | | 76 | | { |
| | 8 | 77 | | return RestClient.CheckExistence(resourceGroupName, resourceProviderNamespace, parentResourcePath, resou |
| | | 78 | | } |
| | 2 | 79 | | catch (Exception e) |
| | | 80 | | { |
| | 2 | 81 | | scope.Failed(e); |
| | 2 | 82 | | throw; |
| | | 83 | | } |
| | 6 | 84 | | } |
| | | 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 | | { |
| | 14 | 96 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.Get"); |
| | 14 | 97 | | scope.Start(); |
| | | 98 | | try |
| | | 99 | | { |
| | 14 | 100 | | return await RestClient.GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resou |
| | | 101 | | } |
| | 4 | 102 | | catch (Exception e) |
| | | 103 | | { |
| | 4 | 104 | | scope.Failed(e); |
| | 4 | 105 | | throw; |
| | | 106 | | } |
| | 10 | 107 | | } |
| | | 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 | | { |
| | 14 | 119 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.Get"); |
| | 14 | 120 | | scope.Start(); |
| | | 121 | | try |
| | | 122 | | { |
| | 14 | 123 | | return RestClient.Get(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, re |
| | | 124 | | } |
| | 4 | 125 | | catch (Exception e) |
| | | 126 | | { |
| | 4 | 127 | | scope.Failed(e); |
| | 4 | 128 | | throw; |
| | | 129 | | } |
| | 10 | 130 | | } |
| | | 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 | | { |
| | 0 | 138 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistenceById"); |
| | 0 | 139 | | scope.Start(); |
| | | 140 | | try |
| | | 141 | | { |
| | 0 | 142 | | return await RestClient.CheckExistenceByIdAsync(resourceId, apiVersion, cancellationToken).ConfigureAwai |
| | | 143 | | } |
| | 0 | 144 | | catch (Exception e) |
| | | 145 | | { |
| | 0 | 146 | | scope.Failed(e); |
| | 0 | 147 | | throw; |
| | | 148 | | } |
| | 0 | 149 | | } |
| | | 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 | | { |
| | 0 | 157 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.CheckExistenceById"); |
| | 0 | 158 | | scope.Start(); |
| | | 159 | | try |
| | | 160 | | { |
| | 0 | 161 | | return RestClient.CheckExistenceById(resourceId, apiVersion, cancellationToken); |
| | | 162 | | } |
| | 0 | 163 | | catch (Exception e) |
| | | 164 | | { |
| | 0 | 165 | | scope.Failed(e); |
| | 0 | 166 | | throw; |
| | | 167 | | } |
| | 0 | 168 | | } |
| | | 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 | | { |
| | 2 | 176 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.GetById"); |
| | 2 | 177 | | scope.Start(); |
| | | 178 | | try |
| | | 179 | | { |
| | 2 | 180 | | return await RestClient.GetByIdAsync(resourceId, apiVersion, cancellationToken).ConfigureAwait(false); |
| | | 181 | | } |
| | 0 | 182 | | catch (Exception e) |
| | | 183 | | { |
| | 0 | 184 | | scope.Failed(e); |
| | 0 | 185 | | throw; |
| | | 186 | | } |
| | 2 | 187 | | } |
| | | 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 | | { |
| | 2 | 195 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.GetById"); |
| | 2 | 196 | | scope.Start(); |
| | | 197 | | try |
| | | 198 | | { |
| | 2 | 199 | | return RestClient.GetById(resourceId, apiVersion, cancellationToken); |
| | | 200 | | } |
| | 0 | 201 | | catch (Exception e) |
| | | 202 | | { |
| | 0 | 203 | | scope.Failed(e); |
| | 0 | 204 | | throw; |
| | | 205 | | } |
| | 2 | 206 | | } |
| | | 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.<br><br>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 | | { |
| | 16 | 216 | | if (resourceGroupName == null) |
| | | 217 | | { |
| | 0 | 218 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 219 | | } |
| | | 220 | | |
| | | 221 | | async Task<Page<GenericResourceExpanded>> FirstPageFunc(int? pageSizeHint) |
| | | 222 | | { |
| | 16 | 223 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup"); |
| | 16 | 224 | | scope.Start(); |
| | | 225 | | try |
| | | 226 | | { |
| | 16 | 227 | | var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, filter, expand, top, can |
| | 16 | 228 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 229 | | } |
| | 0 | 230 | | catch (Exception e) |
| | | 231 | | { |
| | 0 | 232 | | scope.Failed(e); |
| | 0 | 233 | | throw; |
| | | 234 | | } |
| | 16 | 235 | | } |
| | | 236 | | async Task<Page<GenericResourceExpanded>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 237 | | { |
| | 0 | 238 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup"); |
| | 0 | 239 | | scope.Start(); |
| | | 240 | | try |
| | | 241 | | { |
| | 0 | 242 | | var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, filter |
| | 0 | 243 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 244 | | } |
| | 0 | 245 | | catch (Exception e) |
| | | 246 | | { |
| | 0 | 247 | | scope.Failed(e); |
| | 0 | 248 | | throw; |
| | | 249 | | } |
| | 0 | 250 | | } |
| | 16 | 251 | | 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.<br><br>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 | | { |
| | 16 | 262 | | if (resourceGroupName == null) |
| | | 263 | | { |
| | 0 | 264 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 265 | | } |
| | | 266 | | |
| | | 267 | | Page<GenericResourceExpanded> FirstPageFunc(int? pageSizeHint) |
| | | 268 | | { |
| | 16 | 269 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup"); |
| | 16 | 270 | | scope.Start(); |
| | | 271 | | try |
| | | 272 | | { |
| | 16 | 273 | | var response = RestClient.ListByResourceGroup(resourceGroupName, filter, expand, top, cancellationTo |
| | 16 | 274 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 275 | | } |
| | 0 | 276 | | catch (Exception e) |
| | | 277 | | { |
| | 0 | 278 | | scope.Failed(e); |
| | 0 | 279 | | throw; |
| | | 280 | | } |
| | 16 | 281 | | } |
| | | 282 | | Page<GenericResourceExpanded> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 283 | | { |
| | 0 | 284 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.ListByResourceGroup"); |
| | 0 | 285 | | scope.Start(); |
| | | 286 | | try |
| | | 287 | | { |
| | 0 | 288 | | var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, filter, expand, t |
| | 0 | 289 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 290 | | } |
| | 0 | 291 | | catch (Exception e) |
| | | 292 | | { |
| | 0 | 293 | | scope.Failed(e); |
| | 0 | 294 | | throw; |
| | | 295 | | } |
| | 0 | 296 | | } |
| | 16 | 297 | | 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.<br><br>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 | | { |
| | 2 | 309 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List"); |
| | 2 | 310 | | scope.Start(); |
| | | 311 | | try |
| | | 312 | | { |
| | 2 | 313 | | var response = await RestClient.ListAsync(filter, expand, top, cancellationToken).ConfigureAwait(fal |
| | 2 | 314 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 315 | | } |
| | 0 | 316 | | catch (Exception e) |
| | | 317 | | { |
| | 0 | 318 | | scope.Failed(e); |
| | 0 | 319 | | throw; |
| | | 320 | | } |
| | 2 | 321 | | } |
| | | 322 | | async Task<Page<GenericResourceExpanded>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 323 | | { |
| | 0 | 324 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List"); |
| | 0 | 325 | | scope.Start(); |
| | | 326 | | try |
| | | 327 | | { |
| | 0 | 328 | | var response = await RestClient.ListNextPageAsync(nextLink, filter, expand, top, cancellationToken). |
| | 0 | 329 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 330 | | } |
| | 0 | 331 | | catch (Exception e) |
| | | 332 | | { |
| | 0 | 333 | | scope.Failed(e); |
| | 0 | 334 | | throw; |
| | | 335 | | } |
| | 0 | 336 | | } |
| | 2 | 337 | | 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.<br><br>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 | | { |
| | 2 | 349 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List"); |
| | 2 | 350 | | scope.Start(); |
| | | 351 | | try |
| | | 352 | | { |
| | 2 | 353 | | var response = RestClient.List(filter, expand, top, cancellationToken); |
| | 2 | 354 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 355 | | } |
| | 0 | 356 | | catch (Exception e) |
| | | 357 | | { |
| | 0 | 358 | | scope.Failed(e); |
| | 0 | 359 | | throw; |
| | | 360 | | } |
| | 2 | 361 | | } |
| | | 362 | | Page<GenericResourceExpanded> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 363 | | { |
| | 0 | 364 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.List"); |
| | 0 | 365 | | scope.Start(); |
| | | 366 | | try |
| | | 367 | | { |
| | 0 | 368 | | var response = RestClient.ListNextPage(nextLink, filter, expand, top, cancellationToken); |
| | 0 | 369 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 370 | | } |
| | 0 | 371 | | catch (Exception e) |
| | | 372 | | { |
| | 0 | 373 | | scope.Failed(e); |
| | 0 | 374 | | throw; |
| | | 375 | | } |
| | 0 | 376 | | } |
| | 2 | 377 | | 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 | | { |
| | 0 | 386 | | if (sourceResourceGroupName == null) |
| | | 387 | | { |
| | 0 | 388 | | throw new ArgumentNullException(nameof(sourceResourceGroupName)); |
| | | 389 | | } |
| | 0 | 390 | | if (parameters == null) |
| | | 391 | | { |
| | 0 | 392 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 393 | | } |
| | | 394 | | |
| | 0 | 395 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartMoveResources"); |
| | 0 | 396 | | scope.Start(); |
| | | 397 | | try |
| | | 398 | | { |
| | 0 | 399 | | var originalResponse = await RestClient.MoveResourcesAsync(sourceResourceGroupName, parameters, cancella |
| | 0 | 400 | | return new ResourcesMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateMoveResources |
| | | 401 | | } |
| | 0 | 402 | | catch (Exception e) |
| | | 403 | | { |
| | 0 | 404 | | scope.Failed(e); |
| | 0 | 405 | | throw; |
| | | 406 | | } |
| | 0 | 407 | | } |
| | | 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 | | { |
| | 0 | 415 | | if (sourceResourceGroupName == null) |
| | | 416 | | { |
| | 0 | 417 | | throw new ArgumentNullException(nameof(sourceResourceGroupName)); |
| | | 418 | | } |
| | 0 | 419 | | if (parameters == null) |
| | | 420 | | { |
| | 0 | 421 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 422 | | } |
| | | 423 | | |
| | 0 | 424 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartMoveResources"); |
| | 0 | 425 | | scope.Start(); |
| | | 426 | | try |
| | | 427 | | { |
| | 0 | 428 | | var originalResponse = RestClient.MoveResources(sourceResourceGroupName, parameters, cancellationToken); |
| | 0 | 429 | | return new ResourcesMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateMoveResources |
| | | 430 | | } |
| | 0 | 431 | | catch (Exception e) |
| | | 432 | | { |
| | 0 | 433 | | scope.Failed(e); |
| | 0 | 434 | | throw; |
| | | 435 | | } |
| | 0 | 436 | | } |
| | | 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 | | { |
| | 0 | 444 | | if (sourceResourceGroupName == null) |
| | | 445 | | { |
| | 0 | 446 | | throw new ArgumentNullException(nameof(sourceResourceGroupName)); |
| | | 447 | | } |
| | 0 | 448 | | if (parameters == null) |
| | | 449 | | { |
| | 0 | 450 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 451 | | } |
| | | 452 | | |
| | 0 | 453 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartValidateMoveResources"); |
| | 0 | 454 | | scope.Start(); |
| | | 455 | | try |
| | | 456 | | { |
| | 0 | 457 | | var originalResponse = await RestClient.ValidateMoveResourcesAsync(sourceResourceGroupName, parameters, |
| | 0 | 458 | | return new ResourcesValidateMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateValid |
| | | 459 | | } |
| | 0 | 460 | | catch (Exception e) |
| | | 461 | | { |
| | 0 | 462 | | scope.Failed(e); |
| | 0 | 463 | | throw; |
| | | 464 | | } |
| | 0 | 465 | | } |
| | | 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 | | { |
| | 0 | 473 | | if (sourceResourceGroupName == null) |
| | | 474 | | { |
| | 0 | 475 | | throw new ArgumentNullException(nameof(sourceResourceGroupName)); |
| | | 476 | | } |
| | 0 | 477 | | if (parameters == null) |
| | | 478 | | { |
| | 0 | 479 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 480 | | } |
| | | 481 | | |
| | 0 | 482 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartValidateMoveResources"); |
| | 0 | 483 | | scope.Start(); |
| | | 484 | | try |
| | | 485 | | { |
| | 0 | 486 | | var originalResponse = RestClient.ValidateMoveResources(sourceResourceGroupName, parameters, cancellatio |
| | 0 | 487 | | return new ResourcesValidateMoveResourcesOperation(_clientDiagnostics, _pipeline, RestClient.CreateValid |
| | | 488 | | } |
| | 0 | 489 | | catch (Exception e) |
| | | 490 | | { |
| | 0 | 491 | | scope.Failed(e); |
| | 0 | 492 | | throw; |
| | | 493 | | } |
| | 0 | 494 | | } |
| | | 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 | | { |
| | 8 | 506 | | if (resourceGroupName == null) |
| | | 507 | | { |
| | 0 | 508 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 509 | | } |
| | 8 | 510 | | if (resourceProviderNamespace == null) |
| | | 511 | | { |
| | 0 | 512 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 513 | | } |
| | 8 | 514 | | if (parentResourcePath == null) |
| | | 515 | | { |
| | 0 | 516 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 517 | | } |
| | 8 | 518 | | if (resourceType == null) |
| | | 519 | | { |
| | 0 | 520 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 521 | | } |
| | 8 | 522 | | if (resourceName == null) |
| | | 523 | | { |
| | 0 | 524 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 525 | | } |
| | 8 | 526 | | if (apiVersion == null) |
| | | 527 | | { |
| | 2 | 528 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 529 | | } |
| | | 530 | | |
| | 6 | 531 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDelete"); |
| | 6 | 532 | | scope.Start(); |
| | | 533 | | try |
| | | 534 | | { |
| | 6 | 535 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, resourceProviderNamespace, parent |
| | 6 | 536 | | return new ResourcesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour |
| | | 537 | | } |
| | 0 | 538 | | catch (Exception e) |
| | | 539 | | { |
| | 0 | 540 | | scope.Failed(e); |
| | 0 | 541 | | throw; |
| | | 542 | | } |
| | 6 | 543 | | } |
| | | 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 | | { |
| | 8 | 555 | | if (resourceGroupName == null) |
| | | 556 | | { |
| | 0 | 557 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 558 | | } |
| | 8 | 559 | | if (resourceProviderNamespace == null) |
| | | 560 | | { |
| | 0 | 561 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 562 | | } |
| | 8 | 563 | | if (parentResourcePath == null) |
| | | 564 | | { |
| | 0 | 565 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 566 | | } |
| | 8 | 567 | | if (resourceType == null) |
| | | 568 | | { |
| | 0 | 569 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 570 | | } |
| | 8 | 571 | | if (resourceName == null) |
| | | 572 | | { |
| | 0 | 573 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 574 | | } |
| | 8 | 575 | | if (apiVersion == null) |
| | | 576 | | { |
| | 2 | 577 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 578 | | } |
| | | 579 | | |
| | 6 | 580 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDelete"); |
| | 6 | 581 | | scope.Start(); |
| | | 582 | | try |
| | | 583 | | { |
| | 6 | 584 | | var originalResponse = RestClient.Delete(resourceGroupName, resourceProviderNamespace, parentResourcePat |
| | 6 | 585 | | return new ResourcesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resour |
| | | 586 | | } |
| | 0 | 587 | | catch (Exception e) |
| | | 588 | | { |
| | 0 | 589 | | scope.Failed(e); |
| | 0 | 590 | | throw; |
| | | 591 | | } |
| | 6 | 592 | | } |
| | | 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 | | { |
| | 26 | 605 | | if (resourceGroupName == null) |
| | | 606 | | { |
| | 0 | 607 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 608 | | } |
| | 26 | 609 | | if (resourceProviderNamespace == null) |
| | | 610 | | { |
| | 0 | 611 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 612 | | } |
| | 26 | 613 | | if (parentResourcePath == null) |
| | | 614 | | { |
| | 0 | 615 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 616 | | } |
| | 26 | 617 | | if (resourceType == null) |
| | | 618 | | { |
| | 0 | 619 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 620 | | } |
| | 26 | 621 | | if (resourceName == null) |
| | | 622 | | { |
| | 0 | 623 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 624 | | } |
| | 26 | 625 | | if (apiVersion == null) |
| | | 626 | | { |
| | 2 | 627 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 628 | | } |
| | 24 | 629 | | if (parameters == null) |
| | | 630 | | { |
| | 0 | 631 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 632 | | } |
| | | 633 | | |
| | 24 | 634 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdate"); |
| | 24 | 635 | | scope.Start(); |
| | | 636 | | try |
| | | 637 | | { |
| | 24 | 638 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace |
| | 24 | 639 | | return new ResourcesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda |
| | | 640 | | } |
| | 0 | 641 | | catch (Exception e) |
| | | 642 | | { |
| | 0 | 643 | | scope.Failed(e); |
| | 0 | 644 | | throw; |
| | | 645 | | } |
| | 24 | 646 | | } |
| | | 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 | | { |
| | 26 | 659 | | if (resourceGroupName == null) |
| | | 660 | | { |
| | 0 | 661 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 662 | | } |
| | 26 | 663 | | if (resourceProviderNamespace == null) |
| | | 664 | | { |
| | 0 | 665 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 666 | | } |
| | 26 | 667 | | if (parentResourcePath == null) |
| | | 668 | | { |
| | 0 | 669 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 670 | | } |
| | 26 | 671 | | if (resourceType == null) |
| | | 672 | | { |
| | 0 | 673 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 674 | | } |
| | 26 | 675 | | if (resourceName == null) |
| | | 676 | | { |
| | 0 | 677 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 678 | | } |
| | 26 | 679 | | if (apiVersion == null) |
| | | 680 | | { |
| | 2 | 681 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 682 | | } |
| | 24 | 683 | | if (parameters == null) |
| | | 684 | | { |
| | 0 | 685 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 686 | | } |
| | | 687 | | |
| | 24 | 688 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdate"); |
| | 24 | 689 | | scope.Start(); |
| | | 690 | | try |
| | | 691 | | { |
| | 24 | 692 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, resourceProviderNamespace, parentRes |
| | 24 | 693 | | return new ResourcesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpda |
| | | 694 | | } |
| | 0 | 695 | | catch (Exception e) |
| | | 696 | | { |
| | 0 | 697 | | scope.Failed(e); |
| | 0 | 698 | | throw; |
| | | 699 | | } |
| | 24 | 700 | | } |
| | | 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 | | { |
| | 0 | 713 | | if (resourceGroupName == null) |
| | | 714 | | { |
| | 0 | 715 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 716 | | } |
| | 0 | 717 | | if (resourceProviderNamespace == null) |
| | | 718 | | { |
| | 0 | 719 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 720 | | } |
| | 0 | 721 | | if (parentResourcePath == null) |
| | | 722 | | { |
| | 0 | 723 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 724 | | } |
| | 0 | 725 | | if (resourceType == null) |
| | | 726 | | { |
| | 0 | 727 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 728 | | } |
| | 0 | 729 | | if (resourceName == null) |
| | | 730 | | { |
| | 0 | 731 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 732 | | } |
| | 0 | 733 | | if (apiVersion == null) |
| | | 734 | | { |
| | 0 | 735 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 736 | | } |
| | 0 | 737 | | if (parameters == null) |
| | | 738 | | { |
| | 0 | 739 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 740 | | } |
| | | 741 | | |
| | 0 | 742 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdate"); |
| | 0 | 743 | | scope.Start(); |
| | | 744 | | try |
| | | 745 | | { |
| | 0 | 746 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, resourceProviderNamespace, parent |
| | 0 | 747 | | return new ResourcesUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour |
| | | 748 | | } |
| | 0 | 749 | | catch (Exception e) |
| | | 750 | | { |
| | 0 | 751 | | scope.Failed(e); |
| | 0 | 752 | | throw; |
| | | 753 | | } |
| | 0 | 754 | | } |
| | | 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 | | { |
| | 0 | 767 | | if (resourceGroupName == null) |
| | | 768 | | { |
| | 0 | 769 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 770 | | } |
| | 0 | 771 | | if (resourceProviderNamespace == null) |
| | | 772 | | { |
| | 0 | 773 | | throw new ArgumentNullException(nameof(resourceProviderNamespace)); |
| | | 774 | | } |
| | 0 | 775 | | if (parentResourcePath == null) |
| | | 776 | | { |
| | 0 | 777 | | throw new ArgumentNullException(nameof(parentResourcePath)); |
| | | 778 | | } |
| | 0 | 779 | | if (resourceType == null) |
| | | 780 | | { |
| | 0 | 781 | | throw new ArgumentNullException(nameof(resourceType)); |
| | | 782 | | } |
| | 0 | 783 | | if (resourceName == null) |
| | | 784 | | { |
| | 0 | 785 | | throw new ArgumentNullException(nameof(resourceName)); |
| | | 786 | | } |
| | 0 | 787 | | if (apiVersion == null) |
| | | 788 | | { |
| | 0 | 789 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 790 | | } |
| | 0 | 791 | | if (parameters == null) |
| | | 792 | | { |
| | 0 | 793 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 794 | | } |
| | | 795 | | |
| | 0 | 796 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdate"); |
| | 0 | 797 | | scope.Start(); |
| | | 798 | | try |
| | | 799 | | { |
| | 0 | 800 | | var originalResponse = RestClient.Update(resourceGroupName, resourceProviderNamespace, parentResourcePat |
| | 0 | 801 | | return new ResourcesUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resour |
| | | 802 | | } |
| | 0 | 803 | | catch (Exception e) |
| | | 804 | | { |
| | 0 | 805 | | scope.Failed(e); |
| | 0 | 806 | | throw; |
| | | 807 | | } |
| | 0 | 808 | | } |
| | | 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 | | { |
| | 4 | 816 | | if (resourceId == null) |
| | | 817 | | { |
| | 0 | 818 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 819 | | } |
| | 4 | 820 | | if (apiVersion == null) |
| | | 821 | | { |
| | 0 | 822 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 823 | | } |
| | | 824 | | |
| | 4 | 825 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDeleteById"); |
| | 4 | 826 | | scope.Start(); |
| | | 827 | | try |
| | | 828 | | { |
| | 4 | 829 | | var originalResponse = await RestClient.DeleteByIdAsync(resourceId, apiVersion, cancellationToken).Confi |
| | 4 | 830 | | return new ResourcesDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteByIdReques |
| | | 831 | | } |
| | 0 | 832 | | catch (Exception e) |
| | | 833 | | { |
| | 0 | 834 | | scope.Failed(e); |
| | 0 | 835 | | throw; |
| | | 836 | | } |
| | 4 | 837 | | } |
| | | 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 | | { |
| | 4 | 845 | | if (resourceId == null) |
| | | 846 | | { |
| | 0 | 847 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 848 | | } |
| | 4 | 849 | | if (apiVersion == null) |
| | | 850 | | { |
| | 0 | 851 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 852 | | } |
| | | 853 | | |
| | 4 | 854 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartDeleteById"); |
| | 4 | 855 | | scope.Start(); |
| | | 856 | | try |
| | | 857 | | { |
| | 4 | 858 | | var originalResponse = RestClient.DeleteById(resourceId, apiVersion, cancellationToken); |
| | 4 | 859 | | return new ResourcesDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteByIdReques |
| | | 860 | | } |
| | 0 | 861 | | catch (Exception e) |
| | | 862 | | { |
| | 0 | 863 | | scope.Failed(e); |
| | 0 | 864 | | throw; |
| | | 865 | | } |
| | 4 | 866 | | } |
| | | 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 | | { |
| | 4 | 875 | | if (resourceId == null) |
| | | 876 | | { |
| | 0 | 877 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 878 | | } |
| | 4 | 879 | | if (apiVersion == null) |
| | | 880 | | { |
| | 0 | 881 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 882 | | } |
| | 4 | 883 | | if (parameters == null) |
| | | 884 | | { |
| | 0 | 885 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 886 | | } |
| | | 887 | | |
| | 4 | 888 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdateById"); |
| | 4 | 889 | | scope.Start(); |
| | | 890 | | try |
| | | 891 | | { |
| | 4 | 892 | | var originalResponse = await RestClient.CreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, canc |
| | 4 | 893 | | return new ResourcesCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOr |
| | | 894 | | } |
| | 0 | 895 | | catch (Exception e) |
| | | 896 | | { |
| | 0 | 897 | | scope.Failed(e); |
| | 0 | 898 | | throw; |
| | | 899 | | } |
| | 4 | 900 | | } |
| | | 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 | | { |
| | 4 | 909 | | if (resourceId == null) |
| | | 910 | | { |
| | 0 | 911 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 912 | | } |
| | 4 | 913 | | if (apiVersion == null) |
| | | 914 | | { |
| | 0 | 915 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 916 | | } |
| | 4 | 917 | | if (parameters == null) |
| | | 918 | | { |
| | 0 | 919 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 920 | | } |
| | | 921 | | |
| | 4 | 922 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartCreateOrUpdateById"); |
| | 4 | 923 | | scope.Start(); |
| | | 924 | | try |
| | | 925 | | { |
| | 4 | 926 | | var originalResponse = RestClient.CreateOrUpdateById(resourceId, apiVersion, parameters, cancellationTok |
| | 4 | 927 | | return new ResourcesCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOr |
| | | 928 | | } |
| | 0 | 929 | | catch (Exception e) |
| | | 930 | | { |
| | 0 | 931 | | scope.Failed(e); |
| | 0 | 932 | | throw; |
| | | 933 | | } |
| | 4 | 934 | | } |
| | | 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 | | { |
| | 0 | 943 | | if (resourceId == null) |
| | | 944 | | { |
| | 0 | 945 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 946 | | } |
| | 0 | 947 | | if (apiVersion == null) |
| | | 948 | | { |
| | 0 | 949 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 950 | | } |
| | 0 | 951 | | if (parameters == null) |
| | | 952 | | { |
| | 0 | 953 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 954 | | } |
| | | 955 | | |
| | 0 | 956 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdateById"); |
| | 0 | 957 | | scope.Start(); |
| | | 958 | | try |
| | | 959 | | { |
| | 0 | 960 | | var originalResponse = await RestClient.UpdateByIdAsync(resourceId, apiVersion, parameters, cancellation |
| | 0 | 961 | | return new ResourcesUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateByIdReques |
| | | 962 | | } |
| | 0 | 963 | | catch (Exception e) |
| | | 964 | | { |
| | 0 | 965 | | scope.Failed(e); |
| | 0 | 966 | | throw; |
| | | 967 | | } |
| | 0 | 968 | | } |
| | | 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 | | { |
| | 0 | 977 | | if (resourceId == null) |
| | | 978 | | { |
| | 0 | 979 | | throw new ArgumentNullException(nameof(resourceId)); |
| | | 980 | | } |
| | 0 | 981 | | if (apiVersion == null) |
| | | 982 | | { |
| | 0 | 983 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | | 984 | | } |
| | 0 | 985 | | if (parameters == null) |
| | | 986 | | { |
| | 0 | 987 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 988 | | } |
| | | 989 | | |
| | 0 | 990 | | using var scope = _clientDiagnostics.CreateScope("ResourcesOperations.StartUpdateById"); |
| | 0 | 991 | | scope.Start(); |
| | | 992 | | try |
| | | 993 | | { |
| | 0 | 994 | | var originalResponse = RestClient.UpdateById(resourceId, apiVersion, parameters, cancellationToken); |
| | 0 | 995 | | return new ResourcesUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateByIdReques |
| | | 996 | | } |
| | 0 | 997 | | catch (Exception e) |
| | | 998 | | { |
| | 0 | 999 | | scope.Failed(e); |
| | 0 | 1000 | | throw; |
| | | 1001 | | } |
| | 0 | 1002 | | } |
| | | 1003 | | } |
| | | 1004 | | } |