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