| | 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 ExpressRouteCircuitConnections service client. </summary> |
| | 19 | | public partial class ExpressRouteCircuitConnectionsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal ExpressRouteCircuitConnectionsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of ExpressRouteCircuitConnectionsOperations for mocking. </summary> |
| 0 | 25 | | protected ExpressRouteCircuitConnectionsOperations() |
| | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of ExpressRouteCircuitConnectionsOperations. </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 ExpressRouteCircuitConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, st |
| | 34 | | { |
| 0 | 35 | | RestClient = new ExpressRouteCircuitConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, e |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Gets the specified Express Route Circuit Connection from the specified express route circuit. </su |
| | 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 express route circuit connection. </param> |
| | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 46 | | public virtual async Task<Response<ExpressRouteCircuitConnection>> GetAsync(string resourceGroupName, string cir |
| | 47 | | { |
| 0 | 48 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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 Express Route Circuit Connection from the specified express route circuit. </su |
| | 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 express route circuit connection. </param> |
| | 66 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 67 | | public virtual Response<ExpressRouteCircuitConnection> Get(string resourceGroupName, string circuitName, string |
| | 68 | | { |
| 0 | 69 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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 connections associated with a private peering in an express route circuit. < |
| | 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<ExpressRouteCircuitConnection> ListAsync(string resourceGroupName, string circuitNa |
| | 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<ExpressRouteCircuitConnection>> FirstPageFunc(int? pageSizeHint) |
| | 103 | | { |
| 0 | 104 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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<ExpressRouteCircuitConnection>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 118 | | { |
| 0 | 119 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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 connections associated with a private peering in an express route circuit. < |
| | 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<ExpressRouteCircuitConnection> List(string resourceGroupName, string circuitName, string |
| | 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<ExpressRouteCircuitConnection> FirstPageFunc(int? pageSizeHint) |
| | 156 | | { |
| 0 | 157 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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<ExpressRouteCircuitConnection> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 171 | | { |
| 0 | 172 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.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 | | /// <summary> Deletes the specified Express Route Circuit Connection from the specified express route circuit. < |
| | 189 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 190 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 191 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 192 | | /// <param name="connectionName"> The name of the express route circuit connection. </param> |
| | 193 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 194 | | public virtual async Task<ExpressRouteCircuitConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupNa |
| | 195 | | { |
| 0 | 196 | | if (resourceGroupName == null) |
| | 197 | | { |
| 0 | 198 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 199 | | } |
| 0 | 200 | | if (circuitName == null) |
| | 201 | | { |
| 0 | 202 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 203 | | } |
| 0 | 204 | | if (peeringName == null) |
| | 205 | | { |
| 0 | 206 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 207 | | } |
| 0 | 208 | | if (connectionName == null) |
| | 209 | | { |
| 0 | 210 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 211 | | } |
| | 212 | |
|
| 0 | 213 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartDelete"); |
| 0 | 214 | | scope.Start(); |
| | 215 | | try |
| | 216 | | { |
| 0 | 217 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, circuitName, peeringName, connect |
| 0 | 218 | | return new ExpressRouteCircuitConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Creat |
| | 219 | | } |
| 0 | 220 | | catch (Exception e) |
| | 221 | | { |
| 0 | 222 | | scope.Failed(e); |
| 0 | 223 | | throw; |
| | 224 | | } |
| 0 | 225 | | } |
| | 226 | |
|
| | 227 | | /// <summary> Deletes the specified Express Route Circuit Connection from the specified express route circuit. < |
| | 228 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 229 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 230 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 231 | | /// <param name="connectionName"> The name of the express route circuit connection. </param> |
| | 232 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 233 | | public virtual ExpressRouteCircuitConnectionsDeleteOperation StartDelete(string resourceGroupName, string circui |
| | 234 | | { |
| 0 | 235 | | if (resourceGroupName == null) |
| | 236 | | { |
| 0 | 237 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 238 | | } |
| 0 | 239 | | if (circuitName == null) |
| | 240 | | { |
| 0 | 241 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 242 | | } |
| 0 | 243 | | if (peeringName == null) |
| | 244 | | { |
| 0 | 245 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 246 | | } |
| 0 | 247 | | if (connectionName == null) |
| | 248 | | { |
| 0 | 249 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 250 | | } |
| | 251 | |
|
| 0 | 252 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartDelete"); |
| 0 | 253 | | scope.Start(); |
| | 254 | | try |
| | 255 | | { |
| 0 | 256 | | var originalResponse = RestClient.Delete(resourceGroupName, circuitName, peeringName, connectionName, ca |
| 0 | 257 | | return new ExpressRouteCircuitConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Creat |
| | 258 | | } |
| 0 | 259 | | catch (Exception e) |
| | 260 | | { |
| 0 | 261 | | scope.Failed(e); |
| 0 | 262 | | throw; |
| | 263 | | } |
| 0 | 264 | | } |
| | 265 | |
|
| | 266 | | /// <summary> Creates or updates a Express Route Circuit Connection in the specified express route circuits. </s |
| | 267 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 268 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 269 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 270 | | /// <param name="connectionName"> The name of the express route circuit connection. </param> |
| | 271 | | /// <param name="expressRouteCircuitConnectionParameters"> Parameters supplied to the create or update express r |
| | 272 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 273 | | public virtual async Task<ExpressRouteCircuitConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string |
| | 274 | | { |
| 0 | 275 | | if (resourceGroupName == null) |
| | 276 | | { |
| 0 | 277 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 278 | | } |
| 0 | 279 | | if (circuitName == null) |
| | 280 | | { |
| 0 | 281 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 282 | | } |
| 0 | 283 | | if (peeringName == null) |
| | 284 | | { |
| 0 | 285 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 286 | | } |
| 0 | 287 | | if (connectionName == null) |
| | 288 | | { |
| 0 | 289 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 290 | | } |
| 0 | 291 | | if (expressRouteCircuitConnectionParameters == null) |
| | 292 | | { |
| 0 | 293 | | throw new ArgumentNullException(nameof(expressRouteCircuitConnectionParameters)); |
| | 294 | | } |
| | 295 | |
|
| 0 | 296 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartCreateOrUpda |
| 0 | 297 | | scope.Start(); |
| | 298 | | try |
| | 299 | | { |
| 0 | 300 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, |
| 0 | 301 | | return new ExpressRouteCircuitConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClie |
| | 302 | | } |
| 0 | 303 | | catch (Exception e) |
| | 304 | | { |
| 0 | 305 | | scope.Failed(e); |
| 0 | 306 | | throw; |
| | 307 | | } |
| 0 | 308 | | } |
| | 309 | |
|
| | 310 | | /// <summary> Creates or updates a Express Route Circuit Connection in the specified express route circuits. </s |
| | 311 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 312 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 313 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 314 | | /// <param name="connectionName"> The name of the express route circuit connection. </param> |
| | 315 | | /// <param name="expressRouteCircuitConnectionParameters"> Parameters supplied to the create or update express r |
| | 316 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 317 | | public virtual ExpressRouteCircuitConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupNam |
| | 318 | | { |
| 0 | 319 | | if (resourceGroupName == null) |
| | 320 | | { |
| 0 | 321 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 322 | | } |
| 0 | 323 | | if (circuitName == null) |
| | 324 | | { |
| 0 | 325 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 326 | | } |
| 0 | 327 | | if (peeringName == null) |
| | 328 | | { |
| 0 | 329 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 330 | | } |
| 0 | 331 | | if (connectionName == null) |
| | 332 | | { |
| 0 | 333 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 334 | | } |
| 0 | 335 | | if (expressRouteCircuitConnectionParameters == null) |
| | 336 | | { |
| 0 | 337 | | throw new ArgumentNullException(nameof(expressRouteCircuitConnectionParameters)); |
| | 338 | | } |
| | 339 | |
|
| 0 | 340 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartCreateOrUpda |
| 0 | 341 | | scope.Start(); |
| | 342 | | try |
| | 343 | | { |
| 0 | 344 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, circuitName, peeringName, connection |
| 0 | 345 | | return new ExpressRouteCircuitConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClie |
| | 346 | | } |
| 0 | 347 | | catch (Exception e) |
| | 348 | | { |
| 0 | 349 | | scope.Failed(e); |
| 0 | 350 | | throw; |
| | 351 | | } |
| 0 | 352 | | } |
| | 353 | | } |
| | 354 | | } |