| | 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 P2SVpnGateways service client. </summary> |
| | 19 | | public partial class P2SVpnGatewaysOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal P2SVpnGatewaysRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of P2SVpnGatewaysOperations for mocking. </summary> |
| 0 | 25 | | protected P2SVpnGatewaysOperations() |
| | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of P2SVpnGatewaysOperations. </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> |
| 0 | 33 | | internal P2SVpnGatewaysOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptio |
| | 34 | | { |
| 0 | 35 | | RestClient = new P2SVpnGatewaysRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Retrieves the details of a virtual wan p2s vpn gateway. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 42 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<P2SVpnGateway>> GetAsync(string resourceGroupName, string gatewayName, Cancel |
| | 45 | | { |
| 0 | 46 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.Get"); |
| 0 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 0 | 50 | | return await RestClient.GetAsync(resourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Retrieves the details of a virtual wan p2s vpn gateway. </summary> |
| | 60 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 61 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public virtual Response<P2SVpnGateway> Get(string resourceGroupName, string gatewayName, CancellationToken cance |
| | 64 | | { |
| 0 | 65 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.Get"); |
| 0 | 66 | | scope.Start(); |
| | 67 | | try |
| | 68 | | { |
| 0 | 69 | | return RestClient.Get(resourceGroupName, gatewayName, cancellationToken); |
| | 70 | | } |
| 0 | 71 | | catch (Exception e) |
| | 72 | | { |
| 0 | 73 | | scope.Failed(e); |
| 0 | 74 | | throw; |
| | 75 | | } |
| 0 | 76 | | } |
| | 77 | |
|
| | 78 | | /// <summary> Updates virtual wan p2s vpn gateway tags. </summary> |
| | 79 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 80 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 81 | | /// <param name="p2SVpnGatewayParameters"> Parameters supplied to update a virtual wan p2s vpn gateway tags. </p |
| | 82 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 83 | | public virtual async Task<Response<P2SVpnGateway>> UpdateTagsAsync(string resourceGroupName, string gatewayName, |
| | 84 | | { |
| 0 | 85 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.UpdateTags"); |
| 0 | 86 | | scope.Start(); |
| | 87 | | try |
| | 88 | | { |
| 0 | 89 | | return await RestClient.UpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, cancell |
| | 90 | | } |
| 0 | 91 | | catch (Exception e) |
| | 92 | | { |
| 0 | 93 | | scope.Failed(e); |
| 0 | 94 | | throw; |
| | 95 | | } |
| 0 | 96 | | } |
| | 97 | |
|
| | 98 | | /// <summary> Updates virtual wan p2s vpn gateway tags. </summary> |
| | 99 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 100 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 101 | | /// <param name="p2SVpnGatewayParameters"> Parameters supplied to update a virtual wan p2s vpn gateway tags. </p |
| | 102 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 103 | | public virtual Response<P2SVpnGateway> UpdateTags(string resourceGroupName, string gatewayName, TagsObject p2SVp |
| | 104 | | { |
| 0 | 105 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.UpdateTags"); |
| 0 | 106 | | scope.Start(); |
| | 107 | | try |
| | 108 | | { |
| 0 | 109 | | return RestClient.UpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, cancellationToken) |
| | 110 | | } |
| 0 | 111 | | catch (Exception e) |
| | 112 | | { |
| 0 | 113 | | scope.Failed(e); |
| 0 | 114 | | throw; |
| | 115 | | } |
| 0 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> Lists all the P2SVpnGateways in a resource group. </summary> |
| | 119 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 120 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 121 | | public virtual AsyncPageable<P2SVpnGateway> ListByResourceGroupAsync(string resourceGroupName, CancellationToken |
| | 122 | | { |
| 0 | 123 | | if (resourceGroupName == null) |
| | 124 | | { |
| 0 | 125 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 126 | | } |
| | 127 | |
|
| | 128 | | async Task<Page<P2SVpnGateway>> FirstPageFunc(int? pageSizeHint) |
| | 129 | | { |
| 0 | 130 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.ListByResourceGroup"); |
| 0 | 131 | | scope.Start(); |
| | 132 | | try |
| | 133 | | { |
| 0 | 134 | | var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi |
| 0 | 135 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 136 | | } |
| 0 | 137 | | catch (Exception e) |
| | 138 | | { |
| 0 | 139 | | scope.Failed(e); |
| 0 | 140 | | throw; |
| | 141 | | } |
| 0 | 142 | | } |
| | 143 | | async Task<Page<P2SVpnGateway>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 144 | | { |
| 0 | 145 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.ListByResourceGroup"); |
| 0 | 146 | | scope.Start(); |
| | 147 | | try |
| | 148 | | { |
| 0 | 149 | | var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel |
| 0 | 150 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 151 | | } |
| 0 | 152 | | catch (Exception e) |
| | 153 | | { |
| 0 | 154 | | scope.Failed(e); |
| 0 | 155 | | throw; |
| | 156 | | } |
| 0 | 157 | | } |
| 0 | 158 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 159 | | } |
| | 160 | |
|
| | 161 | | /// <summary> Lists all the P2SVpnGateways in a resource group. </summary> |
| | 162 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 163 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 164 | | public virtual Pageable<P2SVpnGateway> ListByResourceGroup(string resourceGroupName, CancellationToken cancellat |
| | 165 | | { |
| 0 | 166 | | if (resourceGroupName == null) |
| | 167 | | { |
| 0 | 168 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 169 | | } |
| | 170 | |
|
| | 171 | | Page<P2SVpnGateway> FirstPageFunc(int? pageSizeHint) |
| | 172 | | { |
| 0 | 173 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.ListByResourceGroup"); |
| 0 | 174 | | scope.Start(); |
| | 175 | | try |
| | 176 | | { |
| 0 | 177 | | var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken); |
| 0 | 178 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 179 | | } |
| 0 | 180 | | catch (Exception e) |
| | 181 | | { |
| 0 | 182 | | scope.Failed(e); |
| 0 | 183 | | throw; |
| | 184 | | } |
| 0 | 185 | | } |
| | 186 | | Page<P2SVpnGateway> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 187 | | { |
| 0 | 188 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.ListByResourceGroup"); |
| 0 | 189 | | scope.Start(); |
| | 190 | | try |
| | 191 | | { |
| 0 | 192 | | var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken |
| 0 | 193 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 194 | | } |
| 0 | 195 | | catch (Exception e) |
| | 196 | | { |
| 0 | 197 | | scope.Failed(e); |
| 0 | 198 | | throw; |
| | 199 | | } |
| 0 | 200 | | } |
| 0 | 201 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 202 | | } |
| | 203 | |
|
| | 204 | | /// <summary> Lists all the P2SVpnGateways in a subscription. </summary> |
| | 205 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 206 | | public virtual AsyncPageable<P2SVpnGateway> ListAsync(CancellationToken cancellationToken = default) |
| | 207 | | { |
| | 208 | | async Task<Page<P2SVpnGateway>> FirstPageFunc(int? pageSizeHint) |
| | 209 | | { |
| 0 | 210 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.List"); |
| 0 | 211 | | scope.Start(); |
| | 212 | | try |
| | 213 | | { |
| 0 | 214 | | var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); |
| 0 | 215 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 216 | | } |
| 0 | 217 | | catch (Exception e) |
| | 218 | | { |
| 0 | 219 | | scope.Failed(e); |
| 0 | 220 | | throw; |
| | 221 | | } |
| 0 | 222 | | } |
| | 223 | | async Task<Page<P2SVpnGateway>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 224 | | { |
| 0 | 225 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.List"); |
| 0 | 226 | | scope.Start(); |
| | 227 | | try |
| | 228 | | { |
| 0 | 229 | | var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false) |
| 0 | 230 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 231 | | } |
| 0 | 232 | | catch (Exception e) |
| | 233 | | { |
| 0 | 234 | | scope.Failed(e); |
| 0 | 235 | | throw; |
| | 236 | | } |
| 0 | 237 | | } |
| 0 | 238 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 239 | | } |
| | 240 | |
|
| | 241 | | /// <summary> Lists all the P2SVpnGateways in a subscription. </summary> |
| | 242 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 243 | | public virtual Pageable<P2SVpnGateway> List(CancellationToken cancellationToken = default) |
| | 244 | | { |
| | 245 | | Page<P2SVpnGateway> FirstPageFunc(int? pageSizeHint) |
| | 246 | | { |
| 0 | 247 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.List"); |
| 0 | 248 | | scope.Start(); |
| | 249 | | try |
| | 250 | | { |
| 0 | 251 | | var response = RestClient.List(cancellationToken); |
| 0 | 252 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 253 | | } |
| 0 | 254 | | catch (Exception e) |
| | 255 | | { |
| 0 | 256 | | scope.Failed(e); |
| 0 | 257 | | throw; |
| | 258 | | } |
| 0 | 259 | | } |
| | 260 | | Page<P2SVpnGateway> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 261 | | { |
| 0 | 262 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.List"); |
| 0 | 263 | | scope.Start(); |
| | 264 | | try |
| | 265 | | { |
| 0 | 266 | | var response = RestClient.ListNextPage(nextLink, cancellationToken); |
| 0 | 267 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 268 | | } |
| 0 | 269 | | catch (Exception e) |
| | 270 | | { |
| 0 | 271 | | scope.Failed(e); |
| 0 | 272 | | throw; |
| | 273 | | } |
| 0 | 274 | | } |
| 0 | 275 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 276 | | } |
| | 277 | |
|
| | 278 | | /// <summary> Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. |
| | 279 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 280 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 281 | | /// <param name="p2SVpnGatewayParameters"> Parameters supplied to create or Update a virtual wan p2s vpn gateway |
| | 282 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 283 | | public virtual async Task<P2SVpnGatewaysCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupNa |
| | 284 | | { |
| 0 | 285 | | if (resourceGroupName == null) |
| | 286 | | { |
| 0 | 287 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 288 | | } |
| 0 | 289 | | if (gatewayName == null) |
| | 290 | | { |
| 0 | 291 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 292 | | } |
| 0 | 293 | | if (p2SVpnGatewayParameters == null) |
| | 294 | | { |
| 0 | 295 | | throw new ArgumentNullException(nameof(p2SVpnGatewayParameters)); |
| | 296 | | } |
| | 297 | |
|
| 0 | 298 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartCreateOrUpdate"); |
| 0 | 299 | | scope.Start(); |
| | 300 | | try |
| | 301 | | { |
| 0 | 302 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewa |
| 0 | 303 | | return new P2SVpnGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateO |
| | 304 | | } |
| 0 | 305 | | catch (Exception e) |
| | 306 | | { |
| 0 | 307 | | scope.Failed(e); |
| 0 | 308 | | throw; |
| | 309 | | } |
| 0 | 310 | | } |
| | 311 | |
|
| | 312 | | /// <summary> Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. |
| | 313 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 314 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 315 | | /// <param name="p2SVpnGatewayParameters"> Parameters supplied to create or Update a virtual wan p2s vpn gateway |
| | 316 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 317 | | public virtual P2SVpnGatewaysCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string gatewa |
| | 318 | | { |
| 0 | 319 | | if (resourceGroupName == null) |
| | 320 | | { |
| 0 | 321 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 322 | | } |
| 0 | 323 | | if (gatewayName == null) |
| | 324 | | { |
| 0 | 325 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 326 | | } |
| 0 | 327 | | if (p2SVpnGatewayParameters == null) |
| | 328 | | { |
| 0 | 329 | | throw new ArgumentNullException(nameof(p2SVpnGatewayParameters)); |
| | 330 | | } |
| | 331 | |
|
| 0 | 332 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartCreateOrUpdate"); |
| 0 | 333 | | scope.Start(); |
| | 334 | | try |
| | 335 | | { |
| 0 | 336 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters |
| 0 | 337 | | return new P2SVpnGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateO |
| | 338 | | } |
| 0 | 339 | | catch (Exception e) |
| | 340 | | { |
| 0 | 341 | | scope.Failed(e); |
| 0 | 342 | | throw; |
| | 343 | | } |
| 0 | 344 | | } |
| | 345 | |
|
| | 346 | | /// <summary> Deletes a virtual wan p2s vpn gateway. </summary> |
| | 347 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 348 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 349 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 350 | | public virtual async Task<P2SVpnGatewaysDeleteOperation> StartDeleteAsync(string resourceGroupName, string gatew |
| | 351 | | { |
| 0 | 352 | | if (resourceGroupName == null) |
| | 353 | | { |
| 0 | 354 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 355 | | } |
| 0 | 356 | | if (gatewayName == null) |
| | 357 | | { |
| 0 | 358 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 359 | | } |
| | 360 | |
|
| 0 | 361 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartDelete"); |
| 0 | 362 | | scope.Start(); |
| | 363 | | try |
| | 364 | | { |
| 0 | 365 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, gatewayName, cancellationToken).C |
| 0 | 366 | | return new P2SVpnGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(r |
| | 367 | | } |
| 0 | 368 | | catch (Exception e) |
| | 369 | | { |
| 0 | 370 | | scope.Failed(e); |
| 0 | 371 | | throw; |
| | 372 | | } |
| 0 | 373 | | } |
| | 374 | |
|
| | 375 | | /// <summary> Deletes a virtual wan p2s vpn gateway. </summary> |
| | 376 | | /// <param name="resourceGroupName"> The resource group name of the P2SVpnGateway. </param> |
| | 377 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 378 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 379 | | public virtual P2SVpnGatewaysDeleteOperation StartDelete(string resourceGroupName, string gatewayName, Cancellat |
| | 380 | | { |
| 0 | 381 | | if (resourceGroupName == null) |
| | 382 | | { |
| 0 | 383 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 384 | | } |
| 0 | 385 | | if (gatewayName == null) |
| | 386 | | { |
| 0 | 387 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 388 | | } |
| | 389 | |
|
| 0 | 390 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartDelete"); |
| 0 | 391 | | scope.Start(); |
| | 392 | | try |
| | 393 | | { |
| 0 | 394 | | var originalResponse = RestClient.Delete(resourceGroupName, gatewayName, cancellationToken); |
| 0 | 395 | | return new P2SVpnGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(r |
| | 396 | | } |
| 0 | 397 | | catch (Exception e) |
| | 398 | | { |
| 0 | 399 | | scope.Failed(e); |
| 0 | 400 | | throw; |
| | 401 | | } |
| 0 | 402 | | } |
| | 403 | |
|
| | 404 | | /// <summary> Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. </summa |
| | 405 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 406 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 407 | | /// <param name="parameters"> Parameters supplied to the generate P2SVpnGateway VPN client package operation. </ |
| | 408 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 409 | | public virtual async Task<P2SVpnGatewaysGenerateVpnProfileOperation> StartGenerateVpnProfileAsync(string resourc |
| | 410 | | { |
| 0 | 411 | | if (resourceGroupName == null) |
| | 412 | | { |
| 0 | 413 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 414 | | } |
| 0 | 415 | | if (gatewayName == null) |
| | 416 | | { |
| 0 | 417 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 418 | | } |
| 0 | 419 | | if (parameters == null) |
| | 420 | | { |
| 0 | 421 | | throw new ArgumentNullException(nameof(parameters)); |
| | 422 | | } |
| | 423 | |
|
| 0 | 424 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGenerateVpnProfile"); |
| 0 | 425 | | scope.Start(); |
| | 426 | | try |
| | 427 | | { |
| 0 | 428 | | var originalResponse = await RestClient.GenerateVpnProfileAsync(resourceGroupName, gatewayName, paramete |
| 0 | 429 | | return new P2SVpnGatewaysGenerateVpnProfileOperation(_clientDiagnostics, _pipeline, RestClient.CreateGen |
| | 430 | | } |
| 0 | 431 | | catch (Exception e) |
| | 432 | | { |
| 0 | 433 | | scope.Failed(e); |
| 0 | 434 | | throw; |
| | 435 | | } |
| 0 | 436 | | } |
| | 437 | |
|
| | 438 | | /// <summary> Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. </summa |
| | 439 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 440 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 441 | | /// <param name="parameters"> Parameters supplied to the generate P2SVpnGateway VPN client package operation. </ |
| | 442 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 443 | | public virtual P2SVpnGatewaysGenerateVpnProfileOperation StartGenerateVpnProfile(string resourceGroupName, strin |
| | 444 | | { |
| 0 | 445 | | if (resourceGroupName == null) |
| | 446 | | { |
| 0 | 447 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 448 | | } |
| 0 | 449 | | if (gatewayName == null) |
| | 450 | | { |
| 0 | 451 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 452 | | } |
| 0 | 453 | | if (parameters == null) |
| | 454 | | { |
| 0 | 455 | | throw new ArgumentNullException(nameof(parameters)); |
| | 456 | | } |
| | 457 | |
|
| 0 | 458 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGenerateVpnProfile"); |
| 0 | 459 | | scope.Start(); |
| | 460 | | try |
| | 461 | | { |
| 0 | 462 | | var originalResponse = RestClient.GenerateVpnProfile(resourceGroupName, gatewayName, parameters, cancell |
| 0 | 463 | | return new P2SVpnGatewaysGenerateVpnProfileOperation(_clientDiagnostics, _pipeline, RestClient.CreateGen |
| | 464 | | } |
| 0 | 465 | | catch (Exception e) |
| | 466 | | { |
| 0 | 467 | | scope.Failed(e); |
| 0 | 468 | | throw; |
| | 469 | | } |
| 0 | 470 | | } |
| | 471 | |
|
| | 472 | | /// <summary> Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resour |
| | 473 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 474 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 475 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 476 | | public virtual async Task<P2SVpnGatewaysGetP2SVpnConnectionHealthOperation> StartGetP2SVpnConnectionHealthAsync( |
| | 477 | | { |
| 0 | 478 | | if (resourceGroupName == null) |
| | 479 | | { |
| 0 | 480 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 481 | | } |
| 0 | 482 | | if (gatewayName == null) |
| | 483 | | { |
| 0 | 484 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 485 | | } |
| | 486 | |
|
| 0 | 487 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGetP2SVpnConnectionHealth"); |
| 0 | 488 | | scope.Start(); |
| | 489 | | try |
| | 490 | | { |
| 0 | 491 | | var originalResponse = await RestClient.GetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName, c |
| 0 | 492 | | return new P2SVpnGatewaysGetP2SVpnConnectionHealthOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 493 | | } |
| 0 | 494 | | catch (Exception e) |
| | 495 | | { |
| 0 | 496 | | scope.Failed(e); |
| 0 | 497 | | throw; |
| | 498 | | } |
| 0 | 499 | | } |
| | 500 | |
|
| | 501 | | /// <summary> Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resour |
| | 502 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 503 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 504 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 505 | | public virtual P2SVpnGatewaysGetP2SVpnConnectionHealthOperation StartGetP2SVpnConnectionHealth(string resourceGr |
| | 506 | | { |
| 0 | 507 | | if (resourceGroupName == null) |
| | 508 | | { |
| 0 | 509 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 510 | | } |
| 0 | 511 | | if (gatewayName == null) |
| | 512 | | { |
| 0 | 513 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 514 | | } |
| | 515 | |
|
| 0 | 516 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGetP2SVpnConnectionHealth"); |
| 0 | 517 | | scope.Start(); |
| | 518 | | try |
| | 519 | | { |
| 0 | 520 | | var originalResponse = RestClient.GetP2SVpnConnectionHealth(resourceGroupName, gatewayName, cancellation |
| 0 | 521 | | return new P2SVpnGatewaysGetP2SVpnConnectionHealthOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 522 | | } |
| 0 | 523 | | catch (Exception e) |
| | 524 | | { |
| 0 | 525 | | scope.Failed(e); |
| 0 | 526 | | throw; |
| | 527 | | } |
| 0 | 528 | | } |
| | 529 | |
|
| | 530 | | /// <summary> Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGatew |
| | 531 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 532 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 533 | | /// <param name="request"> Request parameters supplied to get p2s vpn connections detailed health. </param> |
| | 534 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 535 | | public virtual async Task<P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedOperation> StartGetP2SVpnConnectionHeal |
| | 536 | | { |
| 0 | 537 | | if (resourceGroupName == null) |
| | 538 | | { |
| 0 | 539 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 540 | | } |
| 0 | 541 | | if (gatewayName == null) |
| | 542 | | { |
| 0 | 543 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 544 | | } |
| 0 | 545 | | if (request == null) |
| | 546 | | { |
| 0 | 547 | | throw new ArgumentNullException(nameof(request)); |
| | 548 | | } |
| | 549 | |
|
| 0 | 550 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGetP2SVpnConnectionHealthDet |
| 0 | 551 | | scope.Start(); |
| | 552 | | try |
| | 553 | | { |
| 0 | 554 | | var originalResponse = await RestClient.GetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewa |
| 0 | 555 | | return new P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedOperation(_clientDiagnostics, _pipeline, RestC |
| | 556 | | } |
| 0 | 557 | | catch (Exception e) |
| | 558 | | { |
| 0 | 559 | | scope.Failed(e); |
| 0 | 560 | | throw; |
| | 561 | | } |
| 0 | 562 | | } |
| | 563 | |
|
| | 564 | | /// <summary> Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGatew |
| | 565 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 566 | | /// <param name="gatewayName"> The name of the P2SVpnGateway. </param> |
| | 567 | | /// <param name="request"> Request parameters supplied to get p2s vpn connections detailed health. </param> |
| | 568 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 569 | | public virtual P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedOperation StartGetP2SVpnConnectionHealthDetailed(s |
| | 570 | | { |
| 0 | 571 | | if (resourceGroupName == null) |
| | 572 | | { |
| 0 | 573 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 574 | | } |
| 0 | 575 | | if (gatewayName == null) |
| | 576 | | { |
| 0 | 577 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 578 | | } |
| 0 | 579 | | if (request == null) |
| | 580 | | { |
| 0 | 581 | | throw new ArgumentNullException(nameof(request)); |
| | 582 | | } |
| | 583 | |
|
| 0 | 584 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartGetP2SVpnConnectionHealthDet |
| 0 | 585 | | scope.Start(); |
| | 586 | | try |
| | 587 | | { |
| 0 | 588 | | var originalResponse = RestClient.GetP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, requ |
| 0 | 589 | | return new P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedOperation(_clientDiagnostics, _pipeline, RestC |
| | 590 | | } |
| 0 | 591 | | catch (Exception e) |
| | 592 | | { |
| 0 | 593 | | scope.Failed(e); |
| 0 | 594 | | throw; |
| | 595 | | } |
| 0 | 596 | | } |
| | 597 | |
|
| | 598 | | /// <summary> Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. < |
| | 599 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 600 | | /// <param name="p2SVpnGatewayName"> The name of the P2S Vpn Gateway. </param> |
| | 601 | | /// <param name="request"> The parameters are supplied to disconnect p2s vpn connections. </param> |
| | 602 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 603 | | public virtual async Task<P2SVpnGatewaysDisconnectP2SVpnConnectionsOperation> StartDisconnectP2SVpnConnectionsAs |
| | 604 | | { |
| 0 | 605 | | if (resourceGroupName == null) |
| | 606 | | { |
| 0 | 607 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 608 | | } |
| 0 | 609 | | if (p2SVpnGatewayName == null) |
| | 610 | | { |
| 0 | 611 | | throw new ArgumentNullException(nameof(p2SVpnGatewayName)); |
| | 612 | | } |
| 0 | 613 | | if (request == null) |
| | 614 | | { |
| 0 | 615 | | throw new ArgumentNullException(nameof(request)); |
| | 616 | | } |
| | 617 | |
|
| 0 | 618 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartDisconnectP2SVpnConnections" |
| 0 | 619 | | scope.Start(); |
| | 620 | | try |
| | 621 | | { |
| 0 | 622 | | var originalResponse = await RestClient.DisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewa |
| 0 | 623 | | return new P2SVpnGatewaysDisconnectP2SVpnConnectionsOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 624 | | } |
| 0 | 625 | | catch (Exception e) |
| | 626 | | { |
| 0 | 627 | | scope.Failed(e); |
| 0 | 628 | | throw; |
| | 629 | | } |
| 0 | 630 | | } |
| | 631 | |
|
| | 632 | | /// <summary> Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. < |
| | 633 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 634 | | /// <param name="p2SVpnGatewayName"> The name of the P2S Vpn Gateway. </param> |
| | 635 | | /// <param name="request"> The parameters are supplied to disconnect p2s vpn connections. </param> |
| | 636 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 637 | | public virtual P2SVpnGatewaysDisconnectP2SVpnConnectionsOperation StartDisconnectP2SVpnConnections(string resour |
| | 638 | | { |
| 0 | 639 | | if (resourceGroupName == null) |
| | 640 | | { |
| 0 | 641 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 642 | | } |
| 0 | 643 | | if (p2SVpnGatewayName == null) |
| | 644 | | { |
| 0 | 645 | | throw new ArgumentNullException(nameof(p2SVpnGatewayName)); |
| | 646 | | } |
| 0 | 647 | | if (request == null) |
| | 648 | | { |
| 0 | 649 | | throw new ArgumentNullException(nameof(request)); |
| | 650 | | } |
| | 651 | |
|
| 0 | 652 | | using var scope = _clientDiagnostics.CreateScope("P2SVpnGatewaysOperations.StartDisconnectP2SVpnConnections" |
| 0 | 653 | | scope.Start(); |
| | 654 | | try |
| | 655 | | { |
| 0 | 656 | | var originalResponse = RestClient.DisconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, requ |
| 0 | 657 | | return new P2SVpnGatewaysDisconnectP2SVpnConnectionsOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 658 | | } |
| 0 | 659 | | catch (Exception e) |
| | 660 | | { |
| 0 | 661 | | scope.Failed(e); |
| 0 | 662 | | throw; |
| | 663 | | } |
| 0 | 664 | | } |
| | 665 | | } |
| | 666 | | } |