| | 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.Pipeline; |
| | 14 | |
|
| | 15 | | namespace Azure.Analytics.Synapse.Artifacts |
| 0 | 16 | | { |
| | 17 | | /// <summary> The TriggerRun service client. </summary> |
| 0 | 18 | | public partial class TriggerRunClient |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal TriggerRunRestClient RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of TriggerRunClient for mocking. </summary> |
| 0 | 24 | | protected TriggerRunClient() |
| 0 | 25 | | { |
| 0 | 26 | | } |
| 0 | 27 | | /// <summary> Initializes a new instance of TriggerRunClient. </summary> |
| | 28 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| 0 | 29 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 30 | | /// <param name="endpoint"> The workspace development endpoint, for example https://myworkspace.dev.azuresynapse |
| | 31 | | /// <param name="apiVersion"> Api Version. </param> |
| 0 | 32 | | internal TriggerRunClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string ap |
| | 33 | | { |
| 0 | 34 | | RestClient = new TriggerRunRestClient(clientDiagnostics, pipeline, endpoint, apiVersion); |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> Rerun single trigger instance by runId. </summary> |
| | 40 | | /// <param name="triggerName"> The trigger name. </param> |
| | 41 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | 42 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 43 | | public virtual async Task<Response> RerunTriggerInstanceAsync(string triggerName, string runId, CancellationToke |
| | 44 | | { |
| 0 | 45 | | using var scope = _clientDiagnostics.CreateScope("TriggerRunClient.RerunTriggerInstance"); |
| 0 | 46 | | scope.Start(); |
| | 47 | | try |
| | 48 | | { |
| 0 | 49 | | return await RestClient.RerunTriggerInstanceAsync(triggerName, runId, cancellationToken).ConfigureAwait( |
| | 50 | | } |
| 0 | 51 | | catch (Exception e) |
| | 52 | | { |
| 0 | 53 | | scope.Failed(e); |
| 0 | 54 | | throw; |
| | 55 | | } |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | /// <summary> Rerun single trigger instance by runId. </summary> |
| | 59 | | /// <param name="triggerName"> The trigger name. </param> |
| | 60 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | 61 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 62 | | public virtual Response RerunTriggerInstance(string triggerName, string runId, CancellationToken cancellationTok |
| | 63 | | { |
| 0 | 64 | | using var scope = _clientDiagnostics.CreateScope("TriggerRunClient.RerunTriggerInstance"); |
| 0 | 65 | | scope.Start(); |
| | 66 | | try |
| | 67 | | { |
| 0 | 68 | | return RestClient.RerunTriggerInstance(triggerName, runId, cancellationToken); |
| | 69 | | } |
| 0 | 70 | | catch (Exception e) |
| | 71 | | { |
| 0 | 72 | | scope.Failed(e); |
| 0 | 73 | | throw; |
| | 74 | | } |
| 0 | 75 | | } |
| | 76 | |
|
| | 77 | | /// <summary> Query trigger runs. </summary> |
| | 78 | | /// <param name="filterParameters"> Parameters to filter the pipeline run. </param> |
| | 79 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 80 | | public virtual async Task<Response<TriggerRunsQueryResponse>> QueryTriggerRunsByWorkspaceAsync(RunFilterParamete |
| | 81 | | { |
| 0 | 82 | | using var scope = _clientDiagnostics.CreateScope("TriggerRunClient.QueryTriggerRunsByWorkspace"); |
| 0 | 83 | | scope.Start(); |
| | 84 | | try |
| | 85 | | { |
| 0 | 86 | | return await RestClient.QueryTriggerRunsByWorkspaceAsync(filterParameters, cancellationToken).ConfigureA |
| | 87 | | } |
| 0 | 88 | | catch (Exception e) |
| | 89 | | { |
| 0 | 90 | | scope.Failed(e); |
| 0 | 91 | | throw; |
| | 92 | | } |
| 0 | 93 | | } |
| | 94 | |
|
| | 95 | | /// <summary> Query trigger runs. </summary> |
| | 96 | | /// <param name="filterParameters"> Parameters to filter the pipeline run. </param> |
| | 97 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 98 | | public virtual Response<TriggerRunsQueryResponse> QueryTriggerRunsByWorkspace(RunFilterParameters filterParamete |
| | 99 | | { |
| 0 | 100 | | using var scope = _clientDiagnostics.CreateScope("TriggerRunClient.QueryTriggerRunsByWorkspace"); |
| 0 | 101 | | scope.Start(); |
| | 102 | | try |
| | 103 | | { |
| 0 | 104 | | return RestClient.QueryTriggerRunsByWorkspace(filterParameters, cancellationToken); |
| | 105 | | } |
| 0 | 106 | | catch (Exception e) |
| | 107 | | { |
| 0 | 108 | | scope.Failed(e); |
| 0 | 109 | | throw; |
| | 110 | | } |
| 0 | 111 | | } |
| | 112 | | } |
| | 113 | | } |