...

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

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2015-10-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  // CreateSecret creates the specified secret for use with external data sources in the specified database.
    29  // Parameters:
    30  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
    31  // databaseName - the name of the database in which to create the secret.
    32  // secretName - the name of the secret.
    33  // parameters - the parameters required to create the secret (name and password)
    34  func (client Client) CreateSecret(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (result USQLSecret, err error) {
    35  	if tracing.IsEnabled() {
    36  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateSecret")
    37  		defer func() {
    38  			sc := -1
    39  			if result.Response.Response != nil {
    40  				sc = result.Response.Response.StatusCode
    41  			}
    42  			tracing.EndSpan(ctx, sc, err)
    43  		}()
    44  	}
    45  	if err := validation.Validate([]validation.Validation{
    46  		{TargetValue: parameters,
    47  			Constraints: []validation.Constraint{{Target: "parameters.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
    48  		return result, validation.NewError("catalog.Client", "CreateSecret", err.Error())
    49  	}
    50  
    51  	req, err := client.CreateSecretPreparer(ctx, accountName, databaseName, secretName, parameters)
    52  	if err != nil {
    53  		err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", nil, "Failure preparing request")
    54  		return
    55  	}
    56  
    57  	resp, err := client.CreateSecretSender(req)
    58  	if err != nil {
    59  		result.Response = autorest.Response{Response: resp}
    60  		err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", resp, "Failure sending request")
    61  		return
    62  	}
    63  
    64  	result, err = client.CreateSecretResponder(resp)
    65  	if err != nil {
    66  		err = autorest.NewErrorWithError(err, "catalog.Client", "CreateSecret", resp, "Failure responding to request")
    67  		return
    68  	}
    69  
    70  	return
    71  }
    72  
    73  // CreateSecretPreparer prepares the CreateSecret request.
    74  func (client Client) CreateSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (*http.Request, error) {
    75  	urlParameters := map[string]interface{}{
    76  		"accountName":          accountName,
    77  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
    78  	}
    79  
    80  	pathParameters := map[string]interface{}{
    81  		"databaseName": autorest.Encode("path", databaseName),
    82  		"secretName":   autorest.Encode("path", secretName),
    83  	}
    84  
    85  	const APIVersion = "2015-10-01-preview"
    86  	queryParameters := map[string]interface{}{
    87  		"api-version": APIVersion,
    88  	}
    89  
    90  	preparer := autorest.CreatePreparer(
    91  		autorest.AsContentType("application/json; charset=utf-8"),
    92  		autorest.AsPut(),
    93  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
    94  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters),
    95  		autorest.WithJSON(parameters),
    96  		autorest.WithQueryParameters(queryParameters))
    97  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
    98  }
    99  
   100  // CreateSecretSender sends the CreateSecret request. The method will close the
   101  // http.Response Body if it receives an error.
   102  func (client Client) CreateSecretSender(req *http.Request) (*http.Response, error) {
   103  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   104  }
   105  
   106  // CreateSecretResponder handles the response to the CreateSecret request. The method always
   107  // closes the http.Response Body.
   108  func (client Client) CreateSecretResponder(resp *http.Response) (result USQLSecret, err error) {
   109  	err = autorest.Respond(
   110  		resp,
   111  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   112  		autorest.ByUnmarshallingJSON(&result),
   113  		autorest.ByClosing())
   114  	result.Response = autorest.Response{Response: resp}
   115  	return
   116  }
   117  
   118  // DeleteAllSecrets deletes all secrets in the specified database
   119  // Parameters:
   120  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   121  // databaseName - the name of the database containing the secret.
   122  func (client Client) DeleteAllSecrets(ctx context.Context, accountName string, databaseName string) (result autorest.Response, err error) {
   123  	if tracing.IsEnabled() {
   124  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteAllSecrets")
   125  		defer func() {
   126  			sc := -1
   127  			if result.Response != nil {
   128  				sc = result.Response.StatusCode
   129  			}
   130  			tracing.EndSpan(ctx, sc, err)
   131  		}()
   132  	}
   133  	req, err := client.DeleteAllSecretsPreparer(ctx, accountName, databaseName)
   134  	if err != nil {
   135  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", nil, "Failure preparing request")
   136  		return
   137  	}
   138  
   139  	resp, err := client.DeleteAllSecretsSender(req)
   140  	if err != nil {
   141  		result.Response = resp
   142  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", resp, "Failure sending request")
   143  		return
   144  	}
   145  
   146  	result, err = client.DeleteAllSecretsResponder(resp)
   147  	if err != nil {
   148  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteAllSecrets", resp, "Failure responding to request")
   149  		return
   150  	}
   151  
   152  	return
   153  }
   154  
   155  // DeleteAllSecretsPreparer prepares the DeleteAllSecrets request.
   156  func (client Client) DeleteAllSecretsPreparer(ctx context.Context, accountName string, databaseName string) (*http.Request, error) {
   157  	urlParameters := map[string]interface{}{
   158  		"accountName":          accountName,
   159  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   160  	}
   161  
   162  	pathParameters := map[string]interface{}{
   163  		"databaseName": autorest.Encode("path", databaseName),
   164  	}
   165  
   166  	const APIVersion = "2015-10-01-preview"
   167  	queryParameters := map[string]interface{}{
   168  		"api-version": APIVersion,
   169  	}
   170  
   171  	preparer := autorest.CreatePreparer(
   172  		autorest.AsDelete(),
   173  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   174  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets", pathParameters),
   175  		autorest.WithQueryParameters(queryParameters))
   176  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   177  }
   178  
   179  // DeleteAllSecretsSender sends the DeleteAllSecrets request. The method will close the
   180  // http.Response Body if it receives an error.
   181  func (client Client) DeleteAllSecretsSender(req *http.Request) (*http.Response, error) {
   182  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   183  }
   184  
   185  // DeleteAllSecretsResponder handles the response to the DeleteAllSecrets request. The method always
   186  // closes the http.Response Body.
   187  func (client Client) DeleteAllSecretsResponder(resp *http.Response) (result autorest.Response, err error) {
   188  	err = autorest.Respond(
   189  		resp,
   190  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   191  		autorest.ByClosing())
   192  	result.Response = resp
   193  	return
   194  }
   195  
   196  // DeleteSecret deletes the specified secret in the specified database
   197  // Parameters:
   198  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   199  // databaseName - the name of the database containing the secret.
   200  // secretName - the name of the secret to delete
   201  func (client Client) DeleteSecret(ctx context.Context, accountName string, databaseName string, secretName string) (result autorest.Response, err error) {
   202  	if tracing.IsEnabled() {
   203  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteSecret")
   204  		defer func() {
   205  			sc := -1
   206  			if result.Response != nil {
   207  				sc = result.Response.StatusCode
   208  			}
   209  			tracing.EndSpan(ctx, sc, err)
   210  		}()
   211  	}
   212  	req, err := client.DeleteSecretPreparer(ctx, accountName, databaseName, secretName)
   213  	if err != nil {
   214  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", nil, "Failure preparing request")
   215  		return
   216  	}
   217  
   218  	resp, err := client.DeleteSecretSender(req)
   219  	if err != nil {
   220  		result.Response = resp
   221  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", resp, "Failure sending request")
   222  		return
   223  	}
   224  
   225  	result, err = client.DeleteSecretResponder(resp)
   226  	if err != nil {
   227  		err = autorest.NewErrorWithError(err, "catalog.Client", "DeleteSecret", resp, "Failure responding to request")
   228  		return
   229  	}
   230  
   231  	return
   232  }
   233  
   234  // DeleteSecretPreparer prepares the DeleteSecret request.
   235  func (client Client) DeleteSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string) (*http.Request, error) {
   236  	urlParameters := map[string]interface{}{
   237  		"accountName":          accountName,
   238  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   239  	}
   240  
   241  	pathParameters := map[string]interface{}{
   242  		"databaseName": autorest.Encode("path", databaseName),
   243  		"secretName":   autorest.Encode("path", secretName),
   244  	}
   245  
   246  	const APIVersion = "2015-10-01-preview"
   247  	queryParameters := map[string]interface{}{
   248  		"api-version": APIVersion,
   249  	}
   250  
   251  	preparer := autorest.CreatePreparer(
   252  		autorest.AsDelete(),
   253  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   254  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters),
   255  		autorest.WithQueryParameters(queryParameters))
   256  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   257  }
   258  
   259  // DeleteSecretSender sends the DeleteSecret request. The method will close the
   260  // http.Response Body if it receives an error.
   261  func (client Client) DeleteSecretSender(req *http.Request) (*http.Response, error) {
   262  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   263  }
   264  
   265  // DeleteSecretResponder handles the response to the DeleteSecret request. The method always
   266  // closes the http.Response Body.
   267  func (client Client) DeleteSecretResponder(resp *http.Response) (result autorest.Response, err error) {
   268  	err = autorest.Respond(
   269  		resp,
   270  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   271  		autorest.ByClosing())
   272  	result.Response = resp
   273  	return
   274  }
   275  
   276  // GetAssembly retrieves the specified assembly from the Data Lake Analytics catalog.
   277  // Parameters:
   278  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   279  // databaseName - the name of the database containing the assembly.
   280  // assemblyName - the name of the assembly.
   281  func (client Client) GetAssembly(ctx context.Context, accountName string, databaseName string, assemblyName string) (result USQLAssembly, err error) {
   282  	if tracing.IsEnabled() {
   283  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetAssembly")
   284  		defer func() {
   285  			sc := -1
   286  			if result.Response.Response != nil {
   287  				sc = result.Response.Response.StatusCode
   288  			}
   289  			tracing.EndSpan(ctx, sc, err)
   290  		}()
   291  	}
   292  	req, err := client.GetAssemblyPreparer(ctx, accountName, databaseName, assemblyName)
   293  	if err != nil {
   294  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", nil, "Failure preparing request")
   295  		return
   296  	}
   297  
   298  	resp, err := client.GetAssemblySender(req)
   299  	if err != nil {
   300  		result.Response = autorest.Response{Response: resp}
   301  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", resp, "Failure sending request")
   302  		return
   303  	}
   304  
   305  	result, err = client.GetAssemblyResponder(resp)
   306  	if err != nil {
   307  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetAssembly", resp, "Failure responding to request")
   308  		return
   309  	}
   310  
   311  	return
   312  }
   313  
   314  // GetAssemblyPreparer prepares the GetAssembly request.
   315  func (client Client) GetAssemblyPreparer(ctx context.Context, accountName string, databaseName string, assemblyName string) (*http.Request, error) {
   316  	urlParameters := map[string]interface{}{
   317  		"accountName":          accountName,
   318  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   319  	}
   320  
   321  	pathParameters := map[string]interface{}{
   322  		"assemblyName": autorest.Encode("path", assemblyName),
   323  		"databaseName": autorest.Encode("path", databaseName),
   324  	}
   325  
   326  	const APIVersion = "2015-10-01-preview"
   327  	queryParameters := map[string]interface{}{
   328  		"api-version": APIVersion,
   329  	}
   330  
   331  	preparer := autorest.CreatePreparer(
   332  		autorest.AsGet(),
   333  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   334  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/assemblies/{assemblyName}", pathParameters),
   335  		autorest.WithQueryParameters(queryParameters))
   336  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   337  }
   338  
   339  // GetAssemblySender sends the GetAssembly request. The method will close the
   340  // http.Response Body if it receives an error.
   341  func (client Client) GetAssemblySender(req *http.Request) (*http.Response, error) {
   342  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   343  }
   344  
   345  // GetAssemblyResponder handles the response to the GetAssembly request. The method always
   346  // closes the http.Response Body.
   347  func (client Client) GetAssemblyResponder(resp *http.Response) (result USQLAssembly, err error) {
   348  	err = autorest.Respond(
   349  		resp,
   350  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   351  		autorest.ByUnmarshallingJSON(&result),
   352  		autorest.ByClosing())
   353  	result.Response = autorest.Response{Response: resp}
   354  	return
   355  }
   356  
   357  // GetCredential retrieves the specified credential from the Data Lake Analytics catalog.
   358  // Parameters:
   359  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   360  // databaseName - the name of the database containing the schema.
   361  // credentialName - the name of the credential.
   362  func (client Client) GetCredential(ctx context.Context, accountName string, databaseName string, credentialName string) (result USQLCredential, err error) {
   363  	if tracing.IsEnabled() {
   364  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetCredential")
   365  		defer func() {
   366  			sc := -1
   367  			if result.Response.Response != nil {
   368  				sc = result.Response.Response.StatusCode
   369  			}
   370  			tracing.EndSpan(ctx, sc, err)
   371  		}()
   372  	}
   373  	req, err := client.GetCredentialPreparer(ctx, accountName, databaseName, credentialName)
   374  	if err != nil {
   375  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", nil, "Failure preparing request")
   376  		return
   377  	}
   378  
   379  	resp, err := client.GetCredentialSender(req)
   380  	if err != nil {
   381  		result.Response = autorest.Response{Response: resp}
   382  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", resp, "Failure sending request")
   383  		return
   384  	}
   385  
   386  	result, err = client.GetCredentialResponder(resp)
   387  	if err != nil {
   388  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetCredential", resp, "Failure responding to request")
   389  		return
   390  	}
   391  
   392  	return
   393  }
   394  
   395  // GetCredentialPreparer prepares the GetCredential request.
   396  func (client Client) GetCredentialPreparer(ctx context.Context, accountName string, databaseName string, credentialName string) (*http.Request, error) {
   397  	urlParameters := map[string]interface{}{
   398  		"accountName":          accountName,
   399  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   400  	}
   401  
   402  	pathParameters := map[string]interface{}{
   403  		"credentialName": autorest.Encode("path", credentialName),
   404  		"databaseName":   autorest.Encode("path", databaseName),
   405  	}
   406  
   407  	const APIVersion = "2015-10-01-preview"
   408  	queryParameters := map[string]interface{}{
   409  		"api-version": APIVersion,
   410  	}
   411  
   412  	preparer := autorest.CreatePreparer(
   413  		autorest.AsGet(),
   414  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   415  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials/{credentialName}", pathParameters),
   416  		autorest.WithQueryParameters(queryParameters))
   417  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   418  }
   419  
   420  // GetCredentialSender sends the GetCredential request. The method will close the
   421  // http.Response Body if it receives an error.
   422  func (client Client) GetCredentialSender(req *http.Request) (*http.Response, error) {
   423  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   424  }
   425  
   426  // GetCredentialResponder handles the response to the GetCredential request. The method always
   427  // closes the http.Response Body.
   428  func (client Client) GetCredentialResponder(resp *http.Response) (result USQLCredential, err error) {
   429  	err = autorest.Respond(
   430  		resp,
   431  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   432  		autorest.ByUnmarshallingJSON(&result),
   433  		autorest.ByClosing())
   434  	result.Response = autorest.Response{Response: resp}
   435  	return
   436  }
   437  
   438  // GetDatabase retrieves the specified database from the Data Lake Analytics catalog.
   439  // Parameters:
   440  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   441  // databaseName - the name of the database.
   442  func (client Client) GetDatabase(ctx context.Context, accountName string, databaseName string) (result USQLDatabase, err error) {
   443  	if tracing.IsEnabled() {
   444  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDatabase")
   445  		defer func() {
   446  			sc := -1
   447  			if result.Response.Response != nil {
   448  				sc = result.Response.Response.StatusCode
   449  			}
   450  			tracing.EndSpan(ctx, sc, err)
   451  		}()
   452  	}
   453  	req, err := client.GetDatabasePreparer(ctx, accountName, databaseName)
   454  	if err != nil {
   455  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", nil, "Failure preparing request")
   456  		return
   457  	}
   458  
   459  	resp, err := client.GetDatabaseSender(req)
   460  	if err != nil {
   461  		result.Response = autorest.Response{Response: resp}
   462  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", resp, "Failure sending request")
   463  		return
   464  	}
   465  
   466  	result, err = client.GetDatabaseResponder(resp)
   467  	if err != nil {
   468  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetDatabase", resp, "Failure responding to request")
   469  		return
   470  	}
   471  
   472  	return
   473  }
   474  
   475  // GetDatabasePreparer prepares the GetDatabase request.
   476  func (client Client) GetDatabasePreparer(ctx context.Context, accountName string, databaseName string) (*http.Request, error) {
   477  	urlParameters := map[string]interface{}{
   478  		"accountName":          accountName,
   479  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   480  	}
   481  
   482  	pathParameters := map[string]interface{}{
   483  		"databaseName": autorest.Encode("path", databaseName),
   484  	}
   485  
   486  	const APIVersion = "2015-10-01-preview"
   487  	queryParameters := map[string]interface{}{
   488  		"api-version": APIVersion,
   489  	}
   490  
   491  	preparer := autorest.CreatePreparer(
   492  		autorest.AsGet(),
   493  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   494  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}", pathParameters),
   495  		autorest.WithQueryParameters(queryParameters))
   496  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   497  }
   498  
   499  // GetDatabaseSender sends the GetDatabase request. The method will close the
   500  // http.Response Body if it receives an error.
   501  func (client Client) GetDatabaseSender(req *http.Request) (*http.Response, error) {
   502  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   503  }
   504  
   505  // GetDatabaseResponder handles the response to the GetDatabase request. The method always
   506  // closes the http.Response Body.
   507  func (client Client) GetDatabaseResponder(resp *http.Response) (result USQLDatabase, err error) {
   508  	err = autorest.Respond(
   509  		resp,
   510  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   511  		autorest.ByUnmarshallingJSON(&result),
   512  		autorest.ByClosing())
   513  	result.Response = autorest.Response{Response: resp}
   514  	return
   515  }
   516  
   517  // GetExternalDataSource retrieves the specified external data source from the Data Lake Analytics catalog.
   518  // Parameters:
   519  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   520  // databaseName - the name of the database containing the external data source.
   521  // externalDataSourceName - the name of the external data source.
   522  func (client Client) GetExternalDataSource(ctx context.Context, accountName string, databaseName string, externalDataSourceName string) (result USQLExternalDataSource, err error) {
   523  	if tracing.IsEnabled() {
   524  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetExternalDataSource")
   525  		defer func() {
   526  			sc := -1
   527  			if result.Response.Response != nil {
   528  				sc = result.Response.Response.StatusCode
   529  			}
   530  			tracing.EndSpan(ctx, sc, err)
   531  		}()
   532  	}
   533  	req, err := client.GetExternalDataSourcePreparer(ctx, accountName, databaseName, externalDataSourceName)
   534  	if err != nil {
   535  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", nil, "Failure preparing request")
   536  		return
   537  	}
   538  
   539  	resp, err := client.GetExternalDataSourceSender(req)
   540  	if err != nil {
   541  		result.Response = autorest.Response{Response: resp}
   542  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", resp, "Failure sending request")
   543  		return
   544  	}
   545  
   546  	result, err = client.GetExternalDataSourceResponder(resp)
   547  	if err != nil {
   548  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetExternalDataSource", resp, "Failure responding to request")
   549  		return
   550  	}
   551  
   552  	return
   553  }
   554  
   555  // GetExternalDataSourcePreparer prepares the GetExternalDataSource request.
   556  func (client Client) GetExternalDataSourcePreparer(ctx context.Context, accountName string, databaseName string, externalDataSourceName string) (*http.Request, error) {
   557  	urlParameters := map[string]interface{}{
   558  		"accountName":          accountName,
   559  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   560  	}
   561  
   562  	pathParameters := map[string]interface{}{
   563  		"databaseName":           autorest.Encode("path", databaseName),
   564  		"externalDataSourceName": autorest.Encode("path", externalDataSourceName),
   565  	}
   566  
   567  	const APIVersion = "2015-10-01-preview"
   568  	queryParameters := map[string]interface{}{
   569  		"api-version": APIVersion,
   570  	}
   571  
   572  	preparer := autorest.CreatePreparer(
   573  		autorest.AsGet(),
   574  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   575  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}", pathParameters),
   576  		autorest.WithQueryParameters(queryParameters))
   577  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   578  }
   579  
   580  // GetExternalDataSourceSender sends the GetExternalDataSource request. The method will close the
   581  // http.Response Body if it receives an error.
   582  func (client Client) GetExternalDataSourceSender(req *http.Request) (*http.Response, error) {
   583  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   584  }
   585  
   586  // GetExternalDataSourceResponder handles the response to the GetExternalDataSource request. The method always
   587  // closes the http.Response Body.
   588  func (client Client) GetExternalDataSourceResponder(resp *http.Response) (result USQLExternalDataSource, err error) {
   589  	err = autorest.Respond(
   590  		resp,
   591  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   592  		autorest.ByUnmarshallingJSON(&result),
   593  		autorest.ByClosing())
   594  	result.Response = autorest.Response{Response: resp}
   595  	return
   596  }
   597  
   598  // GetProcedure retrieves the specified procedure from the Data Lake Analytics catalog.
   599  // Parameters:
   600  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   601  // databaseName - the name of the database containing the procedure.
   602  // schemaName - the name of the schema containing the procedure.
   603  // procedureName - the name of the procedure.
   604  func (client Client) GetProcedure(ctx context.Context, accountName string, databaseName string, schemaName string, procedureName string) (result USQLProcedure, err error) {
   605  	if tracing.IsEnabled() {
   606  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetProcedure")
   607  		defer func() {
   608  			sc := -1
   609  			if result.Response.Response != nil {
   610  				sc = result.Response.Response.StatusCode
   611  			}
   612  			tracing.EndSpan(ctx, sc, err)
   613  		}()
   614  	}
   615  	req, err := client.GetProcedurePreparer(ctx, accountName, databaseName, schemaName, procedureName)
   616  	if err != nil {
   617  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", nil, "Failure preparing request")
   618  		return
   619  	}
   620  
   621  	resp, err := client.GetProcedureSender(req)
   622  	if err != nil {
   623  		result.Response = autorest.Response{Response: resp}
   624  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", resp, "Failure sending request")
   625  		return
   626  	}
   627  
   628  	result, err = client.GetProcedureResponder(resp)
   629  	if err != nil {
   630  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetProcedure", resp, "Failure responding to request")
   631  		return
   632  	}
   633  
   634  	return
   635  }
   636  
   637  // GetProcedurePreparer prepares the GetProcedure request.
   638  func (client Client) GetProcedurePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, procedureName string) (*http.Request, error) {
   639  	urlParameters := map[string]interface{}{
   640  		"accountName":          accountName,
   641  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   642  	}
   643  
   644  	pathParameters := map[string]interface{}{
   645  		"databaseName":  autorest.Encode("path", databaseName),
   646  		"procedureName": autorest.Encode("path", procedureName),
   647  		"schemaName":    autorest.Encode("path", schemaName),
   648  	}
   649  
   650  	const APIVersion = "2015-10-01-preview"
   651  	queryParameters := map[string]interface{}{
   652  		"api-version": APIVersion,
   653  	}
   654  
   655  	preparer := autorest.CreatePreparer(
   656  		autorest.AsGet(),
   657  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   658  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}", pathParameters),
   659  		autorest.WithQueryParameters(queryParameters))
   660  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   661  }
   662  
   663  // GetProcedureSender sends the GetProcedure request. The method will close the
   664  // http.Response Body if it receives an error.
   665  func (client Client) GetProcedureSender(req *http.Request) (*http.Response, error) {
   666  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   667  }
   668  
   669  // GetProcedureResponder handles the response to the GetProcedure request. The method always
   670  // closes the http.Response Body.
   671  func (client Client) GetProcedureResponder(resp *http.Response) (result USQLProcedure, err error) {
   672  	err = autorest.Respond(
   673  		resp,
   674  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   675  		autorest.ByUnmarshallingJSON(&result),
   676  		autorest.ByClosing())
   677  	result.Response = autorest.Response{Response: resp}
   678  	return
   679  }
   680  
   681  // GetSchema retrieves the specified schema from the Data Lake Analytics catalog.
   682  // Parameters:
   683  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   684  // databaseName - the name of the database containing the schema.
   685  // schemaName - the name of the schema.
   686  func (client Client) GetSchema(ctx context.Context, accountName string, databaseName string, schemaName string) (result USQLSchema, err error) {
   687  	if tracing.IsEnabled() {
   688  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetSchema")
   689  		defer func() {
   690  			sc := -1
   691  			if result.Response.Response != nil {
   692  				sc = result.Response.Response.StatusCode
   693  			}
   694  			tracing.EndSpan(ctx, sc, err)
   695  		}()
   696  	}
   697  	req, err := client.GetSchemaPreparer(ctx, accountName, databaseName, schemaName)
   698  	if err != nil {
   699  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", nil, "Failure preparing request")
   700  		return
   701  	}
   702  
   703  	resp, err := client.GetSchemaSender(req)
   704  	if err != nil {
   705  		result.Response = autorest.Response{Response: resp}
   706  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", resp, "Failure sending request")
   707  		return
   708  	}
   709  
   710  	result, err = client.GetSchemaResponder(resp)
   711  	if err != nil {
   712  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSchema", resp, "Failure responding to request")
   713  		return
   714  	}
   715  
   716  	return
   717  }
   718  
   719  // GetSchemaPreparer prepares the GetSchema request.
   720  func (client Client) GetSchemaPreparer(ctx context.Context, accountName string, databaseName string, schemaName string) (*http.Request, error) {
   721  	urlParameters := map[string]interface{}{
   722  		"accountName":          accountName,
   723  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   724  	}
   725  
   726  	pathParameters := map[string]interface{}{
   727  		"databaseName": autorest.Encode("path", databaseName),
   728  		"schemaName":   autorest.Encode("path", schemaName),
   729  	}
   730  
   731  	const APIVersion = "2015-10-01-preview"
   732  	queryParameters := map[string]interface{}{
   733  		"api-version": APIVersion,
   734  	}
   735  
   736  	preparer := autorest.CreatePreparer(
   737  		autorest.AsGet(),
   738  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   739  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}", pathParameters),
   740  		autorest.WithQueryParameters(queryParameters))
   741  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   742  }
   743  
   744  // GetSchemaSender sends the GetSchema request. The method will close the
   745  // http.Response Body if it receives an error.
   746  func (client Client) GetSchemaSender(req *http.Request) (*http.Response, error) {
   747  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   748  }
   749  
   750  // GetSchemaResponder handles the response to the GetSchema request. The method always
   751  // closes the http.Response Body.
   752  func (client Client) GetSchemaResponder(resp *http.Response) (result USQLSchema, err error) {
   753  	err = autorest.Respond(
   754  		resp,
   755  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   756  		autorest.ByUnmarshallingJSON(&result),
   757  		autorest.ByClosing())
   758  	result.Response = autorest.Response{Response: resp}
   759  	return
   760  }
   761  
   762  // GetSecret gets the specified secret in the specified database
   763  // Parameters:
   764  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   765  // databaseName - the name of the database containing the secret.
   766  // secretName - the name of the secret to get
   767  func (client Client) GetSecret(ctx context.Context, accountName string, databaseName string, secretName string) (result USQLSecret, err error) {
   768  	if tracing.IsEnabled() {
   769  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetSecret")
   770  		defer func() {
   771  			sc := -1
   772  			if result.Response.Response != nil {
   773  				sc = result.Response.Response.StatusCode
   774  			}
   775  			tracing.EndSpan(ctx, sc, err)
   776  		}()
   777  	}
   778  	req, err := client.GetSecretPreparer(ctx, accountName, databaseName, secretName)
   779  	if err != nil {
   780  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", nil, "Failure preparing request")
   781  		return
   782  	}
   783  
   784  	resp, err := client.GetSecretSender(req)
   785  	if err != nil {
   786  		result.Response = autorest.Response{Response: resp}
   787  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", resp, "Failure sending request")
   788  		return
   789  	}
   790  
   791  	result, err = client.GetSecretResponder(resp)
   792  	if err != nil {
   793  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetSecret", resp, "Failure responding to request")
   794  		return
   795  	}
   796  
   797  	return
   798  }
   799  
   800  // GetSecretPreparer prepares the GetSecret request.
   801  func (client Client) GetSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string) (*http.Request, error) {
   802  	urlParameters := map[string]interface{}{
   803  		"accountName":          accountName,
   804  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   805  	}
   806  
   807  	pathParameters := map[string]interface{}{
   808  		"databaseName": autorest.Encode("path", databaseName),
   809  		"secretName":   autorest.Encode("path", secretName),
   810  	}
   811  
   812  	const APIVersion = "2015-10-01-preview"
   813  	queryParameters := map[string]interface{}{
   814  		"api-version": APIVersion,
   815  	}
   816  
   817  	preparer := autorest.CreatePreparer(
   818  		autorest.AsGet(),
   819  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   820  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters),
   821  		autorest.WithQueryParameters(queryParameters))
   822  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   823  }
   824  
   825  // GetSecretSender sends the GetSecret request. The method will close the
   826  // http.Response Body if it receives an error.
   827  func (client Client) GetSecretSender(req *http.Request) (*http.Response, error) {
   828  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   829  }
   830  
   831  // GetSecretResponder handles the response to the GetSecret request. The method always
   832  // closes the http.Response Body.
   833  func (client Client) GetSecretResponder(resp *http.Response) (result USQLSecret, err error) {
   834  	err = autorest.Respond(
   835  		resp,
   836  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   837  		autorest.ByUnmarshallingJSON(&result),
   838  		autorest.ByClosing())
   839  	result.Response = autorest.Response{Response: resp}
   840  	return
   841  }
   842  
   843  // GetTable retrieves the specified table from the Data Lake Analytics catalog.
   844  // Parameters:
   845  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   846  // databaseName - the name of the database containing the table.
   847  // schemaName - the name of the schema containing the table.
   848  // tableName - the name of the table.
   849  func (client Client) GetTable(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string) (result USQLTable, err error) {
   850  	if tracing.IsEnabled() {
   851  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTable")
   852  		defer func() {
   853  			sc := -1
   854  			if result.Response.Response != nil {
   855  				sc = result.Response.Response.StatusCode
   856  			}
   857  			tracing.EndSpan(ctx, sc, err)
   858  		}()
   859  	}
   860  	req, err := client.GetTablePreparer(ctx, accountName, databaseName, schemaName, tableName)
   861  	if err != nil {
   862  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", nil, "Failure preparing request")
   863  		return
   864  	}
   865  
   866  	resp, err := client.GetTableSender(req)
   867  	if err != nil {
   868  		result.Response = autorest.Response{Response: resp}
   869  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", resp, "Failure sending request")
   870  		return
   871  	}
   872  
   873  	result, err = client.GetTableResponder(resp)
   874  	if err != nil {
   875  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTable", resp, "Failure responding to request")
   876  		return
   877  	}
   878  
   879  	return
   880  }
   881  
   882  // GetTablePreparer prepares the GetTable request.
   883  func (client Client) GetTablePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string) (*http.Request, error) {
   884  	urlParameters := map[string]interface{}{
   885  		"accountName":          accountName,
   886  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   887  	}
   888  
   889  	pathParameters := map[string]interface{}{
   890  		"databaseName": autorest.Encode("path", databaseName),
   891  		"schemaName":   autorest.Encode("path", schemaName),
   892  		"tableName":    autorest.Encode("path", tableName),
   893  	}
   894  
   895  	const APIVersion = "2015-10-01-preview"
   896  	queryParameters := map[string]interface{}{
   897  		"api-version": APIVersion,
   898  	}
   899  
   900  	preparer := autorest.CreatePreparer(
   901  		autorest.AsGet(),
   902  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   903  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}", pathParameters),
   904  		autorest.WithQueryParameters(queryParameters))
   905  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   906  }
   907  
   908  // GetTableSender sends the GetTable request. The method will close the
   909  // http.Response Body if it receives an error.
   910  func (client Client) GetTableSender(req *http.Request) (*http.Response, error) {
   911  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   912  }
   913  
   914  // GetTableResponder handles the response to the GetTable request. The method always
   915  // closes the http.Response Body.
   916  func (client Client) GetTableResponder(resp *http.Response) (result USQLTable, err error) {
   917  	err = autorest.Respond(
   918  		resp,
   919  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   920  		autorest.ByUnmarshallingJSON(&result),
   921  		autorest.ByClosing())
   922  	result.Response = autorest.Response{Response: resp}
   923  	return
   924  }
   925  
   926  // GetTablePartition retrieves the specified table partition from the Data Lake Analytics catalog.
   927  // Parameters:
   928  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
   929  // databaseName - the name of the database containing the partition.
   930  // schemaName - the name of the schema containing the partition.
   931  // tableName - the name of the table containing the partition.
   932  // partitionName - the name of the table partition.
   933  func (client Client) GetTablePartition(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string) (result USQLTablePartition, err error) {
   934  	if tracing.IsEnabled() {
   935  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTablePartition")
   936  		defer func() {
   937  			sc := -1
   938  			if result.Response.Response != nil {
   939  				sc = result.Response.Response.StatusCode
   940  			}
   941  			tracing.EndSpan(ctx, sc, err)
   942  		}()
   943  	}
   944  	req, err := client.GetTablePartitionPreparer(ctx, accountName, databaseName, schemaName, tableName, partitionName)
   945  	if err != nil {
   946  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", nil, "Failure preparing request")
   947  		return
   948  	}
   949  
   950  	resp, err := client.GetTablePartitionSender(req)
   951  	if err != nil {
   952  		result.Response = autorest.Response{Response: resp}
   953  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", resp, "Failure sending request")
   954  		return
   955  	}
   956  
   957  	result, err = client.GetTablePartitionResponder(resp)
   958  	if err != nil {
   959  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTablePartition", resp, "Failure responding to request")
   960  		return
   961  	}
   962  
   963  	return
   964  }
   965  
   966  // GetTablePartitionPreparer prepares the GetTablePartition request.
   967  func (client Client) GetTablePartitionPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, partitionName string) (*http.Request, error) {
   968  	urlParameters := map[string]interface{}{
   969  		"accountName":          accountName,
   970  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
   971  	}
   972  
   973  	pathParameters := map[string]interface{}{
   974  		"databaseName":  autorest.Encode("path", databaseName),
   975  		"partitionName": autorest.Encode("path", partitionName),
   976  		"schemaName":    autorest.Encode("path", schemaName),
   977  		"tableName":     autorest.Encode("path", tableName),
   978  	}
   979  
   980  	const APIVersion = "2015-10-01-preview"
   981  	queryParameters := map[string]interface{}{
   982  		"api-version": APIVersion,
   983  	}
   984  
   985  	preparer := autorest.CreatePreparer(
   986  		autorest.AsGet(),
   987  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
   988  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}", pathParameters),
   989  		autorest.WithQueryParameters(queryParameters))
   990  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   991  }
   992  
   993  // GetTablePartitionSender sends the GetTablePartition request. The method will close the
   994  // http.Response Body if it receives an error.
   995  func (client Client) GetTablePartitionSender(req *http.Request) (*http.Response, error) {
   996  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   997  }
   998  
   999  // GetTablePartitionResponder handles the response to the GetTablePartition request. The method always
  1000  // closes the http.Response Body.
  1001  func (client Client) GetTablePartitionResponder(resp *http.Response) (result USQLTablePartition, err error) {
  1002  	err = autorest.Respond(
  1003  		resp,
  1004  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1005  		autorest.ByUnmarshallingJSON(&result),
  1006  		autorest.ByClosing())
  1007  	result.Response = autorest.Response{Response: resp}
  1008  	return
  1009  }
  1010  
  1011  // GetTableStatistic retrieves the specified table statistics from the Data Lake Analytics catalog.
  1012  // Parameters:
  1013  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1014  // databaseName - the name of the database containing the statistics.
  1015  // schemaName - the name of the schema containing the statistics.
  1016  // tableName - the name of the table containing the statistics.
  1017  // statisticsName - the name of the table statistics.
  1018  func (client Client) GetTableStatistic(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, statisticsName string) (result USQLTableStatistics, err error) {
  1019  	if tracing.IsEnabled() {
  1020  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableStatistic")
  1021  		defer func() {
  1022  			sc := -1
  1023  			if result.Response.Response != nil {
  1024  				sc = result.Response.Response.StatusCode
  1025  			}
  1026  			tracing.EndSpan(ctx, sc, err)
  1027  		}()
  1028  	}
  1029  	req, err := client.GetTableStatisticPreparer(ctx, accountName, databaseName, schemaName, tableName, statisticsName)
  1030  	if err != nil {
  1031  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", nil, "Failure preparing request")
  1032  		return
  1033  	}
  1034  
  1035  	resp, err := client.GetTableStatisticSender(req)
  1036  	if err != nil {
  1037  		result.Response = autorest.Response{Response: resp}
  1038  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", resp, "Failure sending request")
  1039  		return
  1040  	}
  1041  
  1042  	result, err = client.GetTableStatisticResponder(resp)
  1043  	if err != nil {
  1044  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableStatistic", resp, "Failure responding to request")
  1045  		return
  1046  	}
  1047  
  1048  	return
  1049  }
  1050  
  1051  // GetTableStatisticPreparer prepares the GetTableStatistic request.
  1052  func (client Client) GetTableStatisticPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, statisticsName string) (*http.Request, error) {
  1053  	urlParameters := map[string]interface{}{
  1054  		"accountName":          accountName,
  1055  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1056  	}
  1057  
  1058  	pathParameters := map[string]interface{}{
  1059  		"databaseName":   autorest.Encode("path", databaseName),
  1060  		"schemaName":     autorest.Encode("path", schemaName),
  1061  		"statisticsName": autorest.Encode("path", statisticsName),
  1062  		"tableName":      autorest.Encode("path", tableName),
  1063  	}
  1064  
  1065  	const APIVersion = "2015-10-01-preview"
  1066  	queryParameters := map[string]interface{}{
  1067  		"api-version": APIVersion,
  1068  	}
  1069  
  1070  	preparer := autorest.CreatePreparer(
  1071  		autorest.AsGet(),
  1072  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1073  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}", pathParameters),
  1074  		autorest.WithQueryParameters(queryParameters))
  1075  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1076  }
  1077  
  1078  // GetTableStatisticSender sends the GetTableStatistic request. The method will close the
  1079  // http.Response Body if it receives an error.
  1080  func (client Client) GetTableStatisticSender(req *http.Request) (*http.Response, error) {
  1081  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1082  }
  1083  
  1084  // GetTableStatisticResponder handles the response to the GetTableStatistic request. The method always
  1085  // closes the http.Response Body.
  1086  func (client Client) GetTableStatisticResponder(resp *http.Response) (result USQLTableStatistics, err error) {
  1087  	err = autorest.Respond(
  1088  		resp,
  1089  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1090  		autorest.ByUnmarshallingJSON(&result),
  1091  		autorest.ByClosing())
  1092  	result.Response = autorest.Response{Response: resp}
  1093  	return
  1094  }
  1095  
  1096  // GetTableType retrieves the specified table type from the Data Lake Analytics catalog.
  1097  // Parameters:
  1098  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1099  // databaseName - the name of the database containing the table type.
  1100  // schemaName - the name of the schema containing the table type.
  1101  // tableTypeName - the name of the table type to retrieve.
  1102  func (client Client) GetTableType(ctx context.Context, accountName string, databaseName string, schemaName string, tableTypeName string) (result USQLTableType, err error) {
  1103  	if tracing.IsEnabled() {
  1104  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableType")
  1105  		defer func() {
  1106  			sc := -1
  1107  			if result.Response.Response != nil {
  1108  				sc = result.Response.Response.StatusCode
  1109  			}
  1110  			tracing.EndSpan(ctx, sc, err)
  1111  		}()
  1112  	}
  1113  	req, err := client.GetTableTypePreparer(ctx, accountName, databaseName, schemaName, tableTypeName)
  1114  	if err != nil {
  1115  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", nil, "Failure preparing request")
  1116  		return
  1117  	}
  1118  
  1119  	resp, err := client.GetTableTypeSender(req)
  1120  	if err != nil {
  1121  		result.Response = autorest.Response{Response: resp}
  1122  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", resp, "Failure sending request")
  1123  		return
  1124  	}
  1125  
  1126  	result, err = client.GetTableTypeResponder(resp)
  1127  	if err != nil {
  1128  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableType", resp, "Failure responding to request")
  1129  		return
  1130  	}
  1131  
  1132  	return
  1133  }
  1134  
  1135  // GetTableTypePreparer prepares the GetTableType request.
  1136  func (client Client) GetTableTypePreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableTypeName string) (*http.Request, error) {
  1137  	urlParameters := map[string]interface{}{
  1138  		"accountName":          accountName,
  1139  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1140  	}
  1141  
  1142  	pathParameters := map[string]interface{}{
  1143  		"databaseName":  autorest.Encode("path", databaseName),
  1144  		"schemaName":    autorest.Encode("path", schemaName),
  1145  		"tableTypeName": autorest.Encode("path", tableTypeName),
  1146  	}
  1147  
  1148  	const APIVersion = "2015-10-01-preview"
  1149  	queryParameters := map[string]interface{}{
  1150  		"api-version": APIVersion,
  1151  	}
  1152  
  1153  	preparer := autorest.CreatePreparer(
  1154  		autorest.AsGet(),
  1155  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1156  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes/{tableTypeName}", pathParameters),
  1157  		autorest.WithQueryParameters(queryParameters))
  1158  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1159  }
  1160  
  1161  // GetTableTypeSender sends the GetTableType request. The method will close the
  1162  // http.Response Body if it receives an error.
  1163  func (client Client) GetTableTypeSender(req *http.Request) (*http.Response, error) {
  1164  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1165  }
  1166  
  1167  // GetTableTypeResponder handles the response to the GetTableType request. The method always
  1168  // closes the http.Response Body.
  1169  func (client Client) GetTableTypeResponder(resp *http.Response) (result USQLTableType, err error) {
  1170  	err = autorest.Respond(
  1171  		resp,
  1172  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1173  		autorest.ByUnmarshallingJSON(&result),
  1174  		autorest.ByClosing())
  1175  	result.Response = autorest.Response{Response: resp}
  1176  	return
  1177  }
  1178  
  1179  // GetTableValuedFunction retrieves the specified table valued function from the Data Lake Analytics catalog.
  1180  // Parameters:
  1181  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1182  // databaseName - the name of the database containing the table valued function.
  1183  // schemaName - the name of the schema containing the table valued function.
  1184  // tableValuedFunctionName - the name of the tableValuedFunction.
  1185  func (client Client) GetTableValuedFunction(ctx context.Context, accountName string, databaseName string, schemaName string, tableValuedFunctionName string) (result USQLTableValuedFunction, err error) {
  1186  	if tracing.IsEnabled() {
  1187  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetTableValuedFunction")
  1188  		defer func() {
  1189  			sc := -1
  1190  			if result.Response.Response != nil {
  1191  				sc = result.Response.Response.StatusCode
  1192  			}
  1193  			tracing.EndSpan(ctx, sc, err)
  1194  		}()
  1195  	}
  1196  	req, err := client.GetTableValuedFunctionPreparer(ctx, accountName, databaseName, schemaName, tableValuedFunctionName)
  1197  	if err != nil {
  1198  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", nil, "Failure preparing request")
  1199  		return
  1200  	}
  1201  
  1202  	resp, err := client.GetTableValuedFunctionSender(req)
  1203  	if err != nil {
  1204  		result.Response = autorest.Response{Response: resp}
  1205  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", resp, "Failure sending request")
  1206  		return
  1207  	}
  1208  
  1209  	result, err = client.GetTableValuedFunctionResponder(resp)
  1210  	if err != nil {
  1211  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetTableValuedFunction", resp, "Failure responding to request")
  1212  		return
  1213  	}
  1214  
  1215  	return
  1216  }
  1217  
  1218  // GetTableValuedFunctionPreparer prepares the GetTableValuedFunction request.
  1219  func (client Client) GetTableValuedFunctionPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableValuedFunctionName string) (*http.Request, error) {
  1220  	urlParameters := map[string]interface{}{
  1221  		"accountName":          accountName,
  1222  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1223  	}
  1224  
  1225  	pathParameters := map[string]interface{}{
  1226  		"databaseName":            autorest.Encode("path", databaseName),
  1227  		"schemaName":              autorest.Encode("path", schemaName),
  1228  		"tableValuedFunctionName": autorest.Encode("path", tableValuedFunctionName),
  1229  	}
  1230  
  1231  	const APIVersion = "2015-10-01-preview"
  1232  	queryParameters := map[string]interface{}{
  1233  		"api-version": APIVersion,
  1234  	}
  1235  
  1236  	preparer := autorest.CreatePreparer(
  1237  		autorest.AsGet(),
  1238  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1239  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}", pathParameters),
  1240  		autorest.WithQueryParameters(queryParameters))
  1241  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1242  }
  1243  
  1244  // GetTableValuedFunctionSender sends the GetTableValuedFunction request. The method will close the
  1245  // http.Response Body if it receives an error.
  1246  func (client Client) GetTableValuedFunctionSender(req *http.Request) (*http.Response, error) {
  1247  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1248  }
  1249  
  1250  // GetTableValuedFunctionResponder handles the response to the GetTableValuedFunction request. The method always
  1251  // closes the http.Response Body.
  1252  func (client Client) GetTableValuedFunctionResponder(resp *http.Response) (result USQLTableValuedFunction, err error) {
  1253  	err = autorest.Respond(
  1254  		resp,
  1255  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1256  		autorest.ByUnmarshallingJSON(&result),
  1257  		autorest.ByClosing())
  1258  	result.Response = autorest.Response{Response: resp}
  1259  	return
  1260  }
  1261  
  1262  // GetView retrieves the specified view from the Data Lake Analytics catalog.
  1263  // Parameters:
  1264  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1265  // databaseName - the name of the database containing the view.
  1266  // schemaName - the name of the schema containing the view.
  1267  // viewName - the name of the view.
  1268  func (client Client) GetView(ctx context.Context, accountName string, databaseName string, schemaName string, viewName string) (result USQLView, err error) {
  1269  	if tracing.IsEnabled() {
  1270  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetView")
  1271  		defer func() {
  1272  			sc := -1
  1273  			if result.Response.Response != nil {
  1274  				sc = result.Response.Response.StatusCode
  1275  			}
  1276  			tracing.EndSpan(ctx, sc, err)
  1277  		}()
  1278  	}
  1279  	req, err := client.GetViewPreparer(ctx, accountName, databaseName, schemaName, viewName)
  1280  	if err != nil {
  1281  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", nil, "Failure preparing request")
  1282  		return
  1283  	}
  1284  
  1285  	resp, err := client.GetViewSender(req)
  1286  	if err != nil {
  1287  		result.Response = autorest.Response{Response: resp}
  1288  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", resp, "Failure sending request")
  1289  		return
  1290  	}
  1291  
  1292  	result, err = client.GetViewResponder(resp)
  1293  	if err != nil {
  1294  		err = autorest.NewErrorWithError(err, "catalog.Client", "GetView", resp, "Failure responding to request")
  1295  		return
  1296  	}
  1297  
  1298  	return
  1299  }
  1300  
  1301  // GetViewPreparer prepares the GetView request.
  1302  func (client Client) GetViewPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, viewName string) (*http.Request, error) {
  1303  	urlParameters := map[string]interface{}{
  1304  		"accountName":          accountName,
  1305  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1306  	}
  1307  
  1308  	pathParameters := map[string]interface{}{
  1309  		"databaseName": autorest.Encode("path", databaseName),
  1310  		"schemaName":   autorest.Encode("path", schemaName),
  1311  		"viewName":     autorest.Encode("path", viewName),
  1312  	}
  1313  
  1314  	const APIVersion = "2015-10-01-preview"
  1315  	queryParameters := map[string]interface{}{
  1316  		"api-version": APIVersion,
  1317  	}
  1318  
  1319  	preparer := autorest.CreatePreparer(
  1320  		autorest.AsGet(),
  1321  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1322  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}", pathParameters),
  1323  		autorest.WithQueryParameters(queryParameters))
  1324  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1325  }
  1326  
  1327  // GetViewSender sends the GetView request. The method will close the
  1328  // http.Response Body if it receives an error.
  1329  func (client Client) GetViewSender(req *http.Request) (*http.Response, error) {
  1330  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1331  }
  1332  
  1333  // GetViewResponder handles the response to the GetView request. The method always
  1334  // closes the http.Response Body.
  1335  func (client Client) GetViewResponder(resp *http.Response) (result USQLView, err error) {
  1336  	err = autorest.Respond(
  1337  		resp,
  1338  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1339  		autorest.ByUnmarshallingJSON(&result),
  1340  		autorest.ByClosing())
  1341  	result.Response = autorest.Response{Response: resp}
  1342  	return
  1343  }
  1344  
  1345  // ListAssemblies retrieves the list of assemblies from the Data Lake Analytics catalog.
  1346  // Parameters:
  1347  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1348  // databaseName - the name of the database containing the assembly.
  1349  // filter - oData filter. Optional.
  1350  // top - the number of items to return. Optional.
  1351  // skip - the number of items to skip over before returning elements. Optional.
  1352  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1353  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  1354  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1355  // Categories?$select=CategoryName,Description. Optional.
  1356  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1357  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1358  // Optional.
  1359  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1360  // resources in the response, e.g. Categories?$count=true. Optional.
  1361  func (client Client) ListAssemblies(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLAssemblyListPage, err error) {
  1362  	if tracing.IsEnabled() {
  1363  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAssemblies")
  1364  		defer func() {
  1365  			sc := -1
  1366  			if result.ual.Response.Response != nil {
  1367  				sc = result.ual.Response.Response.StatusCode
  1368  			}
  1369  			tracing.EndSpan(ctx, sc, err)
  1370  		}()
  1371  	}
  1372  	result.fn = client.listAssembliesNextResults
  1373  	req, err := client.ListAssembliesPreparer(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1374  	if err != nil {
  1375  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", nil, "Failure preparing request")
  1376  		return
  1377  	}
  1378  
  1379  	resp, err := client.ListAssembliesSender(req)
  1380  	if err != nil {
  1381  		result.ual.Response = autorest.Response{Response: resp}
  1382  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", resp, "Failure sending request")
  1383  		return
  1384  	}
  1385  
  1386  	result.ual, err = client.ListAssembliesResponder(resp)
  1387  	if err != nil {
  1388  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListAssemblies", resp, "Failure responding to request")
  1389  		return
  1390  	}
  1391  	if result.ual.hasNextLink() && result.ual.IsEmpty() {
  1392  		err = result.NextWithContext(ctx)
  1393  		return
  1394  	}
  1395  
  1396  	return
  1397  }
  1398  
  1399  // ListAssembliesPreparer prepares the ListAssemblies request.
  1400  func (client Client) ListAssembliesPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  1401  	urlParameters := map[string]interface{}{
  1402  		"accountName":          accountName,
  1403  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1404  	}
  1405  
  1406  	pathParameters := map[string]interface{}{
  1407  		"databaseName": autorest.Encode("path", databaseName),
  1408  	}
  1409  
  1410  	const APIVersion = "2015-10-01-preview"
  1411  	queryParameters := map[string]interface{}{
  1412  		"api-version": APIVersion,
  1413  	}
  1414  	if len(filter) > 0 {
  1415  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1416  	}
  1417  	if top != nil {
  1418  		queryParameters["$top"] = autorest.Encode("query", *top)
  1419  	}
  1420  	if skip != nil {
  1421  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1422  	}
  1423  	if len(expand) > 0 {
  1424  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1425  	}
  1426  	if len(selectParameter) > 0 {
  1427  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1428  	}
  1429  	if len(orderby) > 0 {
  1430  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1431  	}
  1432  	if count != nil {
  1433  		queryParameters["$count"] = autorest.Encode("query", *count)
  1434  	}
  1435  
  1436  	preparer := autorest.CreatePreparer(
  1437  		autorest.AsGet(),
  1438  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1439  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/assemblies", pathParameters),
  1440  		autorest.WithQueryParameters(queryParameters))
  1441  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1442  }
  1443  
  1444  // ListAssembliesSender sends the ListAssemblies request. The method will close the
  1445  // http.Response Body if it receives an error.
  1446  func (client Client) ListAssembliesSender(req *http.Request) (*http.Response, error) {
  1447  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1448  }
  1449  
  1450  // ListAssembliesResponder handles the response to the ListAssemblies request. The method always
  1451  // closes the http.Response Body.
  1452  func (client Client) ListAssembliesResponder(resp *http.Response) (result USQLAssemblyList, err error) {
  1453  	err = autorest.Respond(
  1454  		resp,
  1455  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1456  		autorest.ByUnmarshallingJSON(&result),
  1457  		autorest.ByClosing())
  1458  	result.Response = autorest.Response{Response: resp}
  1459  	return
  1460  }
  1461  
  1462  // listAssembliesNextResults retrieves the next set of results, if any.
  1463  func (client Client) listAssembliesNextResults(ctx context.Context, lastResults USQLAssemblyList) (result USQLAssemblyList, err error) {
  1464  	req, err := lastResults.uSQLAssemblyListPreparer(ctx)
  1465  	if err != nil {
  1466  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", nil, "Failure preparing next results request")
  1467  	}
  1468  	if req == nil {
  1469  		return
  1470  	}
  1471  	resp, err := client.ListAssembliesSender(req)
  1472  	if err != nil {
  1473  		result.Response = autorest.Response{Response: resp}
  1474  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", resp, "Failure sending next results request")
  1475  	}
  1476  	result, err = client.ListAssembliesResponder(resp)
  1477  	if err != nil {
  1478  		err = autorest.NewErrorWithError(err, "catalog.Client", "listAssembliesNextResults", resp, "Failure responding to next results request")
  1479  	}
  1480  	return
  1481  }
  1482  
  1483  // ListAssembliesComplete enumerates all values, automatically crossing page boundaries as required.
  1484  func (client Client) ListAssembliesComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLAssemblyListIterator, err error) {
  1485  	if tracing.IsEnabled() {
  1486  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListAssemblies")
  1487  		defer func() {
  1488  			sc := -1
  1489  			if result.Response().Response.Response != nil {
  1490  				sc = result.page.Response().Response.Response.StatusCode
  1491  			}
  1492  			tracing.EndSpan(ctx, sc, err)
  1493  		}()
  1494  	}
  1495  	result.page, err = client.ListAssemblies(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1496  	return
  1497  }
  1498  
  1499  // ListCredentials retrieves the list of credentials from the Data Lake Analytics catalog.
  1500  // Parameters:
  1501  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1502  // databaseName - the name of the database containing the schema.
  1503  // filter - oData filter. Optional.
  1504  // top - the number of items to return. Optional.
  1505  // skip - the number of items to skip over before returning elements. Optional.
  1506  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1507  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  1508  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1509  // Categories?$select=CategoryName,Description. Optional.
  1510  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1511  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1512  // Optional.
  1513  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1514  // resources in the response, e.g. Categories?$count=true. Optional.
  1515  func (client Client) ListCredentials(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLCredentialListPage, err error) {
  1516  	if tracing.IsEnabled() {
  1517  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListCredentials")
  1518  		defer func() {
  1519  			sc := -1
  1520  			if result.ucl.Response.Response != nil {
  1521  				sc = result.ucl.Response.Response.StatusCode
  1522  			}
  1523  			tracing.EndSpan(ctx, sc, err)
  1524  		}()
  1525  	}
  1526  	result.fn = client.listCredentialsNextResults
  1527  	req, err := client.ListCredentialsPreparer(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1528  	if err != nil {
  1529  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", nil, "Failure preparing request")
  1530  		return
  1531  	}
  1532  
  1533  	resp, err := client.ListCredentialsSender(req)
  1534  	if err != nil {
  1535  		result.ucl.Response = autorest.Response{Response: resp}
  1536  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", resp, "Failure sending request")
  1537  		return
  1538  	}
  1539  
  1540  	result.ucl, err = client.ListCredentialsResponder(resp)
  1541  	if err != nil {
  1542  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListCredentials", resp, "Failure responding to request")
  1543  		return
  1544  	}
  1545  	if result.ucl.hasNextLink() && result.ucl.IsEmpty() {
  1546  		err = result.NextWithContext(ctx)
  1547  		return
  1548  	}
  1549  
  1550  	return
  1551  }
  1552  
  1553  // ListCredentialsPreparer prepares the ListCredentials request.
  1554  func (client Client) ListCredentialsPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  1555  	urlParameters := map[string]interface{}{
  1556  		"accountName":          accountName,
  1557  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1558  	}
  1559  
  1560  	pathParameters := map[string]interface{}{
  1561  		"databaseName": autorest.Encode("path", databaseName),
  1562  	}
  1563  
  1564  	const APIVersion = "2015-10-01-preview"
  1565  	queryParameters := map[string]interface{}{
  1566  		"api-version": APIVersion,
  1567  	}
  1568  	if len(filter) > 0 {
  1569  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1570  	}
  1571  	if top != nil {
  1572  		queryParameters["$top"] = autorest.Encode("query", *top)
  1573  	}
  1574  	if skip != nil {
  1575  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1576  	}
  1577  	if len(expand) > 0 {
  1578  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1579  	}
  1580  	if len(selectParameter) > 0 {
  1581  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1582  	}
  1583  	if len(orderby) > 0 {
  1584  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1585  	}
  1586  	if count != nil {
  1587  		queryParameters["$count"] = autorest.Encode("query", *count)
  1588  	}
  1589  
  1590  	preparer := autorest.CreatePreparer(
  1591  		autorest.AsGet(),
  1592  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1593  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/credentials", pathParameters),
  1594  		autorest.WithQueryParameters(queryParameters))
  1595  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1596  }
  1597  
  1598  // ListCredentialsSender sends the ListCredentials request. The method will close the
  1599  // http.Response Body if it receives an error.
  1600  func (client Client) ListCredentialsSender(req *http.Request) (*http.Response, error) {
  1601  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1602  }
  1603  
  1604  // ListCredentialsResponder handles the response to the ListCredentials request. The method always
  1605  // closes the http.Response Body.
  1606  func (client Client) ListCredentialsResponder(resp *http.Response) (result USQLCredentialList, err error) {
  1607  	err = autorest.Respond(
  1608  		resp,
  1609  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1610  		autorest.ByUnmarshallingJSON(&result),
  1611  		autorest.ByClosing())
  1612  	result.Response = autorest.Response{Response: resp}
  1613  	return
  1614  }
  1615  
  1616  // listCredentialsNextResults retrieves the next set of results, if any.
  1617  func (client Client) listCredentialsNextResults(ctx context.Context, lastResults USQLCredentialList) (result USQLCredentialList, err error) {
  1618  	req, err := lastResults.uSQLCredentialListPreparer(ctx)
  1619  	if err != nil {
  1620  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", nil, "Failure preparing next results request")
  1621  	}
  1622  	if req == nil {
  1623  		return
  1624  	}
  1625  	resp, err := client.ListCredentialsSender(req)
  1626  	if err != nil {
  1627  		result.Response = autorest.Response{Response: resp}
  1628  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", resp, "Failure sending next results request")
  1629  	}
  1630  	result, err = client.ListCredentialsResponder(resp)
  1631  	if err != nil {
  1632  		err = autorest.NewErrorWithError(err, "catalog.Client", "listCredentialsNextResults", resp, "Failure responding to next results request")
  1633  	}
  1634  	return
  1635  }
  1636  
  1637  // ListCredentialsComplete enumerates all values, automatically crossing page boundaries as required.
  1638  func (client Client) ListCredentialsComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLCredentialListIterator, err error) {
  1639  	if tracing.IsEnabled() {
  1640  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListCredentials")
  1641  		defer func() {
  1642  			sc := -1
  1643  			if result.Response().Response.Response != nil {
  1644  				sc = result.page.Response().Response.Response.StatusCode
  1645  			}
  1646  			tracing.EndSpan(ctx, sc, err)
  1647  		}()
  1648  	}
  1649  	result.page, err = client.ListCredentials(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1650  	return
  1651  }
  1652  
  1653  // ListDatabases retrieves the list of databases from the Data Lake Analytics catalog.
  1654  // Parameters:
  1655  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1656  // filter - oData filter. Optional.
  1657  // top - the number of items to return. Optional.
  1658  // skip - the number of items to skip over before returning elements. Optional.
  1659  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1660  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  1661  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1662  // Categories?$select=CategoryName,Description. Optional.
  1663  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1664  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1665  // Optional.
  1666  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1667  // resources in the response, e.g. Categories?$count=true. Optional.
  1668  func (client Client) ListDatabases(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLDatabaseListPage, err error) {
  1669  	if tracing.IsEnabled() {
  1670  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDatabases")
  1671  		defer func() {
  1672  			sc := -1
  1673  			if result.udl.Response.Response != nil {
  1674  				sc = result.udl.Response.Response.StatusCode
  1675  			}
  1676  			tracing.EndSpan(ctx, sc, err)
  1677  		}()
  1678  	}
  1679  	result.fn = client.listDatabasesNextResults
  1680  	req, err := client.ListDatabasesPreparer(ctx, accountName, filter, top, skip, expand, selectParameter, orderby, count)
  1681  	if err != nil {
  1682  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", nil, "Failure preparing request")
  1683  		return
  1684  	}
  1685  
  1686  	resp, err := client.ListDatabasesSender(req)
  1687  	if err != nil {
  1688  		result.udl.Response = autorest.Response{Response: resp}
  1689  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", resp, "Failure sending request")
  1690  		return
  1691  	}
  1692  
  1693  	result.udl, err = client.ListDatabasesResponder(resp)
  1694  	if err != nil {
  1695  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListDatabases", resp, "Failure responding to request")
  1696  		return
  1697  	}
  1698  	if result.udl.hasNextLink() && result.udl.IsEmpty() {
  1699  		err = result.NextWithContext(ctx)
  1700  		return
  1701  	}
  1702  
  1703  	return
  1704  }
  1705  
  1706  // ListDatabasesPreparer prepares the ListDatabases request.
  1707  func (client Client) ListDatabasesPreparer(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  1708  	urlParameters := map[string]interface{}{
  1709  		"accountName":          accountName,
  1710  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1711  	}
  1712  
  1713  	const APIVersion = "2015-10-01-preview"
  1714  	queryParameters := map[string]interface{}{
  1715  		"api-version": APIVersion,
  1716  	}
  1717  	if len(filter) > 0 {
  1718  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1719  	}
  1720  	if top != nil {
  1721  		queryParameters["$top"] = autorest.Encode("query", *top)
  1722  	}
  1723  	if skip != nil {
  1724  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1725  	}
  1726  	if len(expand) > 0 {
  1727  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1728  	}
  1729  	if len(selectParameter) > 0 {
  1730  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1731  	}
  1732  	if len(orderby) > 0 {
  1733  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1734  	}
  1735  	if count != nil {
  1736  		queryParameters["$count"] = autorest.Encode("query", *count)
  1737  	}
  1738  
  1739  	preparer := autorest.CreatePreparer(
  1740  		autorest.AsGet(),
  1741  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1742  		autorest.WithPath("/catalog/usql/databases"),
  1743  		autorest.WithQueryParameters(queryParameters))
  1744  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1745  }
  1746  
  1747  // ListDatabasesSender sends the ListDatabases request. The method will close the
  1748  // http.Response Body if it receives an error.
  1749  func (client Client) ListDatabasesSender(req *http.Request) (*http.Response, error) {
  1750  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1751  }
  1752  
  1753  // ListDatabasesResponder handles the response to the ListDatabases request. The method always
  1754  // closes the http.Response Body.
  1755  func (client Client) ListDatabasesResponder(resp *http.Response) (result USQLDatabaseList, err error) {
  1756  	err = autorest.Respond(
  1757  		resp,
  1758  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1759  		autorest.ByUnmarshallingJSON(&result),
  1760  		autorest.ByClosing())
  1761  	result.Response = autorest.Response{Response: resp}
  1762  	return
  1763  }
  1764  
  1765  // listDatabasesNextResults retrieves the next set of results, if any.
  1766  func (client Client) listDatabasesNextResults(ctx context.Context, lastResults USQLDatabaseList) (result USQLDatabaseList, err error) {
  1767  	req, err := lastResults.uSQLDatabaseListPreparer(ctx)
  1768  	if err != nil {
  1769  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", nil, "Failure preparing next results request")
  1770  	}
  1771  	if req == nil {
  1772  		return
  1773  	}
  1774  	resp, err := client.ListDatabasesSender(req)
  1775  	if err != nil {
  1776  		result.Response = autorest.Response{Response: resp}
  1777  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", resp, "Failure sending next results request")
  1778  	}
  1779  	result, err = client.ListDatabasesResponder(resp)
  1780  	if err != nil {
  1781  		err = autorest.NewErrorWithError(err, "catalog.Client", "listDatabasesNextResults", resp, "Failure responding to next results request")
  1782  	}
  1783  	return
  1784  }
  1785  
  1786  // ListDatabasesComplete enumerates all values, automatically crossing page boundaries as required.
  1787  func (client Client) ListDatabasesComplete(ctx context.Context, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLDatabaseListIterator, err error) {
  1788  	if tracing.IsEnabled() {
  1789  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDatabases")
  1790  		defer func() {
  1791  			sc := -1
  1792  			if result.Response().Response.Response != nil {
  1793  				sc = result.page.Response().Response.Response.StatusCode
  1794  			}
  1795  			tracing.EndSpan(ctx, sc, err)
  1796  		}()
  1797  	}
  1798  	result.page, err = client.ListDatabases(ctx, accountName, filter, top, skip, expand, selectParameter, orderby, count)
  1799  	return
  1800  }
  1801  
  1802  // ListExternalDataSources retrieves the list of external data sources from the Data Lake Analytics catalog.
  1803  // Parameters:
  1804  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1805  // databaseName - the name of the database containing the external data sources.
  1806  // filter - oData filter. Optional.
  1807  // top - the number of items to return. Optional.
  1808  // skip - the number of items to skip over before returning elements. Optional.
  1809  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1810  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  1811  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1812  // Categories?$select=CategoryName,Description. Optional.
  1813  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1814  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1815  // Optional.
  1816  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1817  // resources in the response, e.g. Categories?$count=true. Optional.
  1818  func (client Client) ListExternalDataSources(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLExternalDataSourceListPage, err error) {
  1819  	if tracing.IsEnabled() {
  1820  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListExternalDataSources")
  1821  		defer func() {
  1822  			sc := -1
  1823  			if result.uedsl.Response.Response != nil {
  1824  				sc = result.uedsl.Response.Response.StatusCode
  1825  			}
  1826  			tracing.EndSpan(ctx, sc, err)
  1827  		}()
  1828  	}
  1829  	result.fn = client.listExternalDataSourcesNextResults
  1830  	req, err := client.ListExternalDataSourcesPreparer(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1831  	if err != nil {
  1832  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", nil, "Failure preparing request")
  1833  		return
  1834  	}
  1835  
  1836  	resp, err := client.ListExternalDataSourcesSender(req)
  1837  	if err != nil {
  1838  		result.uedsl.Response = autorest.Response{Response: resp}
  1839  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", resp, "Failure sending request")
  1840  		return
  1841  	}
  1842  
  1843  	result.uedsl, err = client.ListExternalDataSourcesResponder(resp)
  1844  	if err != nil {
  1845  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListExternalDataSources", resp, "Failure responding to request")
  1846  		return
  1847  	}
  1848  	if result.uedsl.hasNextLink() && result.uedsl.IsEmpty() {
  1849  		err = result.NextWithContext(ctx)
  1850  		return
  1851  	}
  1852  
  1853  	return
  1854  }
  1855  
  1856  // ListExternalDataSourcesPreparer prepares the ListExternalDataSources request.
  1857  func (client Client) ListExternalDataSourcesPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  1858  	urlParameters := map[string]interface{}{
  1859  		"accountName":          accountName,
  1860  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  1861  	}
  1862  
  1863  	pathParameters := map[string]interface{}{
  1864  		"databaseName": autorest.Encode("path", databaseName),
  1865  	}
  1866  
  1867  	const APIVersion = "2015-10-01-preview"
  1868  	queryParameters := map[string]interface{}{
  1869  		"api-version": APIVersion,
  1870  	}
  1871  	if len(filter) > 0 {
  1872  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1873  	}
  1874  	if top != nil {
  1875  		queryParameters["$top"] = autorest.Encode("query", *top)
  1876  	}
  1877  	if skip != nil {
  1878  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  1879  	}
  1880  	if len(expand) > 0 {
  1881  		queryParameters["$expand"] = autorest.Encode("query", expand)
  1882  	}
  1883  	if len(selectParameter) > 0 {
  1884  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  1885  	}
  1886  	if len(orderby) > 0 {
  1887  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  1888  	}
  1889  	if count != nil {
  1890  		queryParameters["$count"] = autorest.Encode("query", *count)
  1891  	}
  1892  
  1893  	preparer := autorest.CreatePreparer(
  1894  		autorest.AsGet(),
  1895  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  1896  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/externaldatasources", pathParameters),
  1897  		autorest.WithQueryParameters(queryParameters))
  1898  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1899  }
  1900  
  1901  // ListExternalDataSourcesSender sends the ListExternalDataSources request. The method will close the
  1902  // http.Response Body if it receives an error.
  1903  func (client Client) ListExternalDataSourcesSender(req *http.Request) (*http.Response, error) {
  1904  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1905  }
  1906  
  1907  // ListExternalDataSourcesResponder handles the response to the ListExternalDataSources request. The method always
  1908  // closes the http.Response Body.
  1909  func (client Client) ListExternalDataSourcesResponder(resp *http.Response) (result USQLExternalDataSourceList, err error) {
  1910  	err = autorest.Respond(
  1911  		resp,
  1912  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1913  		autorest.ByUnmarshallingJSON(&result),
  1914  		autorest.ByClosing())
  1915  	result.Response = autorest.Response{Response: resp}
  1916  	return
  1917  }
  1918  
  1919  // listExternalDataSourcesNextResults retrieves the next set of results, if any.
  1920  func (client Client) listExternalDataSourcesNextResults(ctx context.Context, lastResults USQLExternalDataSourceList) (result USQLExternalDataSourceList, err error) {
  1921  	req, err := lastResults.uSQLExternalDataSourceListPreparer(ctx)
  1922  	if err != nil {
  1923  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", nil, "Failure preparing next results request")
  1924  	}
  1925  	if req == nil {
  1926  		return
  1927  	}
  1928  	resp, err := client.ListExternalDataSourcesSender(req)
  1929  	if err != nil {
  1930  		result.Response = autorest.Response{Response: resp}
  1931  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", resp, "Failure sending next results request")
  1932  	}
  1933  	result, err = client.ListExternalDataSourcesResponder(resp)
  1934  	if err != nil {
  1935  		err = autorest.NewErrorWithError(err, "catalog.Client", "listExternalDataSourcesNextResults", resp, "Failure responding to next results request")
  1936  	}
  1937  	return
  1938  }
  1939  
  1940  // ListExternalDataSourcesComplete enumerates all values, automatically crossing page boundaries as required.
  1941  func (client Client) ListExternalDataSourcesComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLExternalDataSourceListIterator, err error) {
  1942  	if tracing.IsEnabled() {
  1943  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListExternalDataSources")
  1944  		defer func() {
  1945  			sc := -1
  1946  			if result.Response().Response.Response != nil {
  1947  				sc = result.page.Response().Response.Response.StatusCode
  1948  			}
  1949  			tracing.EndSpan(ctx, sc, err)
  1950  		}()
  1951  	}
  1952  	result.page, err = client.ListExternalDataSources(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  1953  	return
  1954  }
  1955  
  1956  // ListProcedures retrieves the list of procedures from the Data Lake Analytics catalog.
  1957  // Parameters:
  1958  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  1959  // databaseName - the name of the database containing the procedures.
  1960  // schemaName - the name of the schema containing the procedures.
  1961  // filter - oData filter. Optional.
  1962  // top - the number of items to return. Optional.
  1963  // skip - the number of items to skip over before returning elements. Optional.
  1964  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  1965  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  1966  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  1967  // Categories?$select=CategoryName,Description. Optional.
  1968  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  1969  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  1970  // Optional.
  1971  // count - the Boolean value of true or false to request a count of the matching resources included with the
  1972  // resources in the response, e.g. Categories?$count=true. Optional.
  1973  func (client Client) ListProcedures(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLProcedureListPage, err error) {
  1974  	if tracing.IsEnabled() {
  1975  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListProcedures")
  1976  		defer func() {
  1977  			sc := -1
  1978  			if result.upl.Response.Response != nil {
  1979  				sc = result.upl.Response.Response.StatusCode
  1980  			}
  1981  			tracing.EndSpan(ctx, sc, err)
  1982  		}()
  1983  	}
  1984  	result.fn = client.listProceduresNextResults
  1985  	req, err := client.ListProceduresPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  1986  	if err != nil {
  1987  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", nil, "Failure preparing request")
  1988  		return
  1989  	}
  1990  
  1991  	resp, err := client.ListProceduresSender(req)
  1992  	if err != nil {
  1993  		result.upl.Response = autorest.Response{Response: resp}
  1994  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", resp, "Failure sending request")
  1995  		return
  1996  	}
  1997  
  1998  	result.upl, err = client.ListProceduresResponder(resp)
  1999  	if err != nil {
  2000  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListProcedures", resp, "Failure responding to request")
  2001  		return
  2002  	}
  2003  	if result.upl.hasNextLink() && result.upl.IsEmpty() {
  2004  		err = result.NextWithContext(ctx)
  2005  		return
  2006  	}
  2007  
  2008  	return
  2009  }
  2010  
  2011  // ListProceduresPreparer prepares the ListProcedures request.
  2012  func (client Client) ListProceduresPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2013  	urlParameters := map[string]interface{}{
  2014  		"accountName":          accountName,
  2015  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2016  	}
  2017  
  2018  	pathParameters := map[string]interface{}{
  2019  		"databaseName": autorest.Encode("path", databaseName),
  2020  		"schemaName":   autorest.Encode("path", schemaName),
  2021  	}
  2022  
  2023  	const APIVersion = "2015-10-01-preview"
  2024  	queryParameters := map[string]interface{}{
  2025  		"api-version": APIVersion,
  2026  	}
  2027  	if len(filter) > 0 {
  2028  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2029  	}
  2030  	if top != nil {
  2031  		queryParameters["$top"] = autorest.Encode("query", *top)
  2032  	}
  2033  	if skip != nil {
  2034  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2035  	}
  2036  	if len(expand) > 0 {
  2037  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2038  	}
  2039  	if len(selectParameter) > 0 {
  2040  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2041  	}
  2042  	if len(orderby) > 0 {
  2043  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2044  	}
  2045  	if count != nil {
  2046  		queryParameters["$count"] = autorest.Encode("query", *count)
  2047  	}
  2048  
  2049  	preparer := autorest.CreatePreparer(
  2050  		autorest.AsGet(),
  2051  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2052  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures", pathParameters),
  2053  		autorest.WithQueryParameters(queryParameters))
  2054  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2055  }
  2056  
  2057  // ListProceduresSender sends the ListProcedures request. The method will close the
  2058  // http.Response Body if it receives an error.
  2059  func (client Client) ListProceduresSender(req *http.Request) (*http.Response, error) {
  2060  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2061  }
  2062  
  2063  // ListProceduresResponder handles the response to the ListProcedures request. The method always
  2064  // closes the http.Response Body.
  2065  func (client Client) ListProceduresResponder(resp *http.Response) (result USQLProcedureList, err error) {
  2066  	err = autorest.Respond(
  2067  		resp,
  2068  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2069  		autorest.ByUnmarshallingJSON(&result),
  2070  		autorest.ByClosing())
  2071  	result.Response = autorest.Response{Response: resp}
  2072  	return
  2073  }
  2074  
  2075  // listProceduresNextResults retrieves the next set of results, if any.
  2076  func (client Client) listProceduresNextResults(ctx context.Context, lastResults USQLProcedureList) (result USQLProcedureList, err error) {
  2077  	req, err := lastResults.uSQLProcedureListPreparer(ctx)
  2078  	if err != nil {
  2079  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", nil, "Failure preparing next results request")
  2080  	}
  2081  	if req == nil {
  2082  		return
  2083  	}
  2084  	resp, err := client.ListProceduresSender(req)
  2085  	if err != nil {
  2086  		result.Response = autorest.Response{Response: resp}
  2087  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", resp, "Failure sending next results request")
  2088  	}
  2089  	result, err = client.ListProceduresResponder(resp)
  2090  	if err != nil {
  2091  		err = autorest.NewErrorWithError(err, "catalog.Client", "listProceduresNextResults", resp, "Failure responding to next results request")
  2092  	}
  2093  	return
  2094  }
  2095  
  2096  // ListProceduresComplete enumerates all values, automatically crossing page boundaries as required.
  2097  func (client Client) ListProceduresComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLProcedureListIterator, err error) {
  2098  	if tracing.IsEnabled() {
  2099  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListProcedures")
  2100  		defer func() {
  2101  			sc := -1
  2102  			if result.Response().Response.Response != nil {
  2103  				sc = result.page.Response().Response.Response.StatusCode
  2104  			}
  2105  			tracing.EndSpan(ctx, sc, err)
  2106  		}()
  2107  	}
  2108  	result.page, err = client.ListProcedures(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2109  	return
  2110  }
  2111  
  2112  // ListSchemas retrieves the list of schemas from the Data Lake Analytics catalog.
  2113  // Parameters:
  2114  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2115  // databaseName - the name of the database containing the schema.
  2116  // filter - oData filter. Optional.
  2117  // top - the number of items to return. Optional.
  2118  // skip - the number of items to skip over before returning elements. Optional.
  2119  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2120  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2121  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2122  // Categories?$select=CategoryName,Description. Optional.
  2123  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2124  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2125  // Optional.
  2126  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2127  // resources in the response, e.g. Categories?$count=true. Optional.
  2128  func (client Client) ListSchemas(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLSchemaListPage, err error) {
  2129  	if tracing.IsEnabled() {
  2130  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSchemas")
  2131  		defer func() {
  2132  			sc := -1
  2133  			if result.usl.Response.Response != nil {
  2134  				sc = result.usl.Response.Response.StatusCode
  2135  			}
  2136  			tracing.EndSpan(ctx, sc, err)
  2137  		}()
  2138  	}
  2139  	result.fn = client.listSchemasNextResults
  2140  	req, err := client.ListSchemasPreparer(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  2141  	if err != nil {
  2142  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", nil, "Failure preparing request")
  2143  		return
  2144  	}
  2145  
  2146  	resp, err := client.ListSchemasSender(req)
  2147  	if err != nil {
  2148  		result.usl.Response = autorest.Response{Response: resp}
  2149  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", resp, "Failure sending request")
  2150  		return
  2151  	}
  2152  
  2153  	result.usl, err = client.ListSchemasResponder(resp)
  2154  	if err != nil {
  2155  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListSchemas", resp, "Failure responding to request")
  2156  		return
  2157  	}
  2158  	if result.usl.hasNextLink() && result.usl.IsEmpty() {
  2159  		err = result.NextWithContext(ctx)
  2160  		return
  2161  	}
  2162  
  2163  	return
  2164  }
  2165  
  2166  // ListSchemasPreparer prepares the ListSchemas request.
  2167  func (client Client) ListSchemasPreparer(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2168  	urlParameters := map[string]interface{}{
  2169  		"accountName":          accountName,
  2170  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2171  	}
  2172  
  2173  	pathParameters := map[string]interface{}{
  2174  		"databaseName": autorest.Encode("path", databaseName),
  2175  	}
  2176  
  2177  	const APIVersion = "2015-10-01-preview"
  2178  	queryParameters := map[string]interface{}{
  2179  		"api-version": APIVersion,
  2180  	}
  2181  	if len(filter) > 0 {
  2182  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2183  	}
  2184  	if top != nil {
  2185  		queryParameters["$top"] = autorest.Encode("query", *top)
  2186  	}
  2187  	if skip != nil {
  2188  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2189  	}
  2190  	if len(expand) > 0 {
  2191  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2192  	}
  2193  	if len(selectParameter) > 0 {
  2194  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2195  	}
  2196  	if len(orderby) > 0 {
  2197  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2198  	}
  2199  	if count != nil {
  2200  		queryParameters["$count"] = autorest.Encode("query", *count)
  2201  	}
  2202  
  2203  	preparer := autorest.CreatePreparer(
  2204  		autorest.AsGet(),
  2205  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2206  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas", pathParameters),
  2207  		autorest.WithQueryParameters(queryParameters))
  2208  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2209  }
  2210  
  2211  // ListSchemasSender sends the ListSchemas request. The method will close the
  2212  // http.Response Body if it receives an error.
  2213  func (client Client) ListSchemasSender(req *http.Request) (*http.Response, error) {
  2214  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2215  }
  2216  
  2217  // ListSchemasResponder handles the response to the ListSchemas request. The method always
  2218  // closes the http.Response Body.
  2219  func (client Client) ListSchemasResponder(resp *http.Response) (result USQLSchemaList, err error) {
  2220  	err = autorest.Respond(
  2221  		resp,
  2222  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2223  		autorest.ByUnmarshallingJSON(&result),
  2224  		autorest.ByClosing())
  2225  	result.Response = autorest.Response{Response: resp}
  2226  	return
  2227  }
  2228  
  2229  // listSchemasNextResults retrieves the next set of results, if any.
  2230  func (client Client) listSchemasNextResults(ctx context.Context, lastResults USQLSchemaList) (result USQLSchemaList, err error) {
  2231  	req, err := lastResults.uSQLSchemaListPreparer(ctx)
  2232  	if err != nil {
  2233  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", nil, "Failure preparing next results request")
  2234  	}
  2235  	if req == nil {
  2236  		return
  2237  	}
  2238  	resp, err := client.ListSchemasSender(req)
  2239  	if err != nil {
  2240  		result.Response = autorest.Response{Response: resp}
  2241  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", resp, "Failure sending next results request")
  2242  	}
  2243  	result, err = client.ListSchemasResponder(resp)
  2244  	if err != nil {
  2245  		err = autorest.NewErrorWithError(err, "catalog.Client", "listSchemasNextResults", resp, "Failure responding to next results request")
  2246  	}
  2247  	return
  2248  }
  2249  
  2250  // ListSchemasComplete enumerates all values, automatically crossing page boundaries as required.
  2251  func (client Client) ListSchemasComplete(ctx context.Context, accountName string, databaseName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLSchemaListIterator, err error) {
  2252  	if tracing.IsEnabled() {
  2253  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSchemas")
  2254  		defer func() {
  2255  			sc := -1
  2256  			if result.Response().Response.Response != nil {
  2257  				sc = result.page.Response().Response.Response.StatusCode
  2258  			}
  2259  			tracing.EndSpan(ctx, sc, err)
  2260  		}()
  2261  	}
  2262  	result.page, err = client.ListSchemas(ctx, accountName, databaseName, filter, top, skip, expand, selectParameter, orderby, count)
  2263  	return
  2264  }
  2265  
  2266  // ListTablePartitions retrieves the list of table partitions from the Data Lake Analytics catalog.
  2267  // Parameters:
  2268  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2269  // databaseName - the name of the database containing the partitions.
  2270  // schemaName - the name of the schema containing the partitions.
  2271  // tableName - the name of the table containing the partitions.
  2272  // filter - oData filter. Optional.
  2273  // top - the number of items to return. Optional.
  2274  // skip - the number of items to skip over before returning elements. Optional.
  2275  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2276  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2277  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2278  // Categories?$select=CategoryName,Description. Optional.
  2279  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2280  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2281  // Optional.
  2282  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2283  // resources in the response, e.g. Categories?$count=true. Optional.
  2284  func (client Client) ListTablePartitions(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTablePartitionListPage, err error) {
  2285  	if tracing.IsEnabled() {
  2286  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablePartitions")
  2287  		defer func() {
  2288  			sc := -1
  2289  			if result.utpl.Response.Response != nil {
  2290  				sc = result.utpl.Response.Response.StatusCode
  2291  			}
  2292  			tracing.EndSpan(ctx, sc, err)
  2293  		}()
  2294  	}
  2295  	result.fn = client.listTablePartitionsNextResults
  2296  	req, err := client.ListTablePartitionsPreparer(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, expand, selectParameter, orderby, count)
  2297  	if err != nil {
  2298  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", nil, "Failure preparing request")
  2299  		return
  2300  	}
  2301  
  2302  	resp, err := client.ListTablePartitionsSender(req)
  2303  	if err != nil {
  2304  		result.utpl.Response = autorest.Response{Response: resp}
  2305  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", resp, "Failure sending request")
  2306  		return
  2307  	}
  2308  
  2309  	result.utpl, err = client.ListTablePartitionsResponder(resp)
  2310  	if err != nil {
  2311  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTablePartitions", resp, "Failure responding to request")
  2312  		return
  2313  	}
  2314  	if result.utpl.hasNextLink() && result.utpl.IsEmpty() {
  2315  		err = result.NextWithContext(ctx)
  2316  		return
  2317  	}
  2318  
  2319  	return
  2320  }
  2321  
  2322  // ListTablePartitionsPreparer prepares the ListTablePartitions request.
  2323  func (client Client) ListTablePartitionsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2324  	urlParameters := map[string]interface{}{
  2325  		"accountName":          accountName,
  2326  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2327  	}
  2328  
  2329  	pathParameters := map[string]interface{}{
  2330  		"databaseName": autorest.Encode("path", databaseName),
  2331  		"schemaName":   autorest.Encode("path", schemaName),
  2332  		"tableName":    autorest.Encode("path", tableName),
  2333  	}
  2334  
  2335  	const APIVersion = "2015-10-01-preview"
  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(expand) > 0 {
  2349  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2350  	}
  2351  	if len(selectParameter) > 0 {
  2352  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2353  	}
  2354  	if len(orderby) > 0 {
  2355  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2356  	}
  2357  	if count != nil {
  2358  		queryParameters["$count"] = autorest.Encode("query", *count)
  2359  	}
  2360  
  2361  	preparer := autorest.CreatePreparer(
  2362  		autorest.AsGet(),
  2363  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2364  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions", pathParameters),
  2365  		autorest.WithQueryParameters(queryParameters))
  2366  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2367  }
  2368  
  2369  // ListTablePartitionsSender sends the ListTablePartitions request. The method will close the
  2370  // http.Response Body if it receives an error.
  2371  func (client Client) ListTablePartitionsSender(req *http.Request) (*http.Response, error) {
  2372  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2373  }
  2374  
  2375  // ListTablePartitionsResponder handles the response to the ListTablePartitions request. The method always
  2376  // closes the http.Response Body.
  2377  func (client Client) ListTablePartitionsResponder(resp *http.Response) (result USQLTablePartitionList, err error) {
  2378  	err = autorest.Respond(
  2379  		resp,
  2380  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2381  		autorest.ByUnmarshallingJSON(&result),
  2382  		autorest.ByClosing())
  2383  	result.Response = autorest.Response{Response: resp}
  2384  	return
  2385  }
  2386  
  2387  // listTablePartitionsNextResults retrieves the next set of results, if any.
  2388  func (client Client) listTablePartitionsNextResults(ctx context.Context, lastResults USQLTablePartitionList) (result USQLTablePartitionList, err error) {
  2389  	req, err := lastResults.uSQLTablePartitionListPreparer(ctx)
  2390  	if err != nil {
  2391  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", nil, "Failure preparing next results request")
  2392  	}
  2393  	if req == nil {
  2394  		return
  2395  	}
  2396  	resp, err := client.ListTablePartitionsSender(req)
  2397  	if err != nil {
  2398  		result.Response = autorest.Response{Response: resp}
  2399  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", resp, "Failure sending next results request")
  2400  	}
  2401  	result, err = client.ListTablePartitionsResponder(resp)
  2402  	if err != nil {
  2403  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTablePartitionsNextResults", resp, "Failure responding to next results request")
  2404  	}
  2405  	return
  2406  }
  2407  
  2408  // ListTablePartitionsComplete enumerates all values, automatically crossing page boundaries as required.
  2409  func (client Client) ListTablePartitionsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTablePartitionListIterator, err error) {
  2410  	if tracing.IsEnabled() {
  2411  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTablePartitions")
  2412  		defer func() {
  2413  			sc := -1
  2414  			if result.Response().Response.Response != nil {
  2415  				sc = result.page.Response().Response.Response.StatusCode
  2416  			}
  2417  			tracing.EndSpan(ctx, sc, err)
  2418  		}()
  2419  	}
  2420  	result.page, err = client.ListTablePartitions(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, expand, selectParameter, orderby, count)
  2421  	return
  2422  }
  2423  
  2424  // ListTables retrieves the list of tables from the Data Lake Analytics catalog.
  2425  // Parameters:
  2426  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2427  // databaseName - the name of the database containing the tables.
  2428  // schemaName - the name of the schema containing the tables.
  2429  // filter - oData filter. Optional.
  2430  // top - the number of items to return. Optional.
  2431  // skip - the number of items to skip over before returning elements. Optional.
  2432  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2433  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2434  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2435  // Categories?$select=CategoryName,Description. Optional.
  2436  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2437  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2438  // Optional.
  2439  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2440  // resources in the response, e.g. Categories?$count=true. Optional.
  2441  func (client Client) ListTables(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableListPage, err error) {
  2442  	if tracing.IsEnabled() {
  2443  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTables")
  2444  		defer func() {
  2445  			sc := -1
  2446  			if result.utl.Response.Response != nil {
  2447  				sc = result.utl.Response.Response.StatusCode
  2448  			}
  2449  			tracing.EndSpan(ctx, sc, err)
  2450  		}()
  2451  	}
  2452  	result.fn = client.listTablesNextResults
  2453  	req, err := client.ListTablesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2454  	if err != nil {
  2455  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", nil, "Failure preparing request")
  2456  		return
  2457  	}
  2458  
  2459  	resp, err := client.ListTablesSender(req)
  2460  	if err != nil {
  2461  		result.utl.Response = autorest.Response{Response: resp}
  2462  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", resp, "Failure sending request")
  2463  		return
  2464  	}
  2465  
  2466  	result.utl, err = client.ListTablesResponder(resp)
  2467  	if err != nil {
  2468  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTables", resp, "Failure responding to request")
  2469  		return
  2470  	}
  2471  	if result.utl.hasNextLink() && result.utl.IsEmpty() {
  2472  		err = result.NextWithContext(ctx)
  2473  		return
  2474  	}
  2475  
  2476  	return
  2477  }
  2478  
  2479  // ListTablesPreparer prepares the ListTables request.
  2480  func (client Client) ListTablesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2481  	urlParameters := map[string]interface{}{
  2482  		"accountName":          accountName,
  2483  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2484  	}
  2485  
  2486  	pathParameters := map[string]interface{}{
  2487  		"databaseName": autorest.Encode("path", databaseName),
  2488  		"schemaName":   autorest.Encode("path", schemaName),
  2489  	}
  2490  
  2491  	const APIVersion = "2015-10-01-preview"
  2492  	queryParameters := map[string]interface{}{
  2493  		"api-version": APIVersion,
  2494  	}
  2495  	if len(filter) > 0 {
  2496  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2497  	}
  2498  	if top != nil {
  2499  		queryParameters["$top"] = autorest.Encode("query", *top)
  2500  	}
  2501  	if skip != nil {
  2502  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2503  	}
  2504  	if len(expand) > 0 {
  2505  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2506  	}
  2507  	if len(selectParameter) > 0 {
  2508  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2509  	}
  2510  	if len(orderby) > 0 {
  2511  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2512  	}
  2513  	if count != nil {
  2514  		queryParameters["$count"] = autorest.Encode("query", *count)
  2515  	}
  2516  
  2517  	preparer := autorest.CreatePreparer(
  2518  		autorest.AsGet(),
  2519  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2520  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables", pathParameters),
  2521  		autorest.WithQueryParameters(queryParameters))
  2522  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2523  }
  2524  
  2525  // ListTablesSender sends the ListTables request. The method will close the
  2526  // http.Response Body if it receives an error.
  2527  func (client Client) ListTablesSender(req *http.Request) (*http.Response, error) {
  2528  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2529  }
  2530  
  2531  // ListTablesResponder handles the response to the ListTables request. The method always
  2532  // closes the http.Response Body.
  2533  func (client Client) ListTablesResponder(resp *http.Response) (result USQLTableList, err error) {
  2534  	err = autorest.Respond(
  2535  		resp,
  2536  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2537  		autorest.ByUnmarshallingJSON(&result),
  2538  		autorest.ByClosing())
  2539  	result.Response = autorest.Response{Response: resp}
  2540  	return
  2541  }
  2542  
  2543  // listTablesNextResults retrieves the next set of results, if any.
  2544  func (client Client) listTablesNextResults(ctx context.Context, lastResults USQLTableList) (result USQLTableList, err error) {
  2545  	req, err := lastResults.uSQLTableListPreparer(ctx)
  2546  	if err != nil {
  2547  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", nil, "Failure preparing next results request")
  2548  	}
  2549  	if req == nil {
  2550  		return
  2551  	}
  2552  	resp, err := client.ListTablesSender(req)
  2553  	if err != nil {
  2554  		result.Response = autorest.Response{Response: resp}
  2555  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", resp, "Failure sending next results request")
  2556  	}
  2557  	result, err = client.ListTablesResponder(resp)
  2558  	if err != nil {
  2559  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTablesNextResults", resp, "Failure responding to next results request")
  2560  	}
  2561  	return
  2562  }
  2563  
  2564  // ListTablesComplete enumerates all values, automatically crossing page boundaries as required.
  2565  func (client Client) ListTablesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableListIterator, err error) {
  2566  	if tracing.IsEnabled() {
  2567  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTables")
  2568  		defer func() {
  2569  			sc := -1
  2570  			if result.Response().Response.Response != nil {
  2571  				sc = result.page.Response().Response.Response.StatusCode
  2572  			}
  2573  			tracing.EndSpan(ctx, sc, err)
  2574  		}()
  2575  	}
  2576  	result.page, err = client.ListTables(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2577  	return
  2578  }
  2579  
  2580  // ListTableStatistics retrieves the list of table statistics from the Data Lake Analytics catalog.
  2581  // Parameters:
  2582  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2583  // databaseName - the name of the database containing the statistics.
  2584  // schemaName - the name of the schema containing the statistics.
  2585  // tableName - the name of the table containing the statistics.
  2586  // filter - oData filter. Optional.
  2587  // top - the number of items to return. Optional.
  2588  // skip - the number of items to skip over before returning elements. Optional.
  2589  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2590  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2591  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2592  // Categories?$select=CategoryName,Description. Optional.
  2593  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2594  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2595  // Optional.
  2596  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2597  // resources in the response, e.g. Categories?$count=true. Optional.
  2598  func (client Client) ListTableStatistics(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListPage, err error) {
  2599  	if tracing.IsEnabled() {
  2600  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatistics")
  2601  		defer func() {
  2602  			sc := -1
  2603  			if result.utsl.Response.Response != nil {
  2604  				sc = result.utsl.Response.Response.StatusCode
  2605  			}
  2606  			tracing.EndSpan(ctx, sc, err)
  2607  		}()
  2608  	}
  2609  	result.fn = client.listTableStatisticsNextResults
  2610  	req, err := client.ListTableStatisticsPreparer(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, expand, selectParameter, orderby, count)
  2611  	if err != nil {
  2612  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", nil, "Failure preparing request")
  2613  		return
  2614  	}
  2615  
  2616  	resp, err := client.ListTableStatisticsSender(req)
  2617  	if err != nil {
  2618  		result.utsl.Response = autorest.Response{Response: resp}
  2619  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", resp, "Failure sending request")
  2620  		return
  2621  	}
  2622  
  2623  	result.utsl, err = client.ListTableStatisticsResponder(resp)
  2624  	if err != nil {
  2625  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableStatistics", resp, "Failure responding to request")
  2626  		return
  2627  	}
  2628  	if result.utsl.hasNextLink() && result.utsl.IsEmpty() {
  2629  		err = result.NextWithContext(ctx)
  2630  		return
  2631  	}
  2632  
  2633  	return
  2634  }
  2635  
  2636  // ListTableStatisticsPreparer prepares the ListTableStatistics request.
  2637  func (client Client) ListTableStatisticsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2638  	urlParameters := map[string]interface{}{
  2639  		"accountName":          accountName,
  2640  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2641  	}
  2642  
  2643  	pathParameters := map[string]interface{}{
  2644  		"databaseName": autorest.Encode("path", databaseName),
  2645  		"schemaName":   autorest.Encode("path", schemaName),
  2646  		"tableName":    autorest.Encode("path", tableName),
  2647  	}
  2648  
  2649  	const APIVersion = "2015-10-01-preview"
  2650  	queryParameters := map[string]interface{}{
  2651  		"api-version": APIVersion,
  2652  	}
  2653  	if len(filter) > 0 {
  2654  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2655  	}
  2656  	if top != nil {
  2657  		queryParameters["$top"] = autorest.Encode("query", *top)
  2658  	}
  2659  	if skip != nil {
  2660  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2661  	}
  2662  	if len(expand) > 0 {
  2663  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2664  	}
  2665  	if len(selectParameter) > 0 {
  2666  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2667  	}
  2668  	if len(orderby) > 0 {
  2669  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2670  	}
  2671  	if count != nil {
  2672  		queryParameters["$count"] = autorest.Encode("query", *count)
  2673  	}
  2674  
  2675  	preparer := autorest.CreatePreparer(
  2676  		autorest.AsGet(),
  2677  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2678  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics", pathParameters),
  2679  		autorest.WithQueryParameters(queryParameters))
  2680  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2681  }
  2682  
  2683  // ListTableStatisticsSender sends the ListTableStatistics request. The method will close the
  2684  // http.Response Body if it receives an error.
  2685  func (client Client) ListTableStatisticsSender(req *http.Request) (*http.Response, error) {
  2686  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2687  }
  2688  
  2689  // ListTableStatisticsResponder handles the response to the ListTableStatistics request. The method always
  2690  // closes the http.Response Body.
  2691  func (client Client) ListTableStatisticsResponder(resp *http.Response) (result USQLTableStatisticsList, err error) {
  2692  	err = autorest.Respond(
  2693  		resp,
  2694  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2695  		autorest.ByUnmarshallingJSON(&result),
  2696  		autorest.ByClosing())
  2697  	result.Response = autorest.Response{Response: resp}
  2698  	return
  2699  }
  2700  
  2701  // listTableStatisticsNextResults retrieves the next set of results, if any.
  2702  func (client Client) listTableStatisticsNextResults(ctx context.Context, lastResults USQLTableStatisticsList) (result USQLTableStatisticsList, err error) {
  2703  	req, err := lastResults.uSQLTableStatisticsListPreparer(ctx)
  2704  	if err != nil {
  2705  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", nil, "Failure preparing next results request")
  2706  	}
  2707  	if req == nil {
  2708  		return
  2709  	}
  2710  	resp, err := client.ListTableStatisticsSender(req)
  2711  	if err != nil {
  2712  		result.Response = autorest.Response{Response: resp}
  2713  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", resp, "Failure sending next results request")
  2714  	}
  2715  	result, err = client.ListTableStatisticsResponder(resp)
  2716  	if err != nil {
  2717  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTableStatisticsNextResults", resp, "Failure responding to next results request")
  2718  	}
  2719  	return
  2720  }
  2721  
  2722  // ListTableStatisticsComplete enumerates all values, automatically crossing page boundaries as required.
  2723  func (client Client) ListTableStatisticsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, tableName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableStatisticsListIterator, err error) {
  2724  	if tracing.IsEnabled() {
  2725  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableStatistics")
  2726  		defer func() {
  2727  			sc := -1
  2728  			if result.Response().Response.Response != nil {
  2729  				sc = result.page.Response().Response.Response.StatusCode
  2730  			}
  2731  			tracing.EndSpan(ctx, sc, err)
  2732  		}()
  2733  	}
  2734  	result.page, err = client.ListTableStatistics(ctx, accountName, databaseName, schemaName, tableName, filter, top, skip, expand, selectParameter, orderby, count)
  2735  	return
  2736  }
  2737  
  2738  // ListTableTypes retrieves the list of table types from the Data Lake Analytics catalog.
  2739  // Parameters:
  2740  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2741  // databaseName - the name of the database containing the table types.
  2742  // schemaName - the name of the schema containing the table types.
  2743  // filter - oData filter. Optional.
  2744  // top - the number of items to return. Optional.
  2745  // skip - the number of items to skip over before returning elements. Optional.
  2746  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2747  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2748  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2749  // Categories?$select=CategoryName,Description. Optional.
  2750  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2751  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2752  // Optional.
  2753  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2754  // resources in the response, e.g. Categories?$count=true. Optional.
  2755  func (client Client) ListTableTypes(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableTypeListPage, err error) {
  2756  	if tracing.IsEnabled() {
  2757  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableTypes")
  2758  		defer func() {
  2759  			sc := -1
  2760  			if result.uttl.Response.Response != nil {
  2761  				sc = result.uttl.Response.Response.StatusCode
  2762  			}
  2763  			tracing.EndSpan(ctx, sc, err)
  2764  		}()
  2765  	}
  2766  	result.fn = client.listTableTypesNextResults
  2767  	req, err := client.ListTableTypesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2768  	if err != nil {
  2769  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", nil, "Failure preparing request")
  2770  		return
  2771  	}
  2772  
  2773  	resp, err := client.ListTableTypesSender(req)
  2774  	if err != nil {
  2775  		result.uttl.Response = autorest.Response{Response: resp}
  2776  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", resp, "Failure sending request")
  2777  		return
  2778  	}
  2779  
  2780  	result.uttl, err = client.ListTableTypesResponder(resp)
  2781  	if err != nil {
  2782  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableTypes", resp, "Failure responding to request")
  2783  		return
  2784  	}
  2785  	if result.uttl.hasNextLink() && result.uttl.IsEmpty() {
  2786  		err = result.NextWithContext(ctx)
  2787  		return
  2788  	}
  2789  
  2790  	return
  2791  }
  2792  
  2793  // ListTableTypesPreparer prepares the ListTableTypes request.
  2794  func (client Client) ListTableTypesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2795  	urlParameters := map[string]interface{}{
  2796  		"accountName":          accountName,
  2797  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2798  	}
  2799  
  2800  	pathParameters := map[string]interface{}{
  2801  		"databaseName": autorest.Encode("path", databaseName),
  2802  		"schemaName":   autorest.Encode("path", schemaName),
  2803  	}
  2804  
  2805  	const APIVersion = "2015-10-01-preview"
  2806  	queryParameters := map[string]interface{}{
  2807  		"api-version": APIVersion,
  2808  	}
  2809  	if len(filter) > 0 {
  2810  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2811  	}
  2812  	if top != nil {
  2813  		queryParameters["$top"] = autorest.Encode("query", *top)
  2814  	}
  2815  	if skip != nil {
  2816  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2817  	}
  2818  	if len(expand) > 0 {
  2819  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2820  	}
  2821  	if len(selectParameter) > 0 {
  2822  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2823  	}
  2824  	if len(orderby) > 0 {
  2825  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2826  	}
  2827  	if count != nil {
  2828  		queryParameters["$count"] = autorest.Encode("query", *count)
  2829  	}
  2830  
  2831  	preparer := autorest.CreatePreparer(
  2832  		autorest.AsGet(),
  2833  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2834  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes", pathParameters),
  2835  		autorest.WithQueryParameters(queryParameters))
  2836  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2837  }
  2838  
  2839  // ListTableTypesSender sends the ListTableTypes request. The method will close the
  2840  // http.Response Body if it receives an error.
  2841  func (client Client) ListTableTypesSender(req *http.Request) (*http.Response, error) {
  2842  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2843  }
  2844  
  2845  // ListTableTypesResponder handles the response to the ListTableTypes request. The method always
  2846  // closes the http.Response Body.
  2847  func (client Client) ListTableTypesResponder(resp *http.Response) (result USQLTableTypeList, err error) {
  2848  	err = autorest.Respond(
  2849  		resp,
  2850  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2851  		autorest.ByUnmarshallingJSON(&result),
  2852  		autorest.ByClosing())
  2853  	result.Response = autorest.Response{Response: resp}
  2854  	return
  2855  }
  2856  
  2857  // listTableTypesNextResults retrieves the next set of results, if any.
  2858  func (client Client) listTableTypesNextResults(ctx context.Context, lastResults USQLTableTypeList) (result USQLTableTypeList, err error) {
  2859  	req, err := lastResults.uSQLTableTypeListPreparer(ctx)
  2860  	if err != nil {
  2861  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", nil, "Failure preparing next results request")
  2862  	}
  2863  	if req == nil {
  2864  		return
  2865  	}
  2866  	resp, err := client.ListTableTypesSender(req)
  2867  	if err != nil {
  2868  		result.Response = autorest.Response{Response: resp}
  2869  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", resp, "Failure sending next results request")
  2870  	}
  2871  	result, err = client.ListTableTypesResponder(resp)
  2872  	if err != nil {
  2873  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTableTypesNextResults", resp, "Failure responding to next results request")
  2874  	}
  2875  	return
  2876  }
  2877  
  2878  // ListTableTypesComplete enumerates all values, automatically crossing page boundaries as required.
  2879  func (client Client) ListTableTypesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableTypeListIterator, err error) {
  2880  	if tracing.IsEnabled() {
  2881  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableTypes")
  2882  		defer func() {
  2883  			sc := -1
  2884  			if result.Response().Response.Response != nil {
  2885  				sc = result.page.Response().Response.Response.StatusCode
  2886  			}
  2887  			tracing.EndSpan(ctx, sc, err)
  2888  		}()
  2889  	}
  2890  	result.page, err = client.ListTableTypes(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2891  	return
  2892  }
  2893  
  2894  // ListTableValuedFunctions retrieves the list of table valued functions from the Data Lake Analytics catalog.
  2895  // Parameters:
  2896  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  2897  // databaseName - the name of the database containing the table valued functions.
  2898  // schemaName - the name of the schema containing the table valued functions.
  2899  // filter - oData filter. Optional.
  2900  // top - the number of items to return. Optional.
  2901  // skip - the number of items to skip over before returning elements. Optional.
  2902  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  2903  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  2904  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  2905  // Categories?$select=CategoryName,Description. Optional.
  2906  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  2907  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  2908  // Optional.
  2909  // count - the Boolean value of true or false to request a count of the matching resources included with the
  2910  // resources in the response, e.g. Categories?$count=true. Optional.
  2911  func (client Client) ListTableValuedFunctions(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListPage, err error) {
  2912  	if tracing.IsEnabled() {
  2913  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctions")
  2914  		defer func() {
  2915  			sc := -1
  2916  			if result.utvfl.Response.Response != nil {
  2917  				sc = result.utvfl.Response.Response.StatusCode
  2918  			}
  2919  			tracing.EndSpan(ctx, sc, err)
  2920  		}()
  2921  	}
  2922  	result.fn = client.listTableValuedFunctionsNextResults
  2923  	req, err := client.ListTableValuedFunctionsPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  2924  	if err != nil {
  2925  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", nil, "Failure preparing request")
  2926  		return
  2927  	}
  2928  
  2929  	resp, err := client.ListTableValuedFunctionsSender(req)
  2930  	if err != nil {
  2931  		result.utvfl.Response = autorest.Response{Response: resp}
  2932  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", resp, "Failure sending request")
  2933  		return
  2934  	}
  2935  
  2936  	result.utvfl, err = client.ListTableValuedFunctionsResponder(resp)
  2937  	if err != nil {
  2938  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTableValuedFunctions", resp, "Failure responding to request")
  2939  		return
  2940  	}
  2941  	if result.utvfl.hasNextLink() && result.utvfl.IsEmpty() {
  2942  		err = result.NextWithContext(ctx)
  2943  		return
  2944  	}
  2945  
  2946  	return
  2947  }
  2948  
  2949  // ListTableValuedFunctionsPreparer prepares the ListTableValuedFunctions request.
  2950  func (client Client) ListTableValuedFunctionsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  2951  	urlParameters := map[string]interface{}{
  2952  		"accountName":          accountName,
  2953  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  2954  	}
  2955  
  2956  	pathParameters := map[string]interface{}{
  2957  		"databaseName": autorest.Encode("path", databaseName),
  2958  		"schemaName":   autorest.Encode("path", schemaName),
  2959  	}
  2960  
  2961  	const APIVersion = "2015-10-01-preview"
  2962  	queryParameters := map[string]interface{}{
  2963  		"api-version": APIVersion,
  2964  	}
  2965  	if len(filter) > 0 {
  2966  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2967  	}
  2968  	if top != nil {
  2969  		queryParameters["$top"] = autorest.Encode("query", *top)
  2970  	}
  2971  	if skip != nil {
  2972  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  2973  	}
  2974  	if len(expand) > 0 {
  2975  		queryParameters["$expand"] = autorest.Encode("query", expand)
  2976  	}
  2977  	if len(selectParameter) > 0 {
  2978  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  2979  	}
  2980  	if len(orderby) > 0 {
  2981  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  2982  	}
  2983  	if count != nil {
  2984  		queryParameters["$count"] = autorest.Encode("query", *count)
  2985  	}
  2986  
  2987  	preparer := autorest.CreatePreparer(
  2988  		autorest.AsGet(),
  2989  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  2990  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions", pathParameters),
  2991  		autorest.WithQueryParameters(queryParameters))
  2992  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2993  }
  2994  
  2995  // ListTableValuedFunctionsSender sends the ListTableValuedFunctions request. The method will close the
  2996  // http.Response Body if it receives an error.
  2997  func (client Client) ListTableValuedFunctionsSender(req *http.Request) (*http.Response, error) {
  2998  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2999  }
  3000  
  3001  // ListTableValuedFunctionsResponder handles the response to the ListTableValuedFunctions request. The method always
  3002  // closes the http.Response Body.
  3003  func (client Client) ListTableValuedFunctionsResponder(resp *http.Response) (result USQLTableValuedFunctionList, err error) {
  3004  	err = autorest.Respond(
  3005  		resp,
  3006  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3007  		autorest.ByUnmarshallingJSON(&result),
  3008  		autorest.ByClosing())
  3009  	result.Response = autorest.Response{Response: resp}
  3010  	return
  3011  }
  3012  
  3013  // listTableValuedFunctionsNextResults retrieves the next set of results, if any.
  3014  func (client Client) listTableValuedFunctionsNextResults(ctx context.Context, lastResults USQLTableValuedFunctionList) (result USQLTableValuedFunctionList, err error) {
  3015  	req, err := lastResults.uSQLTableValuedFunctionListPreparer(ctx)
  3016  	if err != nil {
  3017  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", nil, "Failure preparing next results request")
  3018  	}
  3019  	if req == nil {
  3020  		return
  3021  	}
  3022  	resp, err := client.ListTableValuedFunctionsSender(req)
  3023  	if err != nil {
  3024  		result.Response = autorest.Response{Response: resp}
  3025  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", resp, "Failure sending next results request")
  3026  	}
  3027  	result, err = client.ListTableValuedFunctionsResponder(resp)
  3028  	if err != nil {
  3029  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTableValuedFunctionsNextResults", resp, "Failure responding to next results request")
  3030  	}
  3031  	return
  3032  }
  3033  
  3034  // ListTableValuedFunctionsComplete enumerates all values, automatically crossing page boundaries as required.
  3035  func (client Client) ListTableValuedFunctionsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTableValuedFunctionListIterator, err error) {
  3036  	if tracing.IsEnabled() {
  3037  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTableValuedFunctions")
  3038  		defer func() {
  3039  			sc := -1
  3040  			if result.Response().Response.Response != nil {
  3041  				sc = result.page.Response().Response.Response.StatusCode
  3042  			}
  3043  			tracing.EndSpan(ctx, sc, err)
  3044  		}()
  3045  	}
  3046  	result.page, err = client.ListTableValuedFunctions(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  3047  	return
  3048  }
  3049  
  3050  // ListTypes retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog.
  3051  // Parameters:
  3052  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  3053  // databaseName - the name of the database containing the types.
  3054  // schemaName - the name of the schema containing the types.
  3055  // filter - oData filter. Optional.
  3056  // top - the number of items to return. Optional.
  3057  // skip - the number of items to skip over before returning elements. Optional.
  3058  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  3059  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  3060  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  3061  // Categories?$select=CategoryName,Description. Optional.
  3062  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  3063  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  3064  // Optional.
  3065  // count - the Boolean value of true or false to request a count of the matching resources included with the
  3066  // resources in the response, e.g. Categories?$count=true. Optional.
  3067  func (client Client) ListTypes(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTypeListPage, err error) {
  3068  	if tracing.IsEnabled() {
  3069  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTypes")
  3070  		defer func() {
  3071  			sc := -1
  3072  			if result.utl.Response.Response != nil {
  3073  				sc = result.utl.Response.Response.StatusCode
  3074  			}
  3075  			tracing.EndSpan(ctx, sc, err)
  3076  		}()
  3077  	}
  3078  	result.fn = client.listTypesNextResults
  3079  	req, err := client.ListTypesPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  3080  	if err != nil {
  3081  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", nil, "Failure preparing request")
  3082  		return
  3083  	}
  3084  
  3085  	resp, err := client.ListTypesSender(req)
  3086  	if err != nil {
  3087  		result.utl.Response = autorest.Response{Response: resp}
  3088  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", resp, "Failure sending request")
  3089  		return
  3090  	}
  3091  
  3092  	result.utl, err = client.ListTypesResponder(resp)
  3093  	if err != nil {
  3094  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListTypes", resp, "Failure responding to request")
  3095  		return
  3096  	}
  3097  	if result.utl.hasNextLink() && result.utl.IsEmpty() {
  3098  		err = result.NextWithContext(ctx)
  3099  		return
  3100  	}
  3101  
  3102  	return
  3103  }
  3104  
  3105  // ListTypesPreparer prepares the ListTypes request.
  3106  func (client Client) ListTypesPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  3107  	urlParameters := map[string]interface{}{
  3108  		"accountName":          accountName,
  3109  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  3110  	}
  3111  
  3112  	pathParameters := map[string]interface{}{
  3113  		"databaseName": autorest.Encode("path", databaseName),
  3114  		"schemaName":   autorest.Encode("path", schemaName),
  3115  	}
  3116  
  3117  	const APIVersion = "2015-10-01-preview"
  3118  	queryParameters := map[string]interface{}{
  3119  		"api-version": APIVersion,
  3120  	}
  3121  	if len(filter) > 0 {
  3122  		queryParameters["$filter"] = autorest.Encode("query", filter)
  3123  	}
  3124  	if top != nil {
  3125  		queryParameters["$top"] = autorest.Encode("query", *top)
  3126  	}
  3127  	if skip != nil {
  3128  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  3129  	}
  3130  	if len(expand) > 0 {
  3131  		queryParameters["$expand"] = autorest.Encode("query", expand)
  3132  	}
  3133  	if len(selectParameter) > 0 {
  3134  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  3135  	}
  3136  	if len(orderby) > 0 {
  3137  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  3138  	}
  3139  	if count != nil {
  3140  		queryParameters["$count"] = autorest.Encode("query", *count)
  3141  	}
  3142  
  3143  	preparer := autorest.CreatePreparer(
  3144  		autorest.AsGet(),
  3145  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  3146  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/types", pathParameters),
  3147  		autorest.WithQueryParameters(queryParameters))
  3148  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3149  }
  3150  
  3151  // ListTypesSender sends the ListTypes request. The method will close the
  3152  // http.Response Body if it receives an error.
  3153  func (client Client) ListTypesSender(req *http.Request) (*http.Response, error) {
  3154  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3155  }
  3156  
  3157  // ListTypesResponder handles the response to the ListTypes request. The method always
  3158  // closes the http.Response Body.
  3159  func (client Client) ListTypesResponder(resp *http.Response) (result USQLTypeList, err error) {
  3160  	err = autorest.Respond(
  3161  		resp,
  3162  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3163  		autorest.ByUnmarshallingJSON(&result),
  3164  		autorest.ByClosing())
  3165  	result.Response = autorest.Response{Response: resp}
  3166  	return
  3167  }
  3168  
  3169  // listTypesNextResults retrieves the next set of results, if any.
  3170  func (client Client) listTypesNextResults(ctx context.Context, lastResults USQLTypeList) (result USQLTypeList, err error) {
  3171  	req, err := lastResults.uSQLTypeListPreparer(ctx)
  3172  	if err != nil {
  3173  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", nil, "Failure preparing next results request")
  3174  	}
  3175  	if req == nil {
  3176  		return
  3177  	}
  3178  	resp, err := client.ListTypesSender(req)
  3179  	if err != nil {
  3180  		result.Response = autorest.Response{Response: resp}
  3181  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", resp, "Failure sending next results request")
  3182  	}
  3183  	result, err = client.ListTypesResponder(resp)
  3184  	if err != nil {
  3185  		err = autorest.NewErrorWithError(err, "catalog.Client", "listTypesNextResults", resp, "Failure responding to next results request")
  3186  	}
  3187  	return
  3188  }
  3189  
  3190  // ListTypesComplete enumerates all values, automatically crossing page boundaries as required.
  3191  func (client Client) ListTypesComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLTypeListIterator, err error) {
  3192  	if tracing.IsEnabled() {
  3193  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListTypes")
  3194  		defer func() {
  3195  			sc := -1
  3196  			if result.Response().Response.Response != nil {
  3197  				sc = result.page.Response().Response.Response.StatusCode
  3198  			}
  3199  			tracing.EndSpan(ctx, sc, err)
  3200  		}()
  3201  	}
  3202  	result.page, err = client.ListTypes(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  3203  	return
  3204  }
  3205  
  3206  // ListViews retrieves the list of views from the Data Lake Analytics catalog.
  3207  // Parameters:
  3208  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  3209  // databaseName - the name of the database containing the views.
  3210  // schemaName - the name of the schema containing the views.
  3211  // filter - oData filter. Optional.
  3212  // top - the number of items to return. Optional.
  3213  // skip - the number of items to skip over before returning elements. Optional.
  3214  // expand - oData expansion. Expand related resources in line with the retrieved resources, e.g.
  3215  // Categories?$expand=Products would expand Product data in line with each Category entry. Optional.
  3216  // selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g.
  3217  // Categories?$select=CategoryName,Description. Optional.
  3218  // orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or
  3219  // "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc.
  3220  // Optional.
  3221  // count - the Boolean value of true or false to request a count of the matching resources included with the
  3222  // resources in the response, e.g. Categories?$count=true. Optional.
  3223  func (client Client) ListViews(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLViewListPage, err error) {
  3224  	if tracing.IsEnabled() {
  3225  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViews")
  3226  		defer func() {
  3227  			sc := -1
  3228  			if result.uvl.Response.Response != nil {
  3229  				sc = result.uvl.Response.Response.StatusCode
  3230  			}
  3231  			tracing.EndSpan(ctx, sc, err)
  3232  		}()
  3233  	}
  3234  	result.fn = client.listViewsNextResults
  3235  	req, err := client.ListViewsPreparer(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  3236  	if err != nil {
  3237  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", nil, "Failure preparing request")
  3238  		return
  3239  	}
  3240  
  3241  	resp, err := client.ListViewsSender(req)
  3242  	if err != nil {
  3243  		result.uvl.Response = autorest.Response{Response: resp}
  3244  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", resp, "Failure sending request")
  3245  		return
  3246  	}
  3247  
  3248  	result.uvl, err = client.ListViewsResponder(resp)
  3249  	if err != nil {
  3250  		err = autorest.NewErrorWithError(err, "catalog.Client", "ListViews", resp, "Failure responding to request")
  3251  		return
  3252  	}
  3253  	if result.uvl.hasNextLink() && result.uvl.IsEmpty() {
  3254  		err = result.NextWithContext(ctx)
  3255  		return
  3256  	}
  3257  
  3258  	return
  3259  }
  3260  
  3261  // ListViewsPreparer prepares the ListViews request.
  3262  func (client Client) ListViewsPreparer(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (*http.Request, error) {
  3263  	urlParameters := map[string]interface{}{
  3264  		"accountName":          accountName,
  3265  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  3266  	}
  3267  
  3268  	pathParameters := map[string]interface{}{
  3269  		"databaseName": autorest.Encode("path", databaseName),
  3270  		"schemaName":   autorest.Encode("path", schemaName),
  3271  	}
  3272  
  3273  	const APIVersion = "2015-10-01-preview"
  3274  	queryParameters := map[string]interface{}{
  3275  		"api-version": APIVersion,
  3276  	}
  3277  	if len(filter) > 0 {
  3278  		queryParameters["$filter"] = autorest.Encode("query", filter)
  3279  	}
  3280  	if top != nil {
  3281  		queryParameters["$top"] = autorest.Encode("query", *top)
  3282  	}
  3283  	if skip != nil {
  3284  		queryParameters["$skip"] = autorest.Encode("query", *skip)
  3285  	}
  3286  	if len(expand) > 0 {
  3287  		queryParameters["$expand"] = autorest.Encode("query", expand)
  3288  	}
  3289  	if len(selectParameter) > 0 {
  3290  		queryParameters["$select"] = autorest.Encode("query", selectParameter)
  3291  	}
  3292  	if len(orderby) > 0 {
  3293  		queryParameters["$orderby"] = autorest.Encode("query", orderby)
  3294  	}
  3295  	if count != nil {
  3296  		queryParameters["$count"] = autorest.Encode("query", *count)
  3297  	}
  3298  
  3299  	preparer := autorest.CreatePreparer(
  3300  		autorest.AsGet(),
  3301  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  3302  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views", pathParameters),
  3303  		autorest.WithQueryParameters(queryParameters))
  3304  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3305  }
  3306  
  3307  // ListViewsSender sends the ListViews request. The method will close the
  3308  // http.Response Body if it receives an error.
  3309  func (client Client) ListViewsSender(req *http.Request) (*http.Response, error) {
  3310  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3311  }
  3312  
  3313  // ListViewsResponder handles the response to the ListViews request. The method always
  3314  // closes the http.Response Body.
  3315  func (client Client) ListViewsResponder(resp *http.Response) (result USQLViewList, err error) {
  3316  	err = autorest.Respond(
  3317  		resp,
  3318  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3319  		autorest.ByUnmarshallingJSON(&result),
  3320  		autorest.ByClosing())
  3321  	result.Response = autorest.Response{Response: resp}
  3322  	return
  3323  }
  3324  
  3325  // listViewsNextResults retrieves the next set of results, if any.
  3326  func (client Client) listViewsNextResults(ctx context.Context, lastResults USQLViewList) (result USQLViewList, err error) {
  3327  	req, err := lastResults.uSQLViewListPreparer(ctx)
  3328  	if err != nil {
  3329  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", nil, "Failure preparing next results request")
  3330  	}
  3331  	if req == nil {
  3332  		return
  3333  	}
  3334  	resp, err := client.ListViewsSender(req)
  3335  	if err != nil {
  3336  		result.Response = autorest.Response{Response: resp}
  3337  		return result, autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", resp, "Failure sending next results request")
  3338  	}
  3339  	result, err = client.ListViewsResponder(resp)
  3340  	if err != nil {
  3341  		err = autorest.NewErrorWithError(err, "catalog.Client", "listViewsNextResults", resp, "Failure responding to next results request")
  3342  	}
  3343  	return
  3344  }
  3345  
  3346  // ListViewsComplete enumerates all values, automatically crossing page boundaries as required.
  3347  func (client Client) ListViewsComplete(ctx context.Context, accountName string, databaseName string, schemaName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool) (result USQLViewListIterator, err error) {
  3348  	if tracing.IsEnabled() {
  3349  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListViews")
  3350  		defer func() {
  3351  			sc := -1
  3352  			if result.Response().Response.Response != nil {
  3353  				sc = result.page.Response().Response.Response.StatusCode
  3354  			}
  3355  			tracing.EndSpan(ctx, sc, err)
  3356  		}()
  3357  	}
  3358  	result.page, err = client.ListViews(ctx, accountName, databaseName, schemaName, filter, top, skip, expand, selectParameter, orderby, count)
  3359  	return
  3360  }
  3361  
  3362  // UpdateSecret modifies the specified secret for use with external data sources in the specified database
  3363  // Parameters:
  3364  // accountName - the Azure Data Lake Analytics account to execute catalog operations on.
  3365  // databaseName - the name of the database containing the secret.
  3366  // secretName - the name of the secret.
  3367  // parameters - the parameters required to modify the secret (name and password)
  3368  func (client Client) UpdateSecret(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (result USQLSecret, err error) {
  3369  	if tracing.IsEnabled() {
  3370  		ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateSecret")
  3371  		defer func() {
  3372  			sc := -1
  3373  			if result.Response.Response != nil {
  3374  				sc = result.Response.Response.StatusCode
  3375  			}
  3376  			tracing.EndSpan(ctx, sc, err)
  3377  		}()
  3378  	}
  3379  	req, err := client.UpdateSecretPreparer(ctx, accountName, databaseName, secretName, parameters)
  3380  	if err != nil {
  3381  		err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", nil, "Failure preparing request")
  3382  		return
  3383  	}
  3384  
  3385  	resp, err := client.UpdateSecretSender(req)
  3386  	if err != nil {
  3387  		result.Response = autorest.Response{Response: resp}
  3388  		err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", resp, "Failure sending request")
  3389  		return
  3390  	}
  3391  
  3392  	result, err = client.UpdateSecretResponder(resp)
  3393  	if err != nil {
  3394  		err = autorest.NewErrorWithError(err, "catalog.Client", "UpdateSecret", resp, "Failure responding to request")
  3395  		return
  3396  	}
  3397  
  3398  	return
  3399  }
  3400  
  3401  // UpdateSecretPreparer prepares the UpdateSecret request.
  3402  func (client Client) UpdateSecretPreparer(ctx context.Context, accountName string, databaseName string, secretName string, parameters DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters) (*http.Request, error) {
  3403  	urlParameters := map[string]interface{}{
  3404  		"accountName":          accountName,
  3405  		"adlaCatalogDnsSuffix": client.AdlaCatalogDNSSuffix,
  3406  	}
  3407  
  3408  	pathParameters := map[string]interface{}{
  3409  		"databaseName": autorest.Encode("path", databaseName),
  3410  		"secretName":   autorest.Encode("path", secretName),
  3411  	}
  3412  
  3413  	const APIVersion = "2015-10-01-preview"
  3414  	queryParameters := map[string]interface{}{
  3415  		"api-version": APIVersion,
  3416  	}
  3417  
  3418  	preparer := autorest.CreatePreparer(
  3419  		autorest.AsContentType("application/json; charset=utf-8"),
  3420  		autorest.AsPatch(),
  3421  		autorest.WithCustomBaseURL("https://{accountName}.{adlaCatalogDnsSuffix}", urlParameters),
  3422  		autorest.WithPathParameters("/catalog/usql/databases/{databaseName}/secrets/{secretName}", pathParameters),
  3423  		autorest.WithJSON(parameters),
  3424  		autorest.WithQueryParameters(queryParameters))
  3425  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3426  }
  3427  
  3428  // UpdateSecretSender sends the UpdateSecret request. The method will close the
  3429  // http.Response Body if it receives an error.
  3430  func (client Client) UpdateSecretSender(req *http.Request) (*http.Response, error) {
  3431  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3432  }
  3433  
  3434  // UpdateSecretResponder handles the response to the UpdateSecret request. The method always
  3435  // closes the http.Response Body.
  3436  func (client Client) UpdateSecretResponder(resp *http.Response) (result USQLSecret, err error) {
  3437  	err = autorest.Respond(
  3438  		resp,
  3439  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3440  		autorest.ByUnmarshallingJSON(&result),
  3441  		autorest.ByClosing())
  3442  	result.Response = autorest.Response{Response: resp}
  3443  	return
  3444  }
  3445  

View as plain text