| | 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 DataFlowDebugSession service client. </summary> |
| | 19 | | public partial class DataFlowDebugSessionClient |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 0 | 23 | | internal DataFlowDebugSessionRestClient RestClient { get; } |
| 0 | 24 | | /// <summary> Initializes a new instance of DataFlowDebugSessionClient for mocking. </summary> |
| 0 | 25 | | protected DataFlowDebugSessionClient() |
| 0 | 26 | | { |
| 0 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of DataFlowDebugSessionClient. </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 DataFlowDebugSessionClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, |
| | 34 | | { |
| 0 | 35 | | RestClient = new DataFlowDebugSessionRestClient(clientDiagnostics, pipeline, endpoint, apiVersion); |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Add a data flow into debug session. </summary> |
| | 41 | | /// <param name="request"> Data flow debug session definition with debug content. </param> |
| | 42 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 43 | | public virtual async Task<Response<AddDataFlowToDebugSessionResponse>> AddDataFlowAsync(DataFlowDebugPackage req |
| | 44 | | { |
| 0 | 45 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.AddDataFlow"); |
| 0 | 46 | | scope.Start(); |
| | 47 | | try |
| | 48 | | { |
| 0 | 49 | | return await RestClient.AddDataFlowAsync(request, cancellationToken).ConfigureAwait(false); |
| | 50 | | } |
| 0 | 51 | | catch (Exception e) |
| | 52 | | { |
| 0 | 53 | | scope.Failed(e); |
| 0 | 54 | | throw; |
| | 55 | | } |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | /// <summary> Add a data flow into debug session. </summary> |
| | 59 | | /// <param name="request"> Data flow debug session definition with debug content. </param> |
| | 60 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 61 | | public virtual Response<AddDataFlowToDebugSessionResponse> AddDataFlow(DataFlowDebugPackage request, Cancellatio |
| | 62 | | { |
| 0 | 63 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.AddDataFlow"); |
| 0 | 64 | | scope.Start(); |
| | 65 | | try |
| | 66 | | { |
| 0 | 67 | | return RestClient.AddDataFlow(request, cancellationToken); |
| | 68 | | } |
| 0 | 69 | | catch (Exception e) |
| | 70 | | { |
| 0 | 71 | | scope.Failed(e); |
| 0 | 72 | | throw; |
| | 73 | | } |
| 0 | 74 | | } |
| | 75 | |
|
| | 76 | | /// <summary> Deletes a data flow debug session. </summary> |
| | 77 | | /// <param name="request"> Data flow debug session definition for deletion. </param> |
| | 78 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 79 | | public virtual async Task<Response> DeleteDataFlowDebugSessionAsync(DeleteDataFlowDebugSessionRequest request, C |
| | 80 | | { |
| 0 | 81 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.DeleteDataFlowDebugSession"); |
| 0 | 82 | | scope.Start(); |
| | 83 | | try |
| | 84 | | { |
| 0 | 85 | | return await RestClient.DeleteDataFlowDebugSessionAsync(request, cancellationToken).ConfigureAwait(false |
| | 86 | | } |
| 0 | 87 | | catch (Exception e) |
| | 88 | | { |
| 0 | 89 | | scope.Failed(e); |
| 0 | 90 | | throw; |
| | 91 | | } |
| 0 | 92 | | } |
| | 93 | |
|
| | 94 | | /// <summary> Deletes a data flow debug session. </summary> |
| | 95 | | /// <param name="request"> Data flow debug session definition for deletion. </param> |
| | 96 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 97 | | public virtual Response DeleteDataFlowDebugSession(DeleteDataFlowDebugSessionRequest request, CancellationToken |
| | 98 | | { |
| 0 | 99 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.DeleteDataFlowDebugSession"); |
| 0 | 100 | | scope.Start(); |
| | 101 | | try |
| | 102 | | { |
| 0 | 103 | | return RestClient.DeleteDataFlowDebugSession(request, cancellationToken); |
| | 104 | | } |
| 0 | 105 | | catch (Exception e) |
| | 106 | | { |
| 0 | 107 | | scope.Failed(e); |
| 0 | 108 | | throw; |
| | 109 | | } |
| 0 | 110 | | } |
| | 111 | |
|
| | 112 | | /// <summary> Query all active data flow debug sessions. </summary> |
| | 113 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 114 | | public virtual AsyncPageable<DataFlowDebugSessionInfo> QueryDataFlowDebugSessionsByWorkspaceAsync(CancellationTo |
| | 115 | | { |
| | 116 | | async Task<Page<DataFlowDebugSessionInfo>> FirstPageFunc(int? pageSizeHint) |
| | 117 | | { |
| 0 | 118 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsB |
| 0 | 119 | | scope.Start(); |
| | 120 | | try |
| | 121 | | { |
| 0 | 122 | | var response = await RestClient.QueryDataFlowDebugSessionsByWorkspaceAsync(cancellationToken).Config |
| 0 | 123 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 124 | | } |
| 0 | 125 | | catch (Exception e) |
| | 126 | | { |
| 0 | 127 | | scope.Failed(e); |
| 0 | 128 | | throw; |
| | 129 | | } |
| 0 | 130 | | } |
| | 131 | | async Task<Page<DataFlowDebugSessionInfo>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 132 | | { |
| 0 | 133 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsB |
| 0 | 134 | | scope.Start(); |
| | 135 | | try |
| | 136 | | { |
| 0 | 137 | | var response = await RestClient.QueryDataFlowDebugSessionsByWorkspaceNextPageAsync(nextLink, cancell |
| 0 | 138 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 139 | | } |
| 0 | 140 | | catch (Exception e) |
| | 141 | | { |
| 0 | 142 | | scope.Failed(e); |
| 0 | 143 | | throw; |
| | 144 | | } |
| 0 | 145 | | } |
| 0 | 146 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 147 | | } |
| | 148 | |
|
| | 149 | | /// <summary> Query all active data flow debug sessions. </summary> |
| | 150 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 151 | | public virtual Pageable<DataFlowDebugSessionInfo> QueryDataFlowDebugSessionsByWorkspace(CancellationToken cancel |
| | 152 | | { |
| | 153 | | Page<DataFlowDebugSessionInfo> FirstPageFunc(int? pageSizeHint) |
| | 154 | | { |
| 0 | 155 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsB |
| 0 | 156 | | scope.Start(); |
| | 157 | | try |
| | 158 | | { |
| 0 | 159 | | var response = RestClient.QueryDataFlowDebugSessionsByWorkspace(cancellationToken); |
| 0 | 160 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 161 | | } |
| 0 | 162 | | catch (Exception e) |
| | 163 | | { |
| 0 | 164 | | scope.Failed(e); |
| 0 | 165 | | throw; |
| | 166 | | } |
| 0 | 167 | | } |
| | 168 | | Page<DataFlowDebugSessionInfo> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 169 | | { |
| 0 | 170 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsB |
| 0 | 171 | | scope.Start(); |
| | 172 | | try |
| | 173 | | { |
| 0 | 174 | | var response = RestClient.QueryDataFlowDebugSessionsByWorkspaceNextPage(nextLink, cancellationToken) |
| 0 | 175 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 176 | | } |
| 0 | 177 | | catch (Exception e) |
| | 178 | | { |
| 0 | 179 | | scope.Failed(e); |
| 0 | 180 | | throw; |
| | 181 | | } |
| 0 | 182 | | } |
| 0 | 183 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 184 | | } |
| | 185 | |
|
| | 186 | | /// <summary> Creates a data flow debug session. </summary> |
| | 187 | | /// <param name="request"> Data flow debug session definition. </param> |
| | 188 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 189 | | /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception> |
| | 190 | | public virtual async Task<DataFlowDebugSessionCreateDataFlowDebugSessionOperation> StartCreateDataFlowDebugSessi |
| | 191 | | { |
| 0 | 192 | | if (request == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(request)); |
| | 195 | | } |
| | 196 | |
|
| 0 | 197 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartCreateDataFlowDebugSession |
| 0 | 198 | | scope.Start(); |
| | 199 | | try |
| | 200 | | { |
| 0 | 201 | | var originalResponse = await RestClient.CreateDataFlowDebugSessionAsync(request, cancellationToken).Conf |
| 0 | 202 | | return new DataFlowDebugSessionCreateDataFlowDebugSessionOperation(_clientDiagnostics, _pipeline, RestCl |
| | 203 | | } |
| 0 | 204 | | catch (Exception e) |
| | 205 | | { |
| 0 | 206 | | scope.Failed(e); |
| 0 | 207 | | throw; |
| | 208 | | } |
| 0 | 209 | | } |
| | 210 | |
|
| | 211 | | /// <summary> Creates a data flow debug session. </summary> |
| | 212 | | /// <param name="request"> Data flow debug session definition. </param> |
| | 213 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 214 | | /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception> |
| | 215 | | public virtual DataFlowDebugSessionCreateDataFlowDebugSessionOperation StartCreateDataFlowDebugSession(CreateDat |
| | 216 | | { |
| 0 | 217 | | if (request == null) |
| | 218 | | { |
| 0 | 219 | | throw new ArgumentNullException(nameof(request)); |
| | 220 | | } |
| | 221 | |
|
| 0 | 222 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartCreateDataFlowDebugSession |
| 0 | 223 | | scope.Start(); |
| | 224 | | try |
| | 225 | | { |
| 0 | 226 | | var originalResponse = RestClient.CreateDataFlowDebugSession(request, cancellationToken); |
| 0 | 227 | | return new DataFlowDebugSessionCreateDataFlowDebugSessionOperation(_clientDiagnostics, _pipeline, RestCl |
| | 228 | | } |
| 0 | 229 | | catch (Exception e) |
| | 230 | | { |
| 0 | 231 | | scope.Failed(e); |
| 0 | 232 | | throw; |
| | 233 | | } |
| 0 | 234 | | } |
| | 235 | |
|
| | 236 | | /// <summary> Execute a data flow debug command. </summary> |
| | 237 | | /// <param name="request"> Data flow debug command definition. </param> |
| | 238 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 239 | | /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception> |
| | 240 | | public virtual async Task<DataFlowDebugSessionExecuteCommandOperation> StartExecuteCommandAsync(DataFlowDebugCom |
| | 241 | | { |
| 0 | 242 | | if (request == null) |
| | 243 | | { |
| 0 | 244 | | throw new ArgumentNullException(nameof(request)); |
| | 245 | | } |
| | 246 | |
|
| 0 | 247 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartExecuteCommand"); |
| 0 | 248 | | scope.Start(); |
| | 249 | | try |
| | 250 | | { |
| 0 | 251 | | var originalResponse = await RestClient.ExecuteCommandAsync(request, cancellationToken).ConfigureAwait(f |
| 0 | 252 | | return new DataFlowDebugSessionExecuteCommandOperation(_clientDiagnostics, _pipeline, RestClient.CreateE |
| | 253 | | } |
| 0 | 254 | | catch (Exception e) |
| | 255 | | { |
| 0 | 256 | | scope.Failed(e); |
| 0 | 257 | | throw; |
| | 258 | | } |
| 0 | 259 | | } |
| | 260 | |
|
| | 261 | | /// <summary> Execute a data flow debug command. </summary> |
| | 262 | | /// <param name="request"> Data flow debug command definition. </param> |
| | 263 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 264 | | /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception> |
| | 265 | | public virtual DataFlowDebugSessionExecuteCommandOperation StartExecuteCommand(DataFlowDebugCommandRequest reque |
| | 266 | | { |
| 0 | 267 | | if (request == null) |
| | 268 | | { |
| 0 | 269 | | throw new ArgumentNullException(nameof(request)); |
| | 270 | | } |
| | 271 | |
|
| 0 | 272 | | using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartExecuteCommand"); |
| 0 | 273 | | scope.Start(); |
| | 274 | | try |
| | 275 | | { |
| 0 | 276 | | var originalResponse = RestClient.ExecuteCommand(request, cancellationToken); |
| 0 | 277 | | return new DataFlowDebugSessionExecuteCommandOperation(_clientDiagnostics, _pipeline, RestClient.CreateE |
| | 278 | | } |
| 0 | 279 | | catch (Exception e) |
| | 280 | | { |
| 0 | 281 | | scope.Failed(e); |
| 0 | 282 | | throw; |
| | 283 | | } |
| 0 | 284 | | } |
| | 285 | | } |
| | 286 | | } |