...

Source file src/github.com/Azure/azure-sdk-for-go/services/datalake/analytics/2016-11-01-preview/catalog/catalog.go

Documentation: github.com/Azure/azure-sdk-for-go/services/datalake/analytics/2016-11-01-preview/catalog

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

View as plain text