< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateGetSparkJobDefinitionsByWorkspaceRequest()-0%100%
GetSparkJobDefinitionsByWorkspaceAsync()-0%0%
GetSparkJobDefinitionsByWorkspace(...)-0%0%
CreateCreateOrUpdateSparkJobDefinitionRequest(...)-0%0%
CreateOrUpdateSparkJobDefinitionAsync()-0%0%
CreateOrUpdateSparkJobDefinition(...)-0%0%
CreateGetSparkJobDefinitionRequest(...)-0%0%
GetSparkJobDefinitionAsync()-0%0%
GetSparkJobDefinition(...)-0%0%
CreateDeleteSparkJobDefinitionRequest(...)-0%100%
DeleteSparkJobDefinitionAsync()-0%0%
DeleteSparkJobDefinition(...)-0%0%
CreateExecuteSparkJobDefinitionRequest(...)-0%100%
ExecuteSparkJobDefinitionAsync()-0%0%
ExecuteSparkJobDefinition(...)-0%0%
CreateDebugSparkJobDefinitionRequest(...)-0%100%
DebugSparkJobDefinitionAsync()-0%0%
DebugSparkJobDefinition(...)-0%0%
CreateGetSparkJobDefinitionsByWorkspaceNextPageRequest(...)-0%100%
GetSparkJobDefinitionsByWorkspaceNextPageAsync()-0%0%
GetSparkJobDefinitionsByWorkspaceNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\SparkJobDefinitionRestClient.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 SparkJobDefinitionRestClient
 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 SparkJobDefinitionRestClient. </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 SparkJobDefinitionRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint,
 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 CreateGetSparkJobDefinitionsByWorkspaceRequest()
 50        {
 051            var message = _pipeline.CreateMessage();
 052            var request = message.Request;
 053            request.Method = RequestMethod.Get;
 054            var uri = new RawRequestUriBuilder();
 055            uri.AppendRaw(endpoint, false);
 056            uri.AppendPath("/sparkJobDefinitions", false);
 057            uri.AppendQuery("api-version", apiVersion, true);
 058            request.Uri = uri;
 059            return message;
 60        }
 61
 62        /// <summary> Lists spark job definitions. </summary>
 63        /// <param name="cancellationToken"> The cancellation token to use. </param>
 64        public async Task<Response<SparkJobDefinitionsListResponse>> GetSparkJobDefinitionsByWorkspaceAsync(Cancellation
 65        {
 066            using var message = CreateGetSparkJobDefinitionsByWorkspaceRequest();
 067            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 068            switch (message.Response.Status)
 69            {
 70                case 200:
 71                    {
 72                        SparkJobDefinitionsListResponse value = default;
 073                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 074                        value = SparkJobDefinitionsListResponse.DeserializeSparkJobDefinitionsListResponse(document.Root
 075                        return Response.FromValue(value, message.Response);
 76                    }
 77                default:
 078                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 79            }
 080        }
 81
 82        /// <summary> Lists spark job definitions. </summary>
 83        /// <param name="cancellationToken"> The cancellation token to use. </param>
 84        public Response<SparkJobDefinitionsListResponse> GetSparkJobDefinitionsByWorkspace(CancellationToken cancellatio
 85        {
 086            using var message = CreateGetSparkJobDefinitionsByWorkspaceRequest();
 087            _pipeline.Send(message, cancellationToken);
 088            switch (message.Response.Status)
 89            {
 90                case 200:
 91                    {
 92                        SparkJobDefinitionsListResponse value = default;
 093                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 094                        value = SparkJobDefinitionsListResponse.DeserializeSparkJobDefinitionsListResponse(document.Root
 095                        return Response.FromValue(value, message.Response);
 96                    }
 97                default:
 098                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 99            }
 0100        }
 101
 102        internal HttpMessage CreateCreateOrUpdateSparkJobDefinitionRequest(string sparkJobDefinitionName, SparkJobDefini
 103        {
 0104            var message = _pipeline.CreateMessage();
 0105            var request = message.Request;
 0106            request.Method = RequestMethod.Put;
 0107            var uri = new RawRequestUriBuilder();
 0108            uri.AppendRaw(endpoint, false);
 0109            uri.AppendPath("/sparkJobDefinitions/", false);
 0110            uri.AppendPath(sparkJobDefinitionName, true);
 0111            uri.AppendQuery("api-version", apiVersion, true);
 0112            request.Uri = uri;
 0113            if (ifMatch != null)
 114            {
 0115                request.Headers.Add("If-Match", ifMatch);
 116            }
 0117            request.Headers.Add("Content-Type", "application/json");
 0118            var content = new Utf8JsonRequestContent();
 0119            content.JsonWriter.WriteObjectValue(sparkJobDefinition);
 0120            request.Content = content;
 0121            return message;
 122        }
 123
 124        /// <summary> Creates or updates a Spark Job Definition. </summary>
 125        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 126        /// <param name="sparkJobDefinition"> Spark Job Definition resource definition. </param>
 127        /// <param name="ifMatch"> ETag of the Spark Job Definition entity.  Should only be specified for update, for wh
 128        /// <param name="cancellationToken"> The cancellation token to use. </param>
 129        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> or <paramref name="sparkJ
 130        public async Task<Response<SparkJobDefinitionResource>> CreateOrUpdateSparkJobDefinitionAsync(string sparkJobDef
 131        {
 0132            if (sparkJobDefinitionName == null)
 133            {
 0134                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 135            }
 0136            if (sparkJobDefinition == null)
 137            {
 0138                throw new ArgumentNullException(nameof(sparkJobDefinition));
 139            }
 140
 0141            using var message = CreateCreateOrUpdateSparkJobDefinitionRequest(sparkJobDefinitionName, sparkJobDefinition
 0142            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0143            switch (message.Response.Status)
 144            {
 145                case 200:
 146                    {
 147                        SparkJobDefinitionResource value = default;
 0148                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0149                        value = SparkJobDefinitionResource.DeserializeSparkJobDefinitionResource(document.RootElement);
 0150                        return Response.FromValue(value, message.Response);
 151                    }
 152                default:
 0153                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 154            }
 0155        }
 156
 157        /// <summary> Creates or updates a Spark Job Definition. </summary>
 158        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 159        /// <param name="sparkJobDefinition"> Spark Job Definition resource definition. </param>
 160        /// <param name="ifMatch"> ETag of the Spark Job Definition entity.  Should only be specified for update, for wh
 161        /// <param name="cancellationToken"> The cancellation token to use. </param>
 162        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> or <paramref name="sparkJ
 163        public Response<SparkJobDefinitionResource> CreateOrUpdateSparkJobDefinition(string sparkJobDefinitionName, Spar
 164        {
 0165            if (sparkJobDefinitionName == null)
 166            {
 0167                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 168            }
 0169            if (sparkJobDefinition == null)
 170            {
 0171                throw new ArgumentNullException(nameof(sparkJobDefinition));
 172            }
 173
 0174            using var message = CreateCreateOrUpdateSparkJobDefinitionRequest(sparkJobDefinitionName, sparkJobDefinition
 0175            _pipeline.Send(message, cancellationToken);
 0176            switch (message.Response.Status)
 177            {
 178                case 200:
 179                    {
 180                        SparkJobDefinitionResource value = default;
 0181                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0182                        value = SparkJobDefinitionResource.DeserializeSparkJobDefinitionResource(document.RootElement);
 0183                        return Response.FromValue(value, message.Response);
 184                    }
 185                default:
 0186                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 187            }
 0188        }
 189
 190        internal HttpMessage CreateGetSparkJobDefinitionRequest(string sparkJobDefinitionName, string ifNoneMatch)
 191        {
 0192            var message = _pipeline.CreateMessage();
 0193            var request = message.Request;
 0194            request.Method = RequestMethod.Get;
 0195            var uri = new RawRequestUriBuilder();
 0196            uri.AppendRaw(endpoint, false);
 0197            uri.AppendPath("/sparkJobDefinitions/", false);
 0198            uri.AppendPath(sparkJobDefinitionName, true);
 0199            uri.AppendQuery("api-version", apiVersion, true);
 0200            request.Uri = uri;
 0201            if (ifNoneMatch != null)
 202            {
 0203                request.Headers.Add("If-None-Match", ifNoneMatch);
 204            }
 0205            return message;
 206        }
 207
 208        /// <summary> Gets a Spark Job Definition. </summary>
 209        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 210        /// <param name="ifNoneMatch"> ETag of the Spark Job Definition entity. Should only be specified for get. If the
 211        /// <param name="cancellationToken"> The cancellation token to use. </param>
 212        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 213        public async Task<Response<SparkJobDefinitionResource>> GetSparkJobDefinitionAsync(string sparkJobDefinitionName
 214        {
 0215            if (sparkJobDefinitionName == null)
 216            {
 0217                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 218            }
 219
 0220            using var message = CreateGetSparkJobDefinitionRequest(sparkJobDefinitionName, ifNoneMatch);
 0221            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0222            switch (message.Response.Status)
 223            {
 224                case 200:
 225                    {
 226                        SparkJobDefinitionResource value = default;
 0227                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0228                        value = SparkJobDefinitionResource.DeserializeSparkJobDefinitionResource(document.RootElement);
 0229                        return Response.FromValue(value, message.Response);
 230                    }
 231                case 304:
 0232                    return Response.FromValue<SparkJobDefinitionResource>(null, message.Response);
 233                default:
 0234                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 235            }
 0236        }
 237
 238        /// <summary> Gets a Spark Job Definition. </summary>
 239        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 240        /// <param name="ifNoneMatch"> ETag of the Spark Job Definition entity. Should only be specified for get. If the
 241        /// <param name="cancellationToken"> The cancellation token to use. </param>
 242        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 243        public Response<SparkJobDefinitionResource> GetSparkJobDefinition(string sparkJobDefinitionName, string ifNoneMa
 244        {
 0245            if (sparkJobDefinitionName == null)
 246            {
 0247                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 248            }
 249
 0250            using var message = CreateGetSparkJobDefinitionRequest(sparkJobDefinitionName, ifNoneMatch);
 0251            _pipeline.Send(message, cancellationToken);
 0252            switch (message.Response.Status)
 253            {
 254                case 200:
 255                    {
 256                        SparkJobDefinitionResource value = default;
 0257                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0258                        value = SparkJobDefinitionResource.DeserializeSparkJobDefinitionResource(document.RootElement);
 0259                        return Response.FromValue(value, message.Response);
 260                    }
 261                case 304:
 0262                    return Response.FromValue<SparkJobDefinitionResource>(null, message.Response);
 263                default:
 0264                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 265            }
 0266        }
 267
 268        internal HttpMessage CreateDeleteSparkJobDefinitionRequest(string sparkJobDefinitionName)
 269        {
 0270            var message = _pipeline.CreateMessage();
 0271            var request = message.Request;
 0272            request.Method = RequestMethod.Delete;
 0273            var uri = new RawRequestUriBuilder();
 0274            uri.AppendRaw(endpoint, false);
 0275            uri.AppendPath("/sparkJobDefinitions/", false);
 0276            uri.AppendPath(sparkJobDefinitionName, true);
 0277            uri.AppendQuery("api-version", apiVersion, true);
 0278            request.Uri = uri;
 0279            return message;
 280        }
 281
 282        /// <summary> Deletes a Spark Job Definition. </summary>
 283        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 284        /// <param name="cancellationToken"> The cancellation token to use. </param>
 285        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 286        public async Task<Response> DeleteSparkJobDefinitionAsync(string sparkJobDefinitionName, CancellationToken cance
 287        {
 0288            if (sparkJobDefinitionName == null)
 289            {
 0290                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 291            }
 292
 0293            using var message = CreateDeleteSparkJobDefinitionRequest(sparkJobDefinitionName);
 0294            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0295            switch (message.Response.Status)
 296            {
 297                case 200:
 298                case 204:
 0299                    return message.Response;
 300                default:
 0301                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 302            }
 0303        }
 304
 305        /// <summary> Deletes a Spark Job Definition. </summary>
 306        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 307        /// <param name="cancellationToken"> The cancellation token to use. </param>
 308        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 309        public Response DeleteSparkJobDefinition(string sparkJobDefinitionName, CancellationToken cancellationToken = de
 310        {
 0311            if (sparkJobDefinitionName == null)
 312            {
 0313                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 314            }
 315
 0316            using var message = CreateDeleteSparkJobDefinitionRequest(sparkJobDefinitionName);
 0317            _pipeline.Send(message, cancellationToken);
 0318            switch (message.Response.Status)
 319            {
 320                case 200:
 321                case 204:
 0322                    return message.Response;
 323                default:
 0324                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 325            }
 0326        }
 327
 328        internal HttpMessage CreateExecuteSparkJobDefinitionRequest(string sparkJobDefinitionName)
 329        {
 0330            var message = _pipeline.CreateMessage();
 0331            var request = message.Request;
 0332            request.Method = RequestMethod.Post;
 0333            var uri = new RawRequestUriBuilder();
 0334            uri.AppendRaw(endpoint, false);
 0335            uri.AppendPath("/sparkJobDefinitions/", false);
 0336            uri.AppendPath(sparkJobDefinitionName, true);
 0337            uri.AppendPath("/execute", false);
 0338            uri.AppendQuery("api-version", apiVersion, true);
 0339            request.Uri = uri;
 0340            return message;
 341        }
 342
 343        /// <summary> Executes the spark job definition. </summary>
 344        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 345        /// <param name="cancellationToken"> The cancellation token to use. </param>
 346        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 347        public async Task<Response> ExecuteSparkJobDefinitionAsync(string sparkJobDefinitionName, CancellationToken canc
 348        {
 0349            if (sparkJobDefinitionName == null)
 350            {
 0351                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 352            }
 353
 0354            using var message = CreateExecuteSparkJobDefinitionRequest(sparkJobDefinitionName);
 0355            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0356            switch (message.Response.Status)
 357            {
 358                case 200:
 359                case 202:
 0360                    return message.Response;
 361                default:
 0362                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 363            }
 0364        }
 365
 366        /// <summary> Executes the spark job definition. </summary>
 367        /// <param name="sparkJobDefinitionName"> The spark job definition name. </param>
 368        /// <param name="cancellationToken"> The cancellation token to use. </param>
 369        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionName"/> is null. </exception>
 370        public Response ExecuteSparkJobDefinition(string sparkJobDefinitionName, CancellationToken cancellationToken = d
 371        {
 0372            if (sparkJobDefinitionName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(sparkJobDefinitionName));
 375            }
 376
 0377            using var message = CreateExecuteSparkJobDefinitionRequest(sparkJobDefinitionName);
 0378            _pipeline.Send(message, cancellationToken);
 0379            switch (message.Response.Status)
 380            {
 381                case 200:
 382                case 202:
 0383                    return message.Response;
 384                default:
 0385                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 386            }
 0387        }
 388
 389        internal HttpMessage CreateDebugSparkJobDefinitionRequest(SparkJobDefinitionResource sparkJobDefinitionAzureReso
 390        {
 0391            var message = _pipeline.CreateMessage();
 0392            var request = message.Request;
 0393            request.Method = RequestMethod.Post;
 0394            var uri = new RawRequestUriBuilder();
 0395            uri.AppendRaw(endpoint, false);
 0396            uri.AppendPath("/debugSparkJobDefinition", false);
 0397            uri.AppendQuery("api-version", apiVersion, true);
 0398            request.Uri = uri;
 0399            request.Headers.Add("Content-Type", "application/json");
 0400            var content = new Utf8JsonRequestContent();
 0401            content.JsonWriter.WriteObjectValue(sparkJobDefinitionAzureResource);
 0402            request.Content = content;
 0403            return message;
 404        }
 405
 406        /// <summary> Debug the spark job definition. </summary>
 407        /// <param name="sparkJobDefinitionAzureResource"> Spark Job Definition resource definition. </param>
 408        /// <param name="cancellationToken"> The cancellation token to use. </param>
 409        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionAzureResource"/> is null. </excep
 410        public async Task<Response> DebugSparkJobDefinitionAsync(SparkJobDefinitionResource sparkJobDefinitionAzureResou
 411        {
 0412            if (sparkJobDefinitionAzureResource == null)
 413            {
 0414                throw new ArgumentNullException(nameof(sparkJobDefinitionAzureResource));
 415            }
 416
 0417            using var message = CreateDebugSparkJobDefinitionRequest(sparkJobDefinitionAzureResource);
 0418            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0419            switch (message.Response.Status)
 420            {
 421                case 200:
 422                case 202:
 0423                    return message.Response;
 424                default:
 0425                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 426            }
 0427        }
 428
 429        /// <summary> Debug the spark job definition. </summary>
 430        /// <param name="sparkJobDefinitionAzureResource"> Spark Job Definition resource definition. </param>
 431        /// <param name="cancellationToken"> The cancellation token to use. </param>
 432        /// <exception cref="ArgumentNullException"> <paramref name="sparkJobDefinitionAzureResource"/> is null. </excep
 433        public Response DebugSparkJobDefinition(SparkJobDefinitionResource sparkJobDefinitionAzureResource, Cancellation
 434        {
 0435            if (sparkJobDefinitionAzureResource == null)
 436            {
 0437                throw new ArgumentNullException(nameof(sparkJobDefinitionAzureResource));
 438            }
 439
 0440            using var message = CreateDebugSparkJobDefinitionRequest(sparkJobDefinitionAzureResource);
 0441            _pipeline.Send(message, cancellationToken);
 0442            switch (message.Response.Status)
 443            {
 444                case 200:
 445                case 202:
 0446                    return message.Response;
 447                default:
 0448                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 449            }
 0450        }
 451
 452        internal HttpMessage CreateGetSparkJobDefinitionsByWorkspaceNextPageRequest(string nextLink)
 453        {
 0454            var message = _pipeline.CreateMessage();
 0455            var request = message.Request;
 0456            request.Method = RequestMethod.Get;
 0457            var uri = new RawRequestUriBuilder();
 0458            uri.AppendRaw(endpoint, false);
 0459            uri.AppendRawNextLink(nextLink, false);
 0460            request.Uri = uri;
 0461            return message;
 462        }
 463
 464        /// <summary> Lists spark job definitions. </summary>
 465        /// <param name="nextLink"> The URL to the next page of results. </param>
 466        /// <param name="cancellationToken"> The cancellation token to use. </param>
 467        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
 468        public async Task<Response<SparkJobDefinitionsListResponse>> GetSparkJobDefinitionsByWorkspaceNextPageAsync(stri
 469        {
 0470            if (nextLink == null)
 471            {
 0472                throw new ArgumentNullException(nameof(nextLink));
 473            }
 474
 0475            using var message = CreateGetSparkJobDefinitionsByWorkspaceNextPageRequest(nextLink);
 0476            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0477            switch (message.Response.Status)
 478            {
 479                case 200:
 480                    {
 481                        SparkJobDefinitionsListResponse value = default;
 0482                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0483                        value = SparkJobDefinitionsListResponse.DeserializeSparkJobDefinitionsListResponse(document.Root
 0484                        return Response.FromValue(value, message.Response);
 485                    }
 486                default:
 0487                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 488            }
 0489        }
 490
 491        /// <summary> Lists spark job definitions. </summary>
 492        /// <param name="nextLink"> The URL to the next page of results. </param>
 493        /// <param name="cancellationToken"> The cancellation token to use. </param>
 494        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
 495        public Response<SparkJobDefinitionsListResponse> GetSparkJobDefinitionsByWorkspaceNextPage(string nextLink, Canc
 496        {
 0497            if (nextLink == null)
 498            {
 0499                throw new ArgumentNullException(nameof(nextLink));
 500            }
 501
 0502            using var message = CreateGetSparkJobDefinitionsByWorkspaceNextPageRequest(nextLink);
 0503            _pipeline.Send(message, cancellationToken);
 0504            switch (message.Response.Status)
 505            {
 506                case 200:
 507                    {
 508                        SparkJobDefinitionsListResponse value = default;
 0509                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0510                        value = SparkJobDefinitionsListResponse.DeserializeSparkJobDefinitionsListResponse(document.Root
 0511                        return Response.FromValue(value, message.Response);
 512                    }
 513                default:
 0514                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 515            }
 0516        }
 517    }
 518}