| | 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 PeerExpressRouteCircuitConnections service client. </summary> |
| | 19 | | public partial class PeerExpressRouteCircuitConnectionsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal PeerExpressRouteCircuitConnectionsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of PeerExpressRouteCircuitConnectionsOperations for mocking. </summary> |
| 0 | 25 | | protected PeerExpressRouteCircuitConnectionsOperations() |
| | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of PeerExpressRouteCircuitConnectionsOperations. </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 PeerExpressRouteCircuitConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline |
| | 34 | | { |
| 0 | 35 | | RestClient = new PeerExpressRouteCircuitConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionI |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 42 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 43 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 44 | | /// <param name="connectionName"> The name of the peer express route circuit connection. </param> |
| | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 46 | | public virtual async Task<Response<PeerExpressRouteCircuitConnection>> GetAsync(string resourceGroupName, string |
| | 47 | | { |
| 0 | 48 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.Get"); |
| 0 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 0 | 52 | | return await RestClient.GetAsync(resourceGroupName, circuitName, peeringName, connectionName, cancellati |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 0 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. |
| | 62 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 63 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 64 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 65 | | /// <param name="connectionName"> The name of the peer express route circuit connection. </param> |
| | 66 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 67 | | public virtual Response<PeerExpressRouteCircuitConnection> Get(string resourceGroupName, string circuitName, str |
| | 68 | | { |
| 0 | 69 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.Get"); |
| 0 | 70 | | scope.Start(); |
| | 71 | | try |
| | 72 | | { |
| 0 | 73 | | return RestClient.Get(resourceGroupName, circuitName, peeringName, connectionName, cancellationToken); |
| | 74 | | } |
| 0 | 75 | | catch (Exception e) |
| | 76 | | { |
| 0 | 77 | | scope.Failed(e); |
| 0 | 78 | | throw; |
| | 79 | | } |
| 0 | 80 | | } |
| | 81 | |
|
| | 82 | | /// <summary> Gets all global reach peer connections associated with a private peering in an express route circu |
| | 83 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 84 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 85 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 86 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 87 | | public virtual AsyncPageable<PeerExpressRouteCircuitConnection> ListAsync(string resourceGroupName, string circu |
| | 88 | | { |
| 0 | 89 | | if (resourceGroupName == null) |
| | 90 | | { |
| 0 | 91 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 92 | | } |
| 0 | 93 | | if (circuitName == null) |
| | 94 | | { |
| 0 | 95 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 96 | | } |
| 0 | 97 | | if (peeringName == null) |
| | 98 | | { |
| 0 | 99 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 100 | | } |
| | 101 | |
|
| | 102 | | async Task<Page<PeerExpressRouteCircuitConnection>> FirstPageFunc(int? pageSizeHint) |
| | 103 | | { |
| 0 | 104 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.List"); |
| 0 | 105 | | scope.Start(); |
| | 106 | | try |
| | 107 | | { |
| 0 | 108 | | var response = await RestClient.ListAsync(resourceGroupName, circuitName, peeringName, cancellationT |
| 0 | 109 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 110 | | } |
| 0 | 111 | | catch (Exception e) |
| | 112 | | { |
| 0 | 113 | | scope.Failed(e); |
| 0 | 114 | | throw; |
| | 115 | | } |
| 0 | 116 | | } |
| | 117 | | async Task<Page<PeerExpressRouteCircuitConnection>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 118 | | { |
| 0 | 119 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.List"); |
| 0 | 120 | | scope.Start(); |
| | 121 | | try |
| | 122 | | { |
| 0 | 123 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, circuitName, peeringN |
| 0 | 124 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 125 | | } |
| 0 | 126 | | catch (Exception e) |
| | 127 | | { |
| 0 | 128 | | scope.Failed(e); |
| 0 | 129 | | throw; |
| | 130 | | } |
| 0 | 131 | | } |
| 0 | 132 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 133 | | } |
| | 134 | |
|
| | 135 | | /// <summary> Gets all global reach peer connections associated with a private peering in an express route circu |
| | 136 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 137 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 138 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 139 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 140 | | public virtual Pageable<PeerExpressRouteCircuitConnection> List(string resourceGroupName, string circuitName, st |
| | 141 | | { |
| 0 | 142 | | if (resourceGroupName == null) |
| | 143 | | { |
| 0 | 144 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 145 | | } |
| 0 | 146 | | if (circuitName == null) |
| | 147 | | { |
| 0 | 148 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 149 | | } |
| 0 | 150 | | if (peeringName == null) |
| | 151 | | { |
| 0 | 152 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 153 | | } |
| | 154 | |
|
| | 155 | | Page<PeerExpressRouteCircuitConnection> FirstPageFunc(int? pageSizeHint) |
| | 156 | | { |
| 0 | 157 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.List"); |
| 0 | 158 | | scope.Start(); |
| | 159 | | try |
| | 160 | | { |
| 0 | 161 | | var response = RestClient.List(resourceGroupName, circuitName, peeringName, cancellationToken); |
| 0 | 162 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 163 | | } |
| 0 | 164 | | catch (Exception e) |
| | 165 | | { |
| 0 | 166 | | scope.Failed(e); |
| 0 | 167 | | throw; |
| | 168 | | } |
| 0 | 169 | | } |
| | 170 | | Page<PeerExpressRouteCircuitConnection> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 171 | | { |
| 0 | 172 | | using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.List"); |
| 0 | 173 | | scope.Start(); |
| | 174 | | try |
| | 175 | | { |
| 0 | 176 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, circuitName, peeringName, cancel |
| 0 | 177 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 178 | | } |
| 0 | 179 | | catch (Exception e) |
| | 180 | | { |
| 0 | 181 | | scope.Failed(e); |
| 0 | 182 | | throw; |
| | 183 | | } |
| 0 | 184 | | } |
| 0 | 185 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 186 | | } |
| | 187 | | } |
| | 188 | | } |