| | 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.Network.Models; |
| | 15 | |
|
| | 16 | | namespace Azure.ResourceManager.Network |
| | 17 | | { |
| | 18 | | /// <summary> The Subnets service client. </summary> |
| | 19 | | public partial class SubnetsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 92 | 23 | | internal SubnetsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of SubnetsOperations for mocking. </summary> |
| 84 | 25 | | protected SubnetsOperations() |
| | 26 | | { |
| 84 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of SubnetsOperations. </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 subscription credentials which uniquely identify the Microsoft Azure subsc |
| | 32 | | /// <param name="endpoint"> server parameter. </param> |
| 84 | 33 | | internal SubnetsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Ur |
| | 34 | | { |
| 84 | 35 | | RestClient = new SubnetsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 84 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 84 | 37 | | _pipeline = pipeline; |
| 84 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Gets the specified subnet by virtual network and resource group. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 42 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 43 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 44 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 46 | | public virtual async Task<Response<Subnet>> GetAsync(string resourceGroupName, string virtualNetworkName, string |
| | 47 | | { |
| 34 | 48 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.Get"); |
| 34 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 34 | 52 | | return await RestClient.GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand, cancellation |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 34 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Gets the specified subnet by virtual network and resource group. </summary> |
| | 62 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 63 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 64 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 65 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 66 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 67 | | public virtual Response<Subnet> Get(string resourceGroupName, string virtualNetworkName, string subnetName, stri |
| | 68 | | { |
| 34 | 69 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.Get"); |
| 34 | 70 | | scope.Start(); |
| | 71 | | try |
| | 72 | | { |
| 34 | 73 | | return RestClient.Get(resourceGroupName, virtualNetworkName, subnetName, expand, cancellationToken); |
| | 74 | | } |
| 0 | 75 | | catch (Exception e) |
| | 76 | | { |
| 0 | 77 | | scope.Failed(e); |
| 0 | 78 | | throw; |
| | 79 | | } |
| 34 | 80 | | } |
| | 81 | |
|
| | 82 | | /// <summary> Gets all subnets in a virtual network. </summary> |
| | 83 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 84 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 85 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 86 | | public virtual AsyncPageable<Subnet> ListAsync(string resourceGroupName, string virtualNetworkName, Cancellation |
| | 87 | | { |
| 4 | 88 | | if (resourceGroupName == null) |
| | 89 | | { |
| 0 | 90 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 91 | | } |
| 4 | 92 | | if (virtualNetworkName == null) |
| | 93 | | { |
| 0 | 94 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 95 | | } |
| | 96 | |
|
| | 97 | | async Task<Page<Subnet>> FirstPageFunc(int? pageSizeHint) |
| | 98 | | { |
| 4 | 99 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.List"); |
| 4 | 100 | | scope.Start(); |
| | 101 | | try |
| | 102 | | { |
| 4 | 103 | | var response = await RestClient.ListAsync(resourceGroupName, virtualNetworkName, cancellationToken). |
| 4 | 104 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 105 | | } |
| 0 | 106 | | catch (Exception e) |
| | 107 | | { |
| 0 | 108 | | scope.Failed(e); |
| 0 | 109 | | throw; |
| | 110 | | } |
| 4 | 111 | | } |
| | 112 | | async Task<Page<Subnet>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 113 | | { |
| 0 | 114 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.List"); |
| 0 | 115 | | scope.Start(); |
| | 116 | | try |
| | 117 | | { |
| 0 | 118 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, virtualNetworkName, c |
| 0 | 119 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 120 | | } |
| 0 | 121 | | catch (Exception e) |
| | 122 | | { |
| 0 | 123 | | scope.Failed(e); |
| 0 | 124 | | throw; |
| | 125 | | } |
| 0 | 126 | | } |
| 4 | 127 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 128 | | } |
| | 129 | |
|
| | 130 | | /// <summary> Gets all subnets in a virtual network. </summary> |
| | 131 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 132 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 133 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 134 | | public virtual Pageable<Subnet> List(string resourceGroupName, string virtualNetworkName, CancellationToken canc |
| | 135 | | { |
| 4 | 136 | | if (resourceGroupName == null) |
| | 137 | | { |
| 0 | 138 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 139 | | } |
| 4 | 140 | | if (virtualNetworkName == null) |
| | 141 | | { |
| 0 | 142 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 143 | | } |
| | 144 | |
|
| | 145 | | Page<Subnet> FirstPageFunc(int? pageSizeHint) |
| | 146 | | { |
| 4 | 147 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.List"); |
| 4 | 148 | | scope.Start(); |
| | 149 | | try |
| | 150 | | { |
| 4 | 151 | | var response = RestClient.List(resourceGroupName, virtualNetworkName, cancellationToken); |
| 4 | 152 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 153 | | } |
| 0 | 154 | | catch (Exception e) |
| | 155 | | { |
| 0 | 156 | | scope.Failed(e); |
| 0 | 157 | | throw; |
| | 158 | | } |
| 4 | 159 | | } |
| | 160 | | Page<Subnet> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 161 | | { |
| 0 | 162 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.List"); |
| 0 | 163 | | scope.Start(); |
| | 164 | | try |
| | 165 | | { |
| 0 | 166 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, virtualNetworkName, cancellation |
| 0 | 167 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 168 | | } |
| 0 | 169 | | catch (Exception e) |
| | 170 | | { |
| 0 | 171 | | scope.Failed(e); |
| 0 | 172 | | throw; |
| | 173 | | } |
| 0 | 174 | | } |
| 4 | 175 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 176 | | } |
| | 177 | |
|
| | 178 | | /// <summary> Deletes the specified subnet. </summary> |
| | 179 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 180 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 181 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 182 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 183 | | public virtual async Task<SubnetsDeleteOperation> StartDeleteAsync(string resourceGroupName, string virtualNetwo |
| | 184 | | { |
| 2 | 185 | | if (resourceGroupName == null) |
| | 186 | | { |
| 0 | 187 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 188 | | } |
| 2 | 189 | | if (virtualNetworkName == null) |
| | 190 | | { |
| 0 | 191 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 192 | | } |
| 2 | 193 | | if (subnetName == null) |
| | 194 | | { |
| 0 | 195 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 196 | | } |
| | 197 | |
|
| 2 | 198 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartDelete"); |
| 2 | 199 | | scope.Start(); |
| | 200 | | try |
| | 201 | | { |
| 2 | 202 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, virtualNetworkName, subnetName, c |
| 2 | 203 | | return new SubnetsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resource |
| | 204 | | } |
| 0 | 205 | | catch (Exception e) |
| | 206 | | { |
| 0 | 207 | | scope.Failed(e); |
| 0 | 208 | | throw; |
| | 209 | | } |
| 2 | 210 | | } |
| | 211 | |
|
| | 212 | | /// <summary> Deletes the specified subnet. </summary> |
| | 213 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 214 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 215 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 216 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 217 | | public virtual SubnetsDeleteOperation StartDelete(string resourceGroupName, string virtualNetworkName, string su |
| | 218 | | { |
| 2 | 219 | | if (resourceGroupName == null) |
| | 220 | | { |
| 0 | 221 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 222 | | } |
| 2 | 223 | | if (virtualNetworkName == null) |
| | 224 | | { |
| 0 | 225 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 226 | | } |
| 2 | 227 | | if (subnetName == null) |
| | 228 | | { |
| 0 | 229 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 230 | | } |
| | 231 | |
|
| 2 | 232 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartDelete"); |
| 2 | 233 | | scope.Start(); |
| | 234 | | try |
| | 235 | | { |
| 2 | 236 | | var originalResponse = RestClient.Delete(resourceGroupName, virtualNetworkName, subnetName, cancellation |
| 2 | 237 | | return new SubnetsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resource |
| | 238 | | } |
| 0 | 239 | | catch (Exception e) |
| | 240 | | { |
| 0 | 241 | | scope.Failed(e); |
| 0 | 242 | | throw; |
| | 243 | | } |
| 2 | 244 | | } |
| | 245 | |
|
| | 246 | | /// <summary> Creates or updates a subnet in the specified virtual network. </summary> |
| | 247 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 248 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 249 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 250 | | /// <param name="subnetParameters"> Parameters supplied to the create or update subnet operation. </param> |
| | 251 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 252 | | public virtual async Task<SubnetsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName, str |
| | 253 | | { |
| 2 | 254 | | if (resourceGroupName == null) |
| | 255 | | { |
| 0 | 256 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 257 | | } |
| 2 | 258 | | if (virtualNetworkName == null) |
| | 259 | | { |
| 0 | 260 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 261 | | } |
| 2 | 262 | | if (subnetName == null) |
| | 263 | | { |
| 0 | 264 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 265 | | } |
| 2 | 266 | | if (subnetParameters == null) |
| | 267 | | { |
| 0 | 268 | | throw new ArgumentNullException(nameof(subnetParameters)); |
| | 269 | | } |
| | 270 | |
|
| 2 | 271 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartCreateOrUpdate"); |
| 2 | 272 | | scope.Start(); |
| | 273 | | try |
| | 274 | | { |
| 2 | 275 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subne |
| 2 | 276 | | return new SubnetsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdate |
| | 277 | | } |
| 0 | 278 | | catch (Exception e) |
| | 279 | | { |
| 0 | 280 | | scope.Failed(e); |
| 0 | 281 | | throw; |
| | 282 | | } |
| 2 | 283 | | } |
| | 284 | |
|
| | 285 | | /// <summary> Creates or updates a subnet in the specified virtual network. </summary> |
| | 286 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 287 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 288 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 289 | | /// <param name="subnetParameters"> Parameters supplied to the create or update subnet operation. </param> |
| | 290 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 291 | | public virtual SubnetsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string virtualNetwor |
| | 292 | | { |
| 2 | 293 | | if (resourceGroupName == null) |
| | 294 | | { |
| 0 | 295 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 296 | | } |
| 2 | 297 | | if (virtualNetworkName == null) |
| | 298 | | { |
| 0 | 299 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 300 | | } |
| 2 | 301 | | if (subnetName == null) |
| | 302 | | { |
| 0 | 303 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 304 | | } |
| 2 | 305 | | if (subnetParameters == null) |
| | 306 | | { |
| 0 | 307 | | throw new ArgumentNullException(nameof(subnetParameters)); |
| | 308 | | } |
| | 309 | |
|
| 2 | 310 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartCreateOrUpdate"); |
| 2 | 311 | | scope.Start(); |
| | 312 | | try |
| | 313 | | { |
| 2 | 314 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subn |
| 2 | 315 | | return new SubnetsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdate |
| | 316 | | } |
| 0 | 317 | | catch (Exception e) |
| | 318 | | { |
| 0 | 319 | | scope.Failed(e); |
| 0 | 320 | | throw; |
| | 321 | | } |
| 2 | 322 | | } |
| | 323 | |
|
| | 324 | | /// <summary> Prepares a subnet by applying network intent policies. </summary> |
| | 325 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 326 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 327 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 328 | | /// <param name="prepareNetworkPoliciesRequestParameters"> Parameters supplied to prepare subnet by applying net |
| | 329 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 330 | | public virtual async Task<SubnetsPrepareNetworkPoliciesOperation> StartPrepareNetworkPoliciesAsync(string resour |
| | 331 | | { |
| 0 | 332 | | if (resourceGroupName == null) |
| | 333 | | { |
| 0 | 334 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 335 | | } |
| 0 | 336 | | if (virtualNetworkName == null) |
| | 337 | | { |
| 0 | 338 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 339 | | } |
| 0 | 340 | | if (subnetName == null) |
| | 341 | | { |
| 0 | 342 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 343 | | } |
| 0 | 344 | | if (prepareNetworkPoliciesRequestParameters == null) |
| | 345 | | { |
| 0 | 346 | | throw new ArgumentNullException(nameof(prepareNetworkPoliciesRequestParameters)); |
| | 347 | | } |
| | 348 | |
|
| 0 | 349 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartPrepareNetworkPolicies"); |
| 0 | 350 | | scope.Start(); |
| | 351 | | try |
| | 352 | | { |
| 0 | 353 | | var originalResponse = await RestClient.PrepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkNam |
| 0 | 354 | | return new SubnetsPrepareNetworkPoliciesOperation(_clientDiagnostics, _pipeline, RestClient.CreatePrepar |
| | 355 | | } |
| 0 | 356 | | catch (Exception e) |
| | 357 | | { |
| 0 | 358 | | scope.Failed(e); |
| 0 | 359 | | throw; |
| | 360 | | } |
| 0 | 361 | | } |
| | 362 | |
|
| | 363 | | /// <summary> Prepares a subnet by applying network intent policies. </summary> |
| | 364 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 365 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 366 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 367 | | /// <param name="prepareNetworkPoliciesRequestParameters"> Parameters supplied to prepare subnet by applying net |
| | 368 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 369 | | public virtual SubnetsPrepareNetworkPoliciesOperation StartPrepareNetworkPolicies(string resourceGroupName, stri |
| | 370 | | { |
| 0 | 371 | | if (resourceGroupName == null) |
| | 372 | | { |
| 0 | 373 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 374 | | } |
| 0 | 375 | | if (virtualNetworkName == null) |
| | 376 | | { |
| 0 | 377 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 378 | | } |
| 0 | 379 | | if (subnetName == null) |
| | 380 | | { |
| 0 | 381 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 382 | | } |
| 0 | 383 | | if (prepareNetworkPoliciesRequestParameters == null) |
| | 384 | | { |
| 0 | 385 | | throw new ArgumentNullException(nameof(prepareNetworkPoliciesRequestParameters)); |
| | 386 | | } |
| | 387 | |
|
| 0 | 388 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartPrepareNetworkPolicies"); |
| 0 | 389 | | scope.Start(); |
| | 390 | | try |
| | 391 | | { |
| 0 | 392 | | var originalResponse = RestClient.PrepareNetworkPolicies(resourceGroupName, virtualNetworkName, subnetNa |
| 0 | 393 | | return new SubnetsPrepareNetworkPoliciesOperation(_clientDiagnostics, _pipeline, RestClient.CreatePrepar |
| | 394 | | } |
| 0 | 395 | | catch (Exception e) |
| | 396 | | { |
| 0 | 397 | | scope.Failed(e); |
| 0 | 398 | | throw; |
| | 399 | | } |
| 0 | 400 | | } |
| | 401 | |
|
| | 402 | | /// <summary> Unprepares a subnet by removing network intent policies. </summary> |
| | 403 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 404 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 405 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 406 | | /// <param name="unprepareNetworkPoliciesRequestParameters"> Parameters supplied to unprepare subnet to remove n |
| | 407 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 408 | | public virtual async Task<SubnetsUnprepareNetworkPoliciesOperation> StartUnprepareNetworkPoliciesAsync(string re |
| | 409 | | { |
| 0 | 410 | | if (resourceGroupName == null) |
| | 411 | | { |
| 0 | 412 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 413 | | } |
| 0 | 414 | | if (virtualNetworkName == null) |
| | 415 | | { |
| 0 | 416 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 417 | | } |
| 0 | 418 | | if (subnetName == null) |
| | 419 | | { |
| 0 | 420 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 421 | | } |
| 0 | 422 | | if (unprepareNetworkPoliciesRequestParameters == null) |
| | 423 | | { |
| 0 | 424 | | throw new ArgumentNullException(nameof(unprepareNetworkPoliciesRequestParameters)); |
| | 425 | | } |
| | 426 | |
|
| 0 | 427 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartUnprepareNetworkPolicies"); |
| 0 | 428 | | scope.Start(); |
| | 429 | | try |
| | 430 | | { |
| 0 | 431 | | var originalResponse = await RestClient.UnprepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkN |
| 0 | 432 | | return new SubnetsUnprepareNetworkPoliciesOperation(_clientDiagnostics, _pipeline, RestClient.CreateUnpr |
| | 433 | | } |
| 0 | 434 | | catch (Exception e) |
| | 435 | | { |
| 0 | 436 | | scope.Failed(e); |
| 0 | 437 | | throw; |
| | 438 | | } |
| 0 | 439 | | } |
| | 440 | |
|
| | 441 | | /// <summary> Unprepares a subnet by removing network intent policies. </summary> |
| | 442 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 443 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 444 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 445 | | /// <param name="unprepareNetworkPoliciesRequestParameters"> Parameters supplied to unprepare subnet to remove n |
| | 446 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 447 | | public virtual SubnetsUnprepareNetworkPoliciesOperation StartUnprepareNetworkPolicies(string resourceGroupName, |
| | 448 | | { |
| 0 | 449 | | if (resourceGroupName == null) |
| | 450 | | { |
| 0 | 451 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 452 | | } |
| 0 | 453 | | if (virtualNetworkName == null) |
| | 454 | | { |
| 0 | 455 | | throw new ArgumentNullException(nameof(virtualNetworkName)); |
| | 456 | | } |
| 0 | 457 | | if (subnetName == null) |
| | 458 | | { |
| 0 | 459 | | throw new ArgumentNullException(nameof(subnetName)); |
| | 460 | | } |
| 0 | 461 | | if (unprepareNetworkPoliciesRequestParameters == null) |
| | 462 | | { |
| 0 | 463 | | throw new ArgumentNullException(nameof(unprepareNetworkPoliciesRequestParameters)); |
| | 464 | | } |
| | 465 | |
|
| 0 | 466 | | using var scope = _clientDiagnostics.CreateScope("SubnetsOperations.StartUnprepareNetworkPolicies"); |
| 0 | 467 | | scope.Start(); |
| | 468 | | try |
| | 469 | | { |
| 0 | 470 | | var originalResponse = RestClient.UnprepareNetworkPolicies(resourceGroupName, virtualNetworkName, subnet |
| 0 | 471 | | return new SubnetsUnprepareNetworkPoliciesOperation(_clientDiagnostics, _pipeline, RestClient.CreateUnpr |
| | 472 | | } |
| 0 | 473 | | catch (Exception e) |
| | 474 | | { |
| 0 | 475 | | scope.Failed(e); |
| 0 | 476 | | throw; |
| | 477 | | } |
| 0 | 478 | | } |
| | 479 | | } |
| | 480 | | } |