| | 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.Text.Json; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.Network.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Network |
| | 18 | | { |
| | 19 | | internal partial class ExpressRouteCrossConnectionsRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private ClientDiagnostics _clientDiagnostics; |
| | 24 | | private HttpPipeline _pipeline; |
| | 25 | |
|
| | 26 | | /// <summary> Initializes a new instance of ExpressRouteCrossConnectionsRestOperations. </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> |
| | 31 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 0 | 32 | | public ExpressRouteCrossConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, st |
| | 33 | | { |
| 0 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 0 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 0 | 40 | | this.subscriptionId = subscriptionId; |
| 0 | 41 | | this.endpoint = endpoint; |
| 0 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 43 | | _pipeline = pipeline; |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | internal HttpMessage CreateListRequest() |
| | 47 | | { |
| 0 | 48 | | var message = _pipeline.CreateMessage(); |
| 0 | 49 | | var request = message.Request; |
| 0 | 50 | | request.Method = RequestMethod.Get; |
| 0 | 51 | | var uri = new RawRequestUriBuilder(); |
| 0 | 52 | | uri.Reset(endpoint); |
| 0 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 54 | | uri.AppendPath(subscriptionId, true); |
| 0 | 55 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections", false); |
| 0 | 56 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 57 | | request.Uri = uri; |
| 0 | 58 | | return message; |
| | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary> |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public async Task<Response<ExpressRouteCrossConnectionListResult>> ListAsync(CancellationToken cancellationToken |
| | 64 | | { |
| 0 | 65 | | using var message = CreateListRequest(); |
| 0 | 66 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 67 | | switch (message.Response.Status) |
| | 68 | | { |
| | 69 | | case 200: |
| | 70 | | { |
| 0 | 71 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 72 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 73 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 74 | | { |
| 0 | 75 | | value = null; |
| | 76 | | } |
| | 77 | | else |
| | 78 | | { |
| 0 | 79 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 80 | | } |
| 0 | 81 | | return Response.FromValue(value, message.Response); |
| | 82 | | } |
| | 83 | | default: |
| 0 | 84 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 85 | | } |
| 0 | 86 | | } |
| | 87 | |
|
| | 88 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary> |
| | 89 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 90 | | public Response<ExpressRouteCrossConnectionListResult> List(CancellationToken cancellationToken = default) |
| | 91 | | { |
| 0 | 92 | | using var message = CreateListRequest(); |
| 0 | 93 | | _pipeline.Send(message, cancellationToken); |
| 0 | 94 | | switch (message.Response.Status) |
| | 95 | | { |
| | 96 | | case 200: |
| | 97 | | { |
| 0 | 98 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 99 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 100 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 101 | | { |
| 0 | 102 | | value = null; |
| | 103 | | } |
| | 104 | | else |
| | 105 | | { |
| 0 | 106 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 107 | | } |
| 0 | 108 | | return Response.FromValue(value, message.Response); |
| | 109 | | } |
| | 110 | | default: |
| 0 | 111 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 112 | | } |
| 0 | 113 | | } |
| | 114 | |
|
| | 115 | | internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) |
| | 116 | | { |
| 0 | 117 | | var message = _pipeline.CreateMessage(); |
| 0 | 118 | | var request = message.Request; |
| 0 | 119 | | request.Method = RequestMethod.Get; |
| 0 | 120 | | var uri = new RawRequestUriBuilder(); |
| 0 | 121 | | uri.Reset(endpoint); |
| 0 | 122 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 123 | | uri.AppendPath(subscriptionId, true); |
| 0 | 124 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 125 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 126 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections", false); |
| 0 | 127 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 128 | | request.Uri = uri; |
| 0 | 129 | | return message; |
| | 130 | | } |
| | 131 | |
|
| | 132 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary> |
| | 133 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 134 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 135 | | public async Task<Response<ExpressRouteCrossConnectionListResult>> ListByResourceGroupAsync(string resourceGroup |
| | 136 | | { |
| 0 | 137 | | if (resourceGroupName == null) |
| | 138 | | { |
| 0 | 139 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 140 | | } |
| | 141 | |
|
| 0 | 142 | | using var message = CreateListByResourceGroupRequest(resourceGroupName); |
| 0 | 143 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 144 | | switch (message.Response.Status) |
| | 145 | | { |
| | 146 | | case 200: |
| | 147 | | { |
| 0 | 148 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 149 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 150 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 151 | | { |
| 0 | 152 | | value = null; |
| | 153 | | } |
| | 154 | | else |
| | 155 | | { |
| 0 | 156 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 157 | | } |
| 0 | 158 | | return Response.FromValue(value, message.Response); |
| | 159 | | } |
| | 160 | | default: |
| 0 | 161 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 162 | | } |
| 0 | 163 | | } |
| | 164 | |
|
| | 165 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary> |
| | 166 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 167 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 168 | | public Response<ExpressRouteCrossConnectionListResult> ListByResourceGroup(string resourceGroupName, Cancellatio |
| | 169 | | { |
| 0 | 170 | | if (resourceGroupName == null) |
| | 171 | | { |
| 0 | 172 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 173 | | } |
| | 174 | |
|
| 0 | 175 | | using var message = CreateListByResourceGroupRequest(resourceGroupName); |
| 0 | 176 | | _pipeline.Send(message, cancellationToken); |
| 0 | 177 | | switch (message.Response.Status) |
| | 178 | | { |
| | 179 | | case 200: |
| | 180 | | { |
| 0 | 181 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 182 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 183 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 184 | | { |
| 0 | 185 | | value = null; |
| | 186 | | } |
| | 187 | | else |
| | 188 | | { |
| 0 | 189 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 190 | | } |
| 0 | 191 | | return Response.FromValue(value, message.Response); |
| | 192 | | } |
| | 193 | | default: |
| 0 | 194 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 195 | | } |
| 0 | 196 | | } |
| | 197 | |
|
| | 198 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string crossConnectionName) |
| | 199 | | { |
| 0 | 200 | | var message = _pipeline.CreateMessage(); |
| 0 | 201 | | var request = message.Request; |
| 0 | 202 | | request.Method = RequestMethod.Get; |
| 0 | 203 | | var uri = new RawRequestUriBuilder(); |
| 0 | 204 | | uri.Reset(endpoint); |
| 0 | 205 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 206 | | uri.AppendPath(subscriptionId, true); |
| 0 | 207 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 208 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 209 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 210 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 211 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 212 | | request.Uri = uri; |
| 0 | 213 | | return message; |
| | 214 | | } |
| | 215 | |
|
| | 216 | | /// <summary> Gets details about the specified ExpressRouteCrossConnection. </summary> |
| | 217 | | /// <param name="resourceGroupName"> The name of the resource group (peering location of the circuit). </param> |
| | 218 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection (service key of the circuit). |
| | 219 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 220 | | public async Task<Response<ExpressRouteCrossConnection>> GetAsync(string resourceGroupName, string crossConnecti |
| | 221 | | { |
| 0 | 222 | | if (resourceGroupName == null) |
| | 223 | | { |
| 0 | 224 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 225 | | } |
| 0 | 226 | | if (crossConnectionName == null) |
| | 227 | | { |
| 0 | 228 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 229 | | } |
| | 230 | |
|
| 0 | 231 | | using var message = CreateGetRequest(resourceGroupName, crossConnectionName); |
| 0 | 232 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 233 | | switch (message.Response.Status) |
| | 234 | | { |
| | 235 | | case 200: |
| | 236 | | { |
| 0 | 237 | | ExpressRouteCrossConnection value = default; |
| 0 | 238 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 239 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 240 | | { |
| 0 | 241 | | value = null; |
| | 242 | | } |
| | 243 | | else |
| | 244 | | { |
| 0 | 245 | | value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem |
| | 246 | | } |
| 0 | 247 | | return Response.FromValue(value, message.Response); |
| | 248 | | } |
| | 249 | | default: |
| 0 | 250 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 251 | | } |
| 0 | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> Gets details about the specified ExpressRouteCrossConnection. </summary> |
| | 255 | | /// <param name="resourceGroupName"> The name of the resource group (peering location of the circuit). </param> |
| | 256 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection (service key of the circuit). |
| | 257 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 258 | | public Response<ExpressRouteCrossConnection> Get(string resourceGroupName, string crossConnectionName, Cancellat |
| | 259 | | { |
| 0 | 260 | | if (resourceGroupName == null) |
| | 261 | | { |
| 0 | 262 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 263 | | } |
| 0 | 264 | | if (crossConnectionName == null) |
| | 265 | | { |
| 0 | 266 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 267 | | } |
| | 268 | |
|
| 0 | 269 | | using var message = CreateGetRequest(resourceGroupName, crossConnectionName); |
| 0 | 270 | | _pipeline.Send(message, cancellationToken); |
| 0 | 271 | | switch (message.Response.Status) |
| | 272 | | { |
| | 273 | | case 200: |
| | 274 | | { |
| 0 | 275 | | ExpressRouteCrossConnection value = default; |
| 0 | 276 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 277 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 278 | | { |
| 0 | 279 | | value = null; |
| | 280 | | } |
| | 281 | | else |
| | 282 | | { |
| 0 | 283 | | value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem |
| | 284 | | } |
| 0 | 285 | | return Response.FromValue(value, message.Response); |
| | 286 | | } |
| | 287 | | default: |
| 0 | 288 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 289 | | } |
| 0 | 290 | | } |
| | 291 | |
|
| | 292 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string crossConnectionName, ExpressRo |
| | 293 | | { |
| 0 | 294 | | var message = _pipeline.CreateMessage(); |
| 0 | 295 | | var request = message.Request; |
| 0 | 296 | | request.Method = RequestMethod.Put; |
| 0 | 297 | | var uri = new RawRequestUriBuilder(); |
| 0 | 298 | | uri.Reset(endpoint); |
| 0 | 299 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 300 | | uri.AppendPath(subscriptionId, true); |
| 0 | 301 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 302 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 303 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 304 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 305 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 306 | | request.Uri = uri; |
| 0 | 307 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 308 | | var content = new Utf8JsonRequestContent(); |
| 0 | 309 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 310 | | request.Content = content; |
| 0 | 311 | | return message; |
| | 312 | | } |
| | 313 | |
|
| | 314 | | /// <summary> Update the specified ExpressRouteCrossConnection. </summary> |
| | 315 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 316 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 317 | | /// <param name="parameters"> Parameters supplied to the update express route crossConnection operation. </param |
| | 318 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 319 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string crossConnectionName, ExpressRou |
| | 320 | | { |
| 0 | 321 | | if (resourceGroupName == null) |
| | 322 | | { |
| 0 | 323 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 324 | | } |
| 0 | 325 | | if (crossConnectionName == null) |
| | 326 | | { |
| 0 | 327 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 328 | | } |
| 0 | 329 | | if (parameters == null) |
| | 330 | | { |
| 0 | 331 | | throw new ArgumentNullException(nameof(parameters)); |
| | 332 | | } |
| | 333 | |
|
| 0 | 334 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, crossConnectionName, parameters); |
| 0 | 335 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 336 | | switch (message.Response.Status) |
| | 337 | | { |
| | 338 | | case 200: |
| 0 | 339 | | return message.Response; |
| | 340 | | default: |
| 0 | 341 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 342 | | } |
| 0 | 343 | | } |
| | 344 | |
|
| | 345 | | /// <summary> Update the specified ExpressRouteCrossConnection. </summary> |
| | 346 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 347 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 348 | | /// <param name="parameters"> Parameters supplied to the update express route crossConnection operation. </param |
| | 349 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 350 | | public Response CreateOrUpdate(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection |
| | 351 | | { |
| 0 | 352 | | if (resourceGroupName == null) |
| | 353 | | { |
| 0 | 354 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 355 | | } |
| 0 | 356 | | if (crossConnectionName == null) |
| | 357 | | { |
| 0 | 358 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 359 | | } |
| 0 | 360 | | if (parameters == null) |
| | 361 | | { |
| 0 | 362 | | throw new ArgumentNullException(nameof(parameters)); |
| | 363 | | } |
| | 364 | |
|
| 0 | 365 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, crossConnectionName, parameters); |
| 0 | 366 | | _pipeline.Send(message, cancellationToken); |
| 0 | 367 | | switch (message.Response.Status) |
| | 368 | | { |
| | 369 | | case 200: |
| 0 | 370 | | return message.Response; |
| | 371 | | default: |
| 0 | 372 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 373 | | } |
| 0 | 374 | | } |
| | 375 | |
|
| | 376 | | internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string crossConnectionName, TagsObject cr |
| | 377 | | { |
| 0 | 378 | | var message = _pipeline.CreateMessage(); |
| 0 | 379 | | var request = message.Request; |
| 0 | 380 | | request.Method = RequestMethod.Patch; |
| 0 | 381 | | var uri = new RawRequestUriBuilder(); |
| 0 | 382 | | uri.Reset(endpoint); |
| 0 | 383 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 384 | | uri.AppendPath(subscriptionId, true); |
| 0 | 385 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 386 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 387 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 388 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 389 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 390 | | request.Uri = uri; |
| 0 | 391 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 392 | | var content = new Utf8JsonRequestContent(); |
| 0 | 393 | | content.JsonWriter.WriteObjectValue(crossConnectionParameters); |
| 0 | 394 | | request.Content = content; |
| 0 | 395 | | return message; |
| | 396 | | } |
| | 397 | |
|
| | 398 | | /// <summary> Updates an express route cross connection tags. </summary> |
| | 399 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 400 | | /// <param name="crossConnectionName"> The name of the cross connection. </param> |
| | 401 | | /// <param name="crossConnectionParameters"> Parameters supplied to update express route cross connection tags. |
| | 402 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 403 | | public async Task<Response<ExpressRouteCrossConnection>> UpdateTagsAsync(string resourceGroupName, string crossC |
| | 404 | | { |
| 0 | 405 | | if (resourceGroupName == null) |
| | 406 | | { |
| 0 | 407 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 408 | | } |
| 0 | 409 | | if (crossConnectionName == null) |
| | 410 | | { |
| 0 | 411 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 412 | | } |
| 0 | 413 | | if (crossConnectionParameters == null) |
| | 414 | | { |
| 0 | 415 | | throw new ArgumentNullException(nameof(crossConnectionParameters)); |
| | 416 | | } |
| | 417 | |
|
| 0 | 418 | | using var message = CreateUpdateTagsRequest(resourceGroupName, crossConnectionName, crossConnectionParameter |
| 0 | 419 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 420 | | switch (message.Response.Status) |
| | 421 | | { |
| | 422 | | case 200: |
| | 423 | | { |
| 0 | 424 | | ExpressRouteCrossConnection value = default; |
| 0 | 425 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 426 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 427 | | { |
| 0 | 428 | | value = null; |
| | 429 | | } |
| | 430 | | else |
| | 431 | | { |
| 0 | 432 | | value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem |
| | 433 | | } |
| 0 | 434 | | return Response.FromValue(value, message.Response); |
| | 435 | | } |
| | 436 | | default: |
| 0 | 437 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 438 | | } |
| 0 | 439 | | } |
| | 440 | |
|
| | 441 | | /// <summary> Updates an express route cross connection tags. </summary> |
| | 442 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 443 | | /// <param name="crossConnectionName"> The name of the cross connection. </param> |
| | 444 | | /// <param name="crossConnectionParameters"> Parameters supplied to update express route cross connection tags. |
| | 445 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 446 | | public Response<ExpressRouteCrossConnection> UpdateTags(string resourceGroupName, string crossConnectionName, Ta |
| | 447 | | { |
| 0 | 448 | | if (resourceGroupName == null) |
| | 449 | | { |
| 0 | 450 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 451 | | } |
| 0 | 452 | | if (crossConnectionName == null) |
| | 453 | | { |
| 0 | 454 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 455 | | } |
| 0 | 456 | | if (crossConnectionParameters == null) |
| | 457 | | { |
| 0 | 458 | | throw new ArgumentNullException(nameof(crossConnectionParameters)); |
| | 459 | | } |
| | 460 | |
|
| 0 | 461 | | using var message = CreateUpdateTagsRequest(resourceGroupName, crossConnectionName, crossConnectionParameter |
| 0 | 462 | | _pipeline.Send(message, cancellationToken); |
| 0 | 463 | | switch (message.Response.Status) |
| | 464 | | { |
| | 465 | | case 200: |
| | 466 | | { |
| 0 | 467 | | ExpressRouteCrossConnection value = default; |
| 0 | 468 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 469 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 470 | | { |
| 0 | 471 | | value = null; |
| | 472 | | } |
| | 473 | | else |
| | 474 | | { |
| 0 | 475 | | value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem |
| | 476 | | } |
| 0 | 477 | | return Response.FromValue(value, message.Response); |
| | 478 | | } |
| | 479 | | default: |
| 0 | 480 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 481 | | } |
| 0 | 482 | | } |
| | 483 | |
|
| | 484 | | internal HttpMessage CreateListArpTableRequest(string resourceGroupName, string crossConnectionName, string peer |
| | 485 | | { |
| 0 | 486 | | var message = _pipeline.CreateMessage(); |
| 0 | 487 | | var request = message.Request; |
| 0 | 488 | | request.Method = RequestMethod.Post; |
| 0 | 489 | | var uri = new RawRequestUriBuilder(); |
| 0 | 490 | | uri.Reset(endpoint); |
| 0 | 491 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 492 | | uri.AppendPath(subscriptionId, true); |
| 0 | 493 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 494 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 495 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 496 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 497 | | uri.AppendPath("/peerings/", false); |
| 0 | 498 | | uri.AppendPath(peeringName, true); |
| 0 | 499 | | uri.AppendPath("/arpTables/", false); |
| 0 | 500 | | uri.AppendPath(devicePath, true); |
| 0 | 501 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 502 | | request.Uri = uri; |
| 0 | 503 | | return message; |
| | 504 | | } |
| | 505 | |
|
| | 506 | | /// <summary> Gets the currently advertised ARP table associated with the express route cross connection in a re |
| | 507 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 508 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 509 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 510 | | /// <param name="devicePath"> The path of the device. </param> |
| | 511 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 512 | | public async Task<Response> ListArpTableAsync(string resourceGroupName, string crossConnectionName, string peeri |
| | 513 | | { |
| 0 | 514 | | if (resourceGroupName == null) |
| | 515 | | { |
| 0 | 516 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 517 | | } |
| 0 | 518 | | if (crossConnectionName == null) |
| | 519 | | { |
| 0 | 520 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 521 | | } |
| 0 | 522 | | if (peeringName == null) |
| | 523 | | { |
| 0 | 524 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 525 | | } |
| 0 | 526 | | if (devicePath == null) |
| | 527 | | { |
| 0 | 528 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 529 | | } |
| | 530 | |
|
| 0 | 531 | | using var message = CreateListArpTableRequest(resourceGroupName, crossConnectionName, peeringName, devicePat |
| 0 | 532 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 533 | | switch (message.Response.Status) |
| | 534 | | { |
| | 535 | | case 200: |
| | 536 | | case 202: |
| 0 | 537 | | return message.Response; |
| | 538 | | default: |
| 0 | 539 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 540 | | } |
| 0 | 541 | | } |
| | 542 | |
|
| | 543 | | /// <summary> Gets the currently advertised ARP table associated with the express route cross connection in a re |
| | 544 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 545 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 546 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 547 | | /// <param name="devicePath"> The path of the device. </param> |
| | 548 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 549 | | public Response ListArpTable(string resourceGroupName, string crossConnectionName, string peeringName, string de |
| | 550 | | { |
| 0 | 551 | | if (resourceGroupName == null) |
| | 552 | | { |
| 0 | 553 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 554 | | } |
| 0 | 555 | | if (crossConnectionName == null) |
| | 556 | | { |
| 0 | 557 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 558 | | } |
| 0 | 559 | | if (peeringName == null) |
| | 560 | | { |
| 0 | 561 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 562 | | } |
| 0 | 563 | | if (devicePath == null) |
| | 564 | | { |
| 0 | 565 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 566 | | } |
| | 567 | |
|
| 0 | 568 | | using var message = CreateListArpTableRequest(resourceGroupName, crossConnectionName, peeringName, devicePat |
| 0 | 569 | | _pipeline.Send(message, cancellationToken); |
| 0 | 570 | | switch (message.Response.Status) |
| | 571 | | { |
| | 572 | | case 200: |
| | 573 | | case 202: |
| 0 | 574 | | return message.Response; |
| | 575 | | default: |
| 0 | 576 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 577 | | } |
| 0 | 578 | | } |
| | 579 | |
|
| | 580 | | internal HttpMessage CreateListRoutesTableSummaryRequest(string resourceGroupName, string crossConnectionName, s |
| | 581 | | { |
| 0 | 582 | | var message = _pipeline.CreateMessage(); |
| 0 | 583 | | var request = message.Request; |
| 0 | 584 | | request.Method = RequestMethod.Post; |
| 0 | 585 | | var uri = new RawRequestUriBuilder(); |
| 0 | 586 | | uri.Reset(endpoint); |
| 0 | 587 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 588 | | uri.AppendPath(subscriptionId, true); |
| 0 | 589 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 590 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 591 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 592 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 593 | | uri.AppendPath("/peerings/", false); |
| 0 | 594 | | uri.AppendPath(peeringName, true); |
| 0 | 595 | | uri.AppendPath("/routeTablesSummary/", false); |
| 0 | 596 | | uri.AppendPath(devicePath, true); |
| 0 | 597 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 598 | | request.Uri = uri; |
| 0 | 599 | | return message; |
| | 600 | | } |
| | 601 | |
|
| | 602 | | /// <summary> Gets the route table summary associated with the express route cross connection in a resource grou |
| | 603 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 604 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 605 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 606 | | /// <param name="devicePath"> The path of the device. </param> |
| | 607 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 608 | | public async Task<Response> ListRoutesTableSummaryAsync(string resourceGroupName, string crossConnectionName, st |
| | 609 | | { |
| 0 | 610 | | if (resourceGroupName == null) |
| | 611 | | { |
| 0 | 612 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 613 | | } |
| 0 | 614 | | if (crossConnectionName == null) |
| | 615 | | { |
| 0 | 616 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 617 | | } |
| 0 | 618 | | if (peeringName == null) |
| | 619 | | { |
| 0 | 620 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 621 | | } |
| 0 | 622 | | if (devicePath == null) |
| | 623 | | { |
| 0 | 624 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 625 | | } |
| | 626 | |
|
| 0 | 627 | | using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, crossConnectionName, peeringName, |
| 0 | 628 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 629 | | switch (message.Response.Status) |
| | 630 | | { |
| | 631 | | case 200: |
| | 632 | | case 202: |
| 0 | 633 | | return message.Response; |
| | 634 | | default: |
| 0 | 635 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 636 | | } |
| 0 | 637 | | } |
| | 638 | |
|
| | 639 | | /// <summary> Gets the route table summary associated with the express route cross connection in a resource grou |
| | 640 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 641 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 642 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 643 | | /// <param name="devicePath"> The path of the device. </param> |
| | 644 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 645 | | public Response ListRoutesTableSummary(string resourceGroupName, string crossConnectionName, string peeringName, |
| | 646 | | { |
| 0 | 647 | | if (resourceGroupName == null) |
| | 648 | | { |
| 0 | 649 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 650 | | } |
| 0 | 651 | | if (crossConnectionName == null) |
| | 652 | | { |
| 0 | 653 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 654 | | } |
| 0 | 655 | | if (peeringName == null) |
| | 656 | | { |
| 0 | 657 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 658 | | } |
| 0 | 659 | | if (devicePath == null) |
| | 660 | | { |
| 0 | 661 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 662 | | } |
| | 663 | |
|
| 0 | 664 | | using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, crossConnectionName, peeringName, |
| 0 | 665 | | _pipeline.Send(message, cancellationToken); |
| 0 | 666 | | switch (message.Response.Status) |
| | 667 | | { |
| | 668 | | case 200: |
| | 669 | | case 202: |
| 0 | 670 | | return message.Response; |
| | 671 | | default: |
| 0 | 672 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 673 | | } |
| 0 | 674 | | } |
| | 675 | |
|
| | 676 | | internal HttpMessage CreateListRoutesTableRequest(string resourceGroupName, string crossConnectionName, string p |
| | 677 | | { |
| 0 | 678 | | var message = _pipeline.CreateMessage(); |
| 0 | 679 | | var request = message.Request; |
| 0 | 680 | | request.Method = RequestMethod.Post; |
| 0 | 681 | | var uri = new RawRequestUriBuilder(); |
| 0 | 682 | | uri.Reset(endpoint); |
| 0 | 683 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 684 | | uri.AppendPath(subscriptionId, true); |
| 0 | 685 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 686 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 687 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false); |
| 0 | 688 | | uri.AppendPath(crossConnectionName, true); |
| 0 | 689 | | uri.AppendPath("/peerings/", false); |
| 0 | 690 | | uri.AppendPath(peeringName, true); |
| 0 | 691 | | uri.AppendPath("/routeTables/", false); |
| 0 | 692 | | uri.AppendPath(devicePath, true); |
| 0 | 693 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 694 | | request.Uri = uri; |
| 0 | 695 | | return message; |
| | 696 | | } |
| | 697 | |
|
| | 698 | | /// <summary> Gets the currently advertised routes table associated with the express route cross connection in a |
| | 699 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 700 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 701 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 702 | | /// <param name="devicePath"> The path of the device. </param> |
| | 703 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 704 | | public async Task<Response> ListRoutesTableAsync(string resourceGroupName, string crossConnectionName, string pe |
| | 705 | | { |
| 0 | 706 | | if (resourceGroupName == null) |
| | 707 | | { |
| 0 | 708 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 709 | | } |
| 0 | 710 | | if (crossConnectionName == null) |
| | 711 | | { |
| 0 | 712 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 713 | | } |
| 0 | 714 | | if (peeringName == null) |
| | 715 | | { |
| 0 | 716 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 717 | | } |
| 0 | 718 | | if (devicePath == null) |
| | 719 | | { |
| 0 | 720 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 721 | | } |
| | 722 | |
|
| 0 | 723 | | using var message = CreateListRoutesTableRequest(resourceGroupName, crossConnectionName, peeringName, device |
| 0 | 724 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 725 | | switch (message.Response.Status) |
| | 726 | | { |
| | 727 | | case 200: |
| | 728 | | case 202: |
| 0 | 729 | | return message.Response; |
| | 730 | | default: |
| 0 | 731 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 732 | | } |
| 0 | 733 | | } |
| | 734 | |
|
| | 735 | | /// <summary> Gets the currently advertised routes table associated with the express route cross connection in a |
| | 736 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 737 | | /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param> |
| | 738 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 739 | | /// <param name="devicePath"> The path of the device. </param> |
| | 740 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 741 | | public Response ListRoutesTable(string resourceGroupName, string crossConnectionName, string peeringName, string |
| | 742 | | { |
| 0 | 743 | | if (resourceGroupName == null) |
| | 744 | | { |
| 0 | 745 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 746 | | } |
| 0 | 747 | | if (crossConnectionName == null) |
| | 748 | | { |
| 0 | 749 | | throw new ArgumentNullException(nameof(crossConnectionName)); |
| | 750 | | } |
| 0 | 751 | | if (peeringName == null) |
| | 752 | | { |
| 0 | 753 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 754 | | } |
| 0 | 755 | | if (devicePath == null) |
| | 756 | | { |
| 0 | 757 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 758 | | } |
| | 759 | |
|
| 0 | 760 | | using var message = CreateListRoutesTableRequest(resourceGroupName, crossConnectionName, peeringName, device |
| 0 | 761 | | _pipeline.Send(message, cancellationToken); |
| 0 | 762 | | switch (message.Response.Status) |
| | 763 | | { |
| | 764 | | case 200: |
| | 765 | | case 202: |
| 0 | 766 | | return message.Response; |
| | 767 | | default: |
| 0 | 768 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 769 | | } |
| 0 | 770 | | } |
| | 771 | |
|
| | 772 | | internal HttpMessage CreateListNextPageRequest(string nextLink) |
| | 773 | | { |
| 0 | 774 | | var message = _pipeline.CreateMessage(); |
| 0 | 775 | | var request = message.Request; |
| 0 | 776 | | request.Method = RequestMethod.Get; |
| 0 | 777 | | var uri = new RawRequestUriBuilder(); |
| 0 | 778 | | uri.Reset(endpoint); |
| 0 | 779 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 780 | | request.Uri = uri; |
| 0 | 781 | | return message; |
| | 782 | | } |
| | 783 | |
|
| | 784 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary> |
| | 785 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 786 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 787 | | public async Task<Response<ExpressRouteCrossConnectionListResult>> ListNextPageAsync(string nextLink, Cancellati |
| | 788 | | { |
| 0 | 789 | | if (nextLink == null) |
| | 790 | | { |
| 0 | 791 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 792 | | } |
| | 793 | |
|
| 0 | 794 | | using var message = CreateListNextPageRequest(nextLink); |
| 0 | 795 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 796 | | switch (message.Response.Status) |
| | 797 | | { |
| | 798 | | case 200: |
| | 799 | | { |
| 0 | 800 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 801 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 802 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 803 | | { |
| 0 | 804 | | value = null; |
| | 805 | | } |
| | 806 | | else |
| | 807 | | { |
| 0 | 808 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 809 | | } |
| 0 | 810 | | return Response.FromValue(value, message.Response); |
| | 811 | | } |
| | 812 | | default: |
| 0 | 813 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 814 | | } |
| 0 | 815 | | } |
| | 816 | |
|
| | 817 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary> |
| | 818 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 819 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 820 | | public Response<ExpressRouteCrossConnectionListResult> ListNextPage(string nextLink, CancellationToken cancellat |
| | 821 | | { |
| 0 | 822 | | if (nextLink == null) |
| | 823 | | { |
| 0 | 824 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 825 | | } |
| | 826 | |
|
| 0 | 827 | | using var message = CreateListNextPageRequest(nextLink); |
| 0 | 828 | | _pipeline.Send(message, cancellationToken); |
| 0 | 829 | | switch (message.Response.Status) |
| | 830 | | { |
| | 831 | | case 200: |
| | 832 | | { |
| 0 | 833 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 834 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 835 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 836 | | { |
| 0 | 837 | | value = null; |
| | 838 | | } |
| | 839 | | else |
| | 840 | | { |
| 0 | 841 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 842 | | } |
| 0 | 843 | | return Response.FromValue(value, message.Response); |
| | 844 | | } |
| | 845 | | default: |
| 0 | 846 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 847 | | } |
| 0 | 848 | | } |
| | 849 | |
|
| | 850 | | internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) |
| | 851 | | { |
| 0 | 852 | | var message = _pipeline.CreateMessage(); |
| 0 | 853 | | var request = message.Request; |
| 0 | 854 | | request.Method = RequestMethod.Get; |
| 0 | 855 | | var uri = new RawRequestUriBuilder(); |
| 0 | 856 | | uri.Reset(endpoint); |
| 0 | 857 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 858 | | request.Uri = uri; |
| 0 | 859 | | return message; |
| | 860 | | } |
| | 861 | |
|
| | 862 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary> |
| | 863 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 864 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 865 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 866 | | public async Task<Response<ExpressRouteCrossConnectionListResult>> ListByResourceGroupNextPageAsync(string nextL |
| | 867 | | { |
| 0 | 868 | | if (nextLink == null) |
| | 869 | | { |
| 0 | 870 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 871 | | } |
| 0 | 872 | | if (resourceGroupName == null) |
| | 873 | | { |
| 0 | 874 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 875 | | } |
| | 876 | |
|
| 0 | 877 | | using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); |
| 0 | 878 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 879 | | switch (message.Response.Status) |
| | 880 | | { |
| | 881 | | case 200: |
| | 882 | | { |
| 0 | 883 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 884 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 885 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 886 | | { |
| 0 | 887 | | value = null; |
| | 888 | | } |
| | 889 | | else |
| | 890 | | { |
| 0 | 891 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 892 | | } |
| 0 | 893 | | return Response.FromValue(value, message.Response); |
| | 894 | | } |
| | 895 | | default: |
| 0 | 896 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 897 | | } |
| 0 | 898 | | } |
| | 899 | |
|
| | 900 | | /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary> |
| | 901 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 902 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 903 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 904 | | public Response<ExpressRouteCrossConnectionListResult> ListByResourceGroupNextPage(string nextLink, string resou |
| | 905 | | { |
| 0 | 906 | | if (nextLink == null) |
| | 907 | | { |
| 0 | 908 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 909 | | } |
| 0 | 910 | | if (resourceGroupName == null) |
| | 911 | | { |
| 0 | 912 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 913 | | } |
| | 914 | |
|
| 0 | 915 | | using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); |
| 0 | 916 | | _pipeline.Send(message, cancellationToken); |
| 0 | 917 | | switch (message.Response.Status) |
| | 918 | | { |
| | 919 | | case 200: |
| | 920 | | { |
| 0 | 921 | | ExpressRouteCrossConnectionListResult value = default; |
| 0 | 922 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 923 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 924 | | { |
| 0 | 925 | | value = null; |
| | 926 | | } |
| | 927 | | else |
| | 928 | | { |
| 0 | 929 | | value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu |
| | 930 | | } |
| 0 | 931 | | return Response.FromValue(value, message.Response); |
| | 932 | | } |
| | 933 | | default: |
| 0 | 934 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 935 | | } |
| 0 | 936 | | } |
| | 937 | | } |
| | 938 | | } |