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