| | 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 VpnLinkConnections service client. </summary> |
| | 19 | | public partial class VpnLinkConnectionsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal VpnLinkConnectionsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of VpnLinkConnectionsOperations for mocking. </summary> |
| 0 | 25 | | protected VpnLinkConnectionsOperations() |
| | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of VpnLinkConnectionsOperations. </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 VpnLinkConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri |
| | 34 | | { |
| 0 | 35 | | RestClient = new VpnLinkConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. < |
| | 41 | | /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param> |
| | 42 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 43 | | /// <param name="connectionName"> The name of the vpn connection. </param> |
| | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 45 | | public virtual AsyncPageable<VpnSiteLinkConnection> ListByVpnConnectionAsync(string resourceGroupName, string ga |
| | 46 | | { |
| 0 | 47 | | if (resourceGroupName == null) |
| | 48 | | { |
| 0 | 49 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 50 | | } |
| 0 | 51 | | if (gatewayName == null) |
| | 52 | | { |
| 0 | 53 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 54 | | } |
| 0 | 55 | | if (connectionName == null) |
| | 56 | | { |
| 0 | 57 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 58 | | } |
| | 59 | |
|
| | 60 | | async Task<Page<VpnSiteLinkConnection>> FirstPageFunc(int? pageSizeHint) |
| | 61 | | { |
| 0 | 62 | | using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection"); |
| 0 | 63 | | scope.Start(); |
| | 64 | | try |
| | 65 | | { |
| 0 | 66 | | var response = await RestClient.ListByVpnConnectionAsync(resourceGroupName, gatewayName, connectionN |
| 0 | 67 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 68 | | } |
| 0 | 69 | | catch (Exception e) |
| | 70 | | { |
| 0 | 71 | | scope.Failed(e); |
| 0 | 72 | | throw; |
| | 73 | | } |
| 0 | 74 | | } |
| | 75 | | async Task<Page<VpnSiteLinkConnection>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 76 | | { |
| 0 | 77 | | using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection"); |
| 0 | 78 | | scope.Start(); |
| | 79 | | try |
| | 80 | | { |
| 0 | 81 | | var response = await RestClient.ListByVpnConnectionNextPageAsync(nextLink, resourceGroupName, gatewa |
| 0 | 82 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 83 | | } |
| 0 | 84 | | catch (Exception e) |
| | 85 | | { |
| 0 | 86 | | scope.Failed(e); |
| 0 | 87 | | throw; |
| | 88 | | } |
| 0 | 89 | | } |
| 0 | 90 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 91 | | } |
| | 92 | |
|
| | 93 | | /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. < |
| | 94 | | /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param> |
| | 95 | | /// <param name="gatewayName"> The name of the gateway. </param> |
| | 96 | | /// <param name="connectionName"> The name of the vpn connection. </param> |
| | 97 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 98 | | public virtual Pageable<VpnSiteLinkConnection> ListByVpnConnection(string resourceGroupName, string gatewayName, |
| | 99 | | { |
| 0 | 100 | | if (resourceGroupName == null) |
| | 101 | | { |
| 0 | 102 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 103 | | } |
| 0 | 104 | | if (gatewayName == null) |
| | 105 | | { |
| 0 | 106 | | throw new ArgumentNullException(nameof(gatewayName)); |
| | 107 | | } |
| 0 | 108 | | if (connectionName == null) |
| | 109 | | { |
| 0 | 110 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 111 | | } |
| | 112 | |
|
| | 113 | | Page<VpnSiteLinkConnection> FirstPageFunc(int? pageSizeHint) |
| | 114 | | { |
| 0 | 115 | | using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection"); |
| 0 | 116 | | scope.Start(); |
| | 117 | | try |
| | 118 | | { |
| 0 | 119 | | var response = RestClient.ListByVpnConnection(resourceGroupName, gatewayName, connectionName, cancel |
| 0 | 120 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 121 | | } |
| 0 | 122 | | catch (Exception e) |
| | 123 | | { |
| 0 | 124 | | scope.Failed(e); |
| 0 | 125 | | throw; |
| | 126 | | } |
| 0 | 127 | | } |
| | 128 | | Page<VpnSiteLinkConnection> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 129 | | { |
| 0 | 130 | | using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection"); |
| 0 | 131 | | scope.Start(); |
| | 132 | | try |
| | 133 | | { |
| 0 | 134 | | var response = RestClient.ListByVpnConnectionNextPage(nextLink, resourceGroupName, gatewayName, conn |
| 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 | | } |
| 0 | 143 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 144 | | } |
| | 145 | | } |
| | 146 | | } |