1package job 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "github.com/satori/go.uuid" 26 "net/http" 27) 28 29// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 30// Client is the creates an Azure Data Lake Analytics job client. 31type Client struct { 32 BaseClient 33} 34 35// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 36// NewClient creates an instance of the Client client. 37func NewClient() Client { 38 return Client{New()} 39} 40 41// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 42// Build builds (compiles) the specified job in the specified Data Lake Analytics account for job correctness and 43// validation. 44// 45// accountName is the Azure Data Lake Analytics account to execute job operations on. parameters is the parameters 46// to build a job. 47func (client Client) Build(ctx context.Context, accountName string, parameters Information) (result Information, err error) { 48 if err := validation.Validate([]validation.Validation{ 49 {TargetValue: parameters, 50 Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, 51 {Target: "parameters.Properties", Name: validation.Null, Rule: true, 52 Chain: []validation.Constraint{{Target: "parameters.Properties.Script", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { 53 return result, validation.NewError("job.Client", "Build", err.Error()) 54 } 55 56 req, err := client.BuildPreparer(ctx, accountName, parameters) 57 if err != nil { 58 err = autorest.NewErrorWithError(err, "job.Client", "Build", nil, "Failure preparing request") 59 return 60 } 61 62 resp, err := client.BuildSender(req) 63 if err != nil { 64 result.Response = autorest.Response{Response: resp} 65 err = autorest.NewErrorWithError(err, "job.Client", "Build", resp, "Failure sending request") 66 return 67 } 68 69 result, err = client.BuildResponder(resp) 70 if err != nil { 71 err = autorest.NewErrorWithError(err, "job.Client", "Build", resp, "Failure responding to request") 72 } 73 74 return 75} 76 77// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 78// BuildPreparer prepares the Build request. 79func (client Client) BuildPreparer(ctx context.Context, accountName string, parameters Information) (*http.Request, error) { 80 urlParameters := map[string]interface{}{ 81 "accountName": accountName, 82 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 83 } 84 85 const APIVersion = "2016-03-20-preview" 86 queryParameters := map[string]interface{}{ 87 "api-version": APIVersion, 88 } 89 90 preparer := autorest.CreatePreparer( 91 autorest.AsContentType("application/json; charset=utf-8"), 92 autorest.AsPost(), 93 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 94 autorest.WithPath("/BuildJob"), 95 autorest.WithJSON(parameters), 96 autorest.WithQueryParameters(queryParameters)) 97 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 98} 99 100// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 101// BuildSender sends the Build request. The method will close the 102// http.Response Body if it receives an error. 103func (client Client) BuildSender(req *http.Request) (*http.Response, error) { 104 return autorest.SendWithSender(client, req, 105 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 106} 107 108// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 109// BuildResponder handles the response to the Build request. The method always 110// closes the http.Response Body. 111func (client Client) BuildResponder(resp *http.Response) (result Information, err error) { 112 err = autorest.Respond( 113 resp, 114 client.ByInspecting(), 115 azure.WithErrorUnlessStatusCode(http.StatusOK), 116 autorest.ByUnmarshallingJSON(&result), 117 autorest.ByClosing()) 118 result.Response = autorest.Response{Response: resp} 119 return 120} 121 122// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 123// Cancel cancels the running job specified by the job ID. 124// 125// accountName is the Azure Data Lake Analytics account to execute job operations on. jobIdentity is jobInfo ID to 126// cancel. 127func (client Client) Cancel(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result autorest.Response, err error) { 128 req, err := client.CancelPreparer(ctx, accountName, jobIdentity) 129 if err != nil { 130 err = autorest.NewErrorWithError(err, "job.Client", "Cancel", nil, "Failure preparing request") 131 return 132 } 133 134 resp, err := client.CancelSender(req) 135 if err != nil { 136 result.Response = resp 137 err = autorest.NewErrorWithError(err, "job.Client", "Cancel", resp, "Failure sending request") 138 return 139 } 140 141 result, err = client.CancelResponder(resp) 142 if err != nil { 143 err = autorest.NewErrorWithError(err, "job.Client", "Cancel", resp, "Failure responding to request") 144 } 145 146 return 147} 148 149// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 150// CancelPreparer prepares the Cancel request. 151func (client Client) CancelPreparer(ctx context.Context, accountName string, jobIdentity uuid.UUID) (*http.Request, error) { 152 urlParameters := map[string]interface{}{ 153 "accountName": accountName, 154 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 155 } 156 157 pathParameters := map[string]interface{}{ 158 "jobIdentity": autorest.Encode("path", jobIdentity), 159 } 160 161 const APIVersion = "2016-03-20-preview" 162 queryParameters := map[string]interface{}{ 163 "api-version": APIVersion, 164 } 165 166 preparer := autorest.CreatePreparer( 167 autorest.AsPost(), 168 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 169 autorest.WithPathParameters("/Jobs/{jobIdentity}/CancelJob", pathParameters), 170 autorest.WithQueryParameters(queryParameters)) 171 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 172} 173 174// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 175// CancelSender sends the Cancel request. The method will close the 176// http.Response Body if it receives an error. 177func (client Client) CancelSender(req *http.Request) (*http.Response, error) { 178 return autorest.SendWithSender(client, req, 179 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 180} 181 182// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 183// CancelResponder handles the response to the Cancel request. The method always 184// closes the http.Response Body. 185func (client Client) CancelResponder(resp *http.Response) (result autorest.Response, err error) { 186 err = autorest.Respond( 187 resp, 188 client.ByInspecting(), 189 azure.WithErrorUnlessStatusCode(http.StatusOK), 190 autorest.ByClosing()) 191 result.Response = resp 192 return 193} 194 195// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 196// Create submits a job to the specified Data Lake Analytics account. 197// 198// accountName is the Azure Data Lake Analytics account to execute job operations on. jobIdentity is the job ID (a 199// GUID) for the job being submitted. parameters is the parameters to submit a job. 200func (client Client) Create(ctx context.Context, accountName string, jobIdentity uuid.UUID, parameters Information) (result Information, err error) { 201 if err := validation.Validate([]validation.Validation{ 202 {TargetValue: parameters, 203 Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, 204 {Target: "parameters.Properties", Name: validation.Null, Rule: true, 205 Chain: []validation.Constraint{{Target: "parameters.Properties.Script", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { 206 return result, validation.NewError("job.Client", "Create", err.Error()) 207 } 208 209 req, err := client.CreatePreparer(ctx, accountName, jobIdentity, parameters) 210 if err != nil { 211 err = autorest.NewErrorWithError(err, "job.Client", "Create", nil, "Failure preparing request") 212 return 213 } 214 215 resp, err := client.CreateSender(req) 216 if err != nil { 217 result.Response = autorest.Response{Response: resp} 218 err = autorest.NewErrorWithError(err, "job.Client", "Create", resp, "Failure sending request") 219 return 220 } 221 222 result, err = client.CreateResponder(resp) 223 if err != nil { 224 err = autorest.NewErrorWithError(err, "job.Client", "Create", resp, "Failure responding to request") 225 } 226 227 return 228} 229 230// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 231// CreatePreparer prepares the Create request. 232func (client Client) CreatePreparer(ctx context.Context, accountName string, jobIdentity uuid.UUID, parameters Information) (*http.Request, error) { 233 urlParameters := map[string]interface{}{ 234 "accountName": accountName, 235 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 236 } 237 238 pathParameters := map[string]interface{}{ 239 "jobIdentity": autorest.Encode("path", jobIdentity), 240 } 241 242 const APIVersion = "2016-03-20-preview" 243 queryParameters := map[string]interface{}{ 244 "api-version": APIVersion, 245 } 246 247 preparer := autorest.CreatePreparer( 248 autorest.AsContentType("application/json; charset=utf-8"), 249 autorest.AsPut(), 250 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 251 autorest.WithPathParameters("/Jobs/{jobIdentity}", pathParameters), 252 autorest.WithJSON(parameters), 253 autorest.WithQueryParameters(queryParameters)) 254 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 255} 256 257// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 258// CreateSender sends the Create request. The method will close the 259// http.Response Body if it receives an error. 260func (client Client) CreateSender(req *http.Request) (*http.Response, error) { 261 return autorest.SendWithSender(client, req, 262 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 263} 264 265// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 266// CreateResponder handles the response to the Create request. The method always 267// closes the http.Response Body. 268func (client Client) CreateResponder(resp *http.Response) (result Information, err error) { 269 err = autorest.Respond( 270 resp, 271 client.ByInspecting(), 272 azure.WithErrorUnlessStatusCode(http.StatusOK), 273 autorest.ByUnmarshallingJSON(&result), 274 autorest.ByClosing()) 275 result.Response = autorest.Response{Response: resp} 276 return 277} 278 279// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 280// Get gets the job information for the specified job ID. 281// 282// accountName is the Azure Data Lake Analytics account to execute job operations on. jobIdentity is jobInfo ID. 283func (client Client) Get(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result Information, err error) { 284 req, err := client.GetPreparer(ctx, accountName, jobIdentity) 285 if err != nil { 286 err = autorest.NewErrorWithError(err, "job.Client", "Get", nil, "Failure preparing request") 287 return 288 } 289 290 resp, err := client.GetSender(req) 291 if err != nil { 292 result.Response = autorest.Response{Response: resp} 293 err = autorest.NewErrorWithError(err, "job.Client", "Get", resp, "Failure sending request") 294 return 295 } 296 297 result, err = client.GetResponder(resp) 298 if err != nil { 299 err = autorest.NewErrorWithError(err, "job.Client", "Get", resp, "Failure responding to request") 300 } 301 302 return 303} 304 305// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 306// GetPreparer prepares the Get request. 307func (client Client) GetPreparer(ctx context.Context, accountName string, jobIdentity uuid.UUID) (*http.Request, error) { 308 urlParameters := map[string]interface{}{ 309 "accountName": accountName, 310 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 311 } 312 313 pathParameters := map[string]interface{}{ 314 "jobIdentity": autorest.Encode("path", jobIdentity), 315 } 316 317 const APIVersion = "2016-03-20-preview" 318 queryParameters := map[string]interface{}{ 319 "api-version": APIVersion, 320 } 321 322 preparer := autorest.CreatePreparer( 323 autorest.AsGet(), 324 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 325 autorest.WithPathParameters("/Jobs/{jobIdentity}", pathParameters), 326 autorest.WithQueryParameters(queryParameters)) 327 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 328} 329 330// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 331// GetSender sends the Get request. The method will close the 332// http.Response Body if it receives an error. 333func (client Client) GetSender(req *http.Request) (*http.Response, error) { 334 return autorest.SendWithSender(client, req, 335 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 336} 337 338// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 339// GetResponder handles the response to the Get request. The method always 340// closes the http.Response Body. 341func (client Client) GetResponder(resp *http.Response) (result Information, err error) { 342 err = autorest.Respond( 343 resp, 344 client.ByInspecting(), 345 azure.WithErrorUnlessStatusCode(http.StatusOK), 346 autorest.ByUnmarshallingJSON(&result), 347 autorest.ByClosing()) 348 result.Response = autorest.Response{Response: resp} 349 return 350} 351 352// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 353// GetDebugDataPath gets the job debug data information specified by the job ID. 354// 355// accountName is the Azure Data Lake Analytics account to execute job operations on. jobIdentity is jobInfo ID. 356func (client Client) GetDebugDataPath(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result DataPath, err error) { 357 req, err := client.GetDebugDataPathPreparer(ctx, accountName, jobIdentity) 358 if err != nil { 359 err = autorest.NewErrorWithError(err, "job.Client", "GetDebugDataPath", nil, "Failure preparing request") 360 return 361 } 362 363 resp, err := client.GetDebugDataPathSender(req) 364 if err != nil { 365 result.Response = autorest.Response{Response: resp} 366 err = autorest.NewErrorWithError(err, "job.Client", "GetDebugDataPath", resp, "Failure sending request") 367 return 368 } 369 370 result, err = client.GetDebugDataPathResponder(resp) 371 if err != nil { 372 err = autorest.NewErrorWithError(err, "job.Client", "GetDebugDataPath", resp, "Failure responding to request") 373 } 374 375 return 376} 377 378// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 379// GetDebugDataPathPreparer prepares the GetDebugDataPath request. 380func (client Client) GetDebugDataPathPreparer(ctx context.Context, accountName string, jobIdentity uuid.UUID) (*http.Request, error) { 381 urlParameters := map[string]interface{}{ 382 "accountName": accountName, 383 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 384 } 385 386 pathParameters := map[string]interface{}{ 387 "jobIdentity": autorest.Encode("path", jobIdentity), 388 } 389 390 const APIVersion = "2016-03-20-preview" 391 queryParameters := map[string]interface{}{ 392 "api-version": APIVersion, 393 } 394 395 preparer := autorest.CreatePreparer( 396 autorest.AsPost(), 397 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 398 autorest.WithPathParameters("/Jobs/{jobIdentity}/GetDebugDataPath", pathParameters), 399 autorest.WithQueryParameters(queryParameters)) 400 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 401} 402 403// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 404// GetDebugDataPathSender sends the GetDebugDataPath request. The method will close the 405// http.Response Body if it receives an error. 406func (client Client) GetDebugDataPathSender(req *http.Request) (*http.Response, error) { 407 return autorest.SendWithSender(client, req, 408 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 409} 410 411// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 412// GetDebugDataPathResponder handles the response to the GetDebugDataPath request. The method always 413// closes the http.Response Body. 414func (client Client) GetDebugDataPathResponder(resp *http.Response) (result DataPath, err error) { 415 err = autorest.Respond( 416 resp, 417 client.ByInspecting(), 418 azure.WithErrorUnlessStatusCode(http.StatusOK), 419 autorest.ByUnmarshallingJSON(&result), 420 autorest.ByClosing()) 421 result.Response = autorest.Response{Response: resp} 422 return 423} 424 425// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 426// GetStatistics gets statistics of the specified job. 427// 428// accountName is the Azure Data Lake Analytics account to execute job operations on. jobIdentity is job 429// Information ID. 430func (client Client) GetStatistics(ctx context.Context, accountName string, jobIdentity uuid.UUID) (result Statistics, err error) { 431 req, err := client.GetStatisticsPreparer(ctx, accountName, jobIdentity) 432 if err != nil { 433 err = autorest.NewErrorWithError(err, "job.Client", "GetStatistics", nil, "Failure preparing request") 434 return 435 } 436 437 resp, err := client.GetStatisticsSender(req) 438 if err != nil { 439 result.Response = autorest.Response{Response: resp} 440 err = autorest.NewErrorWithError(err, "job.Client", "GetStatistics", resp, "Failure sending request") 441 return 442 } 443 444 result, err = client.GetStatisticsResponder(resp) 445 if err != nil { 446 err = autorest.NewErrorWithError(err, "job.Client", "GetStatistics", resp, "Failure responding to request") 447 } 448 449 return 450} 451 452// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 453// GetStatisticsPreparer prepares the GetStatistics request. 454func (client Client) GetStatisticsPreparer(ctx context.Context, accountName string, jobIdentity uuid.UUID) (*http.Request, error) { 455 urlParameters := map[string]interface{}{ 456 "accountName": accountName, 457 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 458 } 459 460 pathParameters := map[string]interface{}{ 461 "jobIdentity": autorest.Encode("path", jobIdentity), 462 } 463 464 const APIVersion = "2016-03-20-preview" 465 queryParameters := map[string]interface{}{ 466 "api-version": APIVersion, 467 } 468 469 preparer := autorest.CreatePreparer( 470 autorest.AsGet(), 471 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 472 autorest.WithPathParameters("/Jobs/{jobIdentity}/GetStatistics", pathParameters), 473 autorest.WithQueryParameters(queryParameters)) 474 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 475} 476 477// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 478// GetStatisticsSender sends the GetStatistics request. The method will close the 479// http.Response Body if it receives an error. 480func (client Client) GetStatisticsSender(req *http.Request) (*http.Response, error) { 481 return autorest.SendWithSender(client, req, 482 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 483} 484 485// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 486// GetStatisticsResponder handles the response to the GetStatistics request. The method always 487// closes the http.Response Body. 488func (client Client) GetStatisticsResponder(resp *http.Response) (result Statistics, err error) { 489 err = autorest.Respond( 490 resp, 491 client.ByInspecting(), 492 azure.WithErrorUnlessStatusCode(http.StatusOK), 493 autorest.ByUnmarshallingJSON(&result), 494 autorest.ByClosing()) 495 result.Response = autorest.Response{Response: resp} 496 return 497} 498 499// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 500// List lists the jobs, if any, associated with the specified Data Lake Analytics account. The response includes a link 501// to the next page of results, if any. 502// 503// accountName is the Azure Data Lake Analytics account to execute job operations on. filter is oData filter. 504// Optional. top is the number of items to return. Optional. skip is the number of items to skip over before 505// returning elements. Optional. expand is oData expansion. Expand related resources in line with the retrieved 506// resources, e.g. Categories?$expand=Products would expand Product data in line with each Category entry. 507// Optional. selectParameter is oData Select statement. Limits the properties on each entry to just those 508// requested, e.g. Categories?$select=CategoryName,Description. Optional. orderby is orderBy clause. One or more 509// comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the 510// values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. count is the Boolean value of true or false 511// to request a count of the matching resources included with the resources in the response, e.g. 512// Categories?$count=true. Optional. search is a free form search. A free-text search expression to match for 513// whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. 514// formatParameter is the return format. Return the response in particular formatxii without access to request 515// headers for standard content-type negotiation (e.g Orders?$format=json). Optional. 516func (client Client) List(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result InfoListResultPage, err error) { 517 result.fn = client.listNextResults 518 req, err := client.ListPreparer(ctx, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 519 if err != nil { 520 err = autorest.NewErrorWithError(err, "job.Client", "List", nil, "Failure preparing request") 521 return 522 } 523 524 resp, err := client.ListSender(req) 525 if err != nil { 526 result.ilr.Response = autorest.Response{Response: resp} 527 err = autorest.NewErrorWithError(err, "job.Client", "List", resp, "Failure sending request") 528 return 529 } 530 531 result.ilr, err = client.ListResponder(resp) 532 if err != nil { 533 err = autorest.NewErrorWithError(err, "job.Client", "List", resp, "Failure responding to request") 534 } 535 536 return 537} 538 539// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 540// ListPreparer prepares the List request. 541func (client Client) ListPreparer(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) { 542 urlParameters := map[string]interface{}{ 543 "accountName": accountName, 544 "adlaJobDnsSuffix": client.AdlaJobDNSSuffix, 545 } 546 547 const APIVersion = "2016-03-20-preview" 548 queryParameters := map[string]interface{}{ 549 "api-version": APIVersion, 550 } 551 if len(filter) > 0 { 552 queryParameters["$filter"] = autorest.Encode("query", filter) 553 } 554 if top != nil { 555 queryParameters["$top"] = autorest.Encode("query", *top) 556 } 557 if skip != nil { 558 queryParameters["$skip"] = autorest.Encode("query", *skip) 559 } 560 if len(expand) > 0 { 561 queryParameters["$expand"] = autorest.Encode("query", expand) 562 } 563 if len(selectParameter) > 0 { 564 queryParameters["$select"] = autorest.Encode("query", selectParameter) 565 } 566 if len(orderby) > 0 { 567 queryParameters["$orderby"] = autorest.Encode("query", orderby) 568 } 569 if count != nil { 570 queryParameters["$count"] = autorest.Encode("query", *count) 571 } 572 if len(search) > 0 { 573 queryParameters["$search"] = autorest.Encode("query", search) 574 } 575 if len(formatParameter) > 0 { 576 queryParameters["$format"] = autorest.Encode("query", formatParameter) 577 } 578 579 preparer := autorest.CreatePreparer( 580 autorest.AsGet(), 581 autorest.WithCustomBaseURL("https://{accountName}.{adlaJobDnsSuffix}", urlParameters), 582 autorest.WithPath("/Jobs"), 583 autorest.WithQueryParameters(queryParameters)) 584 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 585} 586 587// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 588// ListSender sends the List request. The method will close the 589// http.Response Body if it receives an error. 590func (client Client) ListSender(req *http.Request) (*http.Response, error) { 591 return autorest.SendWithSender(client, req, 592 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 593} 594 595// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 596// ListResponder handles the response to the List request. The method always 597// closes the http.Response Body. 598func (client Client) ListResponder(resp *http.Response) (result InfoListResult, err error) { 599 err = autorest.Respond( 600 resp, 601 client.ByInspecting(), 602 azure.WithErrorUnlessStatusCode(http.StatusOK), 603 autorest.ByUnmarshallingJSON(&result), 604 autorest.ByClosing()) 605 result.Response = autorest.Response{Response: resp} 606 return 607} 608 609// listNextResults retrieves the next set of results, if any. 610func (client Client) listNextResults(lastResults InfoListResult) (result InfoListResult, err error) { 611 req, err := lastResults.infoListResultPreparer() 612 if err != nil { 613 return result, autorest.NewErrorWithError(err, "job.Client", "listNextResults", nil, "Failure preparing next results request") 614 } 615 if req == nil { 616 return 617 } 618 resp, err := client.ListSender(req) 619 if err != nil { 620 result.Response = autorest.Response{Response: resp} 621 return result, autorest.NewErrorWithError(err, "job.Client", "listNextResults", resp, "Failure sending next results request") 622 } 623 result, err = client.ListResponder(resp) 624 if err != nil { 625 err = autorest.NewErrorWithError(err, "job.Client", "listNextResults", resp, "Failure responding to next results request") 626 } 627 return 628} 629 630// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2016-03-20-preview/job instead. 631// ListComplete enumerates all values, automatically crossing page boundaries as required. 632func (client Client) ListComplete(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result InfoListResultIterator, err error) { 633 result.page, err = client.List(ctx, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 634 return 635} 636