| | 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.Pipeline; |
| | 13 | | using Azure.ResourceManager.Network.Models; |
| | 14 | |
|
| | 15 | | namespace Azure.ResourceManager.Network |
| | 16 | | { |
| | 17 | | /// <summary> The ExpressRouteGateways service client. </summary> |
| | 18 | | public partial class ExpressRouteGatewaysOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal ExpressRouteGatewaysRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of ExpressRouteGatewaysOperations for mocking. </summary> |
| 0 | 24 | | protected ExpressRouteGatewaysOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | | /// <summary> Initializes a new instance of ExpressRouteGatewaysOperations. </summary> |
| | 28 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 29 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 30 | | /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| 0 | 32 | | internal ExpressRouteGatewaysOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc |
| | 33 | | { |
| 0 | 34 | | RestClient = new ExpressRouteGatewaysRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> Lists ExpressRoute gateways under a given subscription. </summary> |
| | 40 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 41 | | public virtual async Task<Response<ExpressRouteGatewayList>> ListBySubscriptionAsync(CancellationToken cancellat |
| | 42 | | { |
| 0 | 43 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListBySubscription"); |
| 0 | 44 | | scope.Start(); |
| | 45 | | try |
| | 46 | | { |
| 0 | 47 | | return await RestClient.ListBySubscriptionAsync(cancellationToken).ConfigureAwait(false); |
| | 48 | | } |
| 0 | 49 | | catch (Exception e) |
| | 50 | | { |
| 0 | 51 | | scope.Failed(e); |
| 0 | 52 | | throw; |
| | 53 | | } |
| 0 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> Lists ExpressRoute gateways under a given subscription. </summary> |
| | 57 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 58 | | public virtual Response<ExpressRouteGatewayList> ListBySubscription(CancellationToken cancellationToken = defaul |
| | 59 | | { |
| 0 | 60 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListBySubscription"); |
| 0 | 61 | | scope.Start(); |
| | 62 | | try |
| | 63 | | { |
| 0 | 64 | | return RestClient.ListBySubscription(cancellationToken); |
| | 65 | | } |
| 0 | 66 | | catch (Exception e) |
| | 67 | | { |
| 0 | 68 | | scope.Failed(e); |
| 0 | 69 | | throw; |
| | 70 | | } |
| 0 | 71 | | } |
| | 72 | |
|
| | 73 | | /// <summary> Lists ExpressRoute gateways in a given resource group. </summary> |
| | 74 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 75 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 76 | | public virtual async Task<Response<ExpressRouteGatewayList>> ListByResourceGroupAsync(string resourceGroupName, |
| | 77 | | { |
| 0 | 78 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListByResourceGroup"); |
| 0 | 79 | | scope.Start(); |
| | 80 | | try |
| | 81 | | { |
| 0 | 82 | | return await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).ConfigureAwait(fa |
| | 83 | | } |
| 0 | 84 | | catch (Exception e) |
| | 85 | | { |
| 0 | 86 | | scope.Failed(e); |
| 0 | 87 | | throw; |
| | 88 | | } |
| 0 | 89 | | } |
| | 90 | |
|
| | 91 | | /// <summary> Lists ExpressRoute gateways in a given resource group. </summary> |
| | 92 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 93 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 94 | | public virtual Response<ExpressRouteGatewayList> ListByResourceGroup(string resourceGroupName, CancellationToken |
| | 95 | | { |
| 0 | 96 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListByResourceGroup"); |
| 0 | 97 | | scope.Start(); |
| | 98 | | try |
| | 99 | | { |
| 0 | 100 | | return RestClient.ListByResourceGroup(resourceGroupName, cancellationToken); |
| | 101 | | } |
| 0 | 102 | | catch (Exception e) |
| | 103 | | { |
| 0 | 104 | | scope.Failed(e); |
| 0 | 105 | | throw; |
| | 106 | | } |
| 0 | 107 | | } |
| | 108 | |
|
| | 109 | | /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary> |
| | 110 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 111 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 112 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 113 | | public virtual async Task<Response<ExpressRouteGateway>> GetAsync(string resourceGroupName, string expressRouteG |
| | 114 | | { |
| 0 | 115 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.Get"); |
| 0 | 116 | | scope.Start(); |
| | 117 | | try |
| | 118 | | { |
| 0 | 119 | | return await RestClient.GetAsync(resourceGroupName, expressRouteGatewayName, cancellationToken).Configur |
| | 120 | | } |
| 0 | 121 | | catch (Exception e) |
| | 122 | | { |
| 0 | 123 | | scope.Failed(e); |
| 0 | 124 | | throw; |
| | 125 | | } |
| 0 | 126 | | } |
| | 127 | |
|
| | 128 | | /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary> |
| | 129 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 130 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 131 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 132 | | public virtual Response<ExpressRouteGateway> Get(string resourceGroupName, string expressRouteGatewayName, Cance |
| | 133 | | { |
| 0 | 134 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.Get"); |
| 0 | 135 | | scope.Start(); |
| | 136 | | try |
| | 137 | | { |
| 0 | 138 | | return RestClient.Get(resourceGroupName, expressRouteGatewayName, cancellationToken); |
| | 139 | | } |
| 0 | 140 | | catch (Exception e) |
| | 141 | | { |
| 0 | 142 | | scope.Failed(e); |
| 0 | 143 | | throw; |
| | 144 | | } |
| 0 | 145 | | } |
| | 146 | |
|
| | 147 | | /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary> |
| | 148 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 149 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 150 | | /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation |
| | 151 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 152 | | public virtual async Task<ExpressRouteGatewaysCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceG |
| | 153 | | { |
| 0 | 154 | | if (resourceGroupName == null) |
| | 155 | | { |
| 0 | 156 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 157 | | } |
| 0 | 158 | | if (expressRouteGatewayName == null) |
| | 159 | | { |
| 0 | 160 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 161 | | } |
| 0 | 162 | | if (putExpressRouteGatewayParameters == null) |
| | 163 | | { |
| 0 | 164 | | throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters)); |
| | 165 | | } |
| | 166 | |
|
| 0 | 167 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartCreateOrUpdate"); |
| 0 | 168 | | scope.Start(); |
| | 169 | | try |
| | 170 | | { |
| 0 | 171 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, |
| 0 | 172 | | return new ExpressRouteGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC |
| | 173 | | } |
| 0 | 174 | | catch (Exception e) |
| | 175 | | { |
| 0 | 176 | | scope.Failed(e); |
| 0 | 177 | | throw; |
| | 178 | | } |
| 0 | 179 | | } |
| | 180 | |
|
| | 181 | | /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary> |
| | 182 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 183 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 184 | | /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation |
| | 185 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 186 | | public virtual ExpressRouteGatewaysCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string |
| | 187 | | { |
| 0 | 188 | | if (resourceGroupName == null) |
| | 189 | | { |
| 0 | 190 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 191 | | } |
| 0 | 192 | | if (expressRouteGatewayName == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 195 | | } |
| 0 | 196 | | if (putExpressRouteGatewayParameters == null) |
| | 197 | | { |
| 0 | 198 | | throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters)); |
| | 199 | | } |
| | 200 | |
|
| 0 | 201 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartCreateOrUpdate"); |
| 0 | 202 | | scope.Start(); |
| | 203 | | try |
| | 204 | | { |
| 0 | 205 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressR |
| 0 | 206 | | return new ExpressRouteGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC |
| | 207 | | } |
| 0 | 208 | | catch (Exception e) |
| | 209 | | { |
| 0 | 210 | | scope.Failed(e); |
| 0 | 211 | | throw; |
| | 212 | | } |
| 0 | 213 | | } |
| | 214 | |
|
| | 215 | | /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c |
| | 216 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 217 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 218 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 219 | | public virtual async Task<ExpressRouteGatewaysDeleteOperation> StartDeleteAsync(string resourceGroupName, string |
| | 220 | | { |
| 0 | 221 | | if (resourceGroupName == null) |
| | 222 | | { |
| 0 | 223 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 224 | | } |
| 0 | 225 | | if (expressRouteGatewayName == null) |
| | 226 | | { |
| 0 | 227 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 228 | | } |
| | 229 | |
|
| 0 | 230 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartDelete"); |
| 0 | 231 | | scope.Start(); |
| | 232 | | try |
| | 233 | | { |
| 0 | 234 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, expressRouteGatewayName, cancella |
| 0 | 235 | | return new ExpressRouteGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq |
| | 236 | | } |
| 0 | 237 | | catch (Exception e) |
| | 238 | | { |
| 0 | 239 | | scope.Failed(e); |
| 0 | 240 | | throw; |
| | 241 | | } |
| 0 | 242 | | } |
| | 243 | |
|
| | 244 | | /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c |
| | 245 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 246 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 247 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 248 | | public virtual ExpressRouteGatewaysDeleteOperation StartDelete(string resourceGroupName, string expressRouteGate |
| | 249 | | { |
| 0 | 250 | | if (resourceGroupName == null) |
| | 251 | | { |
| 0 | 252 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 253 | | } |
| 0 | 254 | | if (expressRouteGatewayName == null) |
| | 255 | | { |
| 0 | 256 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 257 | | } |
| | 258 | |
|
| 0 | 259 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartDelete"); |
| 0 | 260 | | scope.Start(); |
| | 261 | | try |
| | 262 | | { |
| 0 | 263 | | var originalResponse = RestClient.Delete(resourceGroupName, expressRouteGatewayName, cancellationToken); |
| 0 | 264 | | return new ExpressRouteGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq |
| | 265 | | } |
| 0 | 266 | | catch (Exception e) |
| | 267 | | { |
| 0 | 268 | | scope.Failed(e); |
| 0 | 269 | | throw; |
| | 270 | | } |
| 0 | 271 | | } |
| | 272 | | } |
| | 273 | | } |