| | | 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 PipelineRun service client. </summary> |
| | 0 | 18 | | public partial class PipelineRunClient |
| | | 19 | | { |
| | | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 21 | | private readonly HttpPipeline _pipeline; |
| | 0 | 22 | | internal PipelineRunRestClient RestClient { get; } |
| | | 23 | | /// <summary> Initializes a new instance of PipelineRunClient for mocking. </summary> |
| | 0 | 24 | | protected PipelineRunClient() |
| | 0 | 25 | | { |
| | 0 | 26 | | } |
| | 0 | 27 | | /// <summary> Initializes a new instance of PipelineRunClient. </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 PipelineRunClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string a |
| | | 33 | | { |
| | 0 | 34 | | RestClient = new PipelineRunRestClient(clientDiagnostics, pipeline, endpoint, apiVersion); |
| | 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| | 0 | 36 | | _pipeline = pipeline; |
| | 0 | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <summary> Query pipeline runs in the workspace based on input filter conditions. </summary> |
| | | 40 | | /// <param name="filterParameters"> Parameters to filter the pipeline run. </param> |
| | | 41 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 42 | | public virtual async Task<Response<PipelineRunsQueryResponse>> QueryPipelineRunsByWorkspaceAsync(RunFilterParame |
| | | 43 | | { |
| | 0 | 44 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.QueryPipelineRunsByWorkspace"); |
| | 0 | 45 | | scope.Start(); |
| | | 46 | | try |
| | | 47 | | { |
| | 0 | 48 | | return await RestClient.QueryPipelineRunsByWorkspaceAsync(filterParameters, cancellationToken).Configure |
| | | 49 | | } |
| | 0 | 50 | | catch (Exception e) |
| | | 51 | | { |
| | 0 | 52 | | scope.Failed(e); |
| | 0 | 53 | | throw; |
| | | 54 | | } |
| | 0 | 55 | | } |
| | | 56 | | |
| | | 57 | | /// <summary> Query pipeline runs in the workspace based on input filter conditions. </summary> |
| | | 58 | | /// <param name="filterParameters"> Parameters to filter the pipeline run. </param> |
| | | 59 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 60 | | public virtual Response<PipelineRunsQueryResponse> QueryPipelineRunsByWorkspace(RunFilterParameters filterParame |
| | | 61 | | { |
| | 0 | 62 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.QueryPipelineRunsByWorkspace"); |
| | 0 | 63 | | scope.Start(); |
| | | 64 | | try |
| | | 65 | | { |
| | 0 | 66 | | return RestClient.QueryPipelineRunsByWorkspace(filterParameters, cancellationToken); |
| | | 67 | | } |
| | 0 | 68 | | catch (Exception e) |
| | | 69 | | { |
| | 0 | 70 | | scope.Failed(e); |
| | 0 | 71 | | throw; |
| | | 72 | | } |
| | 0 | 73 | | } |
| | | 74 | | |
| | | 75 | | /// <summary> Get a pipeline run by its run ID. </summary> |
| | | 76 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 77 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 78 | | public virtual async Task<Response<PipelineRun>> GetPipelineRunAsync(string runId, CancellationToken cancellatio |
| | | 79 | | { |
| | 0 | 80 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.GetPipelineRun"); |
| | 0 | 81 | | scope.Start(); |
| | | 82 | | try |
| | | 83 | | { |
| | 0 | 84 | | return await RestClient.GetPipelineRunAsync(runId, cancellationToken).ConfigureAwait(false); |
| | | 85 | | } |
| | 0 | 86 | | catch (Exception e) |
| | | 87 | | { |
| | 0 | 88 | | scope.Failed(e); |
| | 0 | 89 | | throw; |
| | | 90 | | } |
| | 0 | 91 | | } |
| | | 92 | | |
| | | 93 | | /// <summary> Get a pipeline run by its run ID. </summary> |
| | | 94 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 95 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 96 | | public virtual Response<PipelineRun> GetPipelineRun(string runId, CancellationToken cancellationToken = default) |
| | | 97 | | { |
| | 0 | 98 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.GetPipelineRun"); |
| | 0 | 99 | | scope.Start(); |
| | | 100 | | try |
| | | 101 | | { |
| | 0 | 102 | | return RestClient.GetPipelineRun(runId, cancellationToken); |
| | | 103 | | } |
| | 0 | 104 | | catch (Exception e) |
| | | 105 | | { |
| | 0 | 106 | | scope.Failed(e); |
| | 0 | 107 | | throw; |
| | | 108 | | } |
| | 0 | 109 | | } |
| | | 110 | | |
| | | 111 | | /// <summary> Query activity runs based on input filter conditions. </summary> |
| | | 112 | | /// <param name="pipelineName"> The pipeline name. </param> |
| | | 113 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 114 | | /// <param name="filterParameters"> Parameters to filter the activity runs. </param> |
| | | 115 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 116 | | public virtual async Task<Response<ActivityRunsQueryResponse>> QueryActivityRunsAsync(string pipelineName, strin |
| | | 117 | | { |
| | 0 | 118 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.QueryActivityRuns"); |
| | 0 | 119 | | scope.Start(); |
| | | 120 | | try |
| | | 121 | | { |
| | 0 | 122 | | return await RestClient.QueryActivityRunsAsync(pipelineName, runId, filterParameters, cancellationToken) |
| | | 123 | | } |
| | 0 | 124 | | catch (Exception e) |
| | | 125 | | { |
| | 0 | 126 | | scope.Failed(e); |
| | 0 | 127 | | throw; |
| | | 128 | | } |
| | 0 | 129 | | } |
| | | 130 | | |
| | | 131 | | /// <summary> Query activity runs based on input filter conditions. </summary> |
| | | 132 | | /// <param name="pipelineName"> The pipeline name. </param> |
| | | 133 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 134 | | /// <param name="filterParameters"> Parameters to filter the activity runs. </param> |
| | | 135 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 136 | | public virtual Response<ActivityRunsQueryResponse> QueryActivityRuns(string pipelineName, string runId, RunFilte |
| | | 137 | | { |
| | 0 | 138 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.QueryActivityRuns"); |
| | 0 | 139 | | scope.Start(); |
| | | 140 | | try |
| | | 141 | | { |
| | 0 | 142 | | return RestClient.QueryActivityRuns(pipelineName, runId, filterParameters, cancellationToken); |
| | | 143 | | } |
| | 0 | 144 | | catch (Exception e) |
| | | 145 | | { |
| | 0 | 146 | | scope.Failed(e); |
| | 0 | 147 | | throw; |
| | | 148 | | } |
| | 0 | 149 | | } |
| | | 150 | | |
| | | 151 | | /// <summary> Cancel a pipeline run by its run ID. </summary> |
| | | 152 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 153 | | /// <param name="isRecursive"> If true, cancel all the Child pipelines that are triggered by the current pipelin |
| | | 154 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 155 | | public virtual async Task<Response> CancelPipelineRunAsync(string runId, bool? isRecursive = null, CancellationT |
| | | 156 | | { |
| | 0 | 157 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.CancelPipelineRun"); |
| | 0 | 158 | | scope.Start(); |
| | | 159 | | try |
| | | 160 | | { |
| | 0 | 161 | | return await RestClient.CancelPipelineRunAsync(runId, isRecursive, cancellationToken).ConfigureAwait(fal |
| | | 162 | | } |
| | 0 | 163 | | catch (Exception e) |
| | | 164 | | { |
| | 0 | 165 | | scope.Failed(e); |
| | 0 | 166 | | throw; |
| | | 167 | | } |
| | 0 | 168 | | } |
| | | 169 | | |
| | | 170 | | /// <summary> Cancel a pipeline run by its run ID. </summary> |
| | | 171 | | /// <param name="runId"> The pipeline run identifier. </param> |
| | | 172 | | /// <param name="isRecursive"> If true, cancel all the Child pipelines that are triggered by the current pipelin |
| | | 173 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 174 | | public virtual Response CancelPipelineRun(string runId, bool? isRecursive = null, CancellationToken cancellation |
| | | 175 | | { |
| | 0 | 176 | | using var scope = _clientDiagnostics.CreateScope("PipelineRunClient.CancelPipelineRun"); |
| | 0 | 177 | | scope.Start(); |
| | | 178 | | try |
| | | 179 | | { |
| | 0 | 180 | | return RestClient.CancelPipelineRun(runId, isRecursive, cancellationToken); |
| | | 181 | | } |
| | 0 | 182 | | catch (Exception e) |
| | | 183 | | { |
| | 0 | 184 | | scope.Failed(e); |
| | 0 | 185 | | throw; |
| | | 186 | | } |
| | 0 | 187 | | } |
| | | 188 | | } |
| | | 189 | | } |