| | 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 ExpressRouteGatewaysRestOperations |
| | 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 ExpressRouteGatewaysRestOperations. </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 ExpressRouteGatewaysRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub |
| | 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 CreateListBySubscriptionRequest() |
| | 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/expressRouteGateways", false); |
| 0 | 56 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 57 | | request.Uri = uri; |
| 0 | 58 | | return message; |
| | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Lists ExpressRoute gateways under a given subscription. </summary> |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public async Task<Response<ExpressRouteGatewayList>> ListBySubscriptionAsync(CancellationToken cancellationToken |
| | 64 | | { |
| 0 | 65 | | using var message = CreateListBySubscriptionRequest(); |
| 0 | 66 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 67 | | switch (message.Response.Status) |
| | 68 | | { |
| | 69 | | case 200: |
| | 70 | | { |
| 0 | 71 | | ExpressRouteGatewayList 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 = ExpressRouteGatewayList.DeserializeExpressRouteGatewayList(document.RootElement); |
| | 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> Lists ExpressRoute gateways under a given subscription. </summary> |
| | 89 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 90 | | public Response<ExpressRouteGatewayList> ListBySubscription(CancellationToken cancellationToken = default) |
| | 91 | | { |
| 0 | 92 | | using var message = CreateListBySubscriptionRequest(); |
| 0 | 93 | | _pipeline.Send(message, cancellationToken); |
| 0 | 94 | | switch (message.Response.Status) |
| | 95 | | { |
| | 96 | | case 200: |
| | 97 | | { |
| 0 | 98 | | ExpressRouteGatewayList 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 = ExpressRouteGatewayList.DeserializeExpressRouteGatewayList(document.RootElement); |
| | 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/expressRouteGateways", false); |
| 0 | 127 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 128 | | request.Uri = uri; |
| 0 | 129 | | return message; |
| | 130 | | } |
| | 131 | |
|
| | 132 | | /// <summary> Lists ExpressRoute gateways in a given 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<ExpressRouteGatewayList>> ListByResourceGroupAsync(string resourceGroupName, Cancella |
| | 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 | | ExpressRouteGatewayList 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 = ExpressRouteGatewayList.DeserializeExpressRouteGatewayList(document.RootElement); |
| | 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> Lists ExpressRoute gateways in a given 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<ExpressRouteGatewayList> ListByResourceGroup(string resourceGroupName, CancellationToken cancell |
| | 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 | | ExpressRouteGatewayList 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 = ExpressRouteGatewayList.DeserializeExpressRouteGatewayList(document.RootElement); |
| | 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 CreateCreateOrUpdateRequest(string resourceGroupName, string expressRouteGatewayName, Expre |
| | 199 | | { |
| 0 | 200 | | var message = _pipeline.CreateMessage(); |
| 0 | 201 | | var request = message.Request; |
| 0 | 202 | | request.Method = RequestMethod.Put; |
| 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/expressRouteGateways/", false); |
| 0 | 210 | | uri.AppendPath(expressRouteGatewayName, true); |
| 0 | 211 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 212 | | request.Uri = uri; |
| 0 | 213 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 214 | | var content = new Utf8JsonRequestContent(); |
| 0 | 215 | | content.JsonWriter.WriteObjectValue(putExpressRouteGatewayParameters); |
| 0 | 216 | | request.Content = content; |
| 0 | 217 | | return message; |
| | 218 | | } |
| | 219 | |
|
| | 220 | | /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary> |
| | 221 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 222 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 223 | | /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation |
| | 224 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 225 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string expressRouteGatewayName, Expres |
| | 226 | | { |
| 0 | 227 | | if (resourceGroupName == null) |
| | 228 | | { |
| 0 | 229 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 230 | | } |
| 0 | 231 | | if (expressRouteGatewayName == null) |
| | 232 | | { |
| 0 | 233 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 234 | | } |
| 0 | 235 | | if (putExpressRouteGatewayParameters == null) |
| | 236 | | { |
| 0 | 237 | | throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters)); |
| | 238 | | } |
| | 239 | |
|
| 0 | 240 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, expressRouteGatewayName, putExpressRouteG |
| 0 | 241 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 242 | | switch (message.Response.Status) |
| | 243 | | { |
| | 244 | | case 200: |
| | 245 | | case 201: |
| 0 | 246 | | return message.Response; |
| | 247 | | default: |
| 0 | 248 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 249 | | } |
| 0 | 250 | | } |
| | 251 | |
|
| | 252 | | /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary> |
| | 253 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 254 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 255 | | /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation |
| | 256 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 257 | | public Response CreateOrUpdate(string resourceGroupName, string expressRouteGatewayName, ExpressRouteGateway put |
| | 258 | | { |
| 0 | 259 | | if (resourceGroupName == null) |
| | 260 | | { |
| 0 | 261 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 262 | | } |
| 0 | 263 | | if (expressRouteGatewayName == null) |
| | 264 | | { |
| 0 | 265 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 266 | | } |
| 0 | 267 | | if (putExpressRouteGatewayParameters == null) |
| | 268 | | { |
| 0 | 269 | | throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters)); |
| | 270 | | } |
| | 271 | |
|
| 0 | 272 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, expressRouteGatewayName, putExpressRouteG |
| 0 | 273 | | _pipeline.Send(message, cancellationToken); |
| 0 | 274 | | switch (message.Response.Status) |
| | 275 | | { |
| | 276 | | case 200: |
| | 277 | | case 201: |
| 0 | 278 | | return message.Response; |
| | 279 | | default: |
| 0 | 280 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 281 | | } |
| 0 | 282 | | } |
| | 283 | |
|
| | 284 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string expressRouteGatewayName) |
| | 285 | | { |
| 0 | 286 | | var message = _pipeline.CreateMessage(); |
| 0 | 287 | | var request = message.Request; |
| 0 | 288 | | request.Method = RequestMethod.Get; |
| 0 | 289 | | var uri = new RawRequestUriBuilder(); |
| 0 | 290 | | uri.Reset(endpoint); |
| 0 | 291 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 292 | | uri.AppendPath(subscriptionId, true); |
| 0 | 293 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 294 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 295 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteGateways/", false); |
| 0 | 296 | | uri.AppendPath(expressRouteGatewayName, true); |
| 0 | 297 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 298 | | request.Uri = uri; |
| 0 | 299 | | return message; |
| | 300 | | } |
| | 301 | |
|
| | 302 | | /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary> |
| | 303 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 304 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 305 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 306 | | public async Task<Response<ExpressRouteGateway>> GetAsync(string resourceGroupName, string expressRouteGatewayNa |
| | 307 | | { |
| 0 | 308 | | if (resourceGroupName == null) |
| | 309 | | { |
| 0 | 310 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 311 | | } |
| 0 | 312 | | if (expressRouteGatewayName == null) |
| | 313 | | { |
| 0 | 314 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 315 | | } |
| | 316 | |
|
| 0 | 317 | | using var message = CreateGetRequest(resourceGroupName, expressRouteGatewayName); |
| 0 | 318 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 319 | | switch (message.Response.Status) |
| | 320 | | { |
| | 321 | | case 200: |
| | 322 | | { |
| 0 | 323 | | ExpressRouteGateway value = default; |
| 0 | 324 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 325 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 326 | | { |
| 0 | 327 | | value = null; |
| | 328 | | } |
| | 329 | | else |
| | 330 | | { |
| 0 | 331 | | value = ExpressRouteGateway.DeserializeExpressRouteGateway(document.RootElement); |
| | 332 | | } |
| 0 | 333 | | return Response.FromValue(value, message.Response); |
| | 334 | | } |
| | 335 | | default: |
| 0 | 336 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 337 | | } |
| 0 | 338 | | } |
| | 339 | |
|
| | 340 | | /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary> |
| | 341 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 342 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 343 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 344 | | public Response<ExpressRouteGateway> Get(string resourceGroupName, string expressRouteGatewayName, CancellationT |
| | 345 | | { |
| 0 | 346 | | if (resourceGroupName == null) |
| | 347 | | { |
| 0 | 348 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 349 | | } |
| 0 | 350 | | if (expressRouteGatewayName == null) |
| | 351 | | { |
| 0 | 352 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 353 | | } |
| | 354 | |
|
| 0 | 355 | | using var message = CreateGetRequest(resourceGroupName, expressRouteGatewayName); |
| 0 | 356 | | _pipeline.Send(message, cancellationToken); |
| 0 | 357 | | switch (message.Response.Status) |
| | 358 | | { |
| | 359 | | case 200: |
| | 360 | | { |
| 0 | 361 | | ExpressRouteGateway value = default; |
| 0 | 362 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 363 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 364 | | { |
| 0 | 365 | | value = null; |
| | 366 | | } |
| | 367 | | else |
| | 368 | | { |
| 0 | 369 | | value = ExpressRouteGateway.DeserializeExpressRouteGateway(document.RootElement); |
| | 370 | | } |
| 0 | 371 | | return Response.FromValue(value, message.Response); |
| | 372 | | } |
| | 373 | | default: |
| 0 | 374 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 375 | | } |
| 0 | 376 | | } |
| | 377 | |
|
| | 378 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string expressRouteGatewayName) |
| | 379 | | { |
| 0 | 380 | | var message = _pipeline.CreateMessage(); |
| 0 | 381 | | var request = message.Request; |
| 0 | 382 | | request.Method = RequestMethod.Delete; |
| 0 | 383 | | var uri = new RawRequestUriBuilder(); |
| 0 | 384 | | uri.Reset(endpoint); |
| 0 | 385 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 386 | | uri.AppendPath(subscriptionId, true); |
| 0 | 387 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 388 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 389 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteGateways/", false); |
| 0 | 390 | | uri.AppendPath(expressRouteGatewayName, true); |
| 0 | 391 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 392 | | request.Uri = uri; |
| 0 | 393 | | return message; |
| | 394 | | } |
| | 395 | |
|
| | 396 | | /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c |
| | 397 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 398 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 399 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 400 | | public async Task<Response> DeleteAsync(string resourceGroupName, string expressRouteGatewayName, CancellationTo |
| | 401 | | { |
| 0 | 402 | | if (resourceGroupName == null) |
| | 403 | | { |
| 0 | 404 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 405 | | } |
| 0 | 406 | | if (expressRouteGatewayName == null) |
| | 407 | | { |
| 0 | 408 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 409 | | } |
| | 410 | |
|
| 0 | 411 | | using var message = CreateDeleteRequest(resourceGroupName, expressRouteGatewayName); |
| 0 | 412 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 413 | | switch (message.Response.Status) |
| | 414 | | { |
| | 415 | | case 200: |
| | 416 | | case 202: |
| | 417 | | case 204: |
| 0 | 418 | | return message.Response; |
| | 419 | | default: |
| 0 | 420 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 421 | | } |
| 0 | 422 | | } |
| | 423 | |
|
| | 424 | | /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c |
| | 425 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 426 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 427 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 428 | | public Response Delete(string resourceGroupName, string expressRouteGatewayName, CancellationToken cancellationT |
| | 429 | | { |
| 0 | 430 | | if (resourceGroupName == null) |
| | 431 | | { |
| 0 | 432 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 433 | | } |
| 0 | 434 | | if (expressRouteGatewayName == null) |
| | 435 | | { |
| 0 | 436 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 437 | | } |
| | 438 | |
|
| 0 | 439 | | using var message = CreateDeleteRequest(resourceGroupName, expressRouteGatewayName); |
| 0 | 440 | | _pipeline.Send(message, cancellationToken); |
| 0 | 441 | | switch (message.Response.Status) |
| | 442 | | { |
| | 443 | | case 200: |
| | 444 | | case 202: |
| | 445 | | case 204: |
| 0 | 446 | | return message.Response; |
| | 447 | | default: |
| 0 | 448 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 449 | | } |
| 0 | 450 | | } |
| | 451 | | } |
| | 452 | | } |