| | | 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.Core.Pipeline; |
| | | 12 | | using Azure.ResourceManager.Network.Models; |
| | | 13 | | |
| | | 14 | | namespace Azure.ResourceManager.Network |
| | | 15 | | { |
| | | 16 | | /// <summary> The VpnSitesConfiguration service client. </summary> |
| | | 17 | | public partial class VpnSitesConfigurationOperations |
| | | 18 | | { |
| | | 19 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 20 | | private readonly HttpPipeline _pipeline; |
| | 0 | 21 | | internal VpnSitesConfigurationRestOperations RestClient { get; } |
| | | 22 | | /// <summary> Initializes a new instance of VpnSitesConfigurationOperations for mocking. </summary> |
| | 0 | 23 | | protected VpnSitesConfigurationOperations() |
| | | 24 | | { |
| | 0 | 25 | | } |
| | | 26 | | /// <summary> Initializes a new instance of VpnSitesConfigurationOperations. </summary> |
| | | 27 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | | 28 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | | 29 | | /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | | 30 | | /// <param name="endpoint"> server parameter. </param> |
| | 0 | 31 | | internal VpnSitesConfigurationOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subs |
| | | 32 | | { |
| | 0 | 33 | | RestClient = new VpnSitesConfigurationRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| | 0 | 34 | | _clientDiagnostics = clientDiagnostics; |
| | 0 | 35 | | _pipeline = pipeline; |
| | 0 | 36 | | } |
| | | 37 | | |
| | | 38 | | /// <summary> Gives the sas-url to download the configurations for vpn-sites in a resource group. </summary> |
| | | 39 | | /// <param name="resourceGroupName"> The resource group name. </param> |
| | | 40 | | /// <param name="virtualWANName"> The name of the VirtualWAN for which configuration of all vpn-sites is needed. |
| | | 41 | | /// <param name="request"> Parameters supplied to download vpn-sites configuration. </param> |
| | | 42 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 43 | | public virtual async Task<VpnSitesConfigurationDownloadOperation> StartDownloadAsync(string resourceGroupName, s |
| | | 44 | | { |
| | 0 | 45 | | if (resourceGroupName == null) |
| | | 46 | | { |
| | 0 | 47 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 48 | | } |
| | 0 | 49 | | if (virtualWANName == null) |
| | | 50 | | { |
| | 0 | 51 | | throw new ArgumentNullException(nameof(virtualWANName)); |
| | | 52 | | } |
| | 0 | 53 | | if (request == null) |
| | | 54 | | { |
| | 0 | 55 | | throw new ArgumentNullException(nameof(request)); |
| | | 56 | | } |
| | | 57 | | |
| | 0 | 58 | | using var scope = _clientDiagnostics.CreateScope("VpnSitesConfigurationOperations.StartDownload"); |
| | 0 | 59 | | scope.Start(); |
| | | 60 | | try |
| | | 61 | | { |
| | 0 | 62 | | var originalResponse = await RestClient.DownloadAsync(resourceGroupName, virtualWANName, request, cancel |
| | 0 | 63 | | return new VpnSitesConfigurationDownloadOperation(_clientDiagnostics, _pipeline, RestClient.CreateDownlo |
| | | 64 | | } |
| | 0 | 65 | | catch (Exception e) |
| | | 66 | | { |
| | 0 | 67 | | scope.Failed(e); |
| | 0 | 68 | | throw; |
| | | 69 | | } |
| | 0 | 70 | | } |
| | | 71 | | |
| | | 72 | | /// <summary> Gives the sas-url to download the configurations for vpn-sites in a resource group. </summary> |
| | | 73 | | /// <param name="resourceGroupName"> The resource group name. </param> |
| | | 74 | | /// <param name="virtualWANName"> The name of the VirtualWAN for which configuration of all vpn-sites is needed. |
| | | 75 | | /// <param name="request"> Parameters supplied to download vpn-sites configuration. </param> |
| | | 76 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 77 | | public virtual VpnSitesConfigurationDownloadOperation StartDownload(string resourceGroupName, string virtualWANN |
| | | 78 | | { |
| | 0 | 79 | | if (resourceGroupName == null) |
| | | 80 | | { |
| | 0 | 81 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 82 | | } |
| | 0 | 83 | | if (virtualWANName == null) |
| | | 84 | | { |
| | 0 | 85 | | throw new ArgumentNullException(nameof(virtualWANName)); |
| | | 86 | | } |
| | 0 | 87 | | if (request == null) |
| | | 88 | | { |
| | 0 | 89 | | throw new ArgumentNullException(nameof(request)); |
| | | 90 | | } |
| | | 91 | | |
| | 0 | 92 | | using var scope = _clientDiagnostics.CreateScope("VpnSitesConfigurationOperations.StartDownload"); |
| | 0 | 93 | | scope.Start(); |
| | | 94 | | try |
| | | 95 | | { |
| | 0 | 96 | | var originalResponse = RestClient.Download(resourceGroupName, virtualWANName, request, cancellationToken |
| | 0 | 97 | | return new VpnSitesConfigurationDownloadOperation(_clientDiagnostics, _pipeline, RestClient.CreateDownlo |
| | | 98 | | } |
| | 0 | 99 | | catch (Exception e) |
| | | 100 | | { |
| | 0 | 101 | | scope.Failed(e); |
| | 0 | 102 | | throw; |
| | | 103 | | } |
| | 0 | 104 | | } |
| | | 105 | | } |
| | | 106 | | } |