1package catalog 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/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// Client is the creates an Azure Data Lake Analytics catalog client. 30type Client struct { 31 BaseClient 32} 33 34// NewClient creates an instance of the Client client. 35func NewClient() Client { 36 return Client{New()} 37} 38 39// CreateCredential creates the specified credential for use with external data sources in the specified database. 40// Parameters: 41// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 42// databaseName - the name of the database in which to create the credential. Note: This is NOT an external 43// database name, but the name of an existing U-SQL database that should contain the new credential object. 44// credentialName - the name of the credential. 45// parameters - the parameters required to create the credential (name and password) 46func (client Client) CreateCredential(ctx context.Context, accountName string, databaseName string, credentialName string, parameters DataLakeAnalyticsCatalogCredentialCreateParameters) (result autorest.Response, err error) { 47 if tracing.IsEnabled() { 48 ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateCredential") 49 defer func() { 50 sc := -1 51 if result.Response != nil { 52 sc = result.Response.StatusCode 53 } 54 tracing.EndSpan(ctx, sc, err) 55 }() 56 } 57 if err := validation.Validate([]validation.Validation{ 58 {TargetValue: parameters, 59 Constraints: []validation.Constraint{{Target: "parameters.Password", Name: validation.Null, Rule: true, Chain: nil}, 60 {Target: "parameters.URI", Name: validation.Null, Rule: true, Chain: nil}, 61 {Target: "parameters.UserID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 62 return result, validation.NewError("catalog.Client", "CreateCredential", err.Error()) 63 } 64 65 req, err := client.CreateCredentialPreparer(ctx, accountName, databaseName, credentialName, parameters) 66 if err != nil { 67 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateCredential", nil, "Failure preparing request") 68 return 69 } 70 71 resp, err := client.CreateCredentialSender(req) 72 if err != nil { 73 result.Response = resp 74 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateCredential", resp, "Failure sending request") 75 return 76 } 77 78 result, err = client.CreateCredentialResponder(resp) 79 if err != nil { 80 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateCredential", resp, "Failure responding to request") 81 } 82 83 return 84} 85 86// CreateCredentialPreparer prepares the CreateCredential request. 87func (client Client) CreateCredentialPreparer(ctx context.Context, accountName string, databaseName string, credentialName string, parameters DataLakeAnalyticsCatalogCredentialCreateParameters) (*http.Request, error) { 88 urlParameters := map[string]interface{}{ 89 "accountName": accountName, 90 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 91 } 92 93 pathParameters := map[string]interface{}{ 94 "credentialName": autorest.Encode("path", credentialName), 95 "databaseName": autorest.Encode("path", databaseName), 96 } 97 98 const APIVersion = "2016-11-01" 99 queryParameters := map[string]interface{}{ 100 "api-version": APIVersion, 101 } 102 103 preparer := autorest.CreatePreparer( 104 autorest.AsContentType("application/json; charset=utf-8"), 105 autorest.AsPut(), 106 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 107 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials/{credentialName}", pathParameters), 108 autorest.WithJSON(parameters), 109 autorest.WithQueryParameters(queryParameters)) 110 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 111} 112 113// CreateCredentialSender sends the CreateCredential request. The method will close the 114// http.Response Body if it receives an error. 115func (client Client) CreateCredentialSender(req *http.Request) (*http.Response, error) { 116 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 117 return autorest.SendWithSender(client, req, sd...) 118} 119 120// CreateCredentialResponder handles the response to the CreateCredential request. The method always 121// closes the http.Response Body. 122func (client Client) CreateCredentialResponder(resp *http.Response) (result autorest.Response, err error) { 123 err = autorest.Respond( 124 resp, 125 client.ByInspecting(), 126 azure.WithErrorUnlessStatusCode(http.StatusOK), 127 autorest.ByClosing()) 128 result.Response = resp 129 return 130} 131 132// CreateSecret creates the specified secret for use with external data sources in the specified database. This is 133// deprecated and will be removed in the next release. Please use CreateCredential instead. 134// Parameters: 135// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 136// databaseName - the name of the database in which to create the secret. 137// secretName - the name of the secret. 138// parameters - the parameters required to create the secret (name and password) 139func (client Client) CreateSecret(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (result autorest.Response, err error) { 140 if tracing.IsEnabled() { 141 ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateSecret") 142 defer func() { 143 sc := -1 144 if result.Response != nil { 145 sc = result.Response.StatusCode 146 } 147 tracing.EndSpan(ctx, sc, err) 148 }() 149 } 150 if err := validation.Validate([]validation.Validation{ 151 {TargetValue: parameters, 152 Constraints: []validation.Constraint{{Target: "parameters.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 153 return result, validation.NewError("catalog.Client", "CreateSecret", err.Error()) 154 } 155 156 req, err := client.CreateSecretPreparer(ctx, accountName, databaseName, secretName, parameters) 157 if err != nil { 158 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", nil, "Failure preparing request") 159 return 160 } 161 162 resp, err := client.CreateSecretSender(req) 163 if err != nil { 164 result.Response = resp 165 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", resp, "Failure sending request") 166 return 167 } 168 169 result, err = client.CreateSecretResponder(resp) 170 if err != nil { 171 err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", resp, "Failure responding to request") 172 } 173 174 return 175} 176 177// CreateSecretPreparer prepares the CreateSecret request. 178func (client Client) CreateSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (*http.Request, error) { 179 urlParameters := map[string]interface{}{ 180 "accountName": accountName, 181 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 182 } 183 184 pathParameters := map[string]interface{}{ 185 "databaseName": autorest.Encode("path", databaseName), 186 "secretName": autorest.Encode("path", secretName), 187 } 188 189 const APIVersion = "2016-11-01" 190 queryParameters := map[string]interface{}{ 191 "api-version": APIVersion, 192 } 193 194 preparer := autorest.CreatePreparer( 195 autorest.AsContentType("application/json; charset=utf-8"), 196 autorest.AsPut(), 197 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 198 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters), 199 autorest.WithJSON(parameters), 200 autorest.WithQueryParameters(queryParameters)) 201 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 202} 203 204// CreateSecretSender sends the CreateSecret request. The method will close the 205// http.Response Body if it receives an error. 206func (client Client) CreateSecretSender(req *http.Request) (*http.Response, error) { 207 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 208 return autorest.SendWithSender(client, req, sd...) 209} 210 211// CreateSecretResponder handles the response to the CreateSecret request. The method always 212// closes the http.Response Body. 213func (client Client) CreateSecretResponder(resp *http.Response) (result autorest.Response, err error) { 214 err = autorest.Respond( 215 resp, 216 client.ByInspecting(), 217 azure.WithErrorUnlessStatusCode(http.StatusOK), 218 autorest.ByClosing()) 219 result.Response = resp 220 return 221} 222 223// DeleteAllSecrets deletes all secrets in the specified database. This is deprecated and will be removed in the next 224// release. In the future, please only drop individual credentials using DeleteCredential 225// Parameters: 226// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 227// databaseName - the name of the database containing the secret. 228func (client Client) DeleteAllSecrets(ctx context.Context, accountName string, databaseName string) (result autorest.Response, err error) { 229 if tracing.IsEnabled() { 230 ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteAllSecrets") 231 defer func() { 232 sc := -1 233 if result.Response != nil { 234 sc = result.Response.StatusCode 235 } 236 tracing.EndSpan(ctx, sc, err) 237 }() 238 } 239 req, err := client.DeleteAllSecretsPreparer(ctx, accountName, databaseName) 240 if err != nil { 241 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", nil, "Failure preparing request") 242 return 243 } 244 245 resp, err := client.DeleteAllSecretsSender(req) 246 if err != nil { 247 result.Response = resp 248 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", resp, "Failure sending request") 249 return 250 } 251 252 result, err = client.DeleteAllSecretsResponder(resp) 253 if err != nil { 254 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", resp, "Failure responding to request") 255 } 256 257 return 258} 259 260// DeleteAllSecretsPreparer prepares the DeleteAllSecrets request. 261func (client Client) DeleteAllSecretsPreparer(ctx context.Context, accountName string, databaseName string) (*http.Request, error) { 262 urlParameters := map[string]interface{}{ 263 "accountName": accountName, 264 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 265 } 266 267 pathParameters := map[string]interface{}{ 268 "databaseName": autorest.Encode("path", databaseName), 269 } 270 271 const APIVersion = "2016-11-01" 272 queryParameters := map[string]interface{}{ 273 "api-version": APIVersion, 274 } 275 276 preparer := autorest.CreatePreparer( 277 autorest.AsDelete(), 278 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 279 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets", pathParameters), 280 autorest.WithQueryParameters(queryParameters)) 281 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 282} 283 284// DeleteAllSecretsSender sends the DeleteAllSecrets request. The method will close the 285// http.Response Body if it receives an error. 286func (client Client) DeleteAllSecretsSender(req *http.Request) (*http.Response, error) { 287 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 288 return autorest.SendWithSender(client, req, sd...) 289} 290 291// DeleteAllSecretsResponder handles the response to the DeleteAllSecrets request. The method always 292// closes the http.Response Body. 293func (client Client) DeleteAllSecretsResponder(resp *http.Response) (result autorest.Response, err error) { 294 err = autorest.Respond( 295 resp, 296 client.ByInspecting(), 297 azure.WithErrorUnlessStatusCode(http.StatusOK), 298 autorest.ByClosing()) 299 result.Response = resp 300 return 301} 302 303// DeleteCredential deletes the specified credential in the specified database 304// Parameters: 305// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 306// databaseName - the name of the database containing the credential. 307// credentialName - the name of the credential to delete 308// parameters - the parameters to delete a credential if the current user is not the account owner. 309// cascade - indicates if the delete should be a cascading delete (which deletes all resources dependent on the 310// credential as well as the credential) or not. If false will fail if there are any resources relying on the 311// credential. 312func (client Client) DeleteCredential(ctx context.Context, accountName string, databaseName string, credentialName string, parameters *DataLakeAnalyticsCatalogCredentialDeleteParameters, cascade *bool) (result autorest.Response, err error) { 313 if tracing.IsEnabled() { 314 ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteCredential") 315 defer func() { 316 sc := -1 317 if result.Response != nil { 318 sc = result.Response.StatusCode 319 } 320 tracing.EndSpan(ctx, sc, err) 321 }() 322 } 323 req, err := client.DeleteCredentialPreparer(ctx, accountName, databaseName, credentialName, parameters, cascade) 324 if err != nil { 325 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteCredential", nil, "Failure preparing request") 326 return 327 } 328 329 resp, err := client.DeleteCredentialSender(req) 330 if err != nil { 331 result.Response = resp 332 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteCredential", resp, "Failure sending request") 333 return 334 } 335 336 result, err = client.DeleteCredentialResponder(resp) 337 if err != nil { 338 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteCredential", resp, "Failure responding to request") 339 } 340 341 return 342} 343 344// DeleteCredentialPreparer prepares the DeleteCredential request. 345func (client Client) DeleteCredentialPreparer(ctx context.Context, accountName string, databaseName string, credentialName string, parameters *DataLakeAnalyticsCatalogCredentialDeleteParameters, cascade *bool) (*http.Request, error) { 346 urlParameters := map[string]interface{}{ 347 "accountName": accountName, 348 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 349 } 350 351 pathParameters := map[string]interface{}{ 352 "credentialName": autorest.Encode("path", credentialName), 353 "databaseName": autorest.Encode("path", databaseName), 354 } 355 356 const APIVersion = "2016-11-01" 357 queryParameters := map[string]interface{}{ 358 "api-version": APIVersion, 359 } 360 if cascade != nil { 361 queryParameters["cascade"] = autorest.Encode("query", *cascade) 362 } else { 363 queryParameters["cascade"] = autorest.Encode("query", false) 364 } 365 366 preparer := autorest.CreatePreparer( 367 autorest.AsContentType("application/json; charset=utf-8"), 368 autorest.AsPost(), 369 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 370 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials/{credentialName}", pathParameters), 371 autorest.WithQueryParameters(queryParameters)) 372 if parameters != nil { 373 preparer = autorest.DecoratePreparer(preparer, 374 autorest.WithJSON(parameters)) 375 } 376 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 377} 378 379// DeleteCredentialSender sends the DeleteCredential request. The method will close the 380// http.Response Body if it receives an error. 381func (client Client) DeleteCredentialSender(req *http.Request) (*http.Response, error) { 382 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 383 return autorest.SendWithSender(client, req, sd...) 384} 385 386// DeleteCredentialResponder handles the response to the DeleteCredential request. The method always 387// closes the http.Response Body. 388func (client Client) DeleteCredentialResponder(resp *http.Response) (result autorest.Response, err error) { 389 err = autorest.Respond( 390 resp, 391 client.ByInspecting(), 392 azure.WithErrorUnlessStatusCode(http.StatusOK), 393 autorest.ByClosing()) 394 result.Response = resp 395 return 396} 397 398// DeleteSecret deletes the specified secret in the specified database. This is deprecated and will be removed in the 399// next release. Please use DeleteCredential instead. 400// Parameters: 401// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 402// databaseName - the name of the database containing the secret. 403// secretName - the name of the secret to delete 404func (client Client) DeleteSecret(ctx context.Context, accountName string, databaseName string, secretName string) (result autorest.Response, err error) { 405 if tracing.IsEnabled() { 406 ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteSecret") 407 defer func() { 408 sc := -1 409 if result.Response != nil { 410 sc = result.Response.StatusCode 411 } 412 tracing.EndSpan(ctx, sc, err) 413 }() 414 } 415 req, err := client.DeleteSecretPreparer(ctx, accountName, databaseName, secretName) 416 if err != nil { 417 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", nil, "Failure preparing request") 418 return 419 } 420 421 resp, err := client.DeleteSecretSender(req) 422 if err != nil { 423 result.Response = resp 424 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", resp, "Failure sending request") 425 return 426 } 427 428 result, err = client.DeleteSecretResponder(resp) 429 if err != nil { 430 err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", resp, "Failure responding to request") 431 } 432 433 return 434} 435 436// DeleteSecretPreparer prepares the DeleteSecret request. 437func (client Client) DeleteSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string) (*http.Request, error) { 438 urlParameters := map[string]interface{}{ 439 "accountName": accountName, 440 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 441 } 442 443 pathParameters := map[string]interface{}{ 444 "databaseName": autorest.Encode("path", databaseName), 445 "secretName": autorest.Encode("path", secretName), 446 } 447 448 const APIVersion = "2016-11-01" 449 queryParameters := map[string]interface{}{ 450 "api-version": APIVersion, 451 } 452 453 preparer := autorest.CreatePreparer( 454 autorest.AsDelete(), 455 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 456 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters), 457 autorest.WithQueryParameters(queryParameters)) 458 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 459} 460 461// DeleteSecretSender sends the DeleteSecret request. The method will close the 462// http.Response Body if it receives an error. 463func (client Client) DeleteSecretSender(req *http.Request) (*http.Response, error) { 464 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 465 return autorest.SendWithSender(client, req, sd...) 466} 467 468// DeleteSecretResponder handles the response to the DeleteSecret request. The method always 469// closes the http.Response Body. 470func (client Client) DeleteSecretResponder(resp *http.Response) (result autorest.Response, err error) { 471 err = autorest.Respond( 472 resp, 473 client.ByInspecting(), 474 azure.WithErrorUnlessStatusCode(http.StatusOK), 475 autorest.ByClosing()) 476 result.Response = resp 477 return 478} 479 480// GetAssembly retrieves the specified assembly from the Data Lake Analytics catalog. 481// Parameters: 482// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 483// databaseName - the name of the database containing the assembly. 484// assemblyName - the name of the assembly. 485func (client Client) GetAssembly(ctx context.Context, accountName string, databaseName string, assemblyName string) (result USQLAssembly, err error) { 486 if tracing.IsEnabled() { 487 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetAssembly") 488 defer func() { 489 sc := -1 490 if result.Response.Response != nil { 491 sc = result.Response.Response.StatusCode 492 } 493 tracing.EndSpan(ctx, sc, err) 494 }() 495 } 496 req, err := client.GetAssemblyPreparer(ctx, accountName, databaseName, assemblyName) 497 if err != nil { 498 err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", nil, "Failure preparing request") 499 return 500 } 501 502 resp, err := client.GetAssemblySender(req) 503 if err != nil { 504 result.Response = autorest.Response{Response: resp} 505 err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", resp, "Failure sending request") 506 return 507 } 508 509 result, err = client.GetAssemblyResponder(resp) 510 if err != nil { 511 err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", resp, "Failure responding to request") 512 } 513 514 return 515} 516 517// GetAssemblyPreparer prepares the GetAssembly request. 518func (client Client) GetAssemblyPreparer(ctx context.Context, accountName string, databaseName string, assemblyName string) (*http.Request, error) { 519 urlParameters := map[string]interface{}{ 520 "accountName": accountName, 521 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 522 } 523 524 pathParameters := map[string]interface{}{ 525 "assemblyName": autorest.Encode("path", assemblyName), 526 "databaseName": autorest.Encode("path", databaseName), 527 } 528 529 const APIVersion = "2016-11-01" 530 queryParameters := map[string]interface{}{ 531 "api-version": APIVersion, 532 } 533 534 preparer := autorest.CreatePreparer( 535 autorest.AsGet(), 536 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 537 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/assemblies/{assemblyName}", pathParameters), 538 autorest.WithQueryParameters(queryParameters)) 539 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 540} 541 542// GetAssemblySender sends the GetAssembly request. The method will close the 543// http.Response Body if it receives an error. 544func (client Client) GetAssemblySender(req *http.Request) (*http.Response, error) { 545 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 546 return autorest.SendWithSender(client, req, sd...) 547} 548 549// GetAssemblyResponder handles the response to the GetAssembly request. The method always 550// closes the http.Response Body. 551func (client Client) GetAssemblyResponder(resp *http.Response) (result USQLAssembly, err error) { 552 err = autorest.Respond( 553 resp, 554 client.ByInspecting(), 555 azure.WithErrorUnlessStatusCode(http.StatusOK), 556 autorest.ByUnmarshallingJSON(&result), 557 autorest.ByClosing()) 558 result.Response = autorest.Response{Response: resp} 559 return 560} 561 562// GetCredential retrieves the specified credential from the Data Lake Analytics catalog. 563// Parameters: 564// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 565// databaseName - the name of the database containing the schema. 566// credentialName - the name of the credential. 567func (client Client) GetCredential(ctx context.Context, accountName string, databaseName string, credentialName string) (result USQLCredential, err error) { 568 if tracing.IsEnabled() { 569 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetCredential") 570 defer func() { 571 sc := -1 572 if result.Response.Response != nil { 573 sc = result.Response.Response.StatusCode 574 } 575 tracing.EndSpan(ctx, sc, err) 576 }() 577 } 578 req, err := client.GetCredentialPreparer(ctx, accountName, databaseName, credentialName) 579 if err != nil { 580 err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", nil, "Failure preparing request") 581 return 582 } 583 584 resp, err := client.GetCredentialSender(req) 585 if err != nil { 586 result.Response = autorest.Response{Response: resp} 587 err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", resp, "Failure sending request") 588 return 589 } 590 591 result, err = client.GetCredentialResponder(resp) 592 if err != nil { 593 err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", resp, "Failure responding to request") 594 } 595 596 return 597} 598 599// GetCredentialPreparer prepares the GetCredential request. 600func (client Client) GetCredentialPreparer(ctx context.Context, accountName string, databaseName string, credentialName string) (*http.Request, error) { 601 urlParameters := map[string]interface{}{ 602 "accountName": accountName, 603 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 604 } 605 606 pathParameters := map[string]interface{}{ 607 "credentialName": autorest.Encode("path", credentialName), 608 "databaseName": autorest.Encode("path", databaseName), 609 } 610 611 const APIVersion = "2016-11-01" 612 queryParameters := map[string]interface{}{ 613 "api-version": APIVersion, 614 } 615 616 preparer := autorest.CreatePreparer( 617 autorest.AsGet(), 618 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 619 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials/{credentialName}", pathParameters), 620 autorest.WithQueryParameters(queryParameters)) 621 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 622} 623 624// GetCredentialSender sends the GetCredential request. The method will close the 625// http.Response Body if it receives an error. 626func (client Client) GetCredentialSender(req *http.Request) (*http.Response, error) { 627 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 628 return autorest.SendWithSender(client, req, sd...) 629} 630 631// GetCredentialResponder handles the response to the GetCredential request. The method always 632// closes the http.Response Body. 633func (client Client) GetCredentialResponder(resp *http.Response) (result USQLCredential, err error) { 634 err = autorest.Respond( 635 resp, 636 client.ByInspecting(), 637 azure.WithErrorUnlessStatusCode(http.StatusOK), 638 autorest.ByUnmarshallingJSON(&result), 639 autorest.ByClosing()) 640 result.Response = autorest.Response{Response: resp} 641 return 642} 643 644// GetDatabase retrieves the specified database from the Data Lake Analytics catalog. 645// Parameters: 646// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 647// databaseName - the name of the database. 648func (client Client) GetDatabase(ctx context.Context, accountName string, databaseName string) (result USQLDatabase, err error) { 649 if tracing.IsEnabled() { 650 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDatabase") 651 defer func() { 652 sc := -1 653 if result.Response.Response != nil { 654 sc = result.Response.Response.StatusCode 655 } 656 tracing.EndSpan(ctx, sc, err) 657 }() 658 } 659 req, err := client.GetDatabasePreparer(ctx, accountName, databaseName) 660 if err != nil { 661 err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", nil, "Failure preparing request") 662 return 663 } 664 665 resp, err := client.GetDatabaseSender(req) 666 if err != nil { 667 result.Response = autorest.Response{Response: resp} 668 err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", resp, "Failure sending request") 669 return 670 } 671 672 result, err = client.GetDatabaseResponder(resp) 673 if err != nil { 674 err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", resp, "Failure responding to request") 675 } 676 677 return 678} 679 680// GetDatabasePreparer prepares the GetDatabase request. 681func (client Client) GetDatabasePreparer(ctx context.Context, accountName string, databaseName string) (*http.Request, error) { 682 urlParameters := map[string]interface{}{ 683 "accountName": accountName, 684 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 685 } 686 687 pathParameters := map[string]interface{}{ 688 "databaseName": autorest.Encode("path", databaseName), 689 } 690 691 const APIVersion = "2016-11-01" 692 queryParameters := map[string]interface{}{ 693 "api-version": APIVersion, 694 } 695 696 preparer := autorest.CreatePreparer( 697 autorest.AsGet(), 698 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 699 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}", pathParameters), 700 autorest.WithQueryParameters(queryParameters)) 701 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 702} 703 704// GetDatabaseSender sends the GetDatabase request. The method will close the 705// http.Response Body if it receives an error. 706func (client Client) GetDatabaseSender(req *http.Request) (*http.Response, error) { 707 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 708 return autorest.SendWithSender(client, req, sd...) 709} 710 711// GetDatabaseResponder handles the response to the GetDatabase request. The method always 712// closes the http.Response Body. 713func (client Client) GetDatabaseResponder(resp *http.Response) (result USQLDatabase, err error) { 714 err = autorest.Respond( 715 resp, 716 client.ByInspecting(), 717 azure.WithErrorUnlessStatusCode(http.StatusOK), 718 autorest.ByUnmarshallingJSON(&result), 719 autorest.ByClosing()) 720 result.Response = autorest.Response{Response: resp} 721 return 722} 723 724// GetExternalDataSource retrieves the specified external data source from the Data Lake Analytics catalog. 725// Parameters: 726// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 727// databaseName - the name of the database containing the external data source. 728// externalDataSourceName - the name of the external data source. 729func (client Client) GetExternalDataSource(ctx context.Context, accountName string, databaseName string, externalDataSourceName string) (result USQLExternalDataSource, err error) { 730 if tracing.IsEnabled() { 731 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetExternalDataSource") 732 defer func() { 733 sc := -1 734 if result.Response.Response != nil { 735 sc = result.Response.Response.StatusCode 736 } 737 tracing.EndSpan(ctx, sc, err) 738 }() 739 } 740 req, err := client.GetExternalDataSourcePreparer(ctx, accountName, databaseName, externalDataSourceName) 741 if err != nil { 742 err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", nil, "Failure preparing request") 743 return 744 } 745 746 resp, err := client.GetExternalDataSourceSender(req) 747 if err != nil { 748 result.Response = autorest.Response{Response: resp} 749 err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", resp, "Failure sending request") 750 return 751 } 752 753 result, err = client.GetExternalDataSourceResponder(resp) 754 if err != nil { 755 err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", resp, "Failure responding to request") 756 } 757 758 return 759} 760 761// GetExternalDataSourcePreparer prepares the GetExternalDataSource request. 762func (client Client) GetExternalDataSourcePreparer(ctx context.Context, accountName string, databaseName string, externalDataSourceName string) (*http.Request, error) { 763 urlParameters := map[string]interface{}{ 764 "accountName": accountName, 765 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 766 } 767 768 pathParameters := map[string]interface{}{ 769 "databaseName": autorest.Encode("path", databaseName), 770 "externalDataSourceName": autorest.Encode("path", externalDataSourceName), 771 } 772 773 const APIVersion = "2016-11-01" 774 queryParameters := map[string]interface{}{ 775 "api-version": APIVersion, 776 } 777 778 preparer := autorest.CreatePreparer( 779 autorest.AsGet(), 780 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 781 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}", pathParameters), 782 autorest.WithQueryParameters(queryParameters)) 783 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 784} 785 786// GetExternalDataSourceSender sends the GetExternalDataSource request. The method will close the 787// http.Response Body if it receives an error. 788func (client Client) GetExternalDataSourceSender(req *http.Request) (*http.Response, error) { 789 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 790 return autorest.SendWithSender(client, req, sd...) 791} 792 793// GetExternalDataSourceResponder handles the response to the GetExternalDataSource request. The method always 794// closes the http.Response Body. 795func (client Client) GetExternalDataSourceResponder(resp *http.Response) (result USQLExternalDataSource, err error) { 796 err = autorest.Respond( 797 resp, 798 client.ByInspecting(), 799 azure.WithErrorUnlessStatusCode(http.StatusOK), 800 autorest.ByUnmarshallingJSON(&result), 801 autorest.ByClosing()) 802 result.Response = autorest.Response{Response: resp} 803 return 804} 805 806// GetPackage retrieves the specified package from the Data Lake Analytics catalog. 807// Parameters: 808// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 809// databaseName - the name of the database containing the package. 810// schemaName - the name of the schema containing the package. 811// packageName - the name of the package. 812func (client Client) GetPackage(ctx context.Context, accountName string, databaseName string, schemaName string, packageName string) (result USQLPackage, err error) { 813 if tracing.IsEnabled() { 814 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetPackage") 815 defer func() { 816 sc := -1 817 if result.Response.Response != nil { 818 sc = result.Response.Response.StatusCode 819 } 820 tracing.EndSpan(ctx, sc, err) 821 }() 822 } 823 req, err := client.GetPackagePreparer(ctx, accountName, databaseName, schemaName, packageName) 824 if err != nil { 825 err = autorest.NewErrorWithError(err, "catalog.Client", "GetPackage", nil, "Failure preparing request") 826 return 827 } 828 829 resp, err := client.GetPackageSender(req) 830 if err != nil { 831 result.Response = autorest.Response{Response: resp} 832 err = autorest.NewErrorWithError(err, "catalog.Client", "GetPackage", resp, "Failure sending request") 833 return 834 } 835 836 result, err = client.GetPackageResponder(resp) 837 if err != nil { 838 err = autorest.NewErrorWithError(err, "catalog.Client", "GetPackage", resp, "Failure responding to request") 839 } 840 841 return 842} 843 844// GetPackagePreparer prepares the GetPackage request. 845func (client Client) GetPackagePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, packageName string) (*http.Request, error) { 846 urlParameters := map[string]interface{}{ 847 "accountName": accountName, 848 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 849 } 850 851 pathParameters := map[string]interface{}{ 852 "databaseName": autorest.Encode("path", databaseName), 853 "packageName": autorest.Encode("path", packageName), 854 "schemaName": autorest.Encode("path", schemaName), 855 } 856 857 const APIVersion = "2016-11-01" 858 queryParameters := map[string]interface{}{ 859 "api-version": APIVersion, 860 } 861 862 preparer := autorest.CreatePreparer( 863 autorest.AsGet(), 864 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 865 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages/{packageName}", pathParameters), 866 autorest.WithQueryParameters(queryParameters)) 867 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 868} 869 870// GetPackageSender sends the GetPackage request. The method will close the 871// http.Response Body if it receives an error. 872func (client Client) GetPackageSender(req *http.Request) (*http.Response, error) { 873 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 874 return autorest.SendWithSender(client, req, sd...) 875} 876 877// GetPackageResponder handles the response to the GetPackage request. The method always 878// closes the http.Response Body. 879func (client Client) GetPackageResponder(resp *http.Response) (result USQLPackage, err error) { 880 err = autorest.Respond( 881 resp, 882 client.ByInspecting(), 883 azure.WithErrorUnlessStatusCode(http.StatusOK), 884 autorest.ByUnmarshallingJSON(&result), 885 autorest.ByClosing()) 886 result.Response = autorest.Response{Response: resp} 887 return 888} 889 890// GetProcedure retrieves the specified procedure from the Data Lake Analytics catalog. 891// Parameters: 892// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 893// databaseName - the name of the database containing the procedure. 894// schemaName - the name of the schema containing the procedure. 895// procedureName - the name of the procedure. 896func (client Client) GetProcedure(ctx context.Context, accountName string, databaseName string, schemaName string, procedureName string) (result USQLProcedure, err error) { 897 if tracing.IsEnabled() { 898 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetProcedure") 899 defer func() { 900 sc := -1 901 if result.Response.Response != nil { 902 sc = result.Response.Response.StatusCode 903 } 904 tracing.EndSpan(ctx, sc, err) 905 }() 906 } 907 req, err := client.GetProcedurePreparer(ctx, accountName, databaseName, schemaName, procedureName) 908 if err != nil { 909 err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", nil, "Failure preparing request") 910 return 911 } 912 913 resp, err := client.GetProcedureSender(req) 914 if err != nil { 915 result.Response = autorest.Response{Response: resp} 916 err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", resp, "Failure sending request") 917 return 918 } 919 920 result, err = client.GetProcedureResponder(resp) 921 if err != nil { 922 err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", resp, "Failure responding to request") 923 } 924 925 return 926} 927 928// GetProcedurePreparer prepares the GetProcedure request. 929func (client Client) GetProcedurePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, procedureName string) (*http.Request, error) { 930 urlParameters := map[string]interface{}{ 931 "accountName": accountName, 932 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 933 } 934 935 pathParameters := map[string]interface{}{ 936 "databaseName": autorest.Encode("path", databaseName), 937 "procedureName": autorest.Encode("path", procedureName), 938 "schemaName": autorest.Encode("path", schemaName), 939 } 940 941 const APIVersion = "2016-11-01" 942 queryParameters := map[string]interface{}{ 943 "api-version": APIVersion, 944 } 945 946 preparer := autorest.CreatePreparer( 947 autorest.AsGet(), 948 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 949 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}", pathParameters), 950 autorest.WithQueryParameters(queryParameters)) 951 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 952} 953 954// GetProcedureSender sends the GetProcedure request. The method will close the 955// http.Response Body if it receives an error. 956func (client Client) GetProcedureSender(req *http.Request) (*http.Response, error) { 957 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 958 return autorest.SendWithSender(client, req, sd...) 959} 960 961// GetProcedureResponder handles the response to the GetProcedure request. The method always 962// closes the http.Response Body. 963func (client Client) GetProcedureResponder(resp *http.Response) (result USQLProcedure, err error) { 964 err = autorest.Respond( 965 resp, 966 client.ByInspecting(), 967 azure.WithErrorUnlessStatusCode(http.StatusOK), 968 autorest.ByUnmarshallingJSON(&result), 969 autorest.ByClosing()) 970 result.Response = autorest.Response{Response: resp} 971 return 972} 973 974// GetSchema retrieves the specified schema from the Data Lake Analytics catalog. 975// Parameters: 976// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 977// databaseName - the name of the database containing the schema. 978// schemaName - the name of the schema. 979func (client Client) GetSchema(ctx context.Context, accountName string, databaseName string, schemaName string) (result USQLSchema, err error) { 980 if tracing.IsEnabled() { 981 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetSchema") 982 defer func() { 983 sc := -1 984 if result.Response.Response != nil { 985 sc = result.Response.Response.StatusCode 986 } 987 tracing.EndSpan(ctx, sc, err) 988 }() 989 } 990 req, err := client.GetSchemaPreparer(ctx, accountName, databaseName, schemaName) 991 if err != nil { 992 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", nil, "Failure preparing request") 993 return 994 } 995 996 resp, err := client.GetSchemaSender(req) 997 if err != nil { 998 result.Response = autorest.Response{Response: resp} 999 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", resp, "Failure sending request") 1000 return 1001 } 1002 1003 result, err = client.GetSchemaResponder(resp) 1004 if err != nil { 1005 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", resp, "Failure responding to request") 1006 } 1007 1008 return 1009} 1010 1011// GetSchemaPreparer prepares the GetSchema request. 1012func (client Client) GetSchemaPreparer(ctx context.Context, accountName string, databaseName string, schemaName string) (*http.Request, error) { 1013 urlParameters := map[string]interface{}{ 1014 "accountName": accountName, 1015 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1016 } 1017 1018 pathParameters := map[string]interface{}{ 1019 "databaseName": autorest.Encode("path", databaseName), 1020 "schemaName": autorest.Encode("path", schemaName), 1021 } 1022 1023 const APIVersion = "2016-11-01" 1024 queryParameters := map[string]interface{}{ 1025 "api-version": APIVersion, 1026 } 1027 1028 preparer := autorest.CreatePreparer( 1029 autorest.AsGet(), 1030 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1031 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}", pathParameters), 1032 autorest.WithQueryParameters(queryParameters)) 1033 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1034} 1035 1036// GetSchemaSender sends the GetSchema request. The method will close the 1037// http.Response Body if it receives an error. 1038func (client Client) GetSchemaSender(req *http.Request) (*http.Response, error) { 1039 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1040 return autorest.SendWithSender(client, req, sd...) 1041} 1042 1043// GetSchemaResponder handles the response to the GetSchema request. The method always 1044// closes the http.Response Body. 1045func (client Client) GetSchemaResponder(resp *http.Response) (result USQLSchema, err error) { 1046 err = autorest.Respond( 1047 resp, 1048 client.ByInspecting(), 1049 azure.WithErrorUnlessStatusCode(http.StatusOK), 1050 autorest.ByUnmarshallingJSON(&result), 1051 autorest.ByClosing()) 1052 result.Response = autorest.Response{Response: resp} 1053 return 1054} 1055 1056// GetSecret gets the specified secret in the specified database. This is deprecated and will be removed in the next 1057// release. Please use GetCredential instead. 1058// Parameters: 1059// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1060// databaseName - the name of the database containing the secret. 1061// secretName - the name of the secret to get 1062func (client Client) GetSecret(ctx context.Context, accountName string, databaseName string, secretName string) (result USQLSecret, err error) { 1063 if tracing.IsEnabled() { 1064 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetSecret") 1065 defer func() { 1066 sc := -1 1067 if result.Response.Response != nil { 1068 sc = result.Response.Response.StatusCode 1069 } 1070 tracing.EndSpan(ctx, sc, err) 1071 }() 1072 } 1073 req, err := client.GetSecretPreparer(ctx, accountName, databaseName, secretName) 1074 if err != nil { 1075 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", nil, "Failure preparing request") 1076 return 1077 } 1078 1079 resp, err := client.GetSecretSender(req) 1080 if err != nil { 1081 result.Response = autorest.Response{Response: resp} 1082 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", resp, "Failure sending request") 1083 return 1084 } 1085 1086 result, err = client.GetSecretResponder(resp) 1087 if err != nil { 1088 err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", resp, "Failure responding to request") 1089 } 1090 1091 return 1092} 1093 1094// GetSecretPreparer prepares the GetSecret request. 1095func (client Client) GetSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string) (*http.Request, error) { 1096 urlParameters := map[string]interface{}{ 1097 "accountName": accountName, 1098 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1099 } 1100 1101 pathParameters := map[string]interface{}{ 1102 "databaseName": autorest.Encode("path", databaseName), 1103 "secretName": autorest.Encode("path", secretName), 1104 } 1105 1106 const APIVersion = "2016-11-01" 1107 queryParameters := map[string]interface{}{ 1108 "api-version": APIVersion, 1109 } 1110 1111 preparer := autorest.CreatePreparer( 1112 autorest.AsGet(), 1113 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1114 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters), 1115 autorest.WithQueryParameters(queryParameters)) 1116 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1117} 1118 1119// GetSecretSender sends the GetSecret request. The method will close the 1120// http.Response Body if it receives an error. 1121func (client Client) GetSecretSender(req *http.Request) (*http.Response, error) { 1122 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1123 return autorest.SendWithSender(client, req, sd...) 1124} 1125 1126// GetSecretResponder handles the response to the GetSecret request. The method always 1127// closes the http.Response Body. 1128func (client Client) GetSecretResponder(resp *http.Response) (result USQLSecret, err error) { 1129 err = autorest.Respond( 1130 resp, 1131 client.ByInspecting(), 1132 azure.WithErrorUnlessStatusCode(http.StatusOK), 1133 autorest.ByUnmarshallingJSON(&result), 1134 autorest.ByClosing()) 1135 result.Response = autorest.Response{Response: resp} 1136 return 1137} 1138 1139// GetTable retrieves the specified table from the Data Lake Analytics catalog. 1140// Parameters: 1141// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1142// databaseName - the name of the database containing the table. 1143// schemaName - the name of the schema containing the table. 1144// tableName - the name of the table. 1145func (client Client) GetTable(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string) (result USQLTable, err error) { 1146 if tracing.IsEnabled() { 1147 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTable") 1148 defer func() { 1149 sc := -1 1150 if result.Response.Response != nil { 1151 sc = result.Response.Response.StatusCode 1152 } 1153 tracing.EndSpan(ctx, sc, err) 1154 }() 1155 } 1156 req, err := client.GetTablePreparer(ctx, accountName, databaseName, schemaName, tableName) 1157 if err != nil { 1158 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", nil, "Failure preparing request") 1159 return 1160 } 1161 1162 resp, err := client.GetTableSender(req) 1163 if err != nil { 1164 result.Response = autorest.Response{Response: resp} 1165 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", resp, "Failure sending request") 1166 return 1167 } 1168 1169 result, err = client.GetTableResponder(resp) 1170 if err != nil { 1171 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", resp, "Failure responding to request") 1172 } 1173 1174 return 1175} 1176 1177// GetTablePreparer prepares the GetTable request. 1178func (client Client) GetTablePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string) (*http.Request, error) { 1179 urlParameters := map[string]interface{}{ 1180 "accountName": accountName, 1181 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1182 } 1183 1184 pathParameters := map[string]interface{}{ 1185 "databaseName": autorest.Encode("path", databaseName), 1186 "schemaName": autorest.Encode("path", schemaName), 1187 "tableName": autorest.Encode("path", tableName), 1188 } 1189 1190 const APIVersion = "2016-11-01" 1191 queryParameters := map[string]interface{}{ 1192 "api-version": APIVersion, 1193 } 1194 1195 preparer := autorest.CreatePreparer( 1196 autorest.AsGet(), 1197 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1198 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}", pathParameters), 1199 autorest.WithQueryParameters(queryParameters)) 1200 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1201} 1202 1203// GetTableSender sends the GetTable request. The method will close the 1204// http.Response Body if it receives an error. 1205func (client Client) GetTableSender(req *http.Request) (*http.Response, error) { 1206 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1207 return autorest.SendWithSender(client, req, sd...) 1208} 1209 1210// GetTableResponder handles the response to the GetTable request. The method always 1211// closes the http.Response Body. 1212func (client Client) GetTableResponder(resp *http.Response) (result USQLTable, err error) { 1213 err = autorest.Respond( 1214 resp, 1215 client.ByInspecting(), 1216 azure.WithErrorUnlessStatusCode(http.StatusOK), 1217 autorest.ByUnmarshallingJSON(&result), 1218 autorest.ByClosing()) 1219 result.Response = autorest.Response{Response: resp} 1220 return 1221} 1222 1223// GetTablePartition retrieves the specified table partition from the Data Lake Analytics catalog. 1224// Parameters: 1225// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1226// databaseName - the name of the database containing the partition. 1227// schemaName - the name of the schema containing the partition. 1228// tableName - the name of the table containing the partition. 1229// partitionName - the name of the table partition. 1230func (client Client) GetTablePartition(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string) (result USQLTablePartition, err error) { 1231 if tracing.IsEnabled() { 1232 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTablePartition") 1233 defer func() { 1234 sc := -1 1235 if result.Response.Response != nil { 1236 sc = result.Response.Response.StatusCode 1237 } 1238 tracing.EndSpan(ctx, sc, err) 1239 }() 1240 } 1241 req, err := client.GetTablePartitionPreparer(ctx, accountName, databaseName, schemaName, tableName, partitionName) 1242 if err != nil { 1243 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", nil, "Failure preparing request") 1244 return 1245 } 1246 1247 resp, err := client.GetTablePartitionSender(req) 1248 if err != nil { 1249 result.Response = autorest.Response{Response: resp} 1250 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", resp, "Failure sending request") 1251 return 1252 } 1253 1254 result, err = client.GetTablePartitionResponder(resp) 1255 if err != nil { 1256 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", resp, "Failure responding to request") 1257 } 1258 1259 return 1260} 1261 1262// GetTablePartitionPreparer prepares the GetTablePartition request. 1263func (client Client) GetTablePartitionPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string) (*http.Request, error) { 1264 urlParameters := map[string]interface{}{ 1265 "accountName": accountName, 1266 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1267 } 1268 1269 pathParameters := map[string]interface{}{ 1270 "databaseName": autorest.Encode("path", databaseName), 1271 "partitionName": autorest.Encode("path", partitionName), 1272 "schemaName": autorest.Encode("path", schemaName), 1273 "tableName": autorest.Encode("path", tableName), 1274 } 1275 1276 const APIVersion = "2016-11-01" 1277 queryParameters := map[string]interface{}{ 1278 "api-version": APIVersion, 1279 } 1280 1281 preparer := autorest.CreatePreparer( 1282 autorest.AsGet(), 1283 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1284 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}", pathParameters), 1285 autorest.WithQueryParameters(queryParameters)) 1286 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1287} 1288 1289// GetTablePartitionSender sends the GetTablePartition request. The method will close the 1290// http.Response Body if it receives an error. 1291func (client Client) GetTablePartitionSender(req *http.Request) (*http.Response, error) { 1292 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1293 return autorest.SendWithSender(client, req, sd...) 1294} 1295 1296// GetTablePartitionResponder handles the response to the GetTablePartition request. The method always 1297// closes the http.Response Body. 1298func (client Client) GetTablePartitionResponder(resp *http.Response) (result USQLTablePartition, err error) { 1299 err = autorest.Respond( 1300 resp, 1301 client.ByInspecting(), 1302 azure.WithErrorUnlessStatusCode(http.StatusOK), 1303 autorest.ByUnmarshallingJSON(&result), 1304 autorest.ByClosing()) 1305 result.Response = autorest.Response{Response: resp} 1306 return 1307} 1308 1309// GetTableStatistic retrieves the specified table statistics from the Data Lake Analytics catalog. 1310// Parameters: 1311// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1312// databaseName - the name of the database containing the statistics. 1313// schemaName - the name of the schema containing the statistics. 1314// tableName - the name of the table containing the statistics. 1315// statisticsName - the name of the table statistics. 1316func (client Client) GetTableStatistic(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, statisticsName string) (result USQLTableStatistics, err error) { 1317 if tracing.IsEnabled() { 1318 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableStatistic") 1319 defer func() { 1320 sc := -1 1321 if result.Response.Response != nil { 1322 sc = result.Response.Response.StatusCode 1323 } 1324 tracing.EndSpan(ctx, sc, err) 1325 }() 1326 } 1327 req, err := client.GetTableStatisticPreparer(ctx, accountName, databaseName, schemaName, tableName, statisticsName) 1328 if err != nil { 1329 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", nil, "Failure preparing request") 1330 return 1331 } 1332 1333 resp, err := client.GetTableStatisticSender(req) 1334 if err != nil { 1335 result.Response = autorest.Response{Response: resp} 1336 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", resp, "Failure sending request") 1337 return 1338 } 1339 1340 result, err = client.GetTableStatisticResponder(resp) 1341 if err != nil { 1342 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", resp, "Failure responding to request") 1343 } 1344 1345 return 1346} 1347 1348// GetTableStatisticPreparer prepares the GetTableStatistic request. 1349func (client Client) GetTableStatisticPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, statisticsName string) (*http.Request, error) { 1350 urlParameters := map[string]interface{}{ 1351 "accountName": accountName, 1352 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1353 } 1354 1355 pathParameters := map[string]interface{}{ 1356 "databaseName": autorest.Encode("path", databaseName), 1357 "schemaName": autorest.Encode("path", schemaName), 1358 "statisticsName": autorest.Encode("path", statisticsName), 1359 "tableName": autorest.Encode("path", tableName), 1360 } 1361 1362 const APIVersion = "2016-11-01" 1363 queryParameters := map[string]interface{}{ 1364 "api-version": APIVersion, 1365 } 1366 1367 preparer := autorest.CreatePreparer( 1368 autorest.AsGet(), 1369 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1370 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}", pathParameters), 1371 autorest.WithQueryParameters(queryParameters)) 1372 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1373} 1374 1375// GetTableStatisticSender sends the GetTableStatistic request. The method will close the 1376// http.Response Body if it receives an error. 1377func (client Client) GetTableStatisticSender(req *http.Request) (*http.Response, error) { 1378 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1379 return autorest.SendWithSender(client, req, sd...) 1380} 1381 1382// GetTableStatisticResponder handles the response to the GetTableStatistic request. The method always 1383// closes the http.Response Body. 1384func (client Client) GetTableStatisticResponder(resp *http.Response) (result USQLTableStatistics, err error) { 1385 err = autorest.Respond( 1386 resp, 1387 client.ByInspecting(), 1388 azure.WithErrorUnlessStatusCode(http.StatusOK), 1389 autorest.ByUnmarshallingJSON(&result), 1390 autorest.ByClosing()) 1391 result.Response = autorest.Response{Response: resp} 1392 return 1393} 1394 1395// GetTableType retrieves the specified table type from the Data Lake Analytics catalog. 1396// Parameters: 1397// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1398// databaseName - the name of the database containing the table type. 1399// schemaName - the name of the schema containing the table type. 1400// tableTypeName - the name of the table type to retrieve. 1401func (client Client) GetTableType(ctx context.Context, accountName string, databaseName string, schemaName string, tableTypeName string) (result USQLTableType, err error) { 1402 if tracing.IsEnabled() { 1403 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableType") 1404 defer func() { 1405 sc := -1 1406 if result.Response.Response != nil { 1407 sc = result.Response.Response.StatusCode 1408 } 1409 tracing.EndSpan(ctx, sc, err) 1410 }() 1411 } 1412 req, err := client.GetTableTypePreparer(ctx, accountName, databaseName, schemaName, tableTypeName) 1413 if err != nil { 1414 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", nil, "Failure preparing request") 1415 return 1416 } 1417 1418 resp, err := client.GetTableTypeSender(req) 1419 if err != nil { 1420 result.Response = autorest.Response{Response: resp} 1421 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", resp, "Failure sending request") 1422 return 1423 } 1424 1425 result, err = client.GetTableTypeResponder(resp) 1426 if err != nil { 1427 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", resp, "Failure responding to request") 1428 } 1429 1430 return 1431} 1432 1433// GetTableTypePreparer prepares the GetTableType request. 1434func (client Client) GetTableTypePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableTypeName string) (*http.Request, error) { 1435 urlParameters := map[string]interface{}{ 1436 "accountName": accountName, 1437 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1438 } 1439 1440 pathParameters := map[string]interface{}{ 1441 "databaseName": autorest.Encode("path", databaseName), 1442 "schemaName": autorest.Encode("path", schemaName), 1443 "tableTypeName": autorest.Encode("path", tableTypeName), 1444 } 1445 1446 const APIVersion = "2016-11-01" 1447 queryParameters := map[string]interface{}{ 1448 "api-version": APIVersion, 1449 } 1450 1451 preparer := autorest.CreatePreparer( 1452 autorest.AsGet(), 1453 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1454 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes/{tableTypeName}", pathParameters), 1455 autorest.WithQueryParameters(queryParameters)) 1456 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1457} 1458 1459// GetTableTypeSender sends the GetTableType request. The method will close the 1460// http.Response Body if it receives an error. 1461func (client Client) GetTableTypeSender(req *http.Request) (*http.Response, error) { 1462 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1463 return autorest.SendWithSender(client, req, sd...) 1464} 1465 1466// GetTableTypeResponder handles the response to the GetTableType request. The method always 1467// closes the http.Response Body. 1468func (client Client) GetTableTypeResponder(resp *http.Response) (result USQLTableType, err error) { 1469 err = autorest.Respond( 1470 resp, 1471 client.ByInspecting(), 1472 azure.WithErrorUnlessStatusCode(http.StatusOK), 1473 autorest.ByUnmarshallingJSON(&result), 1474 autorest.ByClosing()) 1475 result.Response = autorest.Response{Response: resp} 1476 return 1477} 1478 1479// GetTableValuedFunction retrieves the specified table valued function from the Data Lake Analytics catalog. 1480// Parameters: 1481// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1482// databaseName - the name of the database containing the table valued function. 1483// schemaName - the name of the schema containing the table valued function. 1484// tableValuedFunctionName - the name of the tableValuedFunction. 1485func (client Client) GetTableValuedFunction(ctx context.Context, accountName string, databaseName string, schemaName string, tableValuedFunctionName string) (result USQLTableValuedFunction, err error) { 1486 if tracing.IsEnabled() { 1487 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableValuedFunction") 1488 defer func() { 1489 sc := -1 1490 if result.Response.Response != nil { 1491 sc = result.Response.Response.StatusCode 1492 } 1493 tracing.EndSpan(ctx, sc, err) 1494 }() 1495 } 1496 req, err := client.GetTableValuedFunctionPreparer(ctx, accountName, databaseName, schemaName, tableValuedFunctionName) 1497 if err != nil { 1498 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", nil, "Failure preparing request") 1499 return 1500 } 1501 1502 resp, err := client.GetTableValuedFunctionSender(req) 1503 if err != nil { 1504 result.Response = autorest.Response{Response: resp} 1505 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", resp, "Failure sending request") 1506 return 1507 } 1508 1509 result, err = client.GetTableValuedFunctionResponder(resp) 1510 if err != nil { 1511 err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", resp, "Failure responding to request") 1512 } 1513 1514 return 1515} 1516 1517// GetTableValuedFunctionPreparer prepares the GetTableValuedFunction request. 1518func (client Client) GetTableValuedFunctionPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableValuedFunctionName string) (*http.Request, error) { 1519 urlParameters := map[string]interface{}{ 1520 "accountName": accountName, 1521 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1522 } 1523 1524 pathParameters := map[string]interface{}{ 1525 "databaseName": autorest.Encode("path", databaseName), 1526 "schemaName": autorest.Encode("path", schemaName), 1527 "tableValuedFunctionName": autorest.Encode("path", tableValuedFunctionName), 1528 } 1529 1530 const APIVersion = "2016-11-01" 1531 queryParameters := map[string]interface{}{ 1532 "api-version": APIVersion, 1533 } 1534 1535 preparer := autorest.CreatePreparer( 1536 autorest.AsGet(), 1537 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1538 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}", pathParameters), 1539 autorest.WithQueryParameters(queryParameters)) 1540 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1541} 1542 1543// GetTableValuedFunctionSender sends the GetTableValuedFunction request. The method will close the 1544// http.Response Body if it receives an error. 1545func (client Client) GetTableValuedFunctionSender(req *http.Request) (*http.Response, error) { 1546 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1547 return autorest.SendWithSender(client, req, sd...) 1548} 1549 1550// GetTableValuedFunctionResponder handles the response to the GetTableValuedFunction request. The method always 1551// closes the http.Response Body. 1552func (client Client) GetTableValuedFunctionResponder(resp *http.Response) (result USQLTableValuedFunction, err error) { 1553 err = autorest.Respond( 1554 resp, 1555 client.ByInspecting(), 1556 azure.WithErrorUnlessStatusCode(http.StatusOK), 1557 autorest.ByUnmarshallingJSON(&result), 1558 autorest.ByClosing()) 1559 result.Response = autorest.Response{Response: resp} 1560 return 1561} 1562 1563// GetView retrieves the specified view from the Data Lake Analytics catalog. 1564// Parameters: 1565// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1566// databaseName - the name of the database containing the view. 1567// schemaName - the name of the schema containing the view. 1568// viewName - the name of the view. 1569func (client Client) GetView(ctx context.Context, accountName string, databaseName string, schemaName string, viewName string) (result USQLView, err error) { 1570 if tracing.IsEnabled() { 1571 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetView") 1572 defer func() { 1573 sc := -1 1574 if result.Response.Response != nil { 1575 sc = result.Response.Response.StatusCode 1576 } 1577 tracing.EndSpan(ctx, sc, err) 1578 }() 1579 } 1580 req, err := client.GetViewPreparer(ctx, accountName, databaseName, schemaName, viewName) 1581 if err != nil { 1582 err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", nil, "Failure preparing request") 1583 return 1584 } 1585 1586 resp, err := client.GetViewSender(req) 1587 if err != nil { 1588 result.Response = autorest.Response{Response: resp} 1589 err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", resp, "Failure sending request") 1590 return 1591 } 1592 1593 result, err = client.GetViewResponder(resp) 1594 if err != nil { 1595 err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", resp, "Failure responding to request") 1596 } 1597 1598 return 1599} 1600 1601// GetViewPreparer prepares the GetView request. 1602func (client Client) GetViewPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, viewName string) (*http.Request, error) { 1603 urlParameters := map[string]interface{}{ 1604 "accountName": accountName, 1605 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1606 } 1607 1608 pathParameters := map[string]interface{}{ 1609 "databaseName": autorest.Encode("path", databaseName), 1610 "schemaName": autorest.Encode("path", schemaName), 1611 "viewName": autorest.Encode("path", viewName), 1612 } 1613 1614 const APIVersion = "2016-11-01" 1615 queryParameters := map[string]interface{}{ 1616 "api-version": APIVersion, 1617 } 1618 1619 preparer := autorest.CreatePreparer( 1620 autorest.AsGet(), 1621 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1622 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}", pathParameters), 1623 autorest.WithQueryParameters(queryParameters)) 1624 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1625} 1626 1627// GetViewSender sends the GetView request. The method will close the 1628// http.Response Body if it receives an error. 1629func (client Client) GetViewSender(req *http.Request) (*http.Response, error) { 1630 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1631 return autorest.SendWithSender(client, req, sd...) 1632} 1633 1634// GetViewResponder handles the response to the GetView request. The method always 1635// closes the http.Response Body. 1636func (client Client) GetViewResponder(resp *http.Response) (result USQLView, err error) { 1637 err = autorest.Respond( 1638 resp, 1639 client.ByInspecting(), 1640 azure.WithErrorUnlessStatusCode(http.StatusOK), 1641 autorest.ByUnmarshallingJSON(&result), 1642 autorest.ByClosing()) 1643 result.Response = autorest.Response{Response: resp} 1644 return 1645} 1646 1647// GrantACL grants an access control list (ACL) entry to the Data Lake Analytics catalog. 1648// Parameters: 1649// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1650// parameters - parameters supplied to create or update an access control list (ACL) entry for a Data Lake 1651// Analytics catalog. 1652func (client Client) GrantACL(ctx context.Context, accountName string, parameters ACLCreateOrUpdateParameters) (result autorest.Response, err error) { 1653 if tracing.IsEnabled() { 1654 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GrantACL") 1655 defer func() { 1656 sc := -1 1657 if result.Response != nil { 1658 sc = result.Response.StatusCode 1659 } 1660 tracing.EndSpan(ctx, sc, err) 1661 }() 1662 } 1663 if err := validation.Validate([]validation.Validation{ 1664 {TargetValue: parameters, 1665 Constraints: []validation.Constraint{{Target: "parameters.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 1666 return result, validation.NewError("catalog.Client", "GrantACL", err.Error()) 1667 } 1668 1669 req, err := client.GrantACLPreparer(ctx, accountName, parameters) 1670 if err != nil { 1671 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACL", nil, "Failure preparing request") 1672 return 1673 } 1674 1675 resp, err := client.GrantACLSender(req) 1676 if err != nil { 1677 result.Response = resp 1678 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACL", resp, "Failure sending request") 1679 return 1680 } 1681 1682 result, err = client.GrantACLResponder(resp) 1683 if err != nil { 1684 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACL", resp, "Failure responding to request") 1685 } 1686 1687 return 1688} 1689 1690// GrantACLPreparer prepares the GrantACL request. 1691func (client Client) GrantACLPreparer(ctx context.Context, accountName string, parameters ACLCreateOrUpdateParameters) (*http.Request, error) { 1692 urlParameters := map[string]interface{}{ 1693 "accountName": accountName, 1694 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1695 } 1696 1697 const APIVersion = "2016-11-01" 1698 queryParameters := map[string]interface{}{ 1699 "api-version": APIVersion, 1700 "op": autorest.Encode("query", "GRANTACE"), 1701 } 1702 1703 preparer := autorest.CreatePreparer( 1704 autorest.AsContentType("application/json; charset=utf-8"), 1705 autorest.AsPost(), 1706 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1707 autorest.WithPath("/catalog/usql/acl"), 1708 autorest.WithJSON(parameters), 1709 autorest.WithQueryParameters(queryParameters)) 1710 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1711} 1712 1713// GrantACLSender sends the GrantACL request. The method will close the 1714// http.Response Body if it receives an error. 1715func (client Client) GrantACLSender(req *http.Request) (*http.Response, error) { 1716 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1717 return autorest.SendWithSender(client, req, sd...) 1718} 1719 1720// GrantACLResponder handles the response to the GrantACL request. The method always 1721// closes the http.Response Body. 1722func (client Client) GrantACLResponder(resp *http.Response) (result autorest.Response, err error) { 1723 err = autorest.Respond( 1724 resp, 1725 client.ByInspecting(), 1726 azure.WithErrorUnlessStatusCode(http.StatusOK), 1727 autorest.ByClosing()) 1728 result.Response = resp 1729 return 1730} 1731 1732// GrantACLToDatabase grants an access control list (ACL) entry to the database from the Data Lake Analytics catalog. 1733// Parameters: 1734// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1735// databaseName - the name of the database. 1736// parameters - parameters supplied to create or update an access control list (ACL) entry for a database. 1737func (client Client) GrantACLToDatabase(ctx context.Context, accountName string, databaseName string, parameters ACLCreateOrUpdateParameters) (result autorest.Response, err error) { 1738 if tracing.IsEnabled() { 1739 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GrantACLToDatabase") 1740 defer func() { 1741 sc := -1 1742 if result.Response != nil { 1743 sc = result.Response.StatusCode 1744 } 1745 tracing.EndSpan(ctx, sc, err) 1746 }() 1747 } 1748 if err := validation.Validate([]validation.Validation{ 1749 {TargetValue: parameters, 1750 Constraints: []validation.Constraint{{Target: "parameters.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 1751 return result, validation.NewError("catalog.Client", "GrantACLToDatabase", err.Error()) 1752 } 1753 1754 req, err := client.GrantACLToDatabasePreparer(ctx, accountName, databaseName, parameters) 1755 if err != nil { 1756 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACLToDatabase", nil, "Failure preparing request") 1757 return 1758 } 1759 1760 resp, err := client.GrantACLToDatabaseSender(req) 1761 if err != nil { 1762 result.Response = resp 1763 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACLToDatabase", resp, "Failure sending request") 1764 return 1765 } 1766 1767 result, err = client.GrantACLToDatabaseResponder(resp) 1768 if err != nil { 1769 err = autorest.NewErrorWithError(err, "catalog.Client", "GrantACLToDatabase", resp, "Failure responding to request") 1770 } 1771 1772 return 1773} 1774 1775// GrantACLToDatabasePreparer prepares the GrantACLToDatabase request. 1776func (client Client) GrantACLToDatabasePreparer(ctx context.Context, accountName string, databaseName string, parameters ACLCreateOrUpdateParameters) (*http.Request, error) { 1777 urlParameters := map[string]interface{}{ 1778 "accountName": accountName, 1779 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1780 } 1781 1782 pathParameters := map[string]interface{}{ 1783 "databaseName": autorest.Encode("path", databaseName), 1784 } 1785 1786 const APIVersion = "2016-11-01" 1787 queryParameters := map[string]interface{}{ 1788 "api-version": APIVersion, 1789 "op": autorest.Encode("query", "GRANTACE"), 1790 } 1791 1792 preparer := autorest.CreatePreparer( 1793 autorest.AsContentType("application/json; charset=utf-8"), 1794 autorest.AsPost(), 1795 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1796 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/acl", pathParameters), 1797 autorest.WithJSON(parameters), 1798 autorest.WithQueryParameters(queryParameters)) 1799 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1800} 1801 1802// GrantACLToDatabaseSender sends the GrantACLToDatabase request. The method will close the 1803// http.Response Body if it receives an error. 1804func (client Client) GrantACLToDatabaseSender(req *http.Request) (*http.Response, error) { 1805 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1806 return autorest.SendWithSender(client, req, sd...) 1807} 1808 1809// GrantACLToDatabaseResponder handles the response to the GrantACLToDatabase request. The method always 1810// closes the http.Response Body. 1811func (client Client) GrantACLToDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { 1812 err = autorest.Respond( 1813 resp, 1814 client.ByInspecting(), 1815 azure.WithErrorUnlessStatusCode(http.StatusOK), 1816 autorest.ByClosing()) 1817 result.Response = resp 1818 return 1819} 1820 1821// ListAcls retrieves the list of access control list (ACL) entries for the Data Lake Analytics catalog. 1822// Parameters: 1823// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1824// filter - oData filter. Optional. 1825// top - the number of items to return. Optional. 1826// skip - the number of items to skip over before returning elements. Optional. 1827// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 1828// Categories?$select=CategoryName,Description. Optional. 1829// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 1830// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 1831// Optional. 1832// count - the Boolean value of true or false to request a count of the matching resources included with the 1833// resources in the response, e.g. Categories?$count=true. Optional. 1834func (client Client) ListAcls(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result ACLListPage, err error) { 1835 if tracing.IsEnabled() { 1836 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAcls") 1837 defer func() { 1838 sc := -1 1839 if result.al.Response.Response != nil { 1840 sc = result.al.Response.Response.StatusCode 1841 } 1842 tracing.EndSpan(ctx, sc, err) 1843 }() 1844 } 1845 if err := validation.Validate([]validation.Validation{ 1846 {TargetValue: top, 1847 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 1848 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 1849 {TargetValue: skip, 1850 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 1851 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 1852 return result, validation.NewError("catalog.Client", "ListAcls", err.Error()) 1853 } 1854 1855 result.fn = client.listAclsNextResults 1856 req, err := client.ListAclsPreparer(ctx, accountName, filter, top, skip, selectParameter, orderby, count) 1857 if err != nil { 1858 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAcls", nil, "Failure preparing request") 1859 return 1860 } 1861 1862 resp, err := client.ListAclsSender(req) 1863 if err != nil { 1864 result.al.Response = autorest.Response{Response: resp} 1865 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAcls", resp, "Failure sending request") 1866 return 1867 } 1868 1869 result.al, err = client.ListAclsResponder(resp) 1870 if err != nil { 1871 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAcls", resp, "Failure responding to request") 1872 } 1873 1874 return 1875} 1876 1877// ListAclsPreparer prepares the ListAcls request. 1878func (client Client) ListAclsPreparer(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 1879 urlParameters := map[string]interface{}{ 1880 "accountName": accountName, 1881 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 1882 } 1883 1884 const APIVersion = "2016-11-01" 1885 queryParameters := map[string]interface{}{ 1886 "api-version": APIVersion, 1887 } 1888 if len(filter) > 0 { 1889 queryParameters["$filter"] = autorest.Encode("query", filter) 1890 } 1891 if top != nil { 1892 queryParameters["$top"] = autorest.Encode("query", *top) 1893 } 1894 if skip != nil { 1895 queryParameters["$skip"] = autorest.Encode("query", *skip) 1896 } 1897 if len(selectParameter) > 0 { 1898 queryParameters["$select"] = autorest.Encode("query", selectParameter) 1899 } 1900 if len(orderby) > 0 { 1901 queryParameters["$orderby"] = autorest.Encode("query", orderby) 1902 } 1903 if count != nil { 1904 queryParameters["$count"] = autorest.Encode("query", *count) 1905 } 1906 1907 preparer := autorest.CreatePreparer( 1908 autorest.AsGet(), 1909 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 1910 autorest.WithPath("/catalog/usql/acl"), 1911 autorest.WithQueryParameters(queryParameters)) 1912 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1913} 1914 1915// ListAclsSender sends the ListAcls request. The method will close the 1916// http.Response Body if it receives an error. 1917func (client Client) ListAclsSender(req *http.Request) (*http.Response, error) { 1918 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1919 return autorest.SendWithSender(client, req, sd...) 1920} 1921 1922// ListAclsResponder handles the response to the ListAcls request. The method always 1923// closes the http.Response Body. 1924func (client Client) ListAclsResponder(resp *http.Response) (result ACLList, err error) { 1925 err = autorest.Respond( 1926 resp, 1927 client.ByInspecting(), 1928 azure.WithErrorUnlessStatusCode(http.StatusOK), 1929 autorest.ByUnmarshallingJSON(&result), 1930 autorest.ByClosing()) 1931 result.Response = autorest.Response{Response: resp} 1932 return 1933} 1934 1935// listAclsNextResults retrieves the next set of results, if any. 1936func (client Client) listAclsNextResults(ctx context.Context, lastResults ACLList) (result ACLList, err error) { 1937 req, err := lastResults.aCLListPreparer(ctx) 1938 if err != nil { 1939 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAclsNextResults", nil, "Failure preparing next results request") 1940 } 1941 if req == nil { 1942 return 1943 } 1944 resp, err := client.ListAclsSender(req) 1945 if err != nil { 1946 result.Response = autorest.Response{Response: resp} 1947 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAclsNextResults", resp, "Failure sending next results request") 1948 } 1949 result, err = client.ListAclsResponder(resp) 1950 if err != nil { 1951 err = autorest.NewErrorWithError(err, "catalog.Client", "listAclsNextResults", resp, "Failure responding to next results request") 1952 } 1953 return 1954} 1955 1956// ListAclsComplete enumerates all values, automatically crossing page boundaries as required. 1957func (client Client) ListAclsComplete(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result ACLListIterator, err error) { 1958 if tracing.IsEnabled() { 1959 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAcls") 1960 defer func() { 1961 sc := -1 1962 if result.Response().Response.Response != nil { 1963 sc = result.page.Response().Response.Response.StatusCode 1964 } 1965 tracing.EndSpan(ctx, sc, err) 1966 }() 1967 } 1968 result.page, err = client.ListAcls(ctx, accountName, filter, top, skip, selectParameter, orderby, count) 1969 return 1970} 1971 1972// ListAclsByDatabase retrieves the list of access control list (ACL) entries for the database from the Data Lake 1973// Analytics catalog. 1974// Parameters: 1975// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 1976// databaseName - the name of the database. 1977// filter - oData filter. Optional. 1978// top - the number of items to return. Optional. 1979// skip - the number of items to skip over before returning elements. Optional. 1980// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 1981// Categories?$select=CategoryName,Description. Optional. 1982// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 1983// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 1984// Optional. 1985// count - the Boolean value of true or false to request a count of the matching resources included with the 1986// resources in the response, e.g. Categories?$count=true. Optional. 1987func (client Client) ListAclsByDatabase(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result ACLListPage, err error) { 1988 if tracing.IsEnabled() { 1989 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAclsByDatabase") 1990 defer func() { 1991 sc := -1 1992 if result.al.Response.Response != nil { 1993 sc = result.al.Response.Response.StatusCode 1994 } 1995 tracing.EndSpan(ctx, sc, err) 1996 }() 1997 } 1998 if err := validation.Validate([]validation.Validation{ 1999 {TargetValue: top, 2000 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2001 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2002 {TargetValue: skip, 2003 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2004 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2005 return result, validation.NewError("catalog.Client", "ListAclsByDatabase", err.Error()) 2006 } 2007 2008 result.fn = client.listAclsByDatabaseNextResults 2009 req, err := client.ListAclsByDatabasePreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2010 if err != nil { 2011 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAclsByDatabase", nil, "Failure preparing request") 2012 return 2013 } 2014 2015 resp, err := client.ListAclsByDatabaseSender(req) 2016 if err != nil { 2017 result.al.Response = autorest.Response{Response: resp} 2018 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAclsByDatabase", resp, "Failure sending request") 2019 return 2020 } 2021 2022 result.al, err = client.ListAclsByDatabaseResponder(resp) 2023 if err != nil { 2024 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAclsByDatabase", resp, "Failure responding to request") 2025 } 2026 2027 return 2028} 2029 2030// ListAclsByDatabasePreparer prepares the ListAclsByDatabase request. 2031func (client Client) ListAclsByDatabasePreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2032 urlParameters := map[string]interface{}{ 2033 "accountName": accountName, 2034 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2035 } 2036 2037 pathParameters := map[string]interface{}{ 2038 "databaseName": autorest.Encode("path", databaseName), 2039 } 2040 2041 const APIVersion = "2016-11-01" 2042 queryParameters := map[string]interface{}{ 2043 "api-version": APIVersion, 2044 } 2045 if len(filter) > 0 { 2046 queryParameters["$filter"] = autorest.Encode("query", filter) 2047 } 2048 if top != nil { 2049 queryParameters["$top"] = autorest.Encode("query", *top) 2050 } 2051 if skip != nil { 2052 queryParameters["$skip"] = autorest.Encode("query", *skip) 2053 } 2054 if len(selectParameter) > 0 { 2055 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2056 } 2057 if len(orderby) > 0 { 2058 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2059 } 2060 if count != nil { 2061 queryParameters["$count"] = autorest.Encode("query", *count) 2062 } 2063 2064 preparer := autorest.CreatePreparer( 2065 autorest.AsGet(), 2066 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2067 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/acl", pathParameters), 2068 autorest.WithQueryParameters(queryParameters)) 2069 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2070} 2071 2072// ListAclsByDatabaseSender sends the ListAclsByDatabase request. The method will close the 2073// http.Response Body if it receives an error. 2074func (client Client) ListAclsByDatabaseSender(req *http.Request) (*http.Response, error) { 2075 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2076 return autorest.SendWithSender(client, req, sd...) 2077} 2078 2079// ListAclsByDatabaseResponder handles the response to the ListAclsByDatabase request. The method always 2080// closes the http.Response Body. 2081func (client Client) ListAclsByDatabaseResponder(resp *http.Response) (result ACLList, err error) { 2082 err = autorest.Respond( 2083 resp, 2084 client.ByInspecting(), 2085 azure.WithErrorUnlessStatusCode(http.StatusOK), 2086 autorest.ByUnmarshallingJSON(&result), 2087 autorest.ByClosing()) 2088 result.Response = autorest.Response{Response: resp} 2089 return 2090} 2091 2092// listAclsByDatabaseNextResults retrieves the next set of results, if any. 2093func (client Client) listAclsByDatabaseNextResults(ctx context.Context, lastResults ACLList) (result ACLList, err error) { 2094 req, err := lastResults.aCLListPreparer(ctx) 2095 if err != nil { 2096 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAclsByDatabaseNextResults", nil, "Failure preparing next results request") 2097 } 2098 if req == nil { 2099 return 2100 } 2101 resp, err := client.ListAclsByDatabaseSender(req) 2102 if err != nil { 2103 result.Response = autorest.Response{Response: resp} 2104 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAclsByDatabaseNextResults", resp, "Failure sending next results request") 2105 } 2106 result, err = client.ListAclsByDatabaseResponder(resp) 2107 if err != nil { 2108 err = autorest.NewErrorWithError(err, "catalog.Client", "listAclsByDatabaseNextResults", resp, "Failure responding to next results request") 2109 } 2110 return 2111} 2112 2113// ListAclsByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. 2114func (client Client) ListAclsByDatabaseComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result ACLListIterator, err error) { 2115 if tracing.IsEnabled() { 2116 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAclsByDatabase") 2117 defer func() { 2118 sc := -1 2119 if result.Response().Response.Response != nil { 2120 sc = result.page.Response().Response.Response.StatusCode 2121 } 2122 tracing.EndSpan(ctx, sc, err) 2123 }() 2124 } 2125 result.page, err = client.ListAclsByDatabase(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2126 return 2127} 2128 2129// ListAssemblies retrieves the list of assemblies from the Data Lake Analytics catalog. 2130// Parameters: 2131// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2132// databaseName - the name of the database containing the assembly. 2133// filter - oData filter. Optional. 2134// top - the number of items to return. Optional. 2135// skip - the number of items to skip over before returning elements. Optional. 2136// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2137// Categories?$select=CategoryName,Description. Optional. 2138// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2139// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2140// Optional. 2141// count - the Boolean value of true or false to request a count of the matching resources included with the 2142// resources in the response, e.g. Categories?$count=true. Optional. 2143func (client Client) ListAssemblies(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLAssemblyListPage, err error) { 2144 if tracing.IsEnabled() { 2145 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAssemblies") 2146 defer func() { 2147 sc := -1 2148 if result.ual.Response.Response != nil { 2149 sc = result.ual.Response.Response.StatusCode 2150 } 2151 tracing.EndSpan(ctx, sc, err) 2152 }() 2153 } 2154 if err := validation.Validate([]validation.Validation{ 2155 {TargetValue: top, 2156 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2157 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2158 {TargetValue: skip, 2159 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2160 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2161 return result, validation.NewError("catalog.Client", "ListAssemblies", err.Error()) 2162 } 2163 2164 result.fn = client.listAssembliesNextResults 2165 req, err := client.ListAssembliesPreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2166 if err != nil { 2167 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", nil, "Failure preparing request") 2168 return 2169 } 2170 2171 resp, err := client.ListAssembliesSender(req) 2172 if err != nil { 2173 result.ual.Response = autorest.Response{Response: resp} 2174 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", resp, "Failure sending request") 2175 return 2176 } 2177 2178 result.ual, err = client.ListAssembliesResponder(resp) 2179 if err != nil { 2180 err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", resp, "Failure responding to request") 2181 } 2182 2183 return 2184} 2185 2186// ListAssembliesPreparer prepares the ListAssemblies request. 2187func (client Client) ListAssembliesPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2188 urlParameters := map[string]interface{}{ 2189 "accountName": accountName, 2190 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2191 } 2192 2193 pathParameters := map[string]interface{}{ 2194 "databaseName": autorest.Encode("path", databaseName), 2195 } 2196 2197 const APIVersion = "2016-11-01" 2198 queryParameters := map[string]interface{}{ 2199 "api-version": APIVersion, 2200 } 2201 if len(filter) > 0 { 2202 queryParameters["$filter"] = autorest.Encode("query", filter) 2203 } 2204 if top != nil { 2205 queryParameters["$top"] = autorest.Encode("query", *top) 2206 } 2207 if skip != nil { 2208 queryParameters["$skip"] = autorest.Encode("query", *skip) 2209 } 2210 if len(selectParameter) > 0 { 2211 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2212 } 2213 if len(orderby) > 0 { 2214 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2215 } 2216 if count != nil { 2217 queryParameters["$count"] = autorest.Encode("query", *count) 2218 } 2219 2220 preparer := autorest.CreatePreparer( 2221 autorest.AsGet(), 2222 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2223 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/assemblies", pathParameters), 2224 autorest.WithQueryParameters(queryParameters)) 2225 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2226} 2227 2228// ListAssembliesSender sends the ListAssemblies request. The method will close the 2229// http.Response Body if it receives an error. 2230func (client Client) ListAssembliesSender(req *http.Request) (*http.Response, error) { 2231 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2232 return autorest.SendWithSender(client, req, sd...) 2233} 2234 2235// ListAssembliesResponder handles the response to the ListAssemblies request. The method always 2236// closes the http.Response Body. 2237func (client Client) ListAssembliesResponder(resp *http.Response) (result USQLAssemblyList, err error) { 2238 err = autorest.Respond( 2239 resp, 2240 client.ByInspecting(), 2241 azure.WithErrorUnlessStatusCode(http.StatusOK), 2242 autorest.ByUnmarshallingJSON(&result), 2243 autorest.ByClosing()) 2244 result.Response = autorest.Response{Response: resp} 2245 return 2246} 2247 2248// listAssembliesNextResults retrieves the next set of results, if any. 2249func (client Client) listAssembliesNextResults(ctx context.Context, lastResults USQLAssemblyList) (result USQLAssemblyList, err error) { 2250 req, err := lastResults.uSQLAssemblyListPreparer(ctx) 2251 if err != nil { 2252 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", nil, "Failure preparing next results request") 2253 } 2254 if req == nil { 2255 return 2256 } 2257 resp, err := client.ListAssembliesSender(req) 2258 if err != nil { 2259 result.Response = autorest.Response{Response: resp} 2260 return result, autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", resp, "Failure sending next results request") 2261 } 2262 result, err = client.ListAssembliesResponder(resp) 2263 if err != nil { 2264 err = autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", resp, "Failure responding to next results request") 2265 } 2266 return 2267} 2268 2269// ListAssembliesComplete enumerates all values, automatically crossing page boundaries as required. 2270func (client Client) ListAssembliesComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLAssemblyListIterator, err error) { 2271 if tracing.IsEnabled() { 2272 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAssemblies") 2273 defer func() { 2274 sc := -1 2275 if result.Response().Response.Response != nil { 2276 sc = result.page.Response().Response.Response.StatusCode 2277 } 2278 tracing.EndSpan(ctx, sc, err) 2279 }() 2280 } 2281 result.page, err = client.ListAssemblies(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2282 return 2283} 2284 2285// ListCredentials retrieves the list of credentials from the Data Lake Analytics catalog. 2286// Parameters: 2287// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2288// databaseName - the name of the database containing the schema. 2289// filter - oData filter. Optional. 2290// top - the number of items to return. Optional. 2291// skip - the number of items to skip over before returning elements. Optional. 2292// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2293// Categories?$select=CategoryName,Description. Optional. 2294// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2295// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2296// Optional. 2297// count - the Boolean value of true or false to request a count of the matching resources included with the 2298// resources in the response, e.g. Categories?$count=true. Optional. 2299func (client Client) ListCredentials(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLCredentialListPage, err error) { 2300 if tracing.IsEnabled() { 2301 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListCredentials") 2302 defer func() { 2303 sc := -1 2304 if result.ucl.Response.Response != nil { 2305 sc = result.ucl.Response.Response.StatusCode 2306 } 2307 tracing.EndSpan(ctx, sc, err) 2308 }() 2309 } 2310 if err := validation.Validate([]validation.Validation{ 2311 {TargetValue: top, 2312 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2313 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2314 {TargetValue: skip, 2315 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2316 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2317 return result, validation.NewError("catalog.Client", "ListCredentials", err.Error()) 2318 } 2319 2320 result.fn = client.listCredentialsNextResults 2321 req, err := client.ListCredentialsPreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2322 if err != nil { 2323 err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", nil, "Failure preparing request") 2324 return 2325 } 2326 2327 resp, err := client.ListCredentialsSender(req) 2328 if err != nil { 2329 result.ucl.Response = autorest.Response{Response: resp} 2330 err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", resp, "Failure sending request") 2331 return 2332 } 2333 2334 result.ucl, err = client.ListCredentialsResponder(resp) 2335 if err != nil { 2336 err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", resp, "Failure responding to request") 2337 } 2338 2339 return 2340} 2341 2342// ListCredentialsPreparer prepares the ListCredentials request. 2343func (client Client) ListCredentialsPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2344 urlParameters := map[string]interface{}{ 2345 "accountName": accountName, 2346 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2347 } 2348 2349 pathParameters := map[string]interface{}{ 2350 "databaseName": autorest.Encode("path", databaseName), 2351 } 2352 2353 const APIVersion = "2016-11-01" 2354 queryParameters := map[string]interface{}{ 2355 "api-version": APIVersion, 2356 } 2357 if len(filter) > 0 { 2358 queryParameters["$filter"] = autorest.Encode("query", filter) 2359 } 2360 if top != nil { 2361 queryParameters["$top"] = autorest.Encode("query", *top) 2362 } 2363 if skip != nil { 2364 queryParameters["$skip"] = autorest.Encode("query", *skip) 2365 } 2366 if len(selectParameter) > 0 { 2367 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2368 } 2369 if len(orderby) > 0 { 2370 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2371 } 2372 if count != nil { 2373 queryParameters["$count"] = autorest.Encode("query", *count) 2374 } 2375 2376 preparer := autorest.CreatePreparer( 2377 autorest.AsGet(), 2378 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2379 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials", pathParameters), 2380 autorest.WithQueryParameters(queryParameters)) 2381 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2382} 2383 2384// ListCredentialsSender sends the ListCredentials request. The method will close the 2385// http.Response Body if it receives an error. 2386func (client Client) ListCredentialsSender(req *http.Request) (*http.Response, error) { 2387 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2388 return autorest.SendWithSender(client, req, sd...) 2389} 2390 2391// ListCredentialsResponder handles the response to the ListCredentials request. The method always 2392// closes the http.Response Body. 2393func (client Client) ListCredentialsResponder(resp *http.Response) (result USQLCredentialList, err error) { 2394 err = autorest.Respond( 2395 resp, 2396 client.ByInspecting(), 2397 azure.WithErrorUnlessStatusCode(http.StatusOK), 2398 autorest.ByUnmarshallingJSON(&result), 2399 autorest.ByClosing()) 2400 result.Response = autorest.Response{Response: resp} 2401 return 2402} 2403 2404// listCredentialsNextResults retrieves the next set of results, if any. 2405func (client Client) listCredentialsNextResults(ctx context.Context, lastResults USQLCredentialList) (result USQLCredentialList, err error) { 2406 req, err := lastResults.uSQLCredentialListPreparer(ctx) 2407 if err != nil { 2408 return result, autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", nil, "Failure preparing next results request") 2409 } 2410 if req == nil { 2411 return 2412 } 2413 resp, err := client.ListCredentialsSender(req) 2414 if err != nil { 2415 result.Response = autorest.Response{Response: resp} 2416 return result, autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", resp, "Failure sending next results request") 2417 } 2418 result, err = client.ListCredentialsResponder(resp) 2419 if err != nil { 2420 err = autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", resp, "Failure responding to next results request") 2421 } 2422 return 2423} 2424 2425// ListCredentialsComplete enumerates all values, automatically crossing page boundaries as required. 2426func (client Client) ListCredentialsComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLCredentialListIterator, err error) { 2427 if tracing.IsEnabled() { 2428 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListCredentials") 2429 defer func() { 2430 sc := -1 2431 if result.Response().Response.Response != nil { 2432 sc = result.page.Response().Response.Response.StatusCode 2433 } 2434 tracing.EndSpan(ctx, sc, err) 2435 }() 2436 } 2437 result.page, err = client.ListCredentials(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2438 return 2439} 2440 2441// ListDatabases retrieves the list of databases from the Data Lake Analytics catalog. 2442// Parameters: 2443// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2444// filter - oData filter. Optional. 2445// top - the number of items to return. Optional. 2446// skip - the number of items to skip over before returning elements. Optional. 2447// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2448// Categories?$select=CategoryName,Description. Optional. 2449// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2450// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2451// Optional. 2452// count - the Boolean value of true or false to request a count of the matching resources included with the 2453// resources in the response, e.g. Categories?$count=true. Optional. 2454func (client Client) ListDatabases(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLDatabaseListPage, err error) { 2455 if tracing.IsEnabled() { 2456 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDatabases") 2457 defer func() { 2458 sc := -1 2459 if result.udl.Response.Response != nil { 2460 sc = result.udl.Response.Response.StatusCode 2461 } 2462 tracing.EndSpan(ctx, sc, err) 2463 }() 2464 } 2465 if err := validation.Validate([]validation.Validation{ 2466 {TargetValue: top, 2467 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2468 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2469 {TargetValue: skip, 2470 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2471 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2472 return result, validation.NewError("catalog.Client", "ListDatabases", err.Error()) 2473 } 2474 2475 result.fn = client.listDatabasesNextResults 2476 req, err := client.ListDatabasesPreparer(ctx, accountName, filter, top, skip, selectParameter, orderby, count) 2477 if err != nil { 2478 err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", nil, "Failure preparing request") 2479 return 2480 } 2481 2482 resp, err := client.ListDatabasesSender(req) 2483 if err != nil { 2484 result.udl.Response = autorest.Response{Response: resp} 2485 err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", resp, "Failure sending request") 2486 return 2487 } 2488 2489 result.udl, err = client.ListDatabasesResponder(resp) 2490 if err != nil { 2491 err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", resp, "Failure responding to request") 2492 } 2493 2494 return 2495} 2496 2497// ListDatabasesPreparer prepares the ListDatabases request. 2498func (client Client) ListDatabasesPreparer(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2499 urlParameters := map[string]interface{}{ 2500 "accountName": accountName, 2501 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2502 } 2503 2504 const APIVersion = "2016-11-01" 2505 queryParameters := map[string]interface{}{ 2506 "api-version": APIVersion, 2507 } 2508 if len(filter) > 0 { 2509 queryParameters["$filter"] = autorest.Encode("query", filter) 2510 } 2511 if top != nil { 2512 queryParameters["$top"] = autorest.Encode("query", *top) 2513 } 2514 if skip != nil { 2515 queryParameters["$skip"] = autorest.Encode("query", *skip) 2516 } 2517 if len(selectParameter) > 0 { 2518 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2519 } 2520 if len(orderby) > 0 { 2521 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2522 } 2523 if count != nil { 2524 queryParameters["$count"] = autorest.Encode("query", *count) 2525 } 2526 2527 preparer := autorest.CreatePreparer( 2528 autorest.AsGet(), 2529 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2530 autorest.WithPath("/catalog/usql/databases"), 2531 autorest.WithQueryParameters(queryParameters)) 2532 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2533} 2534 2535// ListDatabasesSender sends the ListDatabases request. The method will close the 2536// http.Response Body if it receives an error. 2537func (client Client) ListDatabasesSender(req *http.Request) (*http.Response, error) { 2538 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2539 return autorest.SendWithSender(client, req, sd...) 2540} 2541 2542// ListDatabasesResponder handles the response to the ListDatabases request. The method always 2543// closes the http.Response Body. 2544func (client Client) ListDatabasesResponder(resp *http.Response) (result USQLDatabaseList, err error) { 2545 err = autorest.Respond( 2546 resp, 2547 client.ByInspecting(), 2548 azure.WithErrorUnlessStatusCode(http.StatusOK), 2549 autorest.ByUnmarshallingJSON(&result), 2550 autorest.ByClosing()) 2551 result.Response = autorest.Response{Response: resp} 2552 return 2553} 2554 2555// listDatabasesNextResults retrieves the next set of results, if any. 2556func (client Client) listDatabasesNextResults(ctx context.Context, lastResults USQLDatabaseList) (result USQLDatabaseList, err error) { 2557 req, err := lastResults.uSQLDatabaseListPreparer(ctx) 2558 if err != nil { 2559 return result, autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", nil, "Failure preparing next results request") 2560 } 2561 if req == nil { 2562 return 2563 } 2564 resp, err := client.ListDatabasesSender(req) 2565 if err != nil { 2566 result.Response = autorest.Response{Response: resp} 2567 return result, autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", resp, "Failure sending next results request") 2568 } 2569 result, err = client.ListDatabasesResponder(resp) 2570 if err != nil { 2571 err = autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", resp, "Failure responding to next results request") 2572 } 2573 return 2574} 2575 2576// ListDatabasesComplete enumerates all values, automatically crossing page boundaries as required. 2577func (client Client) ListDatabasesComplete(ctx context.Context, accountName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLDatabaseListIterator, err error) { 2578 if tracing.IsEnabled() { 2579 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDatabases") 2580 defer func() { 2581 sc := -1 2582 if result.Response().Response.Response != nil { 2583 sc = result.page.Response().Response.Response.StatusCode 2584 } 2585 tracing.EndSpan(ctx, sc, err) 2586 }() 2587 } 2588 result.page, err = client.ListDatabases(ctx, accountName, filter, top, skip, selectParameter, orderby, count) 2589 return 2590} 2591 2592// ListExternalDataSources retrieves the list of external data sources from the Data Lake Analytics catalog. 2593// Parameters: 2594// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2595// databaseName - the name of the database containing the external data sources. 2596// filter - oData filter. Optional. 2597// top - the number of items to return. Optional. 2598// skip - the number of items to skip over before returning elements. Optional. 2599// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2600// Categories?$select=CategoryName,Description. Optional. 2601// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2602// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2603// Optional. 2604// count - the Boolean value of true or false to request a count of the matching resources included with the 2605// resources in the response, e.g. Categories?$count=true. Optional. 2606func (client Client) ListExternalDataSources(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLExternalDataSourceListPage, err error) { 2607 if tracing.IsEnabled() { 2608 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListExternalDataSources") 2609 defer func() { 2610 sc := -1 2611 if result.uedsl.Response.Response != nil { 2612 sc = result.uedsl.Response.Response.StatusCode 2613 } 2614 tracing.EndSpan(ctx, sc, err) 2615 }() 2616 } 2617 if err := validation.Validate([]validation.Validation{ 2618 {TargetValue: top, 2619 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2620 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2621 {TargetValue: skip, 2622 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2623 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2624 return result, validation.NewError("catalog.Client", "ListExternalDataSources", err.Error()) 2625 } 2626 2627 result.fn = client.listExternalDataSourcesNextResults 2628 req, err := client.ListExternalDataSourcesPreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2629 if err != nil { 2630 err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", nil, "Failure preparing request") 2631 return 2632 } 2633 2634 resp, err := client.ListExternalDataSourcesSender(req) 2635 if err != nil { 2636 result.uedsl.Response = autorest.Response{Response: resp} 2637 err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", resp, "Failure sending request") 2638 return 2639 } 2640 2641 result.uedsl, err = client.ListExternalDataSourcesResponder(resp) 2642 if err != nil { 2643 err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", resp, "Failure responding to request") 2644 } 2645 2646 return 2647} 2648 2649// ListExternalDataSourcesPreparer prepares the ListExternalDataSources request. 2650func (client Client) ListExternalDataSourcesPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2651 urlParameters := map[string]interface{}{ 2652 "accountName": accountName, 2653 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2654 } 2655 2656 pathParameters := map[string]interface{}{ 2657 "databaseName": autorest.Encode("path", databaseName), 2658 } 2659 2660 const APIVersion = "2016-11-01" 2661 queryParameters := map[string]interface{}{ 2662 "api-version": APIVersion, 2663 } 2664 if len(filter) > 0 { 2665 queryParameters["$filter"] = autorest.Encode("query", filter) 2666 } 2667 if top != nil { 2668 queryParameters["$top"] = autorest.Encode("query", *top) 2669 } 2670 if skip != nil { 2671 queryParameters["$skip"] = autorest.Encode("query", *skip) 2672 } 2673 if len(selectParameter) > 0 { 2674 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2675 } 2676 if len(orderby) > 0 { 2677 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2678 } 2679 if count != nil { 2680 queryParameters["$count"] = autorest.Encode("query", *count) 2681 } 2682 2683 preparer := autorest.CreatePreparer( 2684 autorest.AsGet(), 2685 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2686 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/externaldatasources", pathParameters), 2687 autorest.WithQueryParameters(queryParameters)) 2688 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2689} 2690 2691// ListExternalDataSourcesSender sends the ListExternalDataSources request. The method will close the 2692// http.Response Body if it receives an error. 2693func (client Client) ListExternalDataSourcesSender(req *http.Request) (*http.Response, error) { 2694 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2695 return autorest.SendWithSender(client, req, sd...) 2696} 2697 2698// ListExternalDataSourcesResponder handles the response to the ListExternalDataSources request. The method always 2699// closes the http.Response Body. 2700func (client Client) ListExternalDataSourcesResponder(resp *http.Response) (result USQLExternalDataSourceList, err error) { 2701 err = autorest.Respond( 2702 resp, 2703 client.ByInspecting(), 2704 azure.WithErrorUnlessStatusCode(http.StatusOK), 2705 autorest.ByUnmarshallingJSON(&result), 2706 autorest.ByClosing()) 2707 result.Response = autorest.Response{Response: resp} 2708 return 2709} 2710 2711// listExternalDataSourcesNextResults retrieves the next set of results, if any. 2712func (client Client) listExternalDataSourcesNextResults(ctx context.Context, lastResults USQLExternalDataSourceList) (result USQLExternalDataSourceList, err error) { 2713 req, err := lastResults.uSQLExternalDataSourceListPreparer(ctx) 2714 if err != nil { 2715 return result, autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", nil, "Failure preparing next results request") 2716 } 2717 if req == nil { 2718 return 2719 } 2720 resp, err := client.ListExternalDataSourcesSender(req) 2721 if err != nil { 2722 result.Response = autorest.Response{Response: resp} 2723 return result, autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", resp, "Failure sending next results request") 2724 } 2725 result, err = client.ListExternalDataSourcesResponder(resp) 2726 if err != nil { 2727 err = autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", resp, "Failure responding to next results request") 2728 } 2729 return 2730} 2731 2732// ListExternalDataSourcesComplete enumerates all values, automatically crossing page boundaries as required. 2733func (client Client) ListExternalDataSourcesComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLExternalDataSourceListIterator, err error) { 2734 if tracing.IsEnabled() { 2735 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListExternalDataSources") 2736 defer func() { 2737 sc := -1 2738 if result.Response().Response.Response != nil { 2739 sc = result.page.Response().Response.Response.StatusCode 2740 } 2741 tracing.EndSpan(ctx, sc, err) 2742 }() 2743 } 2744 result.page, err = client.ListExternalDataSources(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 2745 return 2746} 2747 2748// ListPackages retrieves the list of packages from the Data Lake Analytics catalog. 2749// Parameters: 2750// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2751// databaseName - the name of the database containing the packages. 2752// schemaName - the name of the schema containing the packages. 2753// filter - oData filter. Optional. 2754// top - the number of items to return. Optional. 2755// skip - the number of items to skip over before returning elements. Optional. 2756// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2757// Categories?$select=CategoryName,Description. Optional. 2758// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2759// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2760// Optional. 2761// count - the Boolean value of true or false to request a count of the matching resources included with the 2762// resources in the response, e.g. Categories?$count=true. Optional. 2763func (client Client) ListPackages(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLPackageListPage, err error) { 2764 if tracing.IsEnabled() { 2765 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListPackages") 2766 defer func() { 2767 sc := -1 2768 if result.upl.Response.Response != nil { 2769 sc = result.upl.Response.Response.StatusCode 2770 } 2771 tracing.EndSpan(ctx, sc, err) 2772 }() 2773 } 2774 if err := validation.Validate([]validation.Validation{ 2775 {TargetValue: top, 2776 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2777 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2778 {TargetValue: skip, 2779 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2780 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2781 return result, validation.NewError("catalog.Client", "ListPackages", err.Error()) 2782 } 2783 2784 result.fn = client.listPackagesNextResults 2785 req, err := client.ListPackagesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 2786 if err != nil { 2787 err = autorest.NewErrorWithError(err, "catalog.Client", "ListPackages", nil, "Failure preparing request") 2788 return 2789 } 2790 2791 resp, err := client.ListPackagesSender(req) 2792 if err != nil { 2793 result.upl.Response = autorest.Response{Response: resp} 2794 err = autorest.NewErrorWithError(err, "catalog.Client", "ListPackages", resp, "Failure sending request") 2795 return 2796 } 2797 2798 result.upl, err = client.ListPackagesResponder(resp) 2799 if err != nil { 2800 err = autorest.NewErrorWithError(err, "catalog.Client", "ListPackages", resp, "Failure responding to request") 2801 } 2802 2803 return 2804} 2805 2806// ListPackagesPreparer prepares the ListPackages request. 2807func (client Client) ListPackagesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2808 urlParameters := map[string]interface{}{ 2809 "accountName": accountName, 2810 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2811 } 2812 2813 pathParameters := map[string]interface{}{ 2814 "databaseName": autorest.Encode("path", databaseName), 2815 "schemaName": autorest.Encode("path", schemaName), 2816 } 2817 2818 const APIVersion = "2016-11-01" 2819 queryParameters := map[string]interface{}{ 2820 "api-version": APIVersion, 2821 } 2822 if len(filter) > 0 { 2823 queryParameters["$filter"] = autorest.Encode("query", filter) 2824 } 2825 if top != nil { 2826 queryParameters["$top"] = autorest.Encode("query", *top) 2827 } 2828 if skip != nil { 2829 queryParameters["$skip"] = autorest.Encode("query", *skip) 2830 } 2831 if len(selectParameter) > 0 { 2832 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2833 } 2834 if len(orderby) > 0 { 2835 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2836 } 2837 if count != nil { 2838 queryParameters["$count"] = autorest.Encode("query", *count) 2839 } 2840 2841 preparer := autorest.CreatePreparer( 2842 autorest.AsGet(), 2843 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 2844 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages", pathParameters), 2845 autorest.WithQueryParameters(queryParameters)) 2846 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2847} 2848 2849// ListPackagesSender sends the ListPackages request. The method will close the 2850// http.Response Body if it receives an error. 2851func (client Client) ListPackagesSender(req *http.Request) (*http.Response, error) { 2852 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2853 return autorest.SendWithSender(client, req, sd...) 2854} 2855 2856// ListPackagesResponder handles the response to the ListPackages request. The method always 2857// closes the http.Response Body. 2858func (client Client) ListPackagesResponder(resp *http.Response) (result USQLPackageList, err error) { 2859 err = autorest.Respond( 2860 resp, 2861 client.ByInspecting(), 2862 azure.WithErrorUnlessStatusCode(http.StatusOK), 2863 autorest.ByUnmarshallingJSON(&result), 2864 autorest.ByClosing()) 2865 result.Response = autorest.Response{Response: resp} 2866 return 2867} 2868 2869// listPackagesNextResults retrieves the next set of results, if any. 2870func (client Client) listPackagesNextResults(ctx context.Context, lastResults USQLPackageList) (result USQLPackageList, err error) { 2871 req, err := lastResults.uSQLPackageListPreparer(ctx) 2872 if err != nil { 2873 return result, autorest.NewErrorWithError(err, "catalog.Client", "listPackagesNextResults", nil, "Failure preparing next results request") 2874 } 2875 if req == nil { 2876 return 2877 } 2878 resp, err := client.ListPackagesSender(req) 2879 if err != nil { 2880 result.Response = autorest.Response{Response: resp} 2881 return result, autorest.NewErrorWithError(err, "catalog.Client", "listPackagesNextResults", resp, "Failure sending next results request") 2882 } 2883 result, err = client.ListPackagesResponder(resp) 2884 if err != nil { 2885 err = autorest.NewErrorWithError(err, "catalog.Client", "listPackagesNextResults", resp, "Failure responding to next results request") 2886 } 2887 return 2888} 2889 2890// ListPackagesComplete enumerates all values, automatically crossing page boundaries as required. 2891func (client Client) ListPackagesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLPackageListIterator, err error) { 2892 if tracing.IsEnabled() { 2893 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListPackages") 2894 defer func() { 2895 sc := -1 2896 if result.Response().Response.Response != nil { 2897 sc = result.page.Response().Response.Response.StatusCode 2898 } 2899 tracing.EndSpan(ctx, sc, err) 2900 }() 2901 } 2902 result.page, err = client.ListPackages(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 2903 return 2904} 2905 2906// ListProcedures retrieves the list of procedures from the Data Lake Analytics catalog. 2907// Parameters: 2908// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 2909// databaseName - the name of the database containing the procedures. 2910// schemaName - the name of the schema containing the procedures. 2911// filter - oData filter. Optional. 2912// top - the number of items to return. Optional. 2913// skip - the number of items to skip over before returning elements. Optional. 2914// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 2915// Categories?$select=CategoryName,Description. Optional. 2916// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 2917// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 2918// Optional. 2919// count - the Boolean value of true or false to request a count of the matching resources included with the 2920// resources in the response, e.g. Categories?$count=true. Optional. 2921func (client Client) ListProcedures(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLProcedureListPage, err error) { 2922 if tracing.IsEnabled() { 2923 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListProcedures") 2924 defer func() { 2925 sc := -1 2926 if result.upl.Response.Response != nil { 2927 sc = result.upl.Response.Response.StatusCode 2928 } 2929 tracing.EndSpan(ctx, sc, err) 2930 }() 2931 } 2932 if err := validation.Validate([]validation.Validation{ 2933 {TargetValue: top, 2934 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 2935 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 2936 {TargetValue: skip, 2937 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 2938 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 2939 return result, validation.NewError("catalog.Client", "ListProcedures", err.Error()) 2940 } 2941 2942 result.fn = client.listProceduresNextResults 2943 req, err := client.ListProceduresPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 2944 if err != nil { 2945 err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", nil, "Failure preparing request") 2946 return 2947 } 2948 2949 resp, err := client.ListProceduresSender(req) 2950 if err != nil { 2951 result.upl.Response = autorest.Response{Response: resp} 2952 err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", resp, "Failure sending request") 2953 return 2954 } 2955 2956 result.upl, err = client.ListProceduresResponder(resp) 2957 if err != nil { 2958 err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", resp, "Failure responding to request") 2959 } 2960 2961 return 2962} 2963 2964// ListProceduresPreparer prepares the ListProcedures request. 2965func (client Client) ListProceduresPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 2966 urlParameters := map[string]interface{}{ 2967 "accountName": accountName, 2968 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 2969 } 2970 2971 pathParameters := map[string]interface{}{ 2972 "databaseName": autorest.Encode("path", databaseName), 2973 "schemaName": autorest.Encode("path", schemaName), 2974 } 2975 2976 const APIVersion = "2016-11-01" 2977 queryParameters := map[string]interface{}{ 2978 "api-version": APIVersion, 2979 } 2980 if len(filter) > 0 { 2981 queryParameters["$filter"] = autorest.Encode("query", filter) 2982 } 2983 if top != nil { 2984 queryParameters["$top"] = autorest.Encode("query", *top) 2985 } 2986 if skip != nil { 2987 queryParameters["$skip"] = autorest.Encode("query", *skip) 2988 } 2989 if len(selectParameter) > 0 { 2990 queryParameters["$select"] = autorest.Encode("query", selectParameter) 2991 } 2992 if len(orderby) > 0 { 2993 queryParameters["$orderby"] = autorest.Encode("query", orderby) 2994 } 2995 if count != nil { 2996 queryParameters["$count"] = autorest.Encode("query", *count) 2997 } 2998 2999 preparer := autorest.CreatePreparer( 3000 autorest.AsGet(), 3001 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3002 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures", pathParameters), 3003 autorest.WithQueryParameters(queryParameters)) 3004 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3005} 3006 3007// ListProceduresSender sends the ListProcedures request. The method will close the 3008// http.Response Body if it receives an error. 3009func (client Client) ListProceduresSender(req *http.Request) (*http.Response, error) { 3010 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3011 return autorest.SendWithSender(client, req, sd...) 3012} 3013 3014// ListProceduresResponder handles the response to the ListProcedures request. The method always 3015// closes the http.Response Body. 3016func (client Client) ListProceduresResponder(resp *http.Response) (result USQLProcedureList, err error) { 3017 err = autorest.Respond( 3018 resp, 3019 client.ByInspecting(), 3020 azure.WithErrorUnlessStatusCode(http.StatusOK), 3021 autorest.ByUnmarshallingJSON(&result), 3022 autorest.ByClosing()) 3023 result.Response = autorest.Response{Response: resp} 3024 return 3025} 3026 3027// listProceduresNextResults retrieves the next set of results, if any. 3028func (client Client) listProceduresNextResults(ctx context.Context, lastResults USQLProcedureList) (result USQLProcedureList, err error) { 3029 req, err := lastResults.uSQLProcedureListPreparer(ctx) 3030 if err != nil { 3031 return result, autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", nil, "Failure preparing next results request") 3032 } 3033 if req == nil { 3034 return 3035 } 3036 resp, err := client.ListProceduresSender(req) 3037 if err != nil { 3038 result.Response = autorest.Response{Response: resp} 3039 return result, autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", resp, "Failure sending next results request") 3040 } 3041 result, err = client.ListProceduresResponder(resp) 3042 if err != nil { 3043 err = autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", resp, "Failure responding to next results request") 3044 } 3045 return 3046} 3047 3048// ListProceduresComplete enumerates all values, automatically crossing page boundaries as required. 3049func (client Client) ListProceduresComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLProcedureListIterator, err error) { 3050 if tracing.IsEnabled() { 3051 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListProcedures") 3052 defer func() { 3053 sc := -1 3054 if result.Response().Response.Response != nil { 3055 sc = result.page.Response().Response.Response.StatusCode 3056 } 3057 tracing.EndSpan(ctx, sc, err) 3058 }() 3059 } 3060 result.page, err = client.ListProcedures(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 3061 return 3062} 3063 3064// ListSchemas retrieves the list of schemas from the Data Lake Analytics catalog. 3065// Parameters: 3066// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3067// databaseName - the name of the database containing the schema. 3068// filter - oData filter. Optional. 3069// top - the number of items to return. Optional. 3070// skip - the number of items to skip over before returning elements. Optional. 3071// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3072// Categories?$select=CategoryName,Description. Optional. 3073// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3074// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3075// Optional. 3076// count - the Boolean value of true or false to request a count of the matching resources included with the 3077// resources in the response, e.g. Categories?$count=true. Optional. 3078func (client Client) ListSchemas(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLSchemaListPage, err error) { 3079 if tracing.IsEnabled() { 3080 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSchemas") 3081 defer func() { 3082 sc := -1 3083 if result.usl.Response.Response != nil { 3084 sc = result.usl.Response.Response.StatusCode 3085 } 3086 tracing.EndSpan(ctx, sc, err) 3087 }() 3088 } 3089 if err := validation.Validate([]validation.Validation{ 3090 {TargetValue: top, 3091 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3092 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3093 {TargetValue: skip, 3094 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3095 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3096 return result, validation.NewError("catalog.Client", "ListSchemas", err.Error()) 3097 } 3098 3099 result.fn = client.listSchemasNextResults 3100 req, err := client.ListSchemasPreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 3101 if err != nil { 3102 err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", nil, "Failure preparing request") 3103 return 3104 } 3105 3106 resp, err := client.ListSchemasSender(req) 3107 if err != nil { 3108 result.usl.Response = autorest.Response{Response: resp} 3109 err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", resp, "Failure sending request") 3110 return 3111 } 3112 3113 result.usl, err = client.ListSchemasResponder(resp) 3114 if err != nil { 3115 err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", resp, "Failure responding to request") 3116 } 3117 3118 return 3119} 3120 3121// ListSchemasPreparer prepares the ListSchemas request. 3122func (client Client) ListSchemasPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 3123 urlParameters := map[string]interface{}{ 3124 "accountName": accountName, 3125 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3126 } 3127 3128 pathParameters := map[string]interface{}{ 3129 "databaseName": autorest.Encode("path", databaseName), 3130 } 3131 3132 const APIVersion = "2016-11-01" 3133 queryParameters := map[string]interface{}{ 3134 "api-version": APIVersion, 3135 } 3136 if len(filter) > 0 { 3137 queryParameters["$filter"] = autorest.Encode("query", filter) 3138 } 3139 if top != nil { 3140 queryParameters["$top"] = autorest.Encode("query", *top) 3141 } 3142 if skip != nil { 3143 queryParameters["$skip"] = autorest.Encode("query", *skip) 3144 } 3145 if len(selectParameter) > 0 { 3146 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3147 } 3148 if len(orderby) > 0 { 3149 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3150 } 3151 if count != nil { 3152 queryParameters["$count"] = autorest.Encode("query", *count) 3153 } 3154 3155 preparer := autorest.CreatePreparer( 3156 autorest.AsGet(), 3157 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3158 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas", pathParameters), 3159 autorest.WithQueryParameters(queryParameters)) 3160 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3161} 3162 3163// ListSchemasSender sends the ListSchemas request. The method will close the 3164// http.Response Body if it receives an error. 3165func (client Client) ListSchemasSender(req *http.Request) (*http.Response, error) { 3166 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3167 return autorest.SendWithSender(client, req, sd...) 3168} 3169 3170// ListSchemasResponder handles the response to the ListSchemas request. The method always 3171// closes the http.Response Body. 3172func (client Client) ListSchemasResponder(resp *http.Response) (result USQLSchemaList, err error) { 3173 err = autorest.Respond( 3174 resp, 3175 client.ByInspecting(), 3176 azure.WithErrorUnlessStatusCode(http.StatusOK), 3177 autorest.ByUnmarshallingJSON(&result), 3178 autorest.ByClosing()) 3179 result.Response = autorest.Response{Response: resp} 3180 return 3181} 3182 3183// listSchemasNextResults retrieves the next set of results, if any. 3184func (client Client) listSchemasNextResults(ctx context.Context, lastResults USQLSchemaList) (result USQLSchemaList, err error) { 3185 req, err := lastResults.uSQLSchemaListPreparer(ctx) 3186 if err != nil { 3187 return result, autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", nil, "Failure preparing next results request") 3188 } 3189 if req == nil { 3190 return 3191 } 3192 resp, err := client.ListSchemasSender(req) 3193 if err != nil { 3194 result.Response = autorest.Response{Response: resp} 3195 return result, autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", resp, "Failure sending next results request") 3196 } 3197 result, err = client.ListSchemasResponder(resp) 3198 if err != nil { 3199 err = autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", resp, "Failure responding to next results request") 3200 } 3201 return 3202} 3203 3204// ListSchemasComplete enumerates all values, automatically crossing page boundaries as required. 3205func (client Client) ListSchemasComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLSchemaListIterator, err error) { 3206 if tracing.IsEnabled() { 3207 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSchemas") 3208 defer func() { 3209 sc := -1 3210 if result.Response().Response.Response != nil { 3211 sc = result.page.Response().Response.Response.StatusCode 3212 } 3213 tracing.EndSpan(ctx, sc, err) 3214 }() 3215 } 3216 result.page, err = client.ListSchemas(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 3217 return 3218} 3219 3220// ListTableFragments retrieves the list of table fragments from the Data Lake Analytics catalog. 3221// Parameters: 3222// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3223// databaseName - the name of the database containing the table fragments. 3224// schemaName - the name of the schema containing the table fragments. 3225// tableName - the name of the table containing the table fragments. 3226// filter - oData filter. Optional. 3227// top - the number of items to return. Optional. 3228// skip - the number of items to skip over before returning elements. Optional. 3229// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3230// Categories?$select=CategoryName,Description. Optional. 3231// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3232// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3233// Optional. 3234// count - the Boolean value of true or false to request a count of the matching resources included with the 3235// resources in the response, e.g. Categories?$count=true. Optional. 3236func (client Client) ListTableFragments(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableFragmentListPage, err error) { 3237 if tracing.IsEnabled() { 3238 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableFragments") 3239 defer func() { 3240 sc := -1 3241 if result.utfl.Response.Response != nil { 3242 sc = result.utfl.Response.Response.StatusCode 3243 } 3244 tracing.EndSpan(ctx, sc, err) 3245 }() 3246 } 3247 if err := validation.Validate([]validation.Validation{ 3248 {TargetValue: top, 3249 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3250 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3251 {TargetValue: skip, 3252 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3253 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3254 return result, validation.NewError("catalog.Client", "ListTableFragments", err.Error()) 3255 } 3256 3257 result.fn = client.listTableFragmentsNextResults 3258 req, err := client.ListTableFragmentsPreparer(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 3259 if err != nil { 3260 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableFragments", nil, "Failure preparing request") 3261 return 3262 } 3263 3264 resp, err := client.ListTableFragmentsSender(req) 3265 if err != nil { 3266 result.utfl.Response = autorest.Response{Response: resp} 3267 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableFragments", resp, "Failure sending request") 3268 return 3269 } 3270 3271 result.utfl, err = client.ListTableFragmentsResponder(resp) 3272 if err != nil { 3273 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableFragments", resp, "Failure responding to request") 3274 } 3275 3276 return 3277} 3278 3279// ListTableFragmentsPreparer prepares the ListTableFragments request. 3280func (client Client) ListTableFragmentsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 3281 urlParameters := map[string]interface{}{ 3282 "accountName": accountName, 3283 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3284 } 3285 3286 pathParameters := map[string]interface{}{ 3287 "databaseName": autorest.Encode("path", databaseName), 3288 "schemaName": autorest.Encode("path", schemaName), 3289 "tableName": autorest.Encode("path", tableName), 3290 } 3291 3292 const APIVersion = "2016-11-01" 3293 queryParameters := map[string]interface{}{ 3294 "api-version": APIVersion, 3295 } 3296 if len(filter) > 0 { 3297 queryParameters["$filter"] = autorest.Encode("query", filter) 3298 } 3299 if top != nil { 3300 queryParameters["$top"] = autorest.Encode("query", *top) 3301 } 3302 if skip != nil { 3303 queryParameters["$skip"] = autorest.Encode("query", *skip) 3304 } 3305 if len(selectParameter) > 0 { 3306 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3307 } 3308 if len(orderby) > 0 { 3309 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3310 } 3311 if count != nil { 3312 queryParameters["$count"] = autorest.Encode("query", *count) 3313 } 3314 3315 preparer := autorest.CreatePreparer( 3316 autorest.AsGet(), 3317 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3318 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/tablefragments", pathParameters), 3319 autorest.WithQueryParameters(queryParameters)) 3320 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3321} 3322 3323// ListTableFragmentsSender sends the ListTableFragments request. The method will close the 3324// http.Response Body if it receives an error. 3325func (client Client) ListTableFragmentsSender(req *http.Request) (*http.Response, error) { 3326 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3327 return autorest.SendWithSender(client, req, sd...) 3328} 3329 3330// ListTableFragmentsResponder handles the response to the ListTableFragments request. The method always 3331// closes the http.Response Body. 3332func (client Client) ListTableFragmentsResponder(resp *http.Response) (result USQLTableFragmentList, err error) { 3333 err = autorest.Respond( 3334 resp, 3335 client.ByInspecting(), 3336 azure.WithErrorUnlessStatusCode(http.StatusOK), 3337 autorest.ByUnmarshallingJSON(&result), 3338 autorest.ByClosing()) 3339 result.Response = autorest.Response{Response: resp} 3340 return 3341} 3342 3343// listTableFragmentsNextResults retrieves the next set of results, if any. 3344func (client Client) listTableFragmentsNextResults(ctx context.Context, lastResults USQLTableFragmentList) (result USQLTableFragmentList, err error) { 3345 req, err := lastResults.uSQLTableFragmentListPreparer(ctx) 3346 if err != nil { 3347 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableFragmentsNextResults", nil, "Failure preparing next results request") 3348 } 3349 if req == nil { 3350 return 3351 } 3352 resp, err := client.ListTableFragmentsSender(req) 3353 if err != nil { 3354 result.Response = autorest.Response{Response: resp} 3355 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableFragmentsNextResults", resp, "Failure sending next results request") 3356 } 3357 result, err = client.ListTableFragmentsResponder(resp) 3358 if err != nil { 3359 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableFragmentsNextResults", resp, "Failure responding to next results request") 3360 } 3361 return 3362} 3363 3364// ListTableFragmentsComplete enumerates all values, automatically crossing page boundaries as required. 3365func (client Client) ListTableFragmentsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableFragmentListIterator, err error) { 3366 if tracing.IsEnabled() { 3367 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableFragments") 3368 defer func() { 3369 sc := -1 3370 if result.Response().Response.Response != nil { 3371 sc = result.page.Response().Response.Response.StatusCode 3372 } 3373 tracing.EndSpan(ctx, sc, err) 3374 }() 3375 } 3376 result.page, err = client.ListTableFragments(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 3377 return 3378} 3379 3380// ListTablePartitions retrieves the list of table partitions from the Data Lake Analytics catalog. 3381// Parameters: 3382// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3383// databaseName - the name of the database containing the partitions. 3384// schemaName - the name of the schema containing the partitions. 3385// tableName - the name of the table containing the partitions. 3386// filter - oData filter. Optional. 3387// top - the number of items to return. Optional. 3388// skip - the number of items to skip over before returning elements. Optional. 3389// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3390// Categories?$select=CategoryName,Description. Optional. 3391// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3392// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3393// Optional. 3394// count - the Boolean value of true or false to request a count of the matching resources included with the 3395// resources in the response, e.g. Categories?$count=true. Optional. 3396func (client Client) ListTablePartitions(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTablePartitionListPage, err error) { 3397 if tracing.IsEnabled() { 3398 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablePartitions") 3399 defer func() { 3400 sc := -1 3401 if result.utpl.Response.Response != nil { 3402 sc = result.utpl.Response.Response.StatusCode 3403 } 3404 tracing.EndSpan(ctx, sc, err) 3405 }() 3406 } 3407 if err := validation.Validate([]validation.Validation{ 3408 {TargetValue: top, 3409 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3410 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3411 {TargetValue: skip, 3412 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3413 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3414 return result, validation.NewError("catalog.Client", "ListTablePartitions", err.Error()) 3415 } 3416 3417 result.fn = client.listTablePartitionsNextResults 3418 req, err := client.ListTablePartitionsPreparer(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 3419 if err != nil { 3420 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", nil, "Failure preparing request") 3421 return 3422 } 3423 3424 resp, err := client.ListTablePartitionsSender(req) 3425 if err != nil { 3426 result.utpl.Response = autorest.Response{Response: resp} 3427 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", resp, "Failure sending request") 3428 return 3429 } 3430 3431 result.utpl, err = client.ListTablePartitionsResponder(resp) 3432 if err != nil { 3433 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", resp, "Failure responding to request") 3434 } 3435 3436 return 3437} 3438 3439// ListTablePartitionsPreparer prepares the ListTablePartitions request. 3440func (client Client) ListTablePartitionsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 3441 urlParameters := map[string]interface{}{ 3442 "accountName": accountName, 3443 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3444 } 3445 3446 pathParameters := map[string]interface{}{ 3447 "databaseName": autorest.Encode("path", databaseName), 3448 "schemaName": autorest.Encode("path", schemaName), 3449 "tableName": autorest.Encode("path", tableName), 3450 } 3451 3452 const APIVersion = "2016-11-01" 3453 queryParameters := map[string]interface{}{ 3454 "api-version": APIVersion, 3455 } 3456 if len(filter) > 0 { 3457 queryParameters["$filter"] = autorest.Encode("query", filter) 3458 } 3459 if top != nil { 3460 queryParameters["$top"] = autorest.Encode("query", *top) 3461 } 3462 if skip != nil { 3463 queryParameters["$skip"] = autorest.Encode("query", *skip) 3464 } 3465 if len(selectParameter) > 0 { 3466 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3467 } 3468 if len(orderby) > 0 { 3469 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3470 } 3471 if count != nil { 3472 queryParameters["$count"] = autorest.Encode("query", *count) 3473 } 3474 3475 preparer := autorest.CreatePreparer( 3476 autorest.AsGet(), 3477 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3478 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions", pathParameters), 3479 autorest.WithQueryParameters(queryParameters)) 3480 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3481} 3482 3483// ListTablePartitionsSender sends the ListTablePartitions request. The method will close the 3484// http.Response Body if it receives an error. 3485func (client Client) ListTablePartitionsSender(req *http.Request) (*http.Response, error) { 3486 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3487 return autorest.SendWithSender(client, req, sd...) 3488} 3489 3490// ListTablePartitionsResponder handles the response to the ListTablePartitions request. The method always 3491// closes the http.Response Body. 3492func (client Client) ListTablePartitionsResponder(resp *http.Response) (result USQLTablePartitionList, err error) { 3493 err = autorest.Respond( 3494 resp, 3495 client.ByInspecting(), 3496 azure.WithErrorUnlessStatusCode(http.StatusOK), 3497 autorest.ByUnmarshallingJSON(&result), 3498 autorest.ByClosing()) 3499 result.Response = autorest.Response{Response: resp} 3500 return 3501} 3502 3503// listTablePartitionsNextResults retrieves the next set of results, if any. 3504func (client Client) listTablePartitionsNextResults(ctx context.Context, lastResults USQLTablePartitionList) (result USQLTablePartitionList, err error) { 3505 req, err := lastResults.uSQLTablePartitionListPreparer(ctx) 3506 if err != nil { 3507 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", nil, "Failure preparing next results request") 3508 } 3509 if req == nil { 3510 return 3511 } 3512 resp, err := client.ListTablePartitionsSender(req) 3513 if err != nil { 3514 result.Response = autorest.Response{Response: resp} 3515 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", resp, "Failure sending next results request") 3516 } 3517 result, err = client.ListTablePartitionsResponder(resp) 3518 if err != nil { 3519 err = autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", resp, "Failure responding to next results request") 3520 } 3521 return 3522} 3523 3524// ListTablePartitionsComplete enumerates all values, automatically crossing page boundaries as required. 3525func (client Client) ListTablePartitionsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTablePartitionListIterator, err error) { 3526 if tracing.IsEnabled() { 3527 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablePartitions") 3528 defer func() { 3529 sc := -1 3530 if result.Response().Response.Response != nil { 3531 sc = result.page.Response().Response.Response.StatusCode 3532 } 3533 tracing.EndSpan(ctx, sc, err) 3534 }() 3535 } 3536 result.page, err = client.ListTablePartitions(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 3537 return 3538} 3539 3540// ListTables retrieves the list of tables from the Data Lake Analytics catalog. 3541// Parameters: 3542// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3543// databaseName - the name of the database containing the tables. 3544// schemaName - the name of the schema containing the tables. 3545// filter - oData filter. Optional. 3546// top - the number of items to return. Optional. 3547// skip - the number of items to skip over before returning elements. Optional. 3548// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3549// Categories?$select=CategoryName,Description. Optional. 3550// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3551// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3552// Optional. 3553// count - the Boolean value of true or false to request a count of the matching resources included with the 3554// resources in the response, e.g. Categories?$count=true. Optional. 3555// basic - the basic switch indicates what level of information to return when listing tables. When basic is 3556// true, only database_name, schema_name, table_name and version are returned for each table, otherwise all 3557// table metadata is returned. By default, it is false. Optional. 3558func (client Client) ListTables(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (result USQLTableListPage, err error) { 3559 if tracing.IsEnabled() { 3560 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTables") 3561 defer func() { 3562 sc := -1 3563 if result.utl.Response.Response != nil { 3564 sc = result.utl.Response.Response.StatusCode 3565 } 3566 tracing.EndSpan(ctx, sc, err) 3567 }() 3568 } 3569 if err := validation.Validate([]validation.Validation{ 3570 {TargetValue: top, 3571 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3572 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3573 {TargetValue: skip, 3574 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3575 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3576 return result, validation.NewError("catalog.Client", "ListTables", err.Error()) 3577 } 3578 3579 result.fn = client.listTablesNextResults 3580 req, err := client.ListTablesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count, basic) 3581 if err != nil { 3582 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", nil, "Failure preparing request") 3583 return 3584 } 3585 3586 resp, err := client.ListTablesSender(req) 3587 if err != nil { 3588 result.utl.Response = autorest.Response{Response: resp} 3589 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", resp, "Failure sending request") 3590 return 3591 } 3592 3593 result.utl, err = client.ListTablesResponder(resp) 3594 if err != nil { 3595 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", resp, "Failure responding to request") 3596 } 3597 3598 return 3599} 3600 3601// ListTablesPreparer prepares the ListTables request. 3602func (client Client) ListTablesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (*http.Request, error) { 3603 urlParameters := map[string]interface{}{ 3604 "accountName": accountName, 3605 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3606 } 3607 3608 pathParameters := map[string]interface{}{ 3609 "databaseName": autorest.Encode("path", databaseName), 3610 "schemaName": autorest.Encode("path", schemaName), 3611 } 3612 3613 const APIVersion = "2016-11-01" 3614 queryParameters := map[string]interface{}{ 3615 "api-version": APIVersion, 3616 } 3617 if len(filter) > 0 { 3618 queryParameters["$filter"] = autorest.Encode("query", filter) 3619 } 3620 if top != nil { 3621 queryParameters["$top"] = autorest.Encode("query", *top) 3622 } 3623 if skip != nil { 3624 queryParameters["$skip"] = autorest.Encode("query", *skip) 3625 } 3626 if len(selectParameter) > 0 { 3627 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3628 } 3629 if len(orderby) > 0 { 3630 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3631 } 3632 if count != nil { 3633 queryParameters["$count"] = autorest.Encode("query", *count) 3634 } 3635 if basic != nil { 3636 queryParameters["basic"] = autorest.Encode("query", *basic) 3637 } else { 3638 queryParameters["basic"] = autorest.Encode("query", false) 3639 } 3640 3641 preparer := autorest.CreatePreparer( 3642 autorest.AsGet(), 3643 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3644 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables", pathParameters), 3645 autorest.WithQueryParameters(queryParameters)) 3646 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3647} 3648 3649// ListTablesSender sends the ListTables request. The method will close the 3650// http.Response Body if it receives an error. 3651func (client Client) ListTablesSender(req *http.Request) (*http.Response, error) { 3652 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3653 return autorest.SendWithSender(client, req, sd...) 3654} 3655 3656// ListTablesResponder handles the response to the ListTables request. The method always 3657// closes the http.Response Body. 3658func (client Client) ListTablesResponder(resp *http.Response) (result USQLTableList, err error) { 3659 err = autorest.Respond( 3660 resp, 3661 client.ByInspecting(), 3662 azure.WithErrorUnlessStatusCode(http.StatusOK), 3663 autorest.ByUnmarshallingJSON(&result), 3664 autorest.ByClosing()) 3665 result.Response = autorest.Response{Response: resp} 3666 return 3667} 3668 3669// listTablesNextResults retrieves the next set of results, if any. 3670func (client Client) listTablesNextResults(ctx context.Context, lastResults USQLTableList) (result USQLTableList, err error) { 3671 req, err := lastResults.uSQLTableListPreparer(ctx) 3672 if err != nil { 3673 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", nil, "Failure preparing next results request") 3674 } 3675 if req == nil { 3676 return 3677 } 3678 resp, err := client.ListTablesSender(req) 3679 if err != nil { 3680 result.Response = autorest.Response{Response: resp} 3681 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", resp, "Failure sending next results request") 3682 } 3683 result, err = client.ListTablesResponder(resp) 3684 if err != nil { 3685 err = autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", resp, "Failure responding to next results request") 3686 } 3687 return 3688} 3689 3690// ListTablesComplete enumerates all values, automatically crossing page boundaries as required. 3691func (client Client) ListTablesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (result USQLTableListIterator, err error) { 3692 if tracing.IsEnabled() { 3693 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTables") 3694 defer func() { 3695 sc := -1 3696 if result.Response().Response.Response != nil { 3697 sc = result.page.Response().Response.Response.StatusCode 3698 } 3699 tracing.EndSpan(ctx, sc, err) 3700 }() 3701 } 3702 result.page, err = client.ListTables(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count, basic) 3703 return 3704} 3705 3706// ListTablesByDatabase retrieves the list of all tables in a database from the Data Lake Analytics catalog. 3707// Parameters: 3708// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3709// databaseName - the name of the database containing the tables. 3710// filter - oData filter. Optional. 3711// top - the number of items to return. Optional. 3712// skip - the number of items to skip over before returning elements. Optional. 3713// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3714// Categories?$select=CategoryName,Description. Optional. 3715// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3716// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3717// Optional. 3718// count - the Boolean value of true or false to request a count of the matching resources included with the 3719// resources in the response, e.g. Categories?$count=true. Optional. 3720// basic - the basic switch indicates what level of information to return when listing tables. When basic is 3721// true, only database_name, schema_name, table_name and version are returned for each table, otherwise all 3722// table metadata is returned. By default, it is false 3723func (client Client) ListTablesByDatabase(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (result USQLTableListPage, err error) { 3724 if tracing.IsEnabled() { 3725 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablesByDatabase") 3726 defer func() { 3727 sc := -1 3728 if result.utl.Response.Response != nil { 3729 sc = result.utl.Response.Response.StatusCode 3730 } 3731 tracing.EndSpan(ctx, sc, err) 3732 }() 3733 } 3734 if err := validation.Validate([]validation.Validation{ 3735 {TargetValue: top, 3736 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3737 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3738 {TargetValue: skip, 3739 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3740 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3741 return result, validation.NewError("catalog.Client", "ListTablesByDatabase", err.Error()) 3742 } 3743 3744 result.fn = client.listTablesByDatabaseNextResults 3745 req, err := client.ListTablesByDatabasePreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count, basic) 3746 if err != nil { 3747 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablesByDatabase", nil, "Failure preparing request") 3748 return 3749 } 3750 3751 resp, err := client.ListTablesByDatabaseSender(req) 3752 if err != nil { 3753 result.utl.Response = autorest.Response{Response: resp} 3754 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablesByDatabase", resp, "Failure sending request") 3755 return 3756 } 3757 3758 result.utl, err = client.ListTablesByDatabaseResponder(resp) 3759 if err != nil { 3760 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablesByDatabase", resp, "Failure responding to request") 3761 } 3762 3763 return 3764} 3765 3766// ListTablesByDatabasePreparer prepares the ListTablesByDatabase request. 3767func (client Client) ListTablesByDatabasePreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (*http.Request, error) { 3768 urlParameters := map[string]interface{}{ 3769 "accountName": accountName, 3770 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3771 } 3772 3773 pathParameters := map[string]interface{}{ 3774 "databaseName": autorest.Encode("path", databaseName), 3775 } 3776 3777 const APIVersion = "2016-11-01" 3778 queryParameters := map[string]interface{}{ 3779 "api-version": APIVersion, 3780 } 3781 if len(filter) > 0 { 3782 queryParameters["$filter"] = autorest.Encode("query", filter) 3783 } 3784 if top != nil { 3785 queryParameters["$top"] = autorest.Encode("query", *top) 3786 } 3787 if skip != nil { 3788 queryParameters["$skip"] = autorest.Encode("query", *skip) 3789 } 3790 if len(selectParameter) > 0 { 3791 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3792 } 3793 if len(orderby) > 0 { 3794 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3795 } 3796 if count != nil { 3797 queryParameters["$count"] = autorest.Encode("query", *count) 3798 } 3799 if basic != nil { 3800 queryParameters["basic"] = autorest.Encode("query", *basic) 3801 } else { 3802 queryParameters["basic"] = autorest.Encode("query", false) 3803 } 3804 3805 preparer := autorest.CreatePreparer( 3806 autorest.AsGet(), 3807 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3808 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/tables", pathParameters), 3809 autorest.WithQueryParameters(queryParameters)) 3810 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3811} 3812 3813// ListTablesByDatabaseSender sends the ListTablesByDatabase request. The method will close the 3814// http.Response Body if it receives an error. 3815func (client Client) ListTablesByDatabaseSender(req *http.Request) (*http.Response, error) { 3816 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3817 return autorest.SendWithSender(client, req, sd...) 3818} 3819 3820// ListTablesByDatabaseResponder handles the response to the ListTablesByDatabase request. The method always 3821// closes the http.Response Body. 3822func (client Client) ListTablesByDatabaseResponder(resp *http.Response) (result USQLTableList, err error) { 3823 err = autorest.Respond( 3824 resp, 3825 client.ByInspecting(), 3826 azure.WithErrorUnlessStatusCode(http.StatusOK), 3827 autorest.ByUnmarshallingJSON(&result), 3828 autorest.ByClosing()) 3829 result.Response = autorest.Response{Response: resp} 3830 return 3831} 3832 3833// listTablesByDatabaseNextResults retrieves the next set of results, if any. 3834func (client Client) listTablesByDatabaseNextResults(ctx context.Context, lastResults USQLTableList) (result USQLTableList, err error) { 3835 req, err := lastResults.uSQLTableListPreparer(ctx) 3836 if err != nil { 3837 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesByDatabaseNextResults", nil, "Failure preparing next results request") 3838 } 3839 if req == nil { 3840 return 3841 } 3842 resp, err := client.ListTablesByDatabaseSender(req) 3843 if err != nil { 3844 result.Response = autorest.Response{Response: resp} 3845 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesByDatabaseNextResults", resp, "Failure sending next results request") 3846 } 3847 result, err = client.ListTablesByDatabaseResponder(resp) 3848 if err != nil { 3849 err = autorest.NewErrorWithError(err, "catalog.Client", "listTablesByDatabaseNextResults", resp, "Failure responding to next results request") 3850 } 3851 return 3852} 3853 3854// ListTablesByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. 3855func (client Client) ListTablesByDatabaseComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool, basic *bool) (result USQLTableListIterator, err error) { 3856 if tracing.IsEnabled() { 3857 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablesByDatabase") 3858 defer func() { 3859 sc := -1 3860 if result.Response().Response.Response != nil { 3861 sc = result.page.Response().Response.Response.StatusCode 3862 } 3863 tracing.EndSpan(ctx, sc, err) 3864 }() 3865 } 3866 result.page, err = client.ListTablesByDatabase(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count, basic) 3867 return 3868} 3869 3870// ListTableStatistics retrieves the list of table statistics from the Data Lake Analytics catalog. 3871// Parameters: 3872// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 3873// databaseName - the name of the database containing the statistics. 3874// schemaName - the name of the schema containing the statistics. 3875// tableName - the name of the table containing the statistics. 3876// filter - oData filter. Optional. 3877// top - the number of items to return. Optional. 3878// skip - the number of items to skip over before returning elements. Optional. 3879// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 3880// Categories?$select=CategoryName,Description. Optional. 3881// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 3882// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 3883// Optional. 3884// count - the Boolean value of true or false to request a count of the matching resources included with the 3885// resources in the response, e.g. Categories?$count=true. Optional. 3886func (client Client) ListTableStatistics(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListPage, err error) { 3887 if tracing.IsEnabled() { 3888 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatistics") 3889 defer func() { 3890 sc := -1 3891 if result.utsl.Response.Response != nil { 3892 sc = result.utsl.Response.Response.StatusCode 3893 } 3894 tracing.EndSpan(ctx, sc, err) 3895 }() 3896 } 3897 if err := validation.Validate([]validation.Validation{ 3898 {TargetValue: top, 3899 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 3900 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 3901 {TargetValue: skip, 3902 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 3903 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 3904 return result, validation.NewError("catalog.Client", "ListTableStatistics", err.Error()) 3905 } 3906 3907 result.fn = client.listTableStatisticsNextResults 3908 req, err := client.ListTableStatisticsPreparer(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 3909 if err != nil { 3910 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", nil, "Failure preparing request") 3911 return 3912 } 3913 3914 resp, err := client.ListTableStatisticsSender(req) 3915 if err != nil { 3916 result.utsl.Response = autorest.Response{Response: resp} 3917 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", resp, "Failure sending request") 3918 return 3919 } 3920 3921 result.utsl, err = client.ListTableStatisticsResponder(resp) 3922 if err != nil { 3923 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", resp, "Failure responding to request") 3924 } 3925 3926 return 3927} 3928 3929// ListTableStatisticsPreparer prepares the ListTableStatistics request. 3930func (client Client) ListTableStatisticsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 3931 urlParameters := map[string]interface{}{ 3932 "accountName": accountName, 3933 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 3934 } 3935 3936 pathParameters := map[string]interface{}{ 3937 "databaseName": autorest.Encode("path", databaseName), 3938 "schemaName": autorest.Encode("path", schemaName), 3939 "tableName": autorest.Encode("path", tableName), 3940 } 3941 3942 const APIVersion = "2016-11-01" 3943 queryParameters := map[string]interface{}{ 3944 "api-version": APIVersion, 3945 } 3946 if len(filter) > 0 { 3947 queryParameters["$filter"] = autorest.Encode("query", filter) 3948 } 3949 if top != nil { 3950 queryParameters["$top"] = autorest.Encode("query", *top) 3951 } 3952 if skip != nil { 3953 queryParameters["$skip"] = autorest.Encode("query", *skip) 3954 } 3955 if len(selectParameter) > 0 { 3956 queryParameters["$select"] = autorest.Encode("query", selectParameter) 3957 } 3958 if len(orderby) > 0 { 3959 queryParameters["$orderby"] = autorest.Encode("query", orderby) 3960 } 3961 if count != nil { 3962 queryParameters["$count"] = autorest.Encode("query", *count) 3963 } 3964 3965 preparer := autorest.CreatePreparer( 3966 autorest.AsGet(), 3967 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 3968 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics", pathParameters), 3969 autorest.WithQueryParameters(queryParameters)) 3970 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3971} 3972 3973// ListTableStatisticsSender sends the ListTableStatistics request. The method will close the 3974// http.Response Body if it receives an error. 3975func (client Client) ListTableStatisticsSender(req *http.Request) (*http.Response, error) { 3976 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3977 return autorest.SendWithSender(client, req, sd...) 3978} 3979 3980// ListTableStatisticsResponder handles the response to the ListTableStatistics request. The method always 3981// closes the http.Response Body. 3982func (client Client) ListTableStatisticsResponder(resp *http.Response) (result USQLTableStatisticsList, err error) { 3983 err = autorest.Respond( 3984 resp, 3985 client.ByInspecting(), 3986 azure.WithErrorUnlessStatusCode(http.StatusOK), 3987 autorest.ByUnmarshallingJSON(&result), 3988 autorest.ByClosing()) 3989 result.Response = autorest.Response{Response: resp} 3990 return 3991} 3992 3993// listTableStatisticsNextResults retrieves the next set of results, if any. 3994func (client Client) listTableStatisticsNextResults(ctx context.Context, lastResults USQLTableStatisticsList) (result USQLTableStatisticsList, err error) { 3995 req, err := lastResults.uSQLTableStatisticsListPreparer(ctx) 3996 if err != nil { 3997 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", nil, "Failure preparing next results request") 3998 } 3999 if req == nil { 4000 return 4001 } 4002 resp, err := client.ListTableStatisticsSender(req) 4003 if err != nil { 4004 result.Response = autorest.Response{Response: resp} 4005 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", resp, "Failure sending next results request") 4006 } 4007 result, err = client.ListTableStatisticsResponder(resp) 4008 if err != nil { 4009 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", resp, "Failure responding to next results request") 4010 } 4011 return 4012} 4013 4014// ListTableStatisticsComplete enumerates all values, automatically crossing page boundaries as required. 4015func (client Client) ListTableStatisticsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListIterator, err error) { 4016 if tracing.IsEnabled() { 4017 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatistics") 4018 defer func() { 4019 sc := -1 4020 if result.Response().Response.Response != nil { 4021 sc = result.page.Response().Response.Response.StatusCode 4022 } 4023 tracing.EndSpan(ctx, sc, err) 4024 }() 4025 } 4026 result.page, err = client.ListTableStatistics(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, selectParameter, orderby, count) 4027 return 4028} 4029 4030// ListTableStatisticsByDatabase retrieves the list of all statistics in a database from the Data Lake Analytics 4031// catalog. 4032// Parameters: 4033// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4034// databaseName - the name of the database containing the table statistics. 4035// filter - oData filter. Optional. 4036// top - the number of items to return. Optional. 4037// skip - the number of items to skip over before returning elements. Optional. 4038// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4039// Categories?$select=CategoryName,Description. Optional. 4040// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4041// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4042// Optional. 4043// count - the Boolean value of true or false to request a count of the matching resources included with the 4044// resources in the response, e.g. Categories?$count=true. Optional. 4045func (client Client) ListTableStatisticsByDatabase(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListPage, err error) { 4046 if tracing.IsEnabled() { 4047 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatisticsByDatabase") 4048 defer func() { 4049 sc := -1 4050 if result.utsl.Response.Response != nil { 4051 sc = result.utsl.Response.Response.StatusCode 4052 } 4053 tracing.EndSpan(ctx, sc, err) 4054 }() 4055 } 4056 if err := validation.Validate([]validation.Validation{ 4057 {TargetValue: top, 4058 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4059 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4060 {TargetValue: skip, 4061 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4062 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4063 return result, validation.NewError("catalog.Client", "ListTableStatisticsByDatabase", err.Error()) 4064 } 4065 4066 result.fn = client.listTableStatisticsByDatabaseNextResults 4067 req, err := client.ListTableStatisticsByDatabasePreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 4068 if err != nil { 4069 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabase", nil, "Failure preparing request") 4070 return 4071 } 4072 4073 resp, err := client.ListTableStatisticsByDatabaseSender(req) 4074 if err != nil { 4075 result.utsl.Response = autorest.Response{Response: resp} 4076 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabase", resp, "Failure sending request") 4077 return 4078 } 4079 4080 result.utsl, err = client.ListTableStatisticsByDatabaseResponder(resp) 4081 if err != nil { 4082 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabase", resp, "Failure responding to request") 4083 } 4084 4085 return 4086} 4087 4088// ListTableStatisticsByDatabasePreparer prepares the ListTableStatisticsByDatabase request. 4089func (client Client) ListTableStatisticsByDatabasePreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4090 urlParameters := map[string]interface{}{ 4091 "accountName": accountName, 4092 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4093 } 4094 4095 pathParameters := map[string]interface{}{ 4096 "databaseName": autorest.Encode("path", databaseName), 4097 } 4098 4099 const APIVersion = "2016-11-01" 4100 queryParameters := map[string]interface{}{ 4101 "api-version": APIVersion, 4102 } 4103 if len(filter) > 0 { 4104 queryParameters["$filter"] = autorest.Encode("query", filter) 4105 } 4106 if top != nil { 4107 queryParameters["$top"] = autorest.Encode("query", *top) 4108 } 4109 if skip != nil { 4110 queryParameters["$skip"] = autorest.Encode("query", *skip) 4111 } 4112 if len(selectParameter) > 0 { 4113 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4114 } 4115 if len(orderby) > 0 { 4116 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4117 } 4118 if count != nil { 4119 queryParameters["$count"] = autorest.Encode("query", *count) 4120 } 4121 4122 preparer := autorest.CreatePreparer( 4123 autorest.AsGet(), 4124 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4125 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/statistics", pathParameters), 4126 autorest.WithQueryParameters(queryParameters)) 4127 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4128} 4129 4130// ListTableStatisticsByDatabaseSender sends the ListTableStatisticsByDatabase request. The method will close the 4131// http.Response Body if it receives an error. 4132func (client Client) ListTableStatisticsByDatabaseSender(req *http.Request) (*http.Response, error) { 4133 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4134 return autorest.SendWithSender(client, req, sd...) 4135} 4136 4137// ListTableStatisticsByDatabaseResponder handles the response to the ListTableStatisticsByDatabase request. The method always 4138// closes the http.Response Body. 4139func (client Client) ListTableStatisticsByDatabaseResponder(resp *http.Response) (result USQLTableStatisticsList, err error) { 4140 err = autorest.Respond( 4141 resp, 4142 client.ByInspecting(), 4143 azure.WithErrorUnlessStatusCode(http.StatusOK), 4144 autorest.ByUnmarshallingJSON(&result), 4145 autorest.ByClosing()) 4146 result.Response = autorest.Response{Response: resp} 4147 return 4148} 4149 4150// listTableStatisticsByDatabaseNextResults retrieves the next set of results, if any. 4151func (client Client) listTableStatisticsByDatabaseNextResults(ctx context.Context, lastResults USQLTableStatisticsList) (result USQLTableStatisticsList, err error) { 4152 req, err := lastResults.uSQLTableStatisticsListPreparer(ctx) 4153 if err != nil { 4154 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseNextResults", nil, "Failure preparing next results request") 4155 } 4156 if req == nil { 4157 return 4158 } 4159 resp, err := client.ListTableStatisticsByDatabaseSender(req) 4160 if err != nil { 4161 result.Response = autorest.Response{Response: resp} 4162 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseNextResults", resp, "Failure sending next results request") 4163 } 4164 result, err = client.ListTableStatisticsByDatabaseResponder(resp) 4165 if err != nil { 4166 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseNextResults", resp, "Failure responding to next results request") 4167 } 4168 return 4169} 4170 4171// ListTableStatisticsByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. 4172func (client Client) ListTableStatisticsByDatabaseComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListIterator, err error) { 4173 if tracing.IsEnabled() { 4174 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatisticsByDatabase") 4175 defer func() { 4176 sc := -1 4177 if result.Response().Response.Response != nil { 4178 sc = result.page.Response().Response.Response.StatusCode 4179 } 4180 tracing.EndSpan(ctx, sc, err) 4181 }() 4182 } 4183 result.page, err = client.ListTableStatisticsByDatabase(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 4184 return 4185} 4186 4187// ListTableStatisticsByDatabaseAndSchema retrieves the list of all table statistics within the specified schema from 4188// the Data Lake Analytics catalog. 4189// Parameters: 4190// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4191// databaseName - the name of the database containing the statistics. 4192// schemaName - the name of the schema containing the statistics. 4193// filter - oData filter. Optional. 4194// top - the number of items to return. Optional. 4195// skip - the number of items to skip over before returning elements. Optional. 4196// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4197// Categories?$select=CategoryName,Description. Optional. 4198// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4199// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4200// Optional. 4201// count - the Boolean value of true or false to request a count of the matching resources included with the 4202// resources in the response, e.g. Categories?$count=true. Optional. 4203func (client Client) ListTableStatisticsByDatabaseAndSchema(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListPage, err error) { 4204 if tracing.IsEnabled() { 4205 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatisticsByDatabaseAndSchema") 4206 defer func() { 4207 sc := -1 4208 if result.utsl.Response.Response != nil { 4209 sc = result.utsl.Response.Response.StatusCode 4210 } 4211 tracing.EndSpan(ctx, sc, err) 4212 }() 4213 } 4214 if err := validation.Validate([]validation.Validation{ 4215 {TargetValue: top, 4216 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4217 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4218 {TargetValue: skip, 4219 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4220 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4221 return result, validation.NewError("catalog.Client", "ListTableStatisticsByDatabaseAndSchema", err.Error()) 4222 } 4223 4224 result.fn = client.listTableStatisticsByDatabaseAndSchemaNextResults 4225 req, err := client.ListTableStatisticsByDatabaseAndSchemaPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4226 if err != nil { 4227 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabaseAndSchema", nil, "Failure preparing request") 4228 return 4229 } 4230 4231 resp, err := client.ListTableStatisticsByDatabaseAndSchemaSender(req) 4232 if err != nil { 4233 result.utsl.Response = autorest.Response{Response: resp} 4234 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabaseAndSchema", resp, "Failure sending request") 4235 return 4236 } 4237 4238 result.utsl, err = client.ListTableStatisticsByDatabaseAndSchemaResponder(resp) 4239 if err != nil { 4240 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatisticsByDatabaseAndSchema", resp, "Failure responding to request") 4241 } 4242 4243 return 4244} 4245 4246// ListTableStatisticsByDatabaseAndSchemaPreparer prepares the ListTableStatisticsByDatabaseAndSchema request. 4247func (client Client) ListTableStatisticsByDatabaseAndSchemaPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4248 urlParameters := map[string]interface{}{ 4249 "accountName": accountName, 4250 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4251 } 4252 4253 pathParameters := map[string]interface{}{ 4254 "databaseName": autorest.Encode("path", databaseName), 4255 "schemaName": autorest.Encode("path", schemaName), 4256 } 4257 4258 const APIVersion = "2016-11-01" 4259 queryParameters := map[string]interface{}{ 4260 "api-version": APIVersion, 4261 } 4262 if len(filter) > 0 { 4263 queryParameters["$filter"] = autorest.Encode("query", filter) 4264 } 4265 if top != nil { 4266 queryParameters["$top"] = autorest.Encode("query", *top) 4267 } 4268 if skip != nil { 4269 queryParameters["$skip"] = autorest.Encode("query", *skip) 4270 } 4271 if len(selectParameter) > 0 { 4272 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4273 } 4274 if len(orderby) > 0 { 4275 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4276 } 4277 if count != nil { 4278 queryParameters["$count"] = autorest.Encode("query", *count) 4279 } 4280 4281 preparer := autorest.CreatePreparer( 4282 autorest.AsGet(), 4283 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4284 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/statistics", pathParameters), 4285 autorest.WithQueryParameters(queryParameters)) 4286 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4287} 4288 4289// ListTableStatisticsByDatabaseAndSchemaSender sends the ListTableStatisticsByDatabaseAndSchema request. The method will close the 4290// http.Response Body if it receives an error. 4291func (client Client) ListTableStatisticsByDatabaseAndSchemaSender(req *http.Request) (*http.Response, error) { 4292 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4293 return autorest.SendWithSender(client, req, sd...) 4294} 4295 4296// ListTableStatisticsByDatabaseAndSchemaResponder handles the response to the ListTableStatisticsByDatabaseAndSchema request. The method always 4297// closes the http.Response Body. 4298func (client Client) ListTableStatisticsByDatabaseAndSchemaResponder(resp *http.Response) (result USQLTableStatisticsList, err error) { 4299 err = autorest.Respond( 4300 resp, 4301 client.ByInspecting(), 4302 azure.WithErrorUnlessStatusCode(http.StatusOK), 4303 autorest.ByUnmarshallingJSON(&result), 4304 autorest.ByClosing()) 4305 result.Response = autorest.Response{Response: resp} 4306 return 4307} 4308 4309// listTableStatisticsByDatabaseAndSchemaNextResults retrieves the next set of results, if any. 4310func (client Client) listTableStatisticsByDatabaseAndSchemaNextResults(ctx context.Context, lastResults USQLTableStatisticsList) (result USQLTableStatisticsList, err error) { 4311 req, err := lastResults.uSQLTableStatisticsListPreparer(ctx) 4312 if err != nil { 4313 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseAndSchemaNextResults", nil, "Failure preparing next results request") 4314 } 4315 if req == nil { 4316 return 4317 } 4318 resp, err := client.ListTableStatisticsByDatabaseAndSchemaSender(req) 4319 if err != nil { 4320 result.Response = autorest.Response{Response: resp} 4321 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseAndSchemaNextResults", resp, "Failure sending next results request") 4322 } 4323 result, err = client.ListTableStatisticsByDatabaseAndSchemaResponder(resp) 4324 if err != nil { 4325 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsByDatabaseAndSchemaNextResults", resp, "Failure responding to next results request") 4326 } 4327 return 4328} 4329 4330// ListTableStatisticsByDatabaseAndSchemaComplete enumerates all values, automatically crossing page boundaries as required. 4331func (client Client) ListTableStatisticsByDatabaseAndSchemaComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListIterator, err error) { 4332 if tracing.IsEnabled() { 4333 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatisticsByDatabaseAndSchema") 4334 defer func() { 4335 sc := -1 4336 if result.Response().Response.Response != nil { 4337 sc = result.page.Response().Response.Response.StatusCode 4338 } 4339 tracing.EndSpan(ctx, sc, err) 4340 }() 4341 } 4342 result.page, err = client.ListTableStatisticsByDatabaseAndSchema(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4343 return 4344} 4345 4346// ListTableTypes retrieves the list of table types from the Data Lake Analytics catalog. 4347// Parameters: 4348// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4349// databaseName - the name of the database containing the table types. 4350// schemaName - the name of the schema containing the table types. 4351// filter - oData filter. Optional. 4352// top - the number of items to return. Optional. 4353// skip - the number of items to skip over before returning elements. Optional. 4354// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4355// Categories?$select=CategoryName,Description. Optional. 4356// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4357// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4358// Optional. 4359// count - the Boolean value of true or false to request a count of the matching resources included with the 4360// resources in the response, e.g. Categories?$count=true. Optional. 4361func (client Client) ListTableTypes(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableTypeListPage, err error) { 4362 if tracing.IsEnabled() { 4363 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableTypes") 4364 defer func() { 4365 sc := -1 4366 if result.uttl.Response.Response != nil { 4367 sc = result.uttl.Response.Response.StatusCode 4368 } 4369 tracing.EndSpan(ctx, sc, err) 4370 }() 4371 } 4372 if err := validation.Validate([]validation.Validation{ 4373 {TargetValue: top, 4374 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4375 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4376 {TargetValue: skip, 4377 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4378 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4379 return result, validation.NewError("catalog.Client", "ListTableTypes", err.Error()) 4380 } 4381 4382 result.fn = client.listTableTypesNextResults 4383 req, err := client.ListTableTypesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4384 if err != nil { 4385 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", nil, "Failure preparing request") 4386 return 4387 } 4388 4389 resp, err := client.ListTableTypesSender(req) 4390 if err != nil { 4391 result.uttl.Response = autorest.Response{Response: resp} 4392 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", resp, "Failure sending request") 4393 return 4394 } 4395 4396 result.uttl, err = client.ListTableTypesResponder(resp) 4397 if err != nil { 4398 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", resp, "Failure responding to request") 4399 } 4400 4401 return 4402} 4403 4404// ListTableTypesPreparer prepares the ListTableTypes request. 4405func (client Client) ListTableTypesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4406 urlParameters := map[string]interface{}{ 4407 "accountName": accountName, 4408 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4409 } 4410 4411 pathParameters := map[string]interface{}{ 4412 "databaseName": autorest.Encode("path", databaseName), 4413 "schemaName": autorest.Encode("path", schemaName), 4414 } 4415 4416 const APIVersion = "2016-11-01" 4417 queryParameters := map[string]interface{}{ 4418 "api-version": APIVersion, 4419 } 4420 if len(filter) > 0 { 4421 queryParameters["$filter"] = autorest.Encode("query", filter) 4422 } 4423 if top != nil { 4424 queryParameters["$top"] = autorest.Encode("query", *top) 4425 } 4426 if skip != nil { 4427 queryParameters["$skip"] = autorest.Encode("query", *skip) 4428 } 4429 if len(selectParameter) > 0 { 4430 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4431 } 4432 if len(orderby) > 0 { 4433 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4434 } 4435 if count != nil { 4436 queryParameters["$count"] = autorest.Encode("query", *count) 4437 } 4438 4439 preparer := autorest.CreatePreparer( 4440 autorest.AsGet(), 4441 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4442 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes", pathParameters), 4443 autorest.WithQueryParameters(queryParameters)) 4444 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4445} 4446 4447// ListTableTypesSender sends the ListTableTypes request. The method will close the 4448// http.Response Body if it receives an error. 4449func (client Client) ListTableTypesSender(req *http.Request) (*http.Response, error) { 4450 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4451 return autorest.SendWithSender(client, req, sd...) 4452} 4453 4454// ListTableTypesResponder handles the response to the ListTableTypes request. The method always 4455// closes the http.Response Body. 4456func (client Client) ListTableTypesResponder(resp *http.Response) (result USQLTableTypeList, err error) { 4457 err = autorest.Respond( 4458 resp, 4459 client.ByInspecting(), 4460 azure.WithErrorUnlessStatusCode(http.StatusOK), 4461 autorest.ByUnmarshallingJSON(&result), 4462 autorest.ByClosing()) 4463 result.Response = autorest.Response{Response: resp} 4464 return 4465} 4466 4467// listTableTypesNextResults retrieves the next set of results, if any. 4468func (client Client) listTableTypesNextResults(ctx context.Context, lastResults USQLTableTypeList) (result USQLTableTypeList, err error) { 4469 req, err := lastResults.uSQLTableTypeListPreparer(ctx) 4470 if err != nil { 4471 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", nil, "Failure preparing next results request") 4472 } 4473 if req == nil { 4474 return 4475 } 4476 resp, err := client.ListTableTypesSender(req) 4477 if err != nil { 4478 result.Response = autorest.Response{Response: resp} 4479 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", resp, "Failure sending next results request") 4480 } 4481 result, err = client.ListTableTypesResponder(resp) 4482 if err != nil { 4483 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", resp, "Failure responding to next results request") 4484 } 4485 return 4486} 4487 4488// ListTableTypesComplete enumerates all values, automatically crossing page boundaries as required. 4489func (client Client) ListTableTypesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableTypeListIterator, err error) { 4490 if tracing.IsEnabled() { 4491 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableTypes") 4492 defer func() { 4493 sc := -1 4494 if result.Response().Response.Response != nil { 4495 sc = result.page.Response().Response.Response.StatusCode 4496 } 4497 tracing.EndSpan(ctx, sc, err) 4498 }() 4499 } 4500 result.page, err = client.ListTableTypes(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4501 return 4502} 4503 4504// ListTableValuedFunctions retrieves the list of table valued functions from the Data Lake Analytics catalog. 4505// Parameters: 4506// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4507// databaseName - the name of the database containing the table valued functions. 4508// schemaName - the name of the schema containing the table valued functions. 4509// filter - oData filter. Optional. 4510// top - the number of items to return. Optional. 4511// skip - the number of items to skip over before returning elements. Optional. 4512// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4513// Categories?$select=CategoryName,Description. Optional. 4514// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4515// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4516// Optional. 4517// count - the Boolean value of true or false to request a count of the matching resources included with the 4518// resources in the response, e.g. Categories?$count=true. Optional. 4519func (client Client) ListTableValuedFunctions(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListPage, err error) { 4520 if tracing.IsEnabled() { 4521 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctions") 4522 defer func() { 4523 sc := -1 4524 if result.utvfl.Response.Response != nil { 4525 sc = result.utvfl.Response.Response.StatusCode 4526 } 4527 tracing.EndSpan(ctx, sc, err) 4528 }() 4529 } 4530 if err := validation.Validate([]validation.Validation{ 4531 {TargetValue: top, 4532 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4533 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4534 {TargetValue: skip, 4535 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4536 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4537 return result, validation.NewError("catalog.Client", "ListTableValuedFunctions", err.Error()) 4538 } 4539 4540 result.fn = client.listTableValuedFunctionsNextResults 4541 req, err := client.ListTableValuedFunctionsPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4542 if err != nil { 4543 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", nil, "Failure preparing request") 4544 return 4545 } 4546 4547 resp, err := client.ListTableValuedFunctionsSender(req) 4548 if err != nil { 4549 result.utvfl.Response = autorest.Response{Response: resp} 4550 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", resp, "Failure sending request") 4551 return 4552 } 4553 4554 result.utvfl, err = client.ListTableValuedFunctionsResponder(resp) 4555 if err != nil { 4556 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", resp, "Failure responding to request") 4557 } 4558 4559 return 4560} 4561 4562// ListTableValuedFunctionsPreparer prepares the ListTableValuedFunctions request. 4563func (client Client) ListTableValuedFunctionsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4564 urlParameters := map[string]interface{}{ 4565 "accountName": accountName, 4566 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4567 } 4568 4569 pathParameters := map[string]interface{}{ 4570 "databaseName": autorest.Encode("path", databaseName), 4571 "schemaName": autorest.Encode("path", schemaName), 4572 } 4573 4574 const APIVersion = "2016-11-01" 4575 queryParameters := map[string]interface{}{ 4576 "api-version": APIVersion, 4577 } 4578 if len(filter) > 0 { 4579 queryParameters["$filter"] = autorest.Encode("query", filter) 4580 } 4581 if top != nil { 4582 queryParameters["$top"] = autorest.Encode("query", *top) 4583 } 4584 if skip != nil { 4585 queryParameters["$skip"] = autorest.Encode("query", *skip) 4586 } 4587 if len(selectParameter) > 0 { 4588 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4589 } 4590 if len(orderby) > 0 { 4591 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4592 } 4593 if count != nil { 4594 queryParameters["$count"] = autorest.Encode("query", *count) 4595 } 4596 4597 preparer := autorest.CreatePreparer( 4598 autorest.AsGet(), 4599 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4600 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions", pathParameters), 4601 autorest.WithQueryParameters(queryParameters)) 4602 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4603} 4604 4605// ListTableValuedFunctionsSender sends the ListTableValuedFunctions request. The method will close the 4606// http.Response Body if it receives an error. 4607func (client Client) ListTableValuedFunctionsSender(req *http.Request) (*http.Response, error) { 4608 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4609 return autorest.SendWithSender(client, req, sd...) 4610} 4611 4612// ListTableValuedFunctionsResponder handles the response to the ListTableValuedFunctions request. The method always 4613// closes the http.Response Body. 4614func (client Client) ListTableValuedFunctionsResponder(resp *http.Response) (result USQLTableValuedFunctionList, err error) { 4615 err = autorest.Respond( 4616 resp, 4617 client.ByInspecting(), 4618 azure.WithErrorUnlessStatusCode(http.StatusOK), 4619 autorest.ByUnmarshallingJSON(&result), 4620 autorest.ByClosing()) 4621 result.Response = autorest.Response{Response: resp} 4622 return 4623} 4624 4625// listTableValuedFunctionsNextResults retrieves the next set of results, if any. 4626func (client Client) listTableValuedFunctionsNextResults(ctx context.Context, lastResults USQLTableValuedFunctionList) (result USQLTableValuedFunctionList, err error) { 4627 req, err := lastResults.uSQLTableValuedFunctionListPreparer(ctx) 4628 if err != nil { 4629 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", nil, "Failure preparing next results request") 4630 } 4631 if req == nil { 4632 return 4633 } 4634 resp, err := client.ListTableValuedFunctionsSender(req) 4635 if err != nil { 4636 result.Response = autorest.Response{Response: resp} 4637 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", resp, "Failure sending next results request") 4638 } 4639 result, err = client.ListTableValuedFunctionsResponder(resp) 4640 if err != nil { 4641 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", resp, "Failure responding to next results request") 4642 } 4643 return 4644} 4645 4646// ListTableValuedFunctionsComplete enumerates all values, automatically crossing page boundaries as required. 4647func (client Client) ListTableValuedFunctionsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListIterator, err error) { 4648 if tracing.IsEnabled() { 4649 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctions") 4650 defer func() { 4651 sc := -1 4652 if result.Response().Response.Response != nil { 4653 sc = result.page.Response().Response.Response.StatusCode 4654 } 4655 tracing.EndSpan(ctx, sc, err) 4656 }() 4657 } 4658 result.page, err = client.ListTableValuedFunctions(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4659 return 4660} 4661 4662// ListTableValuedFunctionsByDatabase retrieves the list of all table valued functions in a database from the Data Lake 4663// Analytics catalog. 4664// Parameters: 4665// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4666// databaseName - the name of the database containing the table valued functions. 4667// filter - oData filter. Optional. 4668// top - the number of items to return. Optional. 4669// skip - the number of items to skip over before returning elements. Optional. 4670// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4671// Categories?$select=CategoryName,Description. Optional. 4672// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4673// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4674// Optional. 4675// count - the Boolean value of true or false to request a count of the matching resources included with the 4676// resources in the response, e.g. Categories?$count=true. Optional. 4677func (client Client) ListTableValuedFunctionsByDatabase(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListPage, err error) { 4678 if tracing.IsEnabled() { 4679 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctionsByDatabase") 4680 defer func() { 4681 sc := -1 4682 if result.utvfl.Response.Response != nil { 4683 sc = result.utvfl.Response.Response.StatusCode 4684 } 4685 tracing.EndSpan(ctx, sc, err) 4686 }() 4687 } 4688 if err := validation.Validate([]validation.Validation{ 4689 {TargetValue: top, 4690 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4691 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4692 {TargetValue: skip, 4693 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4694 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4695 return result, validation.NewError("catalog.Client", "ListTableValuedFunctionsByDatabase", err.Error()) 4696 } 4697 4698 result.fn = client.listTableValuedFunctionsByDatabaseNextResults 4699 req, err := client.ListTableValuedFunctionsByDatabasePreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 4700 if err != nil { 4701 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctionsByDatabase", nil, "Failure preparing request") 4702 return 4703 } 4704 4705 resp, err := client.ListTableValuedFunctionsByDatabaseSender(req) 4706 if err != nil { 4707 result.utvfl.Response = autorest.Response{Response: resp} 4708 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctionsByDatabase", resp, "Failure sending request") 4709 return 4710 } 4711 4712 result.utvfl, err = client.ListTableValuedFunctionsByDatabaseResponder(resp) 4713 if err != nil { 4714 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctionsByDatabase", resp, "Failure responding to request") 4715 } 4716 4717 return 4718} 4719 4720// ListTableValuedFunctionsByDatabasePreparer prepares the ListTableValuedFunctionsByDatabase request. 4721func (client Client) ListTableValuedFunctionsByDatabasePreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4722 urlParameters := map[string]interface{}{ 4723 "accountName": accountName, 4724 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4725 } 4726 4727 pathParameters := map[string]interface{}{ 4728 "databaseName": autorest.Encode("path", databaseName), 4729 } 4730 4731 const APIVersion = "2016-11-01" 4732 queryParameters := map[string]interface{}{ 4733 "api-version": APIVersion, 4734 } 4735 if len(filter) > 0 { 4736 queryParameters["$filter"] = autorest.Encode("query", filter) 4737 } 4738 if top != nil { 4739 queryParameters["$top"] = autorest.Encode("query", *top) 4740 } 4741 if skip != nil { 4742 queryParameters["$skip"] = autorest.Encode("query", *skip) 4743 } 4744 if len(selectParameter) > 0 { 4745 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4746 } 4747 if len(orderby) > 0 { 4748 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4749 } 4750 if count != nil { 4751 queryParameters["$count"] = autorest.Encode("query", *count) 4752 } 4753 4754 preparer := autorest.CreatePreparer( 4755 autorest.AsGet(), 4756 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4757 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/tablevaluedfunctions", pathParameters), 4758 autorest.WithQueryParameters(queryParameters)) 4759 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4760} 4761 4762// ListTableValuedFunctionsByDatabaseSender sends the ListTableValuedFunctionsByDatabase request. The method will close the 4763// http.Response Body if it receives an error. 4764func (client Client) ListTableValuedFunctionsByDatabaseSender(req *http.Request) (*http.Response, error) { 4765 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4766 return autorest.SendWithSender(client, req, sd...) 4767} 4768 4769// ListTableValuedFunctionsByDatabaseResponder handles the response to the ListTableValuedFunctionsByDatabase request. The method always 4770// closes the http.Response Body. 4771func (client Client) ListTableValuedFunctionsByDatabaseResponder(resp *http.Response) (result USQLTableValuedFunctionList, err error) { 4772 err = autorest.Respond( 4773 resp, 4774 client.ByInspecting(), 4775 azure.WithErrorUnlessStatusCode(http.StatusOK), 4776 autorest.ByUnmarshallingJSON(&result), 4777 autorest.ByClosing()) 4778 result.Response = autorest.Response{Response: resp} 4779 return 4780} 4781 4782// listTableValuedFunctionsByDatabaseNextResults retrieves the next set of results, if any. 4783func (client Client) listTableValuedFunctionsByDatabaseNextResults(ctx context.Context, lastResults USQLTableValuedFunctionList) (result USQLTableValuedFunctionList, err error) { 4784 req, err := lastResults.uSQLTableValuedFunctionListPreparer(ctx) 4785 if err != nil { 4786 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsByDatabaseNextResults", nil, "Failure preparing next results request") 4787 } 4788 if req == nil { 4789 return 4790 } 4791 resp, err := client.ListTableValuedFunctionsByDatabaseSender(req) 4792 if err != nil { 4793 result.Response = autorest.Response{Response: resp} 4794 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsByDatabaseNextResults", resp, "Failure sending next results request") 4795 } 4796 result, err = client.ListTableValuedFunctionsByDatabaseResponder(resp) 4797 if err != nil { 4798 err = autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsByDatabaseNextResults", resp, "Failure responding to next results request") 4799 } 4800 return 4801} 4802 4803// ListTableValuedFunctionsByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. 4804func (client Client) ListTableValuedFunctionsByDatabaseComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListIterator, err error) { 4805 if tracing.IsEnabled() { 4806 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctionsByDatabase") 4807 defer func() { 4808 sc := -1 4809 if result.Response().Response.Response != nil { 4810 sc = result.page.Response().Response.Response.StatusCode 4811 } 4812 tracing.EndSpan(ctx, sc, err) 4813 }() 4814 } 4815 result.page, err = client.ListTableValuedFunctionsByDatabase(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 4816 return 4817} 4818 4819// ListTypes retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. 4820// Parameters: 4821// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4822// databaseName - the name of the database containing the types. 4823// schemaName - the name of the schema containing the types. 4824// filter - oData filter. Optional. 4825// top - the number of items to return. Optional. 4826// skip - the number of items to skip over before returning elements. Optional. 4827// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4828// Categories?$select=CategoryName,Description. Optional. 4829// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4830// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4831// Optional. 4832// count - the Boolean value of true or false to request a count of the matching resources included with the 4833// resources in the response, e.g. Categories?$count=true. Optional. 4834func (client Client) ListTypes(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTypeListPage, err error) { 4835 if tracing.IsEnabled() { 4836 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTypes") 4837 defer func() { 4838 sc := -1 4839 if result.utl.Response.Response != nil { 4840 sc = result.utl.Response.Response.StatusCode 4841 } 4842 tracing.EndSpan(ctx, sc, err) 4843 }() 4844 } 4845 if err := validation.Validate([]validation.Validation{ 4846 {TargetValue: top, 4847 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 4848 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 4849 {TargetValue: skip, 4850 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 4851 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 4852 return result, validation.NewError("catalog.Client", "ListTypes", err.Error()) 4853 } 4854 4855 result.fn = client.listTypesNextResults 4856 req, err := client.ListTypesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4857 if err != nil { 4858 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", nil, "Failure preparing request") 4859 return 4860 } 4861 4862 resp, err := client.ListTypesSender(req) 4863 if err != nil { 4864 result.utl.Response = autorest.Response{Response: resp} 4865 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", resp, "Failure sending request") 4866 return 4867 } 4868 4869 result.utl, err = client.ListTypesResponder(resp) 4870 if err != nil { 4871 err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", resp, "Failure responding to request") 4872 } 4873 4874 return 4875} 4876 4877// ListTypesPreparer prepares the ListTypes request. 4878func (client Client) ListTypesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 4879 urlParameters := map[string]interface{}{ 4880 "accountName": accountName, 4881 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 4882 } 4883 4884 pathParameters := map[string]interface{}{ 4885 "databaseName": autorest.Encode("path", databaseName), 4886 "schemaName": autorest.Encode("path", schemaName), 4887 } 4888 4889 const APIVersion = "2016-11-01" 4890 queryParameters := map[string]interface{}{ 4891 "api-version": APIVersion, 4892 } 4893 if len(filter) > 0 { 4894 queryParameters["$filter"] = autorest.Encode("query", filter) 4895 } 4896 if top != nil { 4897 queryParameters["$top"] = autorest.Encode("query", *top) 4898 } 4899 if skip != nil { 4900 queryParameters["$skip"] = autorest.Encode("query", *skip) 4901 } 4902 if len(selectParameter) > 0 { 4903 queryParameters["$select"] = autorest.Encode("query", selectParameter) 4904 } 4905 if len(orderby) > 0 { 4906 queryParameters["$orderby"] = autorest.Encode("query", orderby) 4907 } 4908 if count != nil { 4909 queryParameters["$count"] = autorest.Encode("query", *count) 4910 } 4911 4912 preparer := autorest.CreatePreparer( 4913 autorest.AsGet(), 4914 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 4915 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/types", pathParameters), 4916 autorest.WithQueryParameters(queryParameters)) 4917 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4918} 4919 4920// ListTypesSender sends the ListTypes request. The method will close the 4921// http.Response Body if it receives an error. 4922func (client Client) ListTypesSender(req *http.Request) (*http.Response, error) { 4923 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4924 return autorest.SendWithSender(client, req, sd...) 4925} 4926 4927// ListTypesResponder handles the response to the ListTypes request. The method always 4928// closes the http.Response Body. 4929func (client Client) ListTypesResponder(resp *http.Response) (result USQLTypeList, err error) { 4930 err = autorest.Respond( 4931 resp, 4932 client.ByInspecting(), 4933 azure.WithErrorUnlessStatusCode(http.StatusOK), 4934 autorest.ByUnmarshallingJSON(&result), 4935 autorest.ByClosing()) 4936 result.Response = autorest.Response{Response: resp} 4937 return 4938} 4939 4940// listTypesNextResults retrieves the next set of results, if any. 4941func (client Client) listTypesNextResults(ctx context.Context, lastResults USQLTypeList) (result USQLTypeList, err error) { 4942 req, err := lastResults.uSQLTypeListPreparer(ctx) 4943 if err != nil { 4944 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", nil, "Failure preparing next results request") 4945 } 4946 if req == nil { 4947 return 4948 } 4949 resp, err := client.ListTypesSender(req) 4950 if err != nil { 4951 result.Response = autorest.Response{Response: resp} 4952 return result, autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", resp, "Failure sending next results request") 4953 } 4954 result, err = client.ListTypesResponder(resp) 4955 if err != nil { 4956 err = autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", resp, "Failure responding to next results request") 4957 } 4958 return 4959} 4960 4961// ListTypesComplete enumerates all values, automatically crossing page boundaries as required. 4962func (client Client) ListTypesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLTypeListIterator, err error) { 4963 if tracing.IsEnabled() { 4964 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTypes") 4965 defer func() { 4966 sc := -1 4967 if result.Response().Response.Response != nil { 4968 sc = result.page.Response().Response.Response.StatusCode 4969 } 4970 tracing.EndSpan(ctx, sc, err) 4971 }() 4972 } 4973 result.page, err = client.ListTypes(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 4974 return 4975} 4976 4977// ListViews retrieves the list of views from the Data Lake Analytics catalog. 4978// Parameters: 4979// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 4980// databaseName - the name of the database containing the views. 4981// schemaName - the name of the schema containing the views. 4982// filter - oData filter. Optional. 4983// top - the number of items to return. Optional. 4984// skip - the number of items to skip over before returning elements. Optional. 4985// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 4986// Categories?$select=CategoryName,Description. Optional. 4987// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 4988// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 4989// Optional. 4990// count - the Boolean value of true or false to request a count of the matching resources included with the 4991// resources in the response, e.g. Categories?$count=true. Optional. 4992func (client Client) ListViews(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLViewListPage, err error) { 4993 if tracing.IsEnabled() { 4994 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViews") 4995 defer func() { 4996 sc := -1 4997 if result.uvl.Response.Response != nil { 4998 sc = result.uvl.Response.Response.StatusCode 4999 } 5000 tracing.EndSpan(ctx, sc, err) 5001 }() 5002 } 5003 if err := validation.Validate([]validation.Validation{ 5004 {TargetValue: top, 5005 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 5006 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 5007 {TargetValue: skip, 5008 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 5009 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 5010 return result, validation.NewError("catalog.Client", "ListViews", err.Error()) 5011 } 5012 5013 result.fn = client.listViewsNextResults 5014 req, err := client.ListViewsPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 5015 if err != nil { 5016 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", nil, "Failure preparing request") 5017 return 5018 } 5019 5020 resp, err := client.ListViewsSender(req) 5021 if err != nil { 5022 result.uvl.Response = autorest.Response{Response: resp} 5023 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", resp, "Failure sending request") 5024 return 5025 } 5026 5027 result.uvl, err = client.ListViewsResponder(resp) 5028 if err != nil { 5029 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", resp, "Failure responding to request") 5030 } 5031 5032 return 5033} 5034 5035// ListViewsPreparer prepares the ListViews request. 5036func (client Client) ListViewsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 5037 urlParameters := map[string]interface{}{ 5038 "accountName": accountName, 5039 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5040 } 5041 5042 pathParameters := map[string]interface{}{ 5043 "databaseName": autorest.Encode("path", databaseName), 5044 "schemaName": autorest.Encode("path", schemaName), 5045 } 5046 5047 const APIVersion = "2016-11-01" 5048 queryParameters := map[string]interface{}{ 5049 "api-version": APIVersion, 5050 } 5051 if len(filter) > 0 { 5052 queryParameters["$filter"] = autorest.Encode("query", filter) 5053 } 5054 if top != nil { 5055 queryParameters["$top"] = autorest.Encode("query", *top) 5056 } 5057 if skip != nil { 5058 queryParameters["$skip"] = autorest.Encode("query", *skip) 5059 } 5060 if len(selectParameter) > 0 { 5061 queryParameters["$select"] = autorest.Encode("query", selectParameter) 5062 } 5063 if len(orderby) > 0 { 5064 queryParameters["$orderby"] = autorest.Encode("query", orderby) 5065 } 5066 if count != nil { 5067 queryParameters["$count"] = autorest.Encode("query", *count) 5068 } 5069 5070 preparer := autorest.CreatePreparer( 5071 autorest.AsGet(), 5072 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5073 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views", pathParameters), 5074 autorest.WithQueryParameters(queryParameters)) 5075 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5076} 5077 5078// ListViewsSender sends the ListViews request. The method will close the 5079// http.Response Body if it receives an error. 5080func (client Client) ListViewsSender(req *http.Request) (*http.Response, error) { 5081 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5082 return autorest.SendWithSender(client, req, sd...) 5083} 5084 5085// ListViewsResponder handles the response to the ListViews request. The method always 5086// closes the http.Response Body. 5087func (client Client) ListViewsResponder(resp *http.Response) (result USQLViewList, err error) { 5088 err = autorest.Respond( 5089 resp, 5090 client.ByInspecting(), 5091 azure.WithErrorUnlessStatusCode(http.StatusOK), 5092 autorest.ByUnmarshallingJSON(&result), 5093 autorest.ByClosing()) 5094 result.Response = autorest.Response{Response: resp} 5095 return 5096} 5097 5098// listViewsNextResults retrieves the next set of results, if any. 5099func (client Client) listViewsNextResults(ctx context.Context, lastResults USQLViewList) (result USQLViewList, err error) { 5100 req, err := lastResults.uSQLViewListPreparer(ctx) 5101 if err != nil { 5102 return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", nil, "Failure preparing next results request") 5103 } 5104 if req == nil { 5105 return 5106 } 5107 resp, err := client.ListViewsSender(req) 5108 if err != nil { 5109 result.Response = autorest.Response{Response: resp} 5110 return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", resp, "Failure sending next results request") 5111 } 5112 result, err = client.ListViewsResponder(resp) 5113 if err != nil { 5114 err = autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", resp, "Failure responding to next results request") 5115 } 5116 return 5117} 5118 5119// ListViewsComplete enumerates all values, automatically crossing page boundaries as required. 5120func (client Client) ListViewsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLViewListIterator, err error) { 5121 if tracing.IsEnabled() { 5122 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViews") 5123 defer func() { 5124 sc := -1 5125 if result.Response().Response.Response != nil { 5126 sc = result.page.Response().Response.Response.StatusCode 5127 } 5128 tracing.EndSpan(ctx, sc, err) 5129 }() 5130 } 5131 result.page, err = client.ListViews(ctx, accountName, databaseName, schemaName, filter, top, skip, selectParameter, orderby, count) 5132 return 5133} 5134 5135// ListViewsByDatabase retrieves the list of all views in a database from the Data Lake Analytics catalog. 5136// Parameters: 5137// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5138// databaseName - the name of the database containing the views. 5139// filter - oData filter. Optional. 5140// top - the number of items to return. Optional. 5141// skip - the number of items to skip over before returning elements. Optional. 5142// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 5143// Categories?$select=CategoryName,Description. Optional. 5144// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 5145// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 5146// Optional. 5147// count - the Boolean value of true or false to request a count of the matching resources included with the 5148// resources in the response, e.g. Categories?$count=true. Optional. 5149func (client Client) ListViewsByDatabase(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLViewListPage, err error) { 5150 if tracing.IsEnabled() { 5151 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViewsByDatabase") 5152 defer func() { 5153 sc := -1 5154 if result.uvl.Response.Response != nil { 5155 sc = result.uvl.Response.Response.StatusCode 5156 } 5157 tracing.EndSpan(ctx, sc, err) 5158 }() 5159 } 5160 if err := validation.Validate([]validation.Validation{ 5161 {TargetValue: top, 5162 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 5163 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 5164 {TargetValue: skip, 5165 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 5166 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { 5167 return result, validation.NewError("catalog.Client", "ListViewsByDatabase", err.Error()) 5168 } 5169 5170 result.fn = client.listViewsByDatabaseNextResults 5171 req, err := client.ListViewsByDatabasePreparer(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 5172 if err != nil { 5173 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViewsByDatabase", nil, "Failure preparing request") 5174 return 5175 } 5176 5177 resp, err := client.ListViewsByDatabaseSender(req) 5178 if err != nil { 5179 result.uvl.Response = autorest.Response{Response: resp} 5180 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViewsByDatabase", resp, "Failure sending request") 5181 return 5182 } 5183 5184 result.uvl, err = client.ListViewsByDatabaseResponder(resp) 5185 if err != nil { 5186 err = autorest.NewErrorWithError(err, "catalog.Client", "ListViewsByDatabase", resp, "Failure responding to request") 5187 } 5188 5189 return 5190} 5191 5192// ListViewsByDatabasePreparer prepares the ListViewsByDatabase request. 5193func (client Client) ListViewsByDatabasePreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (*http.Request, error) { 5194 urlParameters := map[string]interface{}{ 5195 "accountName": accountName, 5196 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5197 } 5198 5199 pathParameters := map[string]interface{}{ 5200 "databaseName": autorest.Encode("path", databaseName), 5201 } 5202 5203 const APIVersion = "2016-11-01" 5204 queryParameters := map[string]interface{}{ 5205 "api-version": APIVersion, 5206 } 5207 if len(filter) > 0 { 5208 queryParameters["$filter"] = autorest.Encode("query", filter) 5209 } 5210 if top != nil { 5211 queryParameters["$top"] = autorest.Encode("query", *top) 5212 } 5213 if skip != nil { 5214 queryParameters["$skip"] = autorest.Encode("query", *skip) 5215 } 5216 if len(selectParameter) > 0 { 5217 queryParameters["$select"] = autorest.Encode("query", selectParameter) 5218 } 5219 if len(orderby) > 0 { 5220 queryParameters["$orderby"] = autorest.Encode("query", orderby) 5221 } 5222 if count != nil { 5223 queryParameters["$count"] = autorest.Encode("query", *count) 5224 } 5225 5226 preparer := autorest.CreatePreparer( 5227 autorest.AsGet(), 5228 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5229 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/views", pathParameters), 5230 autorest.WithQueryParameters(queryParameters)) 5231 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5232} 5233 5234// ListViewsByDatabaseSender sends the ListViewsByDatabase request. The method will close the 5235// http.Response Body if it receives an error. 5236func (client Client) ListViewsByDatabaseSender(req *http.Request) (*http.Response, error) { 5237 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5238 return autorest.SendWithSender(client, req, sd...) 5239} 5240 5241// ListViewsByDatabaseResponder handles the response to the ListViewsByDatabase request. The method always 5242// closes the http.Response Body. 5243func (client Client) ListViewsByDatabaseResponder(resp *http.Response) (result USQLViewList, err error) { 5244 err = autorest.Respond( 5245 resp, 5246 client.ByInspecting(), 5247 azure.WithErrorUnlessStatusCode(http.StatusOK), 5248 autorest.ByUnmarshallingJSON(&result), 5249 autorest.ByClosing()) 5250 result.Response = autorest.Response{Response: resp} 5251 return 5252} 5253 5254// listViewsByDatabaseNextResults retrieves the next set of results, if any. 5255func (client Client) listViewsByDatabaseNextResults(ctx context.Context, lastResults USQLViewList) (result USQLViewList, err error) { 5256 req, err := lastResults.uSQLViewListPreparer(ctx) 5257 if err != nil { 5258 return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsByDatabaseNextResults", nil, "Failure preparing next results request") 5259 } 5260 if req == nil { 5261 return 5262 } 5263 resp, err := client.ListViewsByDatabaseSender(req) 5264 if err != nil { 5265 result.Response = autorest.Response{Response: resp} 5266 return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsByDatabaseNextResults", resp, "Failure sending next results request") 5267 } 5268 result, err = client.ListViewsByDatabaseResponder(resp) 5269 if err != nil { 5270 err = autorest.NewErrorWithError(err, "catalog.Client", "listViewsByDatabaseNextResults", resp, "Failure responding to next results request") 5271 } 5272 return 5273} 5274 5275// ListViewsByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. 5276func (client Client) ListViewsByDatabaseComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, selectParameter string, orderby string, count *bool) (result USQLViewListIterator, err error) { 5277 if tracing.IsEnabled() { 5278 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViewsByDatabase") 5279 defer func() { 5280 sc := -1 5281 if result.Response().Response.Response != nil { 5282 sc = result.page.Response().Response.Response.StatusCode 5283 } 5284 tracing.EndSpan(ctx, sc, err) 5285 }() 5286 } 5287 result.page, err = client.ListViewsByDatabase(ctx, accountName, databaseName, filter, top, skip, selectParameter, orderby, count) 5288 return 5289} 5290 5291// PreviewTable retrieves a preview set of rows in given table. 5292// Parameters: 5293// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5294// databaseName - the name of the database containing the table. 5295// schemaName - the name of the schema containing the table. 5296// tableName - the name of the table. 5297// maxRows - the maximum number of preview rows to be retrieved. Rows returned may be less than or equal to 5298// this number depending on row sizes and number of rows in the table. 5299// maxColumns - the maximum number of columns to be retrieved. 5300func (client Client) PreviewTable(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, maxRows *int64, maxColumns *int64) (result USQLTablePreview, err error) { 5301 if tracing.IsEnabled() { 5302 ctx = tracing.StartSpan(ctx, fqdn+"/Client.PreviewTable") 5303 defer func() { 5304 sc := -1 5305 if result.Response.Response != nil { 5306 sc = result.Response.Response.StatusCode 5307 } 5308 tracing.EndSpan(ctx, sc, err) 5309 }() 5310 } 5311 req, err := client.PreviewTablePreparer(ctx, accountName, databaseName, schemaName, tableName, maxRows, maxColumns) 5312 if err != nil { 5313 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTable", nil, "Failure preparing request") 5314 return 5315 } 5316 5317 resp, err := client.PreviewTableSender(req) 5318 if err != nil { 5319 result.Response = autorest.Response{Response: resp} 5320 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTable", resp, "Failure sending request") 5321 return 5322 } 5323 5324 result, err = client.PreviewTableResponder(resp) 5325 if err != nil { 5326 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTable", resp, "Failure responding to request") 5327 } 5328 5329 return 5330} 5331 5332// PreviewTablePreparer prepares the PreviewTable request. 5333func (client Client) PreviewTablePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, maxRows *int64, maxColumns *int64) (*http.Request, error) { 5334 urlParameters := map[string]interface{}{ 5335 "accountName": accountName, 5336 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5337 } 5338 5339 pathParameters := map[string]interface{}{ 5340 "databaseName": autorest.Encode("path", databaseName), 5341 "schemaName": autorest.Encode("path", schemaName), 5342 "tableName": autorest.Encode("path", tableName), 5343 } 5344 5345 const APIVersion = "2016-11-01" 5346 queryParameters := map[string]interface{}{ 5347 "api-version": APIVersion, 5348 } 5349 if maxRows != nil { 5350 queryParameters["maxRows"] = autorest.Encode("query", *maxRows) 5351 } 5352 if maxColumns != nil { 5353 queryParameters["maxColumns"] = autorest.Encode("query", *maxColumns) 5354 } 5355 5356 preparer := autorest.CreatePreparer( 5357 autorest.AsGet(), 5358 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5359 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/previewrows", pathParameters), 5360 autorest.WithQueryParameters(queryParameters)) 5361 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5362} 5363 5364// PreviewTableSender sends the PreviewTable request. The method will close the 5365// http.Response Body if it receives an error. 5366func (client Client) PreviewTableSender(req *http.Request) (*http.Response, error) { 5367 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5368 return autorest.SendWithSender(client, req, sd...) 5369} 5370 5371// PreviewTableResponder handles the response to the PreviewTable request. The method always 5372// closes the http.Response Body. 5373func (client Client) PreviewTableResponder(resp *http.Response) (result USQLTablePreview, err error) { 5374 err = autorest.Respond( 5375 resp, 5376 client.ByInspecting(), 5377 azure.WithErrorUnlessStatusCode(http.StatusOK), 5378 autorest.ByUnmarshallingJSON(&result), 5379 autorest.ByClosing()) 5380 result.Response = autorest.Response{Response: resp} 5381 return 5382} 5383 5384// PreviewTablePartition retrieves a preview set of rows in given partition. 5385// Parameters: 5386// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5387// databaseName - the name of the database containing the partition. 5388// schemaName - the name of the schema containing the partition. 5389// tableName - the name of the table containing the partition. 5390// partitionName - the name of the table partition. 5391// maxRows - the maximum number of preview rows to be retrieved.Rows returned may be less than or equal to this 5392// number depending on row sizes and number of rows in the partition. 5393// maxColumns - the maximum number of columns to be retrieved. 5394func (client Client) PreviewTablePartition(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string, maxRows *int64, maxColumns *int64) (result USQLTablePreview, err error) { 5395 if tracing.IsEnabled() { 5396 ctx = tracing.StartSpan(ctx, fqdn+"/Client.PreviewTablePartition") 5397 defer func() { 5398 sc := -1 5399 if result.Response.Response != nil { 5400 sc = result.Response.Response.StatusCode 5401 } 5402 tracing.EndSpan(ctx, sc, err) 5403 }() 5404 } 5405 req, err := client.PreviewTablePartitionPreparer(ctx, accountName, databaseName, schemaName, tableName, partitionName, maxRows, maxColumns) 5406 if err != nil { 5407 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTablePartition", nil, "Failure preparing request") 5408 return 5409 } 5410 5411 resp, err := client.PreviewTablePartitionSender(req) 5412 if err != nil { 5413 result.Response = autorest.Response{Response: resp} 5414 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTablePartition", resp, "Failure sending request") 5415 return 5416 } 5417 5418 result, err = client.PreviewTablePartitionResponder(resp) 5419 if err != nil { 5420 err = autorest.NewErrorWithError(err, "catalog.Client", "PreviewTablePartition", resp, "Failure responding to request") 5421 } 5422 5423 return 5424} 5425 5426// PreviewTablePartitionPreparer prepares the PreviewTablePartition request. 5427func (client Client) PreviewTablePartitionPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string, maxRows *int64, maxColumns *int64) (*http.Request, error) { 5428 urlParameters := map[string]interface{}{ 5429 "accountName": accountName, 5430 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5431 } 5432 5433 pathParameters := map[string]interface{}{ 5434 "databaseName": autorest.Encode("path", databaseName), 5435 "partitionName": autorest.Encode("path", partitionName), 5436 "schemaName": autorest.Encode("path", schemaName), 5437 "tableName": autorest.Encode("path", tableName), 5438 } 5439 5440 const APIVersion = "2016-11-01" 5441 queryParameters := map[string]interface{}{ 5442 "api-version": APIVersion, 5443 } 5444 if maxRows != nil { 5445 queryParameters["maxRows"] = autorest.Encode("query", *maxRows) 5446 } 5447 if maxColumns != nil { 5448 queryParameters["maxColumns"] = autorest.Encode("query", *maxColumns) 5449 } 5450 5451 preparer := autorest.CreatePreparer( 5452 autorest.AsGet(), 5453 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5454 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}/previewrows", pathParameters), 5455 autorest.WithQueryParameters(queryParameters)) 5456 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5457} 5458 5459// PreviewTablePartitionSender sends the PreviewTablePartition request. The method will close the 5460// http.Response Body if it receives an error. 5461func (client Client) PreviewTablePartitionSender(req *http.Request) (*http.Response, error) { 5462 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5463 return autorest.SendWithSender(client, req, sd...) 5464} 5465 5466// PreviewTablePartitionResponder handles the response to the PreviewTablePartition request. The method always 5467// closes the http.Response Body. 5468func (client Client) PreviewTablePartitionResponder(resp *http.Response) (result USQLTablePreview, err error) { 5469 err = autorest.Respond( 5470 resp, 5471 client.ByInspecting(), 5472 azure.WithErrorUnlessStatusCode(http.StatusOK), 5473 autorest.ByUnmarshallingJSON(&result), 5474 autorest.ByClosing()) 5475 result.Response = autorest.Response{Response: resp} 5476 return 5477} 5478 5479// RevokeACL revokes an access control list (ACL) entry from the Data Lake Analytics catalog. 5480// Parameters: 5481// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5482// parameters - parameters supplied to delete an access control list (ACL) entry from a Data Lake Analytics 5483// catalog. 5484func (client Client) RevokeACL(ctx context.Context, accountName string, parameters ACLDeleteParameters) (result autorest.Response, err error) { 5485 if tracing.IsEnabled() { 5486 ctx = tracing.StartSpan(ctx, fqdn+"/Client.RevokeACL") 5487 defer func() { 5488 sc := -1 5489 if result.Response != nil { 5490 sc = result.Response.StatusCode 5491 } 5492 tracing.EndSpan(ctx, sc, err) 5493 }() 5494 } 5495 if err := validation.Validate([]validation.Validation{ 5496 {TargetValue: parameters, 5497 Constraints: []validation.Constraint{{Target: "parameters.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 5498 return result, validation.NewError("catalog.Client", "RevokeACL", err.Error()) 5499 } 5500 5501 req, err := client.RevokeACLPreparer(ctx, accountName, parameters) 5502 if err != nil { 5503 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACL", nil, "Failure preparing request") 5504 return 5505 } 5506 5507 resp, err := client.RevokeACLSender(req) 5508 if err != nil { 5509 result.Response = resp 5510 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACL", resp, "Failure sending request") 5511 return 5512 } 5513 5514 result, err = client.RevokeACLResponder(resp) 5515 if err != nil { 5516 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACL", resp, "Failure responding to request") 5517 } 5518 5519 return 5520} 5521 5522// RevokeACLPreparer prepares the RevokeACL request. 5523func (client Client) RevokeACLPreparer(ctx context.Context, accountName string, parameters ACLDeleteParameters) (*http.Request, error) { 5524 urlParameters := map[string]interface{}{ 5525 "accountName": accountName, 5526 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5527 } 5528 5529 const APIVersion = "2016-11-01" 5530 queryParameters := map[string]interface{}{ 5531 "api-version": APIVersion, 5532 "op": autorest.Encode("query", "REVOKEACE"), 5533 } 5534 5535 preparer := autorest.CreatePreparer( 5536 autorest.AsContentType("application/json; charset=utf-8"), 5537 autorest.AsPost(), 5538 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5539 autorest.WithPath("/catalog/usql/acl"), 5540 autorest.WithJSON(parameters), 5541 autorest.WithQueryParameters(queryParameters)) 5542 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5543} 5544 5545// RevokeACLSender sends the RevokeACL request. The method will close the 5546// http.Response Body if it receives an error. 5547func (client Client) RevokeACLSender(req *http.Request) (*http.Response, error) { 5548 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5549 return autorest.SendWithSender(client, req, sd...) 5550} 5551 5552// RevokeACLResponder handles the response to the RevokeACL request. The method always 5553// closes the http.Response Body. 5554func (client Client) RevokeACLResponder(resp *http.Response) (result autorest.Response, err error) { 5555 err = autorest.Respond( 5556 resp, 5557 client.ByInspecting(), 5558 azure.WithErrorUnlessStatusCode(http.StatusOK), 5559 autorest.ByClosing()) 5560 result.Response = resp 5561 return 5562} 5563 5564// RevokeACLFromDatabase revokes an access control list (ACL) entry for the database from the Data Lake Analytics 5565// catalog. 5566// Parameters: 5567// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5568// databaseName - the name of the database. 5569// parameters - parameters supplied to delete an access control list (ACL) entry for a database. 5570func (client Client) RevokeACLFromDatabase(ctx context.Context, accountName string, databaseName string, parameters ACLDeleteParameters) (result autorest.Response, err error) { 5571 if tracing.IsEnabled() { 5572 ctx = tracing.StartSpan(ctx, fqdn+"/Client.RevokeACLFromDatabase") 5573 defer func() { 5574 sc := -1 5575 if result.Response != nil { 5576 sc = result.Response.StatusCode 5577 } 5578 tracing.EndSpan(ctx, sc, err) 5579 }() 5580 } 5581 if err := validation.Validate([]validation.Validation{ 5582 {TargetValue: parameters, 5583 Constraints: []validation.Constraint{{Target: "parameters.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 5584 return result, validation.NewError("catalog.Client", "RevokeACLFromDatabase", err.Error()) 5585 } 5586 5587 req, err := client.RevokeACLFromDatabasePreparer(ctx, accountName, databaseName, parameters) 5588 if err != nil { 5589 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACLFromDatabase", nil, "Failure preparing request") 5590 return 5591 } 5592 5593 resp, err := client.RevokeACLFromDatabaseSender(req) 5594 if err != nil { 5595 result.Response = resp 5596 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACLFromDatabase", resp, "Failure sending request") 5597 return 5598 } 5599 5600 result, err = client.RevokeACLFromDatabaseResponder(resp) 5601 if err != nil { 5602 err = autorest.NewErrorWithError(err, "catalog.Client", "RevokeACLFromDatabase", resp, "Failure responding to request") 5603 } 5604 5605 return 5606} 5607 5608// RevokeACLFromDatabasePreparer prepares the RevokeACLFromDatabase request. 5609func (client Client) RevokeACLFromDatabasePreparer(ctx context.Context, accountName string, databaseName string, parameters ACLDeleteParameters) (*http.Request, error) { 5610 urlParameters := map[string]interface{}{ 5611 "accountName": accountName, 5612 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5613 } 5614 5615 pathParameters := map[string]interface{}{ 5616 "databaseName": autorest.Encode("path", databaseName), 5617 } 5618 5619 const APIVersion = "2016-11-01" 5620 queryParameters := map[string]interface{}{ 5621 "api-version": APIVersion, 5622 "op": autorest.Encode("query", "REVOKEACE"), 5623 } 5624 5625 preparer := autorest.CreatePreparer( 5626 autorest.AsContentType("application/json; charset=utf-8"), 5627 autorest.AsPost(), 5628 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5629 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/acl", pathParameters), 5630 autorest.WithJSON(parameters), 5631 autorest.WithQueryParameters(queryParameters)) 5632 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5633} 5634 5635// RevokeACLFromDatabaseSender sends the RevokeACLFromDatabase request. The method will close the 5636// http.Response Body if it receives an error. 5637func (client Client) RevokeACLFromDatabaseSender(req *http.Request) (*http.Response, error) { 5638 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5639 return autorest.SendWithSender(client, req, sd...) 5640} 5641 5642// RevokeACLFromDatabaseResponder handles the response to the RevokeACLFromDatabase request. The method always 5643// closes the http.Response Body. 5644func (client Client) RevokeACLFromDatabaseResponder(resp *http.Response) (result autorest.Response, err error) { 5645 err = autorest.Respond( 5646 resp, 5647 client.ByInspecting(), 5648 azure.WithErrorUnlessStatusCode(http.StatusOK), 5649 autorest.ByClosing()) 5650 result.Response = resp 5651 return 5652} 5653 5654// UpdateCredential modifies the specified credential for use with external data sources in the specified database 5655// Parameters: 5656// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5657// databaseName - the name of the database containing the credential. 5658// credentialName - the name of the credential. 5659// parameters - the parameters required to modify the credential (name and password) 5660func (client Client) UpdateCredential(ctx context.Context, accountName string, databaseName string, credentialName string, parameters DataLakeAnalyticsCatalogCredentialUpdateParameters) (result autorest.Response, err error) { 5661 if tracing.IsEnabled() { 5662 ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateCredential") 5663 defer func() { 5664 sc := -1 5665 if result.Response != nil { 5666 sc = result.Response.StatusCode 5667 } 5668 tracing.EndSpan(ctx, sc, err) 5669 }() 5670 } 5671 req, err := client.UpdateCredentialPreparer(ctx, accountName, databaseName, credentialName, parameters) 5672 if err != nil { 5673 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateCredential", nil, "Failure preparing request") 5674 return 5675 } 5676 5677 resp, err := client.UpdateCredentialSender(req) 5678 if err != nil { 5679 result.Response = resp 5680 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateCredential", resp, "Failure sending request") 5681 return 5682 } 5683 5684 result, err = client.UpdateCredentialResponder(resp) 5685 if err != nil { 5686 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateCredential", resp, "Failure responding to request") 5687 } 5688 5689 return 5690} 5691 5692// UpdateCredentialPreparer prepares the UpdateCredential request. 5693func (client Client) UpdateCredentialPreparer(ctx context.Context, accountName string, databaseName string, credentialName string, parameters DataLakeAnalyticsCatalogCredentialUpdateParameters) (*http.Request, error) { 5694 urlParameters := map[string]interface{}{ 5695 "accountName": accountName, 5696 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5697 } 5698 5699 pathParameters := map[string]interface{}{ 5700 "credentialName": autorest.Encode("path", credentialName), 5701 "databaseName": autorest.Encode("path", databaseName), 5702 } 5703 5704 const APIVersion = "2016-11-01" 5705 queryParameters := map[string]interface{}{ 5706 "api-version": APIVersion, 5707 } 5708 5709 preparer := autorest.CreatePreparer( 5710 autorest.AsContentType("application/json; charset=utf-8"), 5711 autorest.AsPatch(), 5712 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5713 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials/{credentialName}", pathParameters), 5714 autorest.WithJSON(parameters), 5715 autorest.WithQueryParameters(queryParameters)) 5716 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5717} 5718 5719// UpdateCredentialSender sends the UpdateCredential request. The method will close the 5720// http.Response Body if it receives an error. 5721func (client Client) UpdateCredentialSender(req *http.Request) (*http.Response, error) { 5722 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5723 return autorest.SendWithSender(client, req, sd...) 5724} 5725 5726// UpdateCredentialResponder handles the response to the UpdateCredential request. The method always 5727// closes the http.Response Body. 5728func (client Client) UpdateCredentialResponder(resp *http.Response) (result autorest.Response, err error) { 5729 err = autorest.Respond( 5730 resp, 5731 client.ByInspecting(), 5732 azure.WithErrorUnlessStatusCode(http.StatusOK), 5733 autorest.ByClosing()) 5734 result.Response = resp 5735 return 5736} 5737 5738// UpdateSecret modifies the specified secret for use with external data sources in the specified database. This is 5739// deprecated and will be removed in the next release. Please use UpdateCredential instead. 5740// Parameters: 5741// accountName - the Azure Data Lake Analytics account upon which to execute catalog operations. 5742// databaseName - the name of the database containing the secret. 5743// secretName - the name of the secret. 5744// parameters - the parameters required to modify the secret (name and password) 5745func (client Client) UpdateSecret(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (result autorest.Response, err error) { 5746 if tracing.IsEnabled() { 5747 ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateSecret") 5748 defer func() { 5749 sc := -1 5750 if result.Response != nil { 5751 sc = result.Response.StatusCode 5752 } 5753 tracing.EndSpan(ctx, sc, err) 5754 }() 5755 } 5756 req, err := client.UpdateSecretPreparer(ctx, accountName, databaseName, secretName, parameters) 5757 if err != nil { 5758 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", nil, "Failure preparing request") 5759 return 5760 } 5761 5762 resp, err := client.UpdateSecretSender(req) 5763 if err != nil { 5764 result.Response = resp 5765 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", resp, "Failure sending request") 5766 return 5767 } 5768 5769 result, err = client.UpdateSecretResponder(resp) 5770 if err != nil { 5771 err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", resp, "Failure responding to request") 5772 } 5773 5774 return 5775} 5776 5777// UpdateSecretPreparer prepares the UpdateSecret request. 5778func (client Client) UpdateSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (*http.Request, error) { 5779 urlParameters := map[string]interface{}{ 5780 "accountName": accountName, 5781 "adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix, 5782 } 5783 5784 pathParameters := map[string]interface{}{ 5785 "databaseName": autorest.Encode("path", databaseName), 5786 "secretName": autorest.Encode("path", secretName), 5787 } 5788 5789 const APIVersion = "2016-11-01" 5790 queryParameters := map[string]interface{}{ 5791 "api-version": APIVersion, 5792 } 5793 5794 preparer := autorest.CreatePreparer( 5795 autorest.AsContentType("application/json; charset=utf-8"), 5796 autorest.AsPatch(), 5797 autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters), 5798 autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters), 5799 autorest.WithJSON(parameters), 5800 autorest.WithQueryParameters(queryParameters)) 5801 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5802} 5803 5804// UpdateSecretSender sends the UpdateSecret request. The method will close the 5805// http.Response Body if it receives an error. 5806func (client Client) UpdateSecretSender(req *http.Request) (*http.Response, error) { 5807 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5808 return autorest.SendWithSender(client, req, sd...) 5809} 5810 5811// UpdateSecretResponder handles the response to the UpdateSecret request. The method always 5812// closes the http.Response Body. 5813func (client Client) UpdateSecretResponder(resp *http.Response) (result autorest.Response, err error) { 5814 err = autorest.Respond( 5815 resp, 5816 client.ByInspecting(), 5817 azure.WithErrorUnlessStatusCode(http.StatusOK), 5818 autorest.ByClosing()) 5819 result.Response = resp 5820 return 5821} 5822