| | 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.Analytics.Synapse.Artifacts.Models; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | |
|
| 0 | 16 | | namespace Azure.Analytics.Synapse.Artifacts |
| | 17 | | { |
| 0 | 18 | | /// <summary> The Trigger service client. </summary> |
| | 19 | | public partial class TriggerClient |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal TriggerRestClient RestClient { get; } |
| 0 | 24 | | /// <summary> Initializes a new instance of TriggerClient for mocking. </summary> |
| 0 | 25 | | protected TriggerClient() |
| 0 | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of TriggerClient. </summary> |
| 0 | 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="endpoint"> The workspace development endpoint, for example https://myworkspace.dev.azuresynapse |
| | 32 | | /// <param name="apiVersion"> Api Version. </param> |
| 0 | 33 | | internal TriggerClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVe |
| | 34 | | { |
| 0 | 35 | | RestClient = new TriggerRestClient(clientDiagnostics, pipeline, endpoint, apiVersion); |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Creates or updates a trigger. </summary> |
| | 41 | | /// <param name="triggerName"> The trigger name. </param> |
| | 42 | | /// <param name="trigger"> Trigger resource definition. </param> |
| | 43 | | /// <param name="ifMatch"> ETag of the trigger entity. Should only be specified for update, for which it should |
| | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 45 | | public virtual async Task<Response<TriggerResource>> CreateOrUpdateTriggerAsync(string triggerName, TriggerResou |
| | 46 | | { |
| 0 | 47 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.CreateOrUpdateTrigger"); |
| 0 | 48 | | scope.Start(); |
| | 49 | | try |
| | 50 | | { |
| 0 | 51 | | return await RestClient.CreateOrUpdateTriggerAsync(triggerName, trigger, ifMatch, cancellationToken).Con |
| | 52 | | } |
| 0 | 53 | | catch (Exception e) |
| | 54 | | { |
| 0 | 55 | | scope.Failed(e); |
| 0 | 56 | | throw; |
| | 57 | | } |
| 0 | 58 | | } |
| | 59 | |
|
| | 60 | | /// <summary> Creates or updates a trigger. </summary> |
| | 61 | | /// <param name="triggerName"> The trigger name. </param> |
| | 62 | | /// <param name="trigger"> Trigger resource definition. </param> |
| | 63 | | /// <param name="ifMatch"> ETag of the trigger entity. Should only be specified for update, for which it should |
| | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 65 | | public virtual Response<TriggerResource> CreateOrUpdateTrigger(string triggerName, TriggerResource trigger, stri |
| | 66 | | { |
| 0 | 67 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.CreateOrUpdateTrigger"); |
| 0 | 68 | | scope.Start(); |
| | 69 | | try |
| | 70 | | { |
| 0 | 71 | | return RestClient.CreateOrUpdateTrigger(triggerName, trigger, ifMatch, cancellationToken); |
| | 72 | | } |
| 0 | 73 | | catch (Exception e) |
| | 74 | | { |
| 0 | 75 | | scope.Failed(e); |
| 0 | 76 | | throw; |
| | 77 | | } |
| 0 | 78 | | } |
| | 79 | |
|
| | 80 | | /// <summary> Gets a trigger. </summary> |
| | 81 | | /// <param name="triggerName"> The trigger name. </param> |
| | 82 | | /// <param name="ifNoneMatch"> ETag of the trigger entity. Should only be specified for get. If the ETag matches |
| | 83 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 84 | | public virtual async Task<Response<TriggerResource>> GetTriggerAsync(string triggerName, string ifNoneMatch = nu |
| | 85 | | { |
| 0 | 86 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTrigger"); |
| 0 | 87 | | scope.Start(); |
| | 88 | | try |
| | 89 | | { |
| 0 | 90 | | return await RestClient.GetTriggerAsync(triggerName, ifNoneMatch, cancellationToken).ConfigureAwait(fals |
| | 91 | | } |
| 0 | 92 | | catch (Exception e) |
| | 93 | | { |
| 0 | 94 | | scope.Failed(e); |
| 0 | 95 | | throw; |
| | 96 | | } |
| 0 | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> Gets a trigger. </summary> |
| | 100 | | /// <param name="triggerName"> The trigger name. </param> |
| | 101 | | /// <param name="ifNoneMatch"> ETag of the trigger entity. Should only be specified for get. If the ETag matches |
| | 102 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 103 | | public virtual Response<TriggerResource> GetTrigger(string triggerName, string ifNoneMatch = null, CancellationT |
| | 104 | | { |
| 0 | 105 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTrigger"); |
| 0 | 106 | | scope.Start(); |
| | 107 | | try |
| | 108 | | { |
| 0 | 109 | | return RestClient.GetTrigger(triggerName, ifNoneMatch, cancellationToken); |
| | 110 | | } |
| 0 | 111 | | catch (Exception e) |
| | 112 | | { |
| 0 | 113 | | scope.Failed(e); |
| 0 | 114 | | throw; |
| | 115 | | } |
| 0 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> Deletes a trigger. </summary> |
| | 119 | | /// <param name="triggerName"> The trigger name. </param> |
| | 120 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 121 | | public virtual async Task<Response> DeleteTriggerAsync(string triggerName, CancellationToken cancellationToken = |
| | 122 | | { |
| 0 | 123 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.DeleteTrigger"); |
| 0 | 124 | | scope.Start(); |
| | 125 | | try |
| | 126 | | { |
| 0 | 127 | | return await RestClient.DeleteTriggerAsync(triggerName, cancellationToken).ConfigureAwait(false); |
| | 128 | | } |
| 0 | 129 | | catch (Exception e) |
| | 130 | | { |
| 0 | 131 | | scope.Failed(e); |
| 0 | 132 | | throw; |
| | 133 | | } |
| 0 | 134 | | } |
| | 135 | |
|
| | 136 | | /// <summary> Deletes a trigger. </summary> |
| | 137 | | /// <param name="triggerName"> The trigger name. </param> |
| | 138 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 139 | | public virtual Response DeleteTrigger(string triggerName, CancellationToken cancellationToken = default) |
| | 140 | | { |
| 0 | 141 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.DeleteTrigger"); |
| 0 | 142 | | scope.Start(); |
| | 143 | | try |
| | 144 | | { |
| 0 | 145 | | return RestClient.DeleteTrigger(triggerName, cancellationToken); |
| | 146 | | } |
| 0 | 147 | | catch (Exception e) |
| | 148 | | { |
| 0 | 149 | | scope.Failed(e); |
| 0 | 150 | | throw; |
| | 151 | | } |
| 0 | 152 | | } |
| | 153 | |
|
| | 154 | | /// <summary> Get a trigger's event subscription status. </summary> |
| | 155 | | /// <param name="triggerName"> The trigger name. </param> |
| | 156 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 157 | | public virtual async Task<Response<TriggerSubscriptionOperationStatus>> GetEventSubscriptionStatusAsync(string t |
| | 158 | | { |
| 0 | 159 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetEventSubscriptionStatus"); |
| 0 | 160 | | scope.Start(); |
| | 161 | | try |
| | 162 | | { |
| 0 | 163 | | return await RestClient.GetEventSubscriptionStatusAsync(triggerName, cancellationToken).ConfigureAwait(f |
| | 164 | | } |
| 0 | 165 | | catch (Exception e) |
| | 166 | | { |
| 0 | 167 | | scope.Failed(e); |
| 0 | 168 | | throw; |
| | 169 | | } |
| 0 | 170 | | } |
| | 171 | |
|
| | 172 | | /// <summary> Get a trigger's event subscription status. </summary> |
| | 173 | | /// <param name="triggerName"> The trigger name. </param> |
| | 174 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 175 | | public virtual Response<TriggerSubscriptionOperationStatus> GetEventSubscriptionStatus(string triggerName, Cance |
| | 176 | | { |
| 0 | 177 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetEventSubscriptionStatus"); |
| 0 | 178 | | scope.Start(); |
| | 179 | | try |
| | 180 | | { |
| 0 | 181 | | return RestClient.GetEventSubscriptionStatus(triggerName, cancellationToken); |
| | 182 | | } |
| 0 | 183 | | catch (Exception e) |
| | 184 | | { |
| 0 | 185 | | scope.Failed(e); |
| 0 | 186 | | throw; |
| | 187 | | } |
| 0 | 188 | | } |
| | 189 | |
|
| | 190 | | /// <summary> Lists triggers. </summary> |
| | 191 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 192 | | public virtual AsyncPageable<TriggerResource> GetTriggersByWorkspaceAsync(CancellationToken cancellationToken = |
| | 193 | | { |
| | 194 | | async Task<Page<TriggerResource>> FirstPageFunc(int? pageSizeHint) |
| | 195 | | { |
| 0 | 196 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTriggersByWorkspace"); |
| 0 | 197 | | scope.Start(); |
| | 198 | | try |
| | 199 | | { |
| 0 | 200 | | var response = await RestClient.GetTriggersByWorkspaceAsync(cancellationToken).ConfigureAwait(false) |
| 0 | 201 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 202 | | } |
| 0 | 203 | | catch (Exception e) |
| | 204 | | { |
| 0 | 205 | | scope.Failed(e); |
| 0 | 206 | | throw; |
| | 207 | | } |
| 0 | 208 | | } |
| | 209 | | async Task<Page<TriggerResource>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 210 | | { |
| 0 | 211 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTriggersByWorkspace"); |
| 0 | 212 | | scope.Start(); |
| | 213 | | try |
| | 214 | | { |
| 0 | 215 | | var response = await RestClient.GetTriggersByWorkspaceNextPageAsync(nextLink, cancellationToken).Con |
| 0 | 216 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 217 | | } |
| 0 | 218 | | catch (Exception e) |
| | 219 | | { |
| 0 | 220 | | scope.Failed(e); |
| 0 | 221 | | throw; |
| | 222 | | } |
| 0 | 223 | | } |
| 0 | 224 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 225 | | } |
| | 226 | |
|
| | 227 | | /// <summary> Lists triggers. </summary> |
| | 228 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 229 | | public virtual Pageable<TriggerResource> GetTriggersByWorkspace(CancellationToken cancellationToken = default) |
| | 230 | | { |
| | 231 | | Page<TriggerResource> FirstPageFunc(int? pageSizeHint) |
| | 232 | | { |
| 0 | 233 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTriggersByWorkspace"); |
| 0 | 234 | | scope.Start(); |
| | 235 | | try |
| | 236 | | { |
| 0 | 237 | | var response = RestClient.GetTriggersByWorkspace(cancellationToken); |
| 0 | 238 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 239 | | } |
| 0 | 240 | | catch (Exception e) |
| | 241 | | { |
| 0 | 242 | | scope.Failed(e); |
| 0 | 243 | | throw; |
| | 244 | | } |
| 0 | 245 | | } |
| | 246 | | Page<TriggerResource> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 247 | | { |
| 0 | 248 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.GetTriggersByWorkspace"); |
| 0 | 249 | | scope.Start(); |
| | 250 | | try |
| | 251 | | { |
| 0 | 252 | | var response = RestClient.GetTriggersByWorkspaceNextPage(nextLink, cancellationToken); |
| 0 | 253 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 254 | | } |
| 0 | 255 | | catch (Exception e) |
| | 256 | | { |
| 0 | 257 | | scope.Failed(e); |
| 0 | 258 | | throw; |
| | 259 | | } |
| 0 | 260 | | } |
| 0 | 261 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 262 | | } |
| | 263 | |
|
| | 264 | | /// <summary> Subscribe event trigger to events. </summary> |
| | 265 | | /// <param name="triggerName"> The trigger name. </param> |
| | 266 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 267 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 268 | | public virtual async Task<TriggerSubscribeTriggerToEventsOperation> StartSubscribeTriggerToEventsAsync(string tr |
| | 269 | | { |
| 0 | 270 | | if (triggerName == null) |
| | 271 | | { |
| 0 | 272 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 273 | | } |
| | 274 | |
|
| 0 | 275 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartSubscribeTriggerToEvents"); |
| 0 | 276 | | scope.Start(); |
| | 277 | | try |
| | 278 | | { |
| 0 | 279 | | var originalResponse = await RestClient.SubscribeTriggerToEventsAsync(triggerName, cancellationToken).Co |
| 0 | 280 | | return new TriggerSubscribeTriggerToEventsOperation(_clientDiagnostics, _pipeline, RestClient.CreateSubs |
| | 281 | | } |
| 0 | 282 | | catch (Exception e) |
| | 283 | | { |
| 0 | 284 | | scope.Failed(e); |
| 0 | 285 | | throw; |
| | 286 | | } |
| 0 | 287 | | } |
| | 288 | |
|
| | 289 | | /// <summary> Subscribe event trigger to events. </summary> |
| | 290 | | /// <param name="triggerName"> The trigger name. </param> |
| | 291 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 292 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 293 | | public virtual TriggerSubscribeTriggerToEventsOperation StartSubscribeTriggerToEvents(string triggerName, Cancel |
| | 294 | | { |
| 0 | 295 | | if (triggerName == null) |
| | 296 | | { |
| 0 | 297 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 298 | | } |
| | 299 | |
|
| 0 | 300 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartSubscribeTriggerToEvents"); |
| 0 | 301 | | scope.Start(); |
| | 302 | | try |
| | 303 | | { |
| 0 | 304 | | var originalResponse = RestClient.SubscribeTriggerToEvents(triggerName, cancellationToken); |
| 0 | 305 | | return new TriggerSubscribeTriggerToEventsOperation(_clientDiagnostics, _pipeline, RestClient.CreateSubs |
| | 306 | | } |
| 0 | 307 | | catch (Exception e) |
| | 308 | | { |
| 0 | 309 | | scope.Failed(e); |
| 0 | 310 | | throw; |
| | 311 | | } |
| 0 | 312 | | } |
| | 313 | |
|
| | 314 | | /// <summary> Unsubscribe event trigger from events. </summary> |
| | 315 | | /// <param name="triggerName"> The trigger name. </param> |
| | 316 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 317 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 318 | | public virtual async Task<TriggerUnsubscribeTriggerFromEventsOperation> StartUnsubscribeTriggerFromEventsAsync(s |
| | 319 | | { |
| 0 | 320 | | if (triggerName == null) |
| | 321 | | { |
| 0 | 322 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 323 | | } |
| | 324 | |
|
| 0 | 325 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartUnsubscribeTriggerFromEvents"); |
| 0 | 326 | | scope.Start(); |
| | 327 | | try |
| | 328 | | { |
| 0 | 329 | | var originalResponse = await RestClient.UnsubscribeTriggerFromEventsAsync(triggerName, cancellationToken |
| 0 | 330 | | return new TriggerUnsubscribeTriggerFromEventsOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | 331 | | } |
| 0 | 332 | | catch (Exception e) |
| | 333 | | { |
| 0 | 334 | | scope.Failed(e); |
| 0 | 335 | | throw; |
| | 336 | | } |
| 0 | 337 | | } |
| | 338 | |
|
| | 339 | | /// <summary> Unsubscribe event trigger from events. </summary> |
| | 340 | | /// <param name="triggerName"> The trigger name. </param> |
| | 341 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 342 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 343 | | public virtual TriggerUnsubscribeTriggerFromEventsOperation StartUnsubscribeTriggerFromEvents(string triggerName |
| | 344 | | { |
| 0 | 345 | | if (triggerName == null) |
| | 346 | | { |
| 0 | 347 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 348 | | } |
| | 349 | |
|
| 0 | 350 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartUnsubscribeTriggerFromEvents"); |
| 0 | 351 | | scope.Start(); |
| | 352 | | try |
| | 353 | | { |
| 0 | 354 | | var originalResponse = RestClient.UnsubscribeTriggerFromEvents(triggerName, cancellationToken); |
| 0 | 355 | | return new TriggerUnsubscribeTriggerFromEventsOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | 356 | | } |
| 0 | 357 | | catch (Exception e) |
| | 358 | | { |
| 0 | 359 | | scope.Failed(e); |
| 0 | 360 | | throw; |
| | 361 | | } |
| 0 | 362 | | } |
| | 363 | |
|
| | 364 | | /// <summary> Starts a trigger. </summary> |
| | 365 | | /// <param name="triggerName"> The trigger name. </param> |
| | 366 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 367 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 368 | | public virtual async Task<TriggerStartTriggerOperation> StartStartTriggerAsync(string triggerName, CancellationT |
| | 369 | | { |
| 0 | 370 | | if (triggerName == null) |
| | 371 | | { |
| 0 | 372 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 373 | | } |
| | 374 | |
|
| 0 | 375 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartStartTrigger"); |
| 0 | 376 | | scope.Start(); |
| | 377 | | try |
| | 378 | | { |
| 0 | 379 | | var originalResponse = await RestClient.StartTriggerAsync(triggerName, cancellationToken).ConfigureAwait |
| 0 | 380 | | return new TriggerStartTriggerOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartTriggerRequ |
| | 381 | | } |
| 0 | 382 | | catch (Exception e) |
| | 383 | | { |
| 0 | 384 | | scope.Failed(e); |
| 0 | 385 | | throw; |
| | 386 | | } |
| 0 | 387 | | } |
| | 388 | |
|
| | 389 | | /// <summary> Starts a trigger. </summary> |
| | 390 | | /// <param name="triggerName"> The trigger name. </param> |
| | 391 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 392 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 393 | | public virtual TriggerStartTriggerOperation StartStartTrigger(string triggerName, CancellationToken cancellation |
| | 394 | | { |
| 0 | 395 | | if (triggerName == null) |
| | 396 | | { |
| 0 | 397 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 398 | | } |
| | 399 | |
|
| 0 | 400 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartStartTrigger"); |
| 0 | 401 | | scope.Start(); |
| | 402 | | try |
| | 403 | | { |
| 0 | 404 | | var originalResponse = RestClient.StartTrigger(triggerName, cancellationToken); |
| 0 | 405 | | return new TriggerStartTriggerOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartTriggerRequ |
| | 406 | | } |
| 0 | 407 | | catch (Exception e) |
| | 408 | | { |
| 0 | 409 | | scope.Failed(e); |
| 0 | 410 | | throw; |
| | 411 | | } |
| 0 | 412 | | } |
| | 413 | |
|
| | 414 | | /// <summary> Stops a trigger. </summary> |
| | 415 | | /// <param name="triggerName"> The trigger name. </param> |
| | 416 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 417 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 418 | | public virtual async Task<TriggerStopTriggerOperation> StartStopTriggerAsync(string triggerName, CancellationTok |
| | 419 | | { |
| 0 | 420 | | if (triggerName == null) |
| | 421 | | { |
| 0 | 422 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 423 | | } |
| | 424 | |
|
| 0 | 425 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartStopTrigger"); |
| 0 | 426 | | scope.Start(); |
| | 427 | | try |
| | 428 | | { |
| 0 | 429 | | var originalResponse = await RestClient.StopTriggerAsync(triggerName, cancellationToken).ConfigureAwait( |
| 0 | 430 | | return new TriggerStopTriggerOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopTriggerReques |
| | 431 | | } |
| 0 | 432 | | catch (Exception e) |
| | 433 | | { |
| 0 | 434 | | scope.Failed(e); |
| 0 | 435 | | throw; |
| | 436 | | } |
| 0 | 437 | | } |
| | 438 | |
|
| | 439 | | /// <summary> Stops a trigger. </summary> |
| | 440 | | /// <param name="triggerName"> The trigger name. </param> |
| | 441 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 442 | | /// <exception cref="ArgumentNullException"> <paramref name="triggerName"/> is null. </exception> |
| | 443 | | public virtual TriggerStopTriggerOperation StartStopTrigger(string triggerName, CancellationToken cancellationTo |
| | 444 | | { |
| 0 | 445 | | if (triggerName == null) |
| | 446 | | { |
| 0 | 447 | | throw new ArgumentNullException(nameof(triggerName)); |
| | 448 | | } |
| | 449 | |
|
| 0 | 450 | | using var scope = _clientDiagnostics.CreateScope("TriggerClient.StartStopTrigger"); |
| 0 | 451 | | scope.Start(); |
| | 452 | | try |
| | 453 | | { |
| 0 | 454 | | var originalResponse = RestClient.StopTrigger(triggerName, cancellationToken); |
| 0 | 455 | | return new TriggerStopTriggerOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopTriggerReques |
| | 456 | | } |
| 0 | 457 | | catch (Exception e) |
| | 458 | | { |
| 0 | 459 | | scope.Failed(e); |
| 0 | 460 | | throw; |
| | 461 | | } |
| 0 | 462 | | } |
| | 463 | | } |
| | 464 | | } |