< Summary

Class:Azure.Analytics.Synapse.Artifacts.DataFlowDebugSessionRestClient
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\DataFlowDebugSessionRestClient.cs
Covered lines:0
Uncovered lines:187
Coverable lines:187
Total lines:430
Line coverage:0% (0 of 187)
Covered branches:0
Total branches:56
Branch coverage:0% (0 of 56)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateCreateDataFlowDebugSessionRequest(...)-0%100%
CreateDataFlowDebugSessionAsync()-0%0%
CreateDataFlowDebugSession(...)-0%0%
CreateQueryDataFlowDebugSessionsByWorkspaceRequest()-0%100%
QueryDataFlowDebugSessionsByWorkspaceAsync()-0%0%
QueryDataFlowDebugSessionsByWorkspace(...)-0%0%
CreateAddDataFlowRequest(...)-0%100%
AddDataFlowAsync()-0%0%
AddDataFlow(...)-0%0%
CreateDeleteDataFlowDebugSessionRequest(...)-0%100%
DeleteDataFlowDebugSessionAsync()-0%0%
DeleteDataFlowDebugSession(...)-0%0%
CreateExecuteCommandRequest(...)-0%100%
ExecuteCommandAsync()-0%0%
ExecuteCommand(...)-0%0%
CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(...)-0%100%
QueryDataFlowDebugSessionsByWorkspaceNextPageAsync()-0%0%
QueryDataFlowDebugSessionsByWorkspaceNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\DataFlowDebugSessionRestClient.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Analytics.Synapse.Artifacts.Models;
 14using Azure.Core;
 15using Azure.Core.Pipeline;
 16
 17namespace Azure.Analytics.Synapse.Artifacts
 18{
 19    internal partial class DataFlowDebugSessionRestClient
 20    {
 21        private string endpoint;
 22        private string apiVersion;
 23        private ClientDiagnostics _clientDiagnostics;
 24        private HttpPipeline _pipeline;
 25
 26        /// <summary> Initializes a new instance of DataFlowDebugSessionRestClient. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="endpoint"> The workspace development endpoint, for example https://myworkspace.dev.azuresynapse
 30        /// <param name="apiVersion"> Api Version. </param>
 31        /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="apiVersion"/> is nul
 032        public DataFlowDebugSessionRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoin
 33        {
 034            if (endpoint == null)
 35            {
 036                throw new ArgumentNullException(nameof(endpoint));
 37            }
 038            if (apiVersion == null)
 39            {
 040                throw new ArgumentNullException(nameof(apiVersion));
 41            }
 42
 043            this.endpoint = endpoint;
 044            this.apiVersion = apiVersion;
 045            _clientDiagnostics = clientDiagnostics;
 046            _pipeline = pipeline;
 047        }
 48
 49        internal HttpMessage CreateCreateDataFlowDebugSessionRequest(CreateDataFlowDebugSessionRequest request)
 50        {
 051            var message = _pipeline.CreateMessage();
 052            var request0 = message.Request;
 053            request0.Method = RequestMethod.Post;
 054            var uri = new RawRequestUriBuilder();
 055            uri.AppendRaw(endpoint, false);
 056            uri.AppendPath("/createDataFlowDebugSession", false);
 057            uri.AppendQuery("api-version", apiVersion, true);
 058            request0.Uri = uri;
 059            request0.Headers.Add("Content-Type", "application/json");
 060            var content = new Utf8JsonRequestContent();
 061            content.JsonWriter.WriteObjectValue(request);
 062            request0.Content = content;
 063            return message;
 64        }
 65
 66        /// <summary> Creates a data flow debug session. </summary>
 67        /// <param name="request"> Data flow debug session definition. </param>
 68        /// <param name="cancellationToken"> The cancellation token to use. </param>
 69        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 70        public async Task<ResponseWithHeaders<DataFlowDebugSessionCreateDataFlowDebugSessionHeaders>> CreateDataFlowDebu
 71        {
 072            if (request == null)
 73            {
 074                throw new ArgumentNullException(nameof(request));
 75            }
 76
 077            using var message = CreateCreateDataFlowDebugSessionRequest(request);
 078            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 079            var headers = new DataFlowDebugSessionCreateDataFlowDebugSessionHeaders(message.Response);
 080            switch (message.Response.Status)
 81            {
 82                case 200:
 83                case 202:
 084                    return ResponseWithHeaders.FromValue(headers, message.Response);
 85                default:
 086                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 87            }
 088        }
 89
 90        /// <summary> Creates a data flow debug session. </summary>
 91        /// <param name="request"> Data flow debug session definition. </param>
 92        /// <param name="cancellationToken"> The cancellation token to use. </param>
 93        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 94        public ResponseWithHeaders<DataFlowDebugSessionCreateDataFlowDebugSessionHeaders> CreateDataFlowDebugSession(Cre
 95        {
 096            if (request == null)
 97            {
 098                throw new ArgumentNullException(nameof(request));
 99            }
 100
 0101            using var message = CreateCreateDataFlowDebugSessionRequest(request);
 0102            _pipeline.Send(message, cancellationToken);
 0103            var headers = new DataFlowDebugSessionCreateDataFlowDebugSessionHeaders(message.Response);
 0104            switch (message.Response.Status)
 105            {
 106                case 200:
 107                case 202:
 0108                    return ResponseWithHeaders.FromValue(headers, message.Response);
 109                default:
 0110                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 111            }
 0112        }
 113
 114        internal HttpMessage CreateQueryDataFlowDebugSessionsByWorkspaceRequest()
 115        {
 0116            var message = _pipeline.CreateMessage();
 0117            var request = message.Request;
 0118            request.Method = RequestMethod.Post;
 0119            var uri = new RawRequestUriBuilder();
 0120            uri.AppendRaw(endpoint, false);
 0121            uri.AppendPath("/queryDataFlowDebugSessions", false);
 0122            uri.AppendQuery("api-version", apiVersion, true);
 0123            request.Uri = uri;
 0124            return message;
 125        }
 126
 127        /// <summary> Query all active data flow debug sessions. </summary>
 128        /// <param name="cancellationToken"> The cancellation token to use. </param>
 129        public async Task<Response<QueryDataFlowDebugSessionsResponse>> QueryDataFlowDebugSessionsByWorkspaceAsync(Cance
 130        {
 0131            using var message = CreateQueryDataFlowDebugSessionsByWorkspaceRequest();
 0132            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0133            switch (message.Response.Status)
 134            {
 135                case 200:
 136                    {
 137                        QueryDataFlowDebugSessionsResponse value = default;
 0138                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0139                        value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(documen
 0140                        return Response.FromValue(value, message.Response);
 141                    }
 142                default:
 0143                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 144            }
 0145        }
 146
 147        /// <summary> Query all active data flow debug sessions. </summary>
 148        /// <param name="cancellationToken"> The cancellation token to use. </param>
 149        public Response<QueryDataFlowDebugSessionsResponse> QueryDataFlowDebugSessionsByWorkspace(CancellationToken canc
 150        {
 0151            using var message = CreateQueryDataFlowDebugSessionsByWorkspaceRequest();
 0152            _pipeline.Send(message, cancellationToken);
 0153            switch (message.Response.Status)
 154            {
 155                case 200:
 156                    {
 157                        QueryDataFlowDebugSessionsResponse value = default;
 0158                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0159                        value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(documen
 0160                        return Response.FromValue(value, message.Response);
 161                    }
 162                default:
 0163                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 164            }
 0165        }
 166
 167        internal HttpMessage CreateAddDataFlowRequest(DataFlowDebugPackage request)
 168        {
 0169            var message = _pipeline.CreateMessage();
 0170            var request0 = message.Request;
 0171            request0.Method = RequestMethod.Post;
 0172            var uri = new RawRequestUriBuilder();
 0173            uri.AppendRaw(endpoint, false);
 0174            uri.AppendPath("/addDataFlowToDebugSession", false);
 0175            uri.AppendQuery("api-version", apiVersion, true);
 0176            request0.Uri = uri;
 0177            request0.Headers.Add("Content-Type", "application/json");
 0178            var content = new Utf8JsonRequestContent();
 0179            content.JsonWriter.WriteObjectValue(request);
 0180            request0.Content = content;
 0181            return message;
 182        }
 183
 184        /// <summary> Add a data flow into debug session. </summary>
 185        /// <param name="request"> Data flow debug session definition with debug content. </param>
 186        /// <param name="cancellationToken"> The cancellation token to use. </param>
 187        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 188        public async Task<Response<AddDataFlowToDebugSessionResponse>> AddDataFlowAsync(DataFlowDebugPackage request, Ca
 189        {
 0190            if (request == null)
 191            {
 0192                throw new ArgumentNullException(nameof(request));
 193            }
 194
 0195            using var message = CreateAddDataFlowRequest(request);
 0196            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0197            switch (message.Response.Status)
 198            {
 199                case 200:
 200                    {
 201                        AddDataFlowToDebugSessionResponse value = default;
 0202                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0203                        value = AddDataFlowToDebugSessionResponse.DeserializeAddDataFlowToDebugSessionResponse(document.
 0204                        return Response.FromValue(value, message.Response);
 205                    }
 206                default:
 0207                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 208            }
 0209        }
 210
 211        /// <summary> Add a data flow into debug session. </summary>
 212        /// <param name="request"> Data flow debug session definition with debug content. </param>
 213        /// <param name="cancellationToken"> The cancellation token to use. </param>
 214        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 215        public Response<AddDataFlowToDebugSessionResponse> AddDataFlow(DataFlowDebugPackage request, CancellationToken c
 216        {
 0217            if (request == null)
 218            {
 0219                throw new ArgumentNullException(nameof(request));
 220            }
 221
 0222            using var message = CreateAddDataFlowRequest(request);
 0223            _pipeline.Send(message, cancellationToken);
 0224            switch (message.Response.Status)
 225            {
 226                case 200:
 227                    {
 228                        AddDataFlowToDebugSessionResponse value = default;
 0229                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0230                        value = AddDataFlowToDebugSessionResponse.DeserializeAddDataFlowToDebugSessionResponse(document.
 0231                        return Response.FromValue(value, message.Response);
 232                    }
 233                default:
 0234                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 235            }
 0236        }
 237
 238        internal HttpMessage CreateDeleteDataFlowDebugSessionRequest(DeleteDataFlowDebugSessionRequest request)
 239        {
 0240            var message = _pipeline.CreateMessage();
 0241            var request0 = message.Request;
 0242            request0.Method = RequestMethod.Post;
 0243            var uri = new RawRequestUriBuilder();
 0244            uri.AppendRaw(endpoint, false);
 0245            uri.AppendPath("/deleteDataFlowDebugSession", false);
 0246            uri.AppendQuery("api-version", apiVersion, true);
 0247            request0.Uri = uri;
 0248            request0.Headers.Add("Content-Type", "application/json");
 0249            var content = new Utf8JsonRequestContent();
 0250            content.JsonWriter.WriteObjectValue(request);
 0251            request0.Content = content;
 0252            return message;
 253        }
 254
 255        /// <summary> Deletes a data flow debug session. </summary>
 256        /// <param name="request"> Data flow debug session definition for deletion. </param>
 257        /// <param name="cancellationToken"> The cancellation token to use. </param>
 258        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 259        public async Task<Response> DeleteDataFlowDebugSessionAsync(DeleteDataFlowDebugSessionRequest request, Cancellat
 260        {
 0261            if (request == null)
 262            {
 0263                throw new ArgumentNullException(nameof(request));
 264            }
 265
 0266            using var message = CreateDeleteDataFlowDebugSessionRequest(request);
 0267            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0268            switch (message.Response.Status)
 269            {
 270                case 200:
 0271                    return message.Response;
 272                default:
 0273                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 274            }
 0275        }
 276
 277        /// <summary> Deletes a data flow debug session. </summary>
 278        /// <param name="request"> Data flow debug session definition for deletion. </param>
 279        /// <param name="cancellationToken"> The cancellation token to use. </param>
 280        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 281        public Response DeleteDataFlowDebugSession(DeleteDataFlowDebugSessionRequest request, CancellationToken cancella
 282        {
 0283            if (request == null)
 284            {
 0285                throw new ArgumentNullException(nameof(request));
 286            }
 287
 0288            using var message = CreateDeleteDataFlowDebugSessionRequest(request);
 0289            _pipeline.Send(message, cancellationToken);
 0290            switch (message.Response.Status)
 291            {
 292                case 200:
 0293                    return message.Response;
 294                default:
 0295                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 296            }
 0297        }
 298
 299        internal HttpMessage CreateExecuteCommandRequest(DataFlowDebugCommandRequest request)
 300        {
 0301            var message = _pipeline.CreateMessage();
 0302            var request0 = message.Request;
 0303            request0.Method = RequestMethod.Post;
 0304            var uri = new RawRequestUriBuilder();
 0305            uri.AppendRaw(endpoint, false);
 0306            uri.AppendPath("/executeDataFlowDebugCommand", false);
 0307            uri.AppendQuery("api-version", apiVersion, true);
 0308            request0.Uri = uri;
 0309            request0.Headers.Add("Content-Type", "application/json");
 0310            var content = new Utf8JsonRequestContent();
 0311            content.JsonWriter.WriteObjectValue(request);
 0312            request0.Content = content;
 0313            return message;
 314        }
 315
 316        /// <summary> Execute a data flow debug command. </summary>
 317        /// <param name="request"> Data flow debug command definition. </param>
 318        /// <param name="cancellationToken"> The cancellation token to use. </param>
 319        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 320        public async Task<ResponseWithHeaders<DataFlowDebugSessionExecuteCommandHeaders>> ExecuteCommandAsync(DataFlowDe
 321        {
 0322            if (request == null)
 323            {
 0324                throw new ArgumentNullException(nameof(request));
 325            }
 326
 0327            using var message = CreateExecuteCommandRequest(request);
 0328            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0329            var headers = new DataFlowDebugSessionExecuteCommandHeaders(message.Response);
 0330            switch (message.Response.Status)
 331            {
 332                case 200:
 333                case 202:
 0334                    return ResponseWithHeaders.FromValue(headers, message.Response);
 335                default:
 0336                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 337            }
 0338        }
 339
 340        /// <summary> Execute a data flow debug command. </summary>
 341        /// <param name="request"> Data flow debug command definition. </param>
 342        /// <param name="cancellationToken"> The cancellation token to use. </param>
 343        /// <exception cref="ArgumentNullException"> <paramref name="request"/> is null. </exception>
 344        public ResponseWithHeaders<DataFlowDebugSessionExecuteCommandHeaders> ExecuteCommand(DataFlowDebugCommandRequest
 345        {
 0346            if (request == null)
 347            {
 0348                throw new ArgumentNullException(nameof(request));
 349            }
 350
 0351            using var message = CreateExecuteCommandRequest(request);
 0352            _pipeline.Send(message, cancellationToken);
 0353            var headers = new DataFlowDebugSessionExecuteCommandHeaders(message.Response);
 0354            switch (message.Response.Status)
 355            {
 356                case 200:
 357                case 202:
 0358                    return ResponseWithHeaders.FromValue(headers, message.Response);
 359                default:
 0360                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 361            }
 0362        }
 363
 364        internal HttpMessage CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(string nextLink)
 365        {
 0366            var message = _pipeline.CreateMessage();
 0367            var request = message.Request;
 0368            request.Method = RequestMethod.Get;
 0369            var uri = new RawRequestUriBuilder();
 0370            uri.AppendRaw(endpoint, false);
 0371            uri.AppendRawNextLink(nextLink, false);
 0372            request.Uri = uri;
 0373            return message;
 374        }
 375
 376        /// <summary> Query all active data flow debug sessions. </summary>
 377        /// <param name="nextLink"> The URL to the next page of results. </param>
 378        /// <param name="cancellationToken"> The cancellation token to use. </param>
 379        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
 380        public async Task<Response<QueryDataFlowDebugSessionsResponse>> QueryDataFlowDebugSessionsByWorkspaceNextPageAsy
 381        {
 0382            if (nextLink == null)
 383            {
 0384                throw new ArgumentNullException(nameof(nextLink));
 385            }
 386
 0387            using var message = CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(nextLink);
 0388            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0389            switch (message.Response.Status)
 390            {
 391                case 200:
 392                    {
 393                        QueryDataFlowDebugSessionsResponse value = default;
 0394                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0395                        value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(documen
 0396                        return Response.FromValue(value, message.Response);
 397                    }
 398                default:
 0399                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 400            }
 0401        }
 402
 403        /// <summary> Query all active data flow debug sessions. </summary>
 404        /// <param name="nextLink"> The URL to the next page of results. </param>
 405        /// <param name="cancellationToken"> The cancellation token to use. </param>
 406        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
 407        public Response<QueryDataFlowDebugSessionsResponse> QueryDataFlowDebugSessionsByWorkspaceNextPage(string nextLin
 408        {
 0409            if (nextLink == null)
 410            {
 0411                throw new ArgumentNullException(nameof(nextLink));
 412            }
 413
 0414            using var message = CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(nextLink);
 0415            _pipeline.Send(message, cancellationToken);
 0416            switch (message.Response.Status)
 417            {
 418                case 200:
 419                    {
 420                        QueryDataFlowDebugSessionsResponse value = default;
 0421                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0422                        value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(documen
 0423                        return Response.FromValue(value, message.Response);
 424                    }
 425                default:
 0426                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 427            }
 0428        }
 429    }
 430}