| | 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 ExpressRouteConnections service client. </summary> |
| | 18 | | public partial class ExpressRouteConnectionsOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal ExpressRouteConnectionsRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of ExpressRouteConnectionsOperations for mocking. </summary> |
| 0 | 24 | | protected ExpressRouteConnectionsOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | | /// <summary> Initializes a new instance of ExpressRouteConnectionsOperations. </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 ExpressRouteConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su |
| | 33 | | { |
| 0 | 34 | | RestClient = new ExpressRouteConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> Gets the specified ExpressRouteConnection. </summary> |
| | 40 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 41 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 42 | | /// <param name="connectionName"> The name of the ExpressRoute connection. </param> |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<ExpressRouteConnection>> GetAsync(string resourceGroupName, string expressRou |
| | 45 | | { |
| 0 | 46 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.Get"); |
| 0 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 0 | 50 | | return await RestClient.GetAsync(resourceGroupName, expressRouteGatewayName, connectionName, cancellatio |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Gets the specified ExpressRouteConnection. </summary> |
| | 60 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 61 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 62 | | /// <param name="connectionName"> The name of the ExpressRoute connection. </param> |
| | 63 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 64 | | public virtual Response<ExpressRouteConnection> Get(string resourceGroupName, string expressRouteGatewayName, st |
| | 65 | | { |
| 0 | 66 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.Get"); |
| 0 | 67 | | scope.Start(); |
| | 68 | | try |
| | 69 | | { |
| 0 | 70 | | return RestClient.Get(resourceGroupName, expressRouteGatewayName, connectionName, cancellationToken); |
| | 71 | | } |
| 0 | 72 | | catch (Exception e) |
| | 73 | | { |
| 0 | 74 | | scope.Failed(e); |
| 0 | 75 | | throw; |
| | 76 | | } |
| 0 | 77 | | } |
| | 78 | |
|
| | 79 | | /// <summary> Lists ExpressRouteConnections. </summary> |
| | 80 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 81 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 82 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 83 | | public virtual async Task<Response<ExpressRouteConnectionList>> ListAsync(string resourceGroupName, string expre |
| | 84 | | { |
| 0 | 85 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.List"); |
| 0 | 86 | | scope.Start(); |
| | 87 | | try |
| | 88 | | { |
| 0 | 89 | | return await RestClient.ListAsync(resourceGroupName, expressRouteGatewayName, cancellationToken).Configu |
| | 90 | | } |
| 0 | 91 | | catch (Exception e) |
| | 92 | | { |
| 0 | 93 | | scope.Failed(e); |
| 0 | 94 | | throw; |
| | 95 | | } |
| 0 | 96 | | } |
| | 97 | |
|
| | 98 | | /// <summary> Lists ExpressRouteConnections. </summary> |
| | 99 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 100 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 101 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 102 | | public virtual Response<ExpressRouteConnectionList> List(string resourceGroupName, string expressRouteGatewayNam |
| | 103 | | { |
| 0 | 104 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.List"); |
| 0 | 105 | | scope.Start(); |
| | 106 | | try |
| | 107 | | { |
| 0 | 108 | | return RestClient.List(resourceGroupName, expressRouteGatewayName, cancellationToken); |
| | 109 | | } |
| 0 | 110 | | catch (Exception e) |
| | 111 | | { |
| 0 | 112 | | scope.Failed(e); |
| 0 | 113 | | throw; |
| | 114 | | } |
| 0 | 115 | | } |
| | 116 | |
|
| | 117 | | /// <summary> Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. </summary> |
| | 118 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 119 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 120 | | /// <param name="connectionName"> The name of the connection subresource. </param> |
| | 121 | | /// <param name="putExpressRouteConnectionParameters"> Parameters required in an ExpressRouteConnection PUT oper |
| | 122 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 123 | | public virtual async Task<ExpressRouteConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resour |
| | 124 | | { |
| 0 | 125 | | if (resourceGroupName == null) |
| | 126 | | { |
| 0 | 127 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 128 | | } |
| 0 | 129 | | if (expressRouteGatewayName == null) |
| | 130 | | { |
| 0 | 131 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 132 | | } |
| 0 | 133 | | if (connectionName == null) |
| | 134 | | { |
| 0 | 135 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 136 | | } |
| 0 | 137 | | if (putExpressRouteConnectionParameters == null) |
| | 138 | | { |
| 0 | 139 | | throw new ArgumentNullException(nameof(putExpressRouteConnectionParameters)); |
| | 140 | | } |
| | 141 | |
|
| 0 | 142 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartCreateOrUpdate"); |
| 0 | 143 | | scope.Start(); |
| | 144 | | try |
| | 145 | | { |
| 0 | 146 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, |
| 0 | 147 | | return new ExpressRouteConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 148 | | } |
| 0 | 149 | | catch (Exception e) |
| | 150 | | { |
| 0 | 151 | | scope.Failed(e); |
| 0 | 152 | | throw; |
| | 153 | | } |
| 0 | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. </summary> |
| | 157 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 158 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 159 | | /// <param name="connectionName"> The name of the connection subresource. </param> |
| | 160 | | /// <param name="putExpressRouteConnectionParameters"> Parameters required in an ExpressRouteConnection PUT oper |
| | 161 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 162 | | public virtual ExpressRouteConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, stri |
| | 163 | | { |
| 0 | 164 | | if (resourceGroupName == null) |
| | 165 | | { |
| 0 | 166 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 167 | | } |
| 0 | 168 | | if (expressRouteGatewayName == null) |
| | 169 | | { |
| 0 | 170 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 171 | | } |
| 0 | 172 | | if (connectionName == null) |
| | 173 | | { |
| 0 | 174 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 175 | | } |
| 0 | 176 | | if (putExpressRouteConnectionParameters == null) |
| | 177 | | { |
| 0 | 178 | | throw new ArgumentNullException(nameof(putExpressRouteConnectionParameters)); |
| | 179 | | } |
| | 180 | |
|
| 0 | 181 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartCreateOrUpdate"); |
| 0 | 182 | | scope.Start(); |
| | 183 | | try |
| | 184 | | { |
| 0 | 185 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionN |
| 0 | 186 | | return new ExpressRouteConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 187 | | } |
| 0 | 188 | | catch (Exception e) |
| | 189 | | { |
| 0 | 190 | | scope.Failed(e); |
| 0 | 191 | | throw; |
| | 192 | | } |
| 0 | 193 | | } |
| | 194 | |
|
| | 195 | | /// <summary> Deletes a connection to a ExpressRoute circuit. </summary> |
| | 196 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 197 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 198 | | /// <param name="connectionName"> The name of the connection subresource. </param> |
| | 199 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 200 | | public virtual async Task<ExpressRouteConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupName, str |
| | 201 | | { |
| 0 | 202 | | if (resourceGroupName == null) |
| | 203 | | { |
| 0 | 204 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 205 | | } |
| 0 | 206 | | if (expressRouteGatewayName == null) |
| | 207 | | { |
| 0 | 208 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 209 | | } |
| 0 | 210 | | if (connectionName == null) |
| | 211 | | { |
| 0 | 212 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 213 | | } |
| | 214 | |
|
| 0 | 215 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartDelete"); |
| 0 | 216 | | scope.Start(); |
| | 217 | | try |
| | 218 | | { |
| 0 | 219 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, expressRouteGatewayName, connecti |
| 0 | 220 | | return new ExpressRouteConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete |
| | 221 | | } |
| 0 | 222 | | catch (Exception e) |
| | 223 | | { |
| 0 | 224 | | scope.Failed(e); |
| 0 | 225 | | throw; |
| | 226 | | } |
| 0 | 227 | | } |
| | 228 | |
|
| | 229 | | /// <summary> Deletes a connection to a ExpressRoute circuit. </summary> |
| | 230 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 231 | | /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param> |
| | 232 | | /// <param name="connectionName"> The name of the connection subresource. </param> |
| | 233 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 234 | | public virtual ExpressRouteConnectionsDeleteOperation StartDelete(string resourceGroupName, string expressRouteG |
| | 235 | | { |
| 0 | 236 | | if (resourceGroupName == null) |
| | 237 | | { |
| 0 | 238 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 239 | | } |
| 0 | 240 | | if (expressRouteGatewayName == null) |
| | 241 | | { |
| 0 | 242 | | throw new ArgumentNullException(nameof(expressRouteGatewayName)); |
| | 243 | | } |
| 0 | 244 | | if (connectionName == null) |
| | 245 | | { |
| 0 | 246 | | throw new ArgumentNullException(nameof(connectionName)); |
| | 247 | | } |
| | 248 | |
|
| 0 | 249 | | using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartDelete"); |
| 0 | 250 | | scope.Start(); |
| | 251 | | try |
| | 252 | | { |
| 0 | 253 | | var originalResponse = RestClient.Delete(resourceGroupName, expressRouteGatewayName, connectionName, can |
| 0 | 254 | | return new ExpressRouteConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete |
| | 255 | | } |
| 0 | 256 | | catch (Exception e) |
| | 257 | | { |
| 0 | 258 | | scope.Failed(e); |
| 0 | 259 | | throw; |
| | 260 | | } |
| 0 | 261 | | } |
| | 262 | | } |
| | 263 | | } |