| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.EventHubs.Models; |
| | 15 | |
|
| | 16 | | namespace Azure.ResourceManager.EventHubs |
| | 17 | | { |
| | 18 | | /// <summary> The EventHubs service client. </summary> |
| | 19 | | public partial class EventHubsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 192 | 23 | | internal EventHubsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of EventHubsOperations for mocking. </summary> |
| 48 | 25 | | protected EventHubsOperations() |
| | 26 | | { |
| 48 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of EventHubsOperations. </summary> |
| | 29 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 30 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 31 | | /// <param name="subscriptionId"> Subscription credentials that uniquely identify a Microsoft Azure subscription |
| | 32 | | /// <param name="endpoint"> server parameter. </param> |
| 48 | 33 | | internal EventHubsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, |
| | 34 | | { |
| 48 | 35 | | RestClient = new EventHubsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 48 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 48 | 37 | | _pipeline = pipeline; |
| 48 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the Author |
| | 41 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 42 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 43 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 44 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 45 | | /// <param name="parameters"> The shared access AuthorizationRule. </param> |
| | 46 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 47 | | public virtual async Task<Response<AuthorizationRule>> CreateOrUpdateAuthorizationRuleAsync(string resourceGroup |
| | 48 | | { |
| 8 | 49 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdateAuthorizationRule"); |
| 8 | 50 | | scope.Start(); |
| | 51 | | try |
| | 52 | | { |
| 8 | 53 | | return await RestClient.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubN |
| | 54 | | } |
| 0 | 55 | | catch (Exception e) |
| | 56 | | { |
| 0 | 57 | | scope.Failed(e); |
| 0 | 58 | | throw; |
| | 59 | | } |
| 8 | 60 | | } |
| | 61 | |
|
| | 62 | | /// <summary> Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the Author |
| | 63 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 64 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 65 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 66 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 67 | | /// <param name="parameters"> The shared access AuthorizationRule. </param> |
| | 68 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 69 | | public virtual Response<AuthorizationRule> CreateOrUpdateAuthorizationRule(string resourceGroupName, string name |
| | 70 | | { |
| 8 | 71 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdateAuthorizationRule"); |
| 8 | 72 | | scope.Start(); |
| | 73 | | try |
| | 74 | | { |
| 8 | 75 | | return RestClient.CreateOrUpdateAuthorizationRule(resourceGroupName, namespaceName, eventHubName, author |
| | 76 | | } |
| 0 | 77 | | catch (Exception e) |
| | 78 | | { |
| 0 | 79 | | scope.Failed(e); |
| 0 | 80 | | throw; |
| | 81 | | } |
| 8 | 82 | | } |
| | 83 | |
|
| | 84 | | /// <summary> Gets an AuthorizationRule for an Event Hub by rule name. </summary> |
| | 85 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 86 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 87 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 88 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 89 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 90 | | public virtual async Task<Response<AuthorizationRule>> GetAuthorizationRuleAsync(string resourceGroupName, strin |
| | 91 | | { |
| 8 | 92 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.GetAuthorizationRule"); |
| 8 | 93 | | scope.Start(); |
| | 94 | | try |
| | 95 | | { |
| 8 | 96 | | return await RestClient.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, author |
| | 97 | | } |
| 0 | 98 | | catch (Exception e) |
| | 99 | | { |
| 0 | 100 | | scope.Failed(e); |
| 0 | 101 | | throw; |
| | 102 | | } |
| 8 | 103 | | } |
| | 104 | |
|
| | 105 | | /// <summary> Gets an AuthorizationRule for an Event Hub by rule name. </summary> |
| | 106 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 107 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 108 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 109 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 110 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 111 | | public virtual Response<AuthorizationRule> GetAuthorizationRule(string resourceGroupName, string namespaceName, |
| | 112 | | { |
| 8 | 113 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.GetAuthorizationRule"); |
| 8 | 114 | | scope.Start(); |
| | 115 | | try |
| | 116 | | { |
| 8 | 117 | | return RestClient.GetAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRule |
| | 118 | | } |
| 0 | 119 | | catch (Exception e) |
| | 120 | | { |
| 0 | 121 | | scope.Failed(e); |
| 0 | 122 | | throw; |
| | 123 | | } |
| 8 | 124 | | } |
| | 125 | |
|
| | 126 | | /// <summary> Deletes an Event Hub AuthorizationRule. </summary> |
| | 127 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 128 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 129 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 130 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 131 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 132 | | public virtual async Task<Response> DeleteAuthorizationRuleAsync(string resourceGroupName, string namespaceName, |
| | 133 | | { |
| 4 | 134 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.DeleteAuthorizationRule"); |
| 4 | 135 | | scope.Start(); |
| | 136 | | try |
| | 137 | | { |
| 4 | 138 | | return await RestClient.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, aut |
| | 139 | | } |
| 0 | 140 | | catch (Exception e) |
| | 141 | | { |
| 0 | 142 | | scope.Failed(e); |
| 0 | 143 | | throw; |
| | 144 | | } |
| 4 | 145 | | } |
| | 146 | |
|
| | 147 | | /// <summary> Deletes an Event Hub AuthorizationRule. </summary> |
| | 148 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 149 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 150 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 151 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 152 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 153 | | public virtual Response DeleteAuthorizationRule(string resourceGroupName, string namespaceName, string eventHubN |
| | 154 | | { |
| 4 | 155 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.DeleteAuthorizationRule"); |
| 4 | 156 | | scope.Start(); |
| | 157 | | try |
| | 158 | | { |
| 4 | 159 | | return RestClient.DeleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationR |
| | 160 | | } |
| 0 | 161 | | catch (Exception e) |
| | 162 | | { |
| 0 | 163 | | scope.Failed(e); |
| 0 | 164 | | throw; |
| | 165 | | } |
| 4 | 166 | | } |
| | 167 | |
|
| | 168 | | /// <summary> Gets the ACS and SAS connection strings for the Event Hub. </summary> |
| | 169 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 170 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 171 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 172 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 173 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 174 | | public virtual async Task<Response<AccessKeys>> ListKeysAsync(string resourceGroupName, string namespaceName, st |
| | 175 | | { |
| 4 | 176 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListKeys"); |
| 4 | 177 | | scope.Start(); |
| | 178 | | try |
| | 179 | | { |
| 4 | 180 | | return await RestClient.ListKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleN |
| | 181 | | } |
| 0 | 182 | | catch (Exception e) |
| | 183 | | { |
| 0 | 184 | | scope.Failed(e); |
| 0 | 185 | | throw; |
| | 186 | | } |
| 4 | 187 | | } |
| | 188 | |
|
| | 189 | | /// <summary> Gets the ACS and SAS connection strings for the Event Hub. </summary> |
| | 190 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 191 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 192 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 193 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 194 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 195 | | public virtual Response<AccessKeys> ListKeys(string resourceGroupName, string namespaceName, string eventHubName |
| | 196 | | { |
| 4 | 197 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListKeys"); |
| 4 | 198 | | scope.Start(); |
| | 199 | | try |
| | 200 | | { |
| 4 | 201 | | return RestClient.ListKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, cancel |
| | 202 | | } |
| 0 | 203 | | catch (Exception e) |
| | 204 | | { |
| 0 | 205 | | scope.Failed(e); |
| 0 | 206 | | throw; |
| | 207 | | } |
| 4 | 208 | | } |
| | 209 | |
|
| | 210 | | /// <summary> Regenerates the ACS and SAS connection strings for the Event Hub. </summary> |
| | 211 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 212 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 213 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 214 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 215 | | /// <param name="parameters"> Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/Secondary |
| | 216 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 217 | | public virtual async Task<Response<AccessKeys>> RegenerateKeysAsync(string resourceGroupName, string namespaceNa |
| | 218 | | { |
| 8 | 219 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.RegenerateKeys"); |
| 8 | 220 | | scope.Start(); |
| | 221 | | try |
| | 222 | | { |
| 8 | 223 | | return await RestClient.RegenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizatio |
| | 224 | | } |
| 0 | 225 | | catch (Exception e) |
| | 226 | | { |
| 0 | 227 | | scope.Failed(e); |
| 0 | 228 | | throw; |
| | 229 | | } |
| 8 | 230 | | } |
| | 231 | |
|
| | 232 | | /// <summary> Regenerates the ACS and SAS connection strings for the Event Hub. </summary> |
| | 233 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 234 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 235 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 236 | | /// <param name="authorizationRuleName"> The authorization rule name. </param> |
| | 237 | | /// <param name="parameters"> Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/Secondary |
| | 238 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 239 | | public virtual Response<AccessKeys> RegenerateKeys(string resourceGroupName, string namespaceName, string eventH |
| | 240 | | { |
| 8 | 241 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.RegenerateKeys"); |
| 8 | 242 | | scope.Start(); |
| | 243 | | try |
| | 244 | | { |
| 8 | 245 | | return RestClient.RegenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, |
| | 246 | | } |
| 0 | 247 | | catch (Exception e) |
| | 248 | | { |
| 0 | 249 | | scope.Failed(e); |
| 0 | 250 | | throw; |
| | 251 | | } |
| 8 | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> Creates or updates a new Event Hub as a nested resource within a Namespace. </summary> |
| | 255 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 256 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 257 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 258 | | /// <param name="parameters"> Parameters supplied to create an Event Hub resource. </param> |
| | 259 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 260 | | public virtual async Task<Response<Eventhub>> CreateOrUpdateAsync(string resourceGroupName, string namespaceName |
| | 261 | | { |
| 32 | 262 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdate"); |
| 32 | 263 | | scope.Start(); |
| | 264 | | try |
| | 265 | | { |
| 32 | 266 | | return await RestClient.CreateOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters, |
| | 267 | | } |
| 0 | 268 | | catch (Exception e) |
| | 269 | | { |
| 0 | 270 | | scope.Failed(e); |
| 0 | 271 | | throw; |
| | 272 | | } |
| 32 | 273 | | } |
| | 274 | |
|
| | 275 | | /// <summary> Creates or updates a new Event Hub as a nested resource within a Namespace. </summary> |
| | 276 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 277 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 278 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 279 | | /// <param name="parameters"> Parameters supplied to create an Event Hub resource. </param> |
| | 280 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 281 | | public virtual Response<Eventhub> CreateOrUpdate(string resourceGroupName, string namespaceName, string eventHub |
| | 282 | | { |
| 32 | 283 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdate"); |
| 32 | 284 | | scope.Start(); |
| | 285 | | try |
| | 286 | | { |
| 32 | 287 | | return RestClient.CreateOrUpdate(resourceGroupName, namespaceName, eventHubName, parameters, cancellatio |
| | 288 | | } |
| 0 | 289 | | catch (Exception e) |
| | 290 | | { |
| 0 | 291 | | scope.Failed(e); |
| 0 | 292 | | throw; |
| | 293 | | } |
| 32 | 294 | | } |
| | 295 | |
|
| | 296 | | /// <summary> Deletes an Event Hub from the specified Namespace and resource group. </summary> |
| | 297 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 298 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 299 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 300 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 301 | | public virtual async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, string eventHubN |
| | 302 | | { |
| 10 | 303 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Delete"); |
| 10 | 304 | | scope.Start(); |
| | 305 | | try |
| | 306 | | { |
| 10 | 307 | | return await RestClient.DeleteAsync(resourceGroupName, namespaceName, eventHubName, cancellationToken).C |
| | 308 | | } |
| 0 | 309 | | catch (Exception e) |
| | 310 | | { |
| 0 | 311 | | scope.Failed(e); |
| 0 | 312 | | throw; |
| | 313 | | } |
| 10 | 314 | | } |
| | 315 | |
|
| | 316 | | /// <summary> Deletes an Event Hub from the specified Namespace and resource group. </summary> |
| | 317 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 318 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 319 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 320 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 321 | | public virtual Response Delete(string resourceGroupName, string namespaceName, string eventHubName, Cancellation |
| | 322 | | { |
| 10 | 323 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Delete"); |
| 10 | 324 | | scope.Start(); |
| | 325 | | try |
| | 326 | | { |
| 10 | 327 | | return RestClient.Delete(resourceGroupName, namespaceName, eventHubName, cancellationToken); |
| | 328 | | } |
| 0 | 329 | | catch (Exception e) |
| | 330 | | { |
| 0 | 331 | | scope.Failed(e); |
| 0 | 332 | | throw; |
| | 333 | | } |
| 10 | 334 | | } |
| | 335 | |
|
| | 336 | | /// <summary> Gets an Event Hubs description for the specified Event Hub. </summary> |
| | 337 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 338 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 339 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 340 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 341 | | public virtual async Task<Response<Eventhub>> GetAsync(string resourceGroupName, string namespaceName, string ev |
| | 342 | | { |
| 12 | 343 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Get"); |
| 12 | 344 | | scope.Start(); |
| | 345 | | try |
| | 346 | | { |
| 12 | 347 | | return await RestClient.GetAsync(resourceGroupName, namespaceName, eventHubName, cancellationToken).Conf |
| | 348 | | } |
| 0 | 349 | | catch (Exception e) |
| | 350 | | { |
| 0 | 351 | | scope.Failed(e); |
| 0 | 352 | | throw; |
| | 353 | | } |
| 12 | 354 | | } |
| | 355 | |
|
| | 356 | | /// <summary> Gets an Event Hubs description for the specified Event Hub. </summary> |
| | 357 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 358 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 359 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 360 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 361 | | public virtual Response<Eventhub> Get(string resourceGroupName, string namespaceName, string eventHubName, Cance |
| | 362 | | { |
| 12 | 363 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Get"); |
| 12 | 364 | | scope.Start(); |
| | 365 | | try |
| | 366 | | { |
| 12 | 367 | | return RestClient.Get(resourceGroupName, namespaceName, eventHubName, cancellationToken); |
| | 368 | | } |
| 0 | 369 | | catch (Exception e) |
| | 370 | | { |
| 0 | 371 | | scope.Failed(e); |
| 0 | 372 | | throw; |
| | 373 | | } |
| 12 | 374 | | } |
| | 375 | |
|
| | 376 | | /// <summary> Gets the authorization rules for an Event Hub. </summary> |
| | 377 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 378 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 379 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 380 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 381 | | public virtual AsyncPageable<AuthorizationRule> ListAuthorizationRulesAsync(string resourceGroupName, string nam |
| | 382 | | { |
| 4 | 383 | | if (resourceGroupName == null) |
| | 384 | | { |
| 0 | 385 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 386 | | } |
| 4 | 387 | | if (namespaceName == null) |
| | 388 | | { |
| 0 | 389 | | throw new ArgumentNullException(nameof(namespaceName)); |
| | 390 | | } |
| 4 | 391 | | if (eventHubName == null) |
| | 392 | | { |
| 0 | 393 | | throw new ArgumentNullException(nameof(eventHubName)); |
| | 394 | | } |
| | 395 | |
|
| | 396 | | async Task<Page<AuthorizationRule>> FirstPageFunc(int? pageSizeHint) |
| | 397 | | { |
| 4 | 398 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules"); |
| 4 | 399 | | scope.Start(); |
| | 400 | | try |
| | 401 | | { |
| 4 | 402 | | var response = await RestClient.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, eventH |
| 4 | 403 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 404 | | } |
| 0 | 405 | | catch (Exception e) |
| | 406 | | { |
| 0 | 407 | | scope.Failed(e); |
| 0 | 408 | | throw; |
| | 409 | | } |
| 4 | 410 | | } |
| | 411 | | async Task<Page<AuthorizationRule>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 412 | | { |
| 0 | 413 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules"); |
| 0 | 414 | | scope.Start(); |
| | 415 | | try |
| | 416 | | { |
| 0 | 417 | | var response = await RestClient.ListAuthorizationRulesNextPageAsync(nextLink, resourceGroupName, nam |
| 0 | 418 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 419 | | } |
| 0 | 420 | | catch (Exception e) |
| | 421 | | { |
| 0 | 422 | | scope.Failed(e); |
| 0 | 423 | | throw; |
| | 424 | | } |
| 0 | 425 | | } |
| 4 | 426 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 427 | | } |
| | 428 | |
|
| | 429 | | /// <summary> Gets the authorization rules for an Event Hub. </summary> |
| | 430 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 431 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 432 | | /// <param name="eventHubName"> The Event Hub name. </param> |
| | 433 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 434 | | public virtual Pageable<AuthorizationRule> ListAuthorizationRules(string resourceGroupName, string namespaceName |
| | 435 | | { |
| 4 | 436 | | if (resourceGroupName == null) |
| | 437 | | { |
| 0 | 438 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 439 | | } |
| 4 | 440 | | if (namespaceName == null) |
| | 441 | | { |
| 0 | 442 | | throw new ArgumentNullException(nameof(namespaceName)); |
| | 443 | | } |
| 4 | 444 | | if (eventHubName == null) |
| | 445 | | { |
| 0 | 446 | | throw new ArgumentNullException(nameof(eventHubName)); |
| | 447 | | } |
| | 448 | |
|
| | 449 | | Page<AuthorizationRule> FirstPageFunc(int? pageSizeHint) |
| | 450 | | { |
| 4 | 451 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules"); |
| 4 | 452 | | scope.Start(); |
| | 453 | | try |
| | 454 | | { |
| 4 | 455 | | var response = RestClient.ListAuthorizationRules(resourceGroupName, namespaceName, eventHubName, can |
| 4 | 456 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 457 | | } |
| 0 | 458 | | catch (Exception e) |
| | 459 | | { |
| 0 | 460 | | scope.Failed(e); |
| 0 | 461 | | throw; |
| | 462 | | } |
| 4 | 463 | | } |
| | 464 | | Page<AuthorizationRule> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 465 | | { |
| 0 | 466 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules"); |
| 0 | 467 | | scope.Start(); |
| | 468 | | try |
| | 469 | | { |
| 0 | 470 | | var response = RestClient.ListAuthorizationRulesNextPage(nextLink, resourceGroupName, namespaceName, |
| 0 | 471 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 472 | | } |
| 0 | 473 | | catch (Exception e) |
| | 474 | | { |
| 0 | 475 | | scope.Failed(e); |
| 0 | 476 | | throw; |
| | 477 | | } |
| 0 | 478 | | } |
| 4 | 479 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 480 | | } |
| | 481 | |
|
| | 482 | | /// <summary> Gets all the Event Hubs in a Namespace. </summary> |
| | 483 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 484 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 485 | | /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo |
| | 486 | | /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param> |
| | 487 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 488 | | public virtual AsyncPageable<Eventhub> ListByNamespaceAsync(string resourceGroupName, string namespaceName, int? |
| | 489 | | { |
| 6 | 490 | | if (resourceGroupName == null) |
| | 491 | | { |
| 0 | 492 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 493 | | } |
| 6 | 494 | | if (namespaceName == null) |
| | 495 | | { |
| 0 | 496 | | throw new ArgumentNullException(nameof(namespaceName)); |
| | 497 | | } |
| | 498 | |
|
| | 499 | | async Task<Page<Eventhub>> FirstPageFunc(int? pageSizeHint) |
| | 500 | | { |
| 6 | 501 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace"); |
| 6 | 502 | | scope.Start(); |
| | 503 | | try |
| | 504 | | { |
| 6 | 505 | | var response = await RestClient.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top, ca |
| 6 | 506 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 507 | | } |
| 0 | 508 | | catch (Exception e) |
| | 509 | | { |
| 0 | 510 | | scope.Failed(e); |
| 0 | 511 | | throw; |
| | 512 | | } |
| 6 | 513 | | } |
| | 514 | | async Task<Page<Eventhub>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 515 | | { |
| 0 | 516 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace"); |
| 0 | 517 | | scope.Start(); |
| | 518 | | try |
| | 519 | | { |
| 0 | 520 | | var response = await RestClient.ListByNamespaceNextPageAsync(nextLink, resourceGroupName, namespaceN |
| 0 | 521 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 522 | | } |
| 0 | 523 | | catch (Exception e) |
| | 524 | | { |
| 0 | 525 | | scope.Failed(e); |
| 0 | 526 | | throw; |
| | 527 | | } |
| 0 | 528 | | } |
| 6 | 529 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 530 | | } |
| | 531 | |
|
| | 532 | | /// <summary> Gets all the Event Hubs in a Namespace. </summary> |
| | 533 | | /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param> |
| | 534 | | /// <param name="namespaceName"> The Namespace name. </param> |
| | 535 | | /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo |
| | 536 | | /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param> |
| | 537 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 538 | | public virtual Pageable<Eventhub> ListByNamespace(string resourceGroupName, string namespaceName, int? skip = nu |
| | 539 | | { |
| 6 | 540 | | if (resourceGroupName == null) |
| | 541 | | { |
| 0 | 542 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 543 | | } |
| 6 | 544 | | if (namespaceName == null) |
| | 545 | | { |
| 0 | 546 | | throw new ArgumentNullException(nameof(namespaceName)); |
| | 547 | | } |
| | 548 | |
|
| | 549 | | Page<Eventhub> FirstPageFunc(int? pageSizeHint) |
| | 550 | | { |
| 6 | 551 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace"); |
| 6 | 552 | | scope.Start(); |
| | 553 | | try |
| | 554 | | { |
| 6 | 555 | | var response = RestClient.ListByNamespace(resourceGroupName, namespaceName, skip, top, cancellationT |
| 6 | 556 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 557 | | } |
| 0 | 558 | | catch (Exception e) |
| | 559 | | { |
| 0 | 560 | | scope.Failed(e); |
| 0 | 561 | | throw; |
| | 562 | | } |
| 6 | 563 | | } |
| | 564 | | Page<Eventhub> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 565 | | { |
| 0 | 566 | | using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace"); |
| 0 | 567 | | scope.Start(); |
| | 568 | | try |
| | 569 | | { |
| 0 | 570 | | var response = RestClient.ListByNamespaceNextPage(nextLink, resourceGroupName, namespaceName, skip, |
| 0 | 571 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 572 | | } |
| 0 | 573 | | catch (Exception e) |
| | 574 | | { |
| 0 | 575 | | scope.Failed(e); |
| 0 | 576 | | throw; |
| | 577 | | } |
| 0 | 578 | | } |
| 6 | 579 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 580 | | } |
| | 581 | | } |
| | 582 | | } |