/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const msRest = require('ms-rest');
const msRestAzure = require('ms-rest-azure');
const WebResource = msRest.WebResource;

/**
 * Creates the specified secret for use with external data sources in the
 * specified database. This is deprecated and will be removed in the next
 * release. Please use CreateCredential instead.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database in which to create the
 * secret.
 *
 * @param {string} secretName The name of the secret.
 *
 * @param {object} parameters The parameters required to create the secret
 * (name and password)
 *
 * @param {string} parameters.password the password for the secret to pass in
 *
 * @param {string} [parameters.uri] the URI identifier for the secret in the
 * format <hostname>:<port>
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _createSecret(accountName, databaseName, secretName, parameters, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') {
      throw new Error('secretName cannot be null or undefined and it must be of type string.');
    }
    if (parameters === null || parameters === undefined) {
      throw new Error('parameters cannot be null or undefined.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/secrets/{secretName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{secretName}', encodeURIComponent(secretName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'PUT';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  // Serialize Request
  let requestContent = null;
  let requestModel = null;
  try {
    if (parameters !== null && parameters !== undefined) {
      let requestModelMapper = new client.models['DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters']().mapper();
      requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(parameters, null, 2)}.`);
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Modifies the specified secret for use with external data sources in the
 * specified database. This is deprecated and will be removed in the next
 * release. Please use UpdateCredential instead.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the secret.
 *
 * @param {string} secretName The name of the secret.
 *
 * @param {object} parameters The parameters required to modify the secret
 * (name and password)
 *
 * @param {string} parameters.password the password for the secret to pass in
 *
 * @param {string} [parameters.uri] the URI identifier for the secret in the
 * format <hostname>:<port>
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _updateSecret(accountName, databaseName, secretName, parameters, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') {
      throw new Error('secretName cannot be null or undefined and it must be of type string.');
    }
    if (parameters === null || parameters === undefined) {
      throw new Error('parameters cannot be null or undefined.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/secrets/{secretName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{secretName}', encodeURIComponent(secretName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'PATCH';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  // Serialize Request
  let requestContent = null;
  let requestModel = null;
  try {
    if (parameters !== null && parameters !== undefined) {
      let requestModelMapper = new client.models['DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters']().mapper();
      requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(parameters, null, 2)}.`);
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Deletes the specified secret in the specified database. This is deprecated
 * and will be removed in the next release. Please use DeleteCredential
 * instead.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the secret.
 *
 * @param {string} secretName The name of the secret to delete
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _deleteSecret(accountName, databaseName, secretName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') {
      throw new Error('secretName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/secrets/{secretName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{secretName}', encodeURIComponent(secretName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'DELETE';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Gets the specified secret in the specified database. This is deprecated and
 * will be removed in the next release. Please use GetCredential instead.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the secret.
 *
 * @param {string} secretName The name of the secret to get
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlSecret} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getSecret(accountName, databaseName, secretName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') {
      throw new Error('secretName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/secrets/{secretName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{secretName}', encodeURIComponent(secretName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlSecret']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Deletes all secrets in the specified database. This is deprecated and will
 * be removed in the next release. In the future, please only drop individual
 * credentials using DeleteCredential
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the secret.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _deleteAllSecrets(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/secrets';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'DELETE';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Creates the specified credential for use with external data sources in the
 * specified database.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database in which to create the
 * credential. Note: This is NOT an external database name, but the name of an
 * existing U-SQL database that should contain the new credential object.
 *
 * @param {string} credentialName The name of the credential.
 *
 * @param {object} parameters The parameters required to create the credential
 * (name and password)
 *
 * @param {string} parameters.password the password for the credential and user
 * with access to the data source.
 *
 * @param {string} parameters.uri the URI identifier for the data source this
 * credential can connect to in the format <hostname>:<port>
 *
 * @param {string} parameters.userId the object identifier for the user
 * associated with this credential with access to the data source.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _createCredential(accountName, databaseName, credentialName, parameters, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') {
      throw new Error('credentialName cannot be null or undefined and it must be of type string.');
    }
    if (parameters === null || parameters === undefined) {
      throw new Error('parameters cannot be null or undefined.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/credentials/{credentialName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'PUT';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  // Serialize Request
  let requestContent = null;
  let requestModel = null;
  try {
    if (parameters !== null && parameters !== undefined) {
      let requestModelMapper = new client.models['DataLakeAnalyticsCatalogCredentialCreateParameters']().mapper();
      requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(parameters, null, 2)}.`);
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Modifies the specified credential for use with external data sources in the
 * specified database
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * credential.
 *
 * @param {string} credentialName The name of the credential.
 *
 * @param {object} parameters The parameters required to modify the credential
 * (name and password)
 *
 * @param {string} [parameters.password] the current password for the
 * credential and user with access to the data source. This is required if the
 * requester is not the account owner.
 *
 * @param {string} [parameters.newPassword] the new password for the credential
 * and user with access to the data source.
 *
 * @param {string} [parameters.uri] the URI identifier for the data source this
 * credential can connect to in the format <hostname>:<port>
 *
 * @param {string} [parameters.userId] the object identifier for the user
 * associated with this credential with access to the data source.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _updateCredential(accountName, databaseName, credentialName, parameters, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') {
      throw new Error('credentialName cannot be null or undefined and it must be of type string.');
    }
    if (parameters === null || parameters === undefined) {
      throw new Error('parameters cannot be null or undefined.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/credentials/{credentialName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'PATCH';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  // Serialize Request
  let requestContent = null;
  let requestModel = null;
  try {
    if (parameters !== null && parameters !== undefined) {
      let requestModelMapper = new client.models['DataLakeAnalyticsCatalogCredentialUpdateParameters']().mapper();
      requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(parameters, null, 2)}.`);
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Deletes the specified credential in the specified database
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * credential.
 *
 * @param {string} credentialName The name of the credential to delete
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.parameters] The parameters to delete a credential
 * if the current user is not the account owner.
 *
 * @param {string} [options.parameters.password] the current password for the
 * credential and user with access to the data source. This is required if the
 * requester is not the account owner.
 *
 * @param {boolean} [options.cascade] Indicates if the delete should be a
 * cascading delete (which deletes all resources dependent on the credential as
 * well as the credential) or not. If false will fail if there are any
 * resources relying on the credential.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object if an error did not occur.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _deleteCredential(accountName, databaseName, credentialName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let parameters = (options && options.parameters !== undefined) ? options.parameters : undefined;
  let cascade = (options && options.cascade !== undefined) ? options.cascade : false;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') {
      throw new Error('credentialName cannot be null or undefined and it must be of type string.');
    }
    if (cascade !== null && cascade !== undefined && typeof cascade !== 'boolean') {
      throw new Error('cascade must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/credentials/{credentialName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName));
  let queryParameters = [];
  if (cascade !== null && cascade !== undefined) {
    queryParameters.push('cascade=' + encodeURIComponent(cascade.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'POST';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  // Serialize Request
  let requestContent = null;
  let requestModel = null;
  try {
    if (parameters !== null && parameters !== undefined) {
      let requestModelMapper = new client.models['DataLakeAnalyticsCatalogCredentialDeleteParameters']().mapper();
      requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(parameters, null, 2)}.`);
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified credential from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the schema.
 *
 * @param {string} credentialName The name of the credential.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlCredential} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getCredential(accountName, databaseName, credentialName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') {
      throw new Error('credentialName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/credentials/{credentialName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlCredential']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of credentials from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the schema.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlCredentialList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listCredentials(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/credentials';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlCredentialList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified external data source from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * external data source.
 *
 * @param {string} externalDataSourceName The name of the external data source.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlExternalDataSource} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getExternalDataSource(accountName, databaseName, externalDataSourceName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (externalDataSourceName === null || externalDataSourceName === undefined || typeof externalDataSourceName.valueOf() !== 'string') {
      throw new Error('externalDataSourceName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{externalDataSourceName}', encodeURIComponent(externalDataSourceName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlExternalDataSource']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of external data sources from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * external data sources.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlExternalDataSourceList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listExternalDataSources(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/externaldatasources';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlExternalDataSourceList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified procedure from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * procedure.
 *
 * @param {string} schemaName The name of the schema containing the procedure.
 *
 * @param {string} procedureName The name of the procedure.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlProcedure} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getProcedure(accountName, databaseName, schemaName, procedureName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (procedureName === null || procedureName === undefined || typeof procedureName.valueOf() !== 'string') {
      throw new Error('procedureName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{procedureName}', encodeURIComponent(procedureName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlProcedure']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of procedures from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * procedures.
 *
 * @param {string} schemaName The name of the schema containing the procedures.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlProcedureList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listProcedures(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlProcedureList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified table from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table.
 *
 * @param {string} schemaName The name of the schema containing the table.
 *
 * @param {string} tableName The name of the table.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTable} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getTable(accountName, databaseName, schemaName, tableName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') {
      throw new Error('tableName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTable']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of tables from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the tables.
 *
 * @param {string} schemaName The name of the schema containing the tables.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {boolean} [options.basic] The basic switch indicates what level of
 * information to return when listing tables. When basic is true, only
 * database_name, schema_name, table_name and version are returned for each
 * table, otherwise all table metadata is returned. By default, it is false.
 * Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTables(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  let basic = (options && options.basic !== undefined) ? options.basic : false;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (basic !== null && basic !== undefined && typeof basic !== 'boolean') {
      throw new Error('basic must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  if (basic !== null && basic !== undefined) {
    queryParameters.push('basic=' + encodeURIComponent(basic.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all table statistics within the specified schema from
 * the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * statistics.
 *
 * @param {string} schemaName The name of the schema containing the statistics.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatisticsByDatabaseAndSchema(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/statistics';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified table type from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * type.
 *
 * @param {string} schemaName The name of the schema containing the table type.
 *
 * @param {string} tableTypeName The name of the table type to retrieve.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableType} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getTableType(accountName, databaseName, schemaName, tableTypeName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableTypeName === null || tableTypeName === undefined || typeof tableTypeName.valueOf() !== 'string') {
      throw new Error('tableTypeName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes/{tableTypeName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableTypeName}', encodeURIComponent(tableTypeName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableType']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table types from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * types.
 *
 * @param {string} schemaName The name of the schema containing the table
 * types.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableTypeList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableTypes(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableTypeList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified package from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * package.
 *
 * @param {string} schemaName The name of the schema containing the package.
 *
 * @param {string} packageName The name of the package.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlPackage} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getPackage(accountName, databaseName, schemaName, packageName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (packageName === null || packageName === undefined || typeof packageName.valueOf() !== 'string') {
      throw new Error('packageName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages/{packageName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{packageName}', encodeURIComponent(packageName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlPackage']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of packages from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * packages.
 *
 * @param {string} schemaName The name of the schema containing the packages.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlPackageList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listPackages(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlPackageList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified view from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the view.
 *
 * @param {string} schemaName The name of the schema containing the view.
 *
 * @param {string} viewName The name of the view.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlView} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getView(accountName, databaseName, schemaName, viewName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (viewName === null || viewName === undefined || typeof viewName.valueOf() !== 'string') {
      throw new Error('viewName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{viewName}', encodeURIComponent(viewName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlView']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of views from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the views.
 *
 * @param {string} schemaName The name of the schema containing the views.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlViewList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listViews(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/views';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlViewList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified table statistics from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * statistics.
 *
 * @param {string} schemaName The name of the schema containing the statistics.
 *
 * @param {string} tableName The name of the table containing the statistics.
 *
 * @param {string} statisticsName The name of the table statistics.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatistics} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getTableStatistic(accountName, databaseName, schemaName, tableName, statisticsName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') {
      throw new Error('tableName cannot be null or undefined and it must be of type string.');
    }
    if (statisticsName === null || statisticsName === undefined || typeof statisticsName.valueOf() !== 'string') {
      throw new Error('statisticsName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName));
  requestUrl = requestUrl.replace('{statisticsName}', encodeURIComponent(statisticsName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatistics']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table statistics from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * statistics.
 *
 * @param {string} schemaName The name of the schema containing the statistics.
 *
 * @param {string} tableName The name of the table containing the statistics.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatistics(accountName, databaseName, schemaName, tableName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') {
      throw new Error('tableName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified table partition from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * partition.
 *
 * @param {string} schemaName The name of the schema containing the partition.
 *
 * @param {string} tableName The name of the table containing the partition.
 *
 * @param {string} partitionName The name of the table partition.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTablePartition} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getTablePartition(accountName, databaseName, schemaName, tableName, partitionName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') {
      throw new Error('tableName cannot be null or undefined and it must be of type string.');
    }
    if (partitionName === null || partitionName === undefined || typeof partitionName.valueOf() !== 'string') {
      throw new Error('partitionName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName));
  requestUrl = requestUrl.replace('{partitionName}', encodeURIComponent(partitionName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTablePartition']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table partitions from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * partitions.
 *
 * @param {string} schemaName The name of the schema containing the partitions.
 *
 * @param {string} tableName The name of the table containing the partitions.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTablePartitionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTablePartitions(accountName, databaseName, schemaName, tableName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') {
      throw new Error('tableName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTablePartitionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of types within the specified database and schema from
 * the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the types.
 *
 * @param {string} schemaName The name of the schema containing the types.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTypeList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTypes(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/types';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTypeList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified table valued function from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * valued function.
 *
 * @param {string} schemaName The name of the schema containing the table
 * valued function.
 *
 * @param {string} tableValuedFunctionName The name of the tableValuedFunction.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableValuedFunction} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getTableValuedFunction(accountName, databaseName, schemaName, tableValuedFunctionName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (tableValuedFunctionName === null || tableValuedFunctionName === undefined || typeof tableValuedFunctionName.valueOf() !== 'string') {
      throw new Error('tableValuedFunctionName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  requestUrl = requestUrl.replace('{tableValuedFunctionName}', encodeURIComponent(tableValuedFunctionName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableValuedFunction']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table valued functions from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * valued functions.
 *
 * @param {string} schemaName The name of the schema containing the table
 * valued functions.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableValuedFunctionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableValuedFunctions(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableValuedFunctionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified assembly from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * assembly.
 *
 * @param {string} assemblyName The name of the assembly.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlAssembly} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getAssembly(accountName, databaseName, assemblyName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (assemblyName === null || assemblyName === undefined || typeof assemblyName.valueOf() !== 'string') {
      throw new Error('assemblyName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/assemblies/{assemblyName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{assemblyName}', encodeURIComponent(assemblyName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlAssembly']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of assemblies from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the
 * assembly.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlAssemblyList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listAssemblies(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/assemblies';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlAssemblyList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified schema from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the schema.
 *
 * @param {string} schemaName The name of the schema.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlSchema} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getSchema(accountName, databaseName, schemaName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') {
      throw new Error('schemaName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas/{schemaName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlSchema']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of schemas from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the schema.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlSchemaList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listSchemas(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/schemas';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlSchemaList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all statistics in a database from the Data Lake
 * Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * statistics.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatisticsByDatabase(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/statistics';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all tables in a database from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the tables.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {boolean} [options.basic] The basic switch indicates what level of
 * information to return when listing tables. When basic is true, only
 * database_name, schema_name, table_name and version are returned for each
 * table, otherwise all table metadata is returned. By default, it is false
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTablesByDatabase(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  let basic = (options && options.basic !== undefined) ? options.basic : false;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (basic !== null && basic !== undefined && typeof basic !== 'boolean') {
      throw new Error('basic must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/tables';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  if (basic !== null && basic !== undefined) {
    queryParameters.push('basic=' + encodeURIComponent(basic.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all table valued functions in a database from the Data
 * Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the table
 * valued functions.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableValuedFunctionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableValuedFunctionsByDatabase(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/tablevaluedfunctions';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableValuedFunctionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all views in a database from the Data Lake Analytics
 * catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database containing the views.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlViewList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listViewsByDatabase(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}/views';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlViewList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the specified database from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {string} databaseName The name of the database.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlDatabase} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _getDatabase(accountName, databaseName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') {
      throw new Error('databaseName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases/{databaseName}';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlDatabase']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of databases from the Data Lake Analytics catalog.
 *
 * @param {string} accountName The Azure Data Lake Analytics account upon which
 * to execute catalog operations.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {string} [options.filter] OData filter. Optional.
 *
 * @param {number} [options.top] The number of items to return. Optional.
 *
 * @param {number} [options.skip] The number of items to skip over before
 * returning elements. Optional.
 *
 * @param {string} [options.select] OData Select statement. Limits the
 * properties on each entry to just those requested, e.g.
 * Categories?$select=CategoryName,Description. Optional.
 *
 * @param {string} [options.orderby] OrderBy clause. One or more
 * comma-separated expressions with an optional "asc" (the default) or "desc"
 * depending on the order you'd like the values sorted, e.g.
 * Categories?$orderby=CategoryName desc. Optional.
 *
 * @param {boolean} [options.count] The Boolean value of true or false to
 * request a count of the matching resources included with the resources in the
 * response, e.g. Categories?$count=true. Optional.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlDatabaseList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listDatabases(accountName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let filter = (options && options.filter !== undefined) ? options.filter : undefined;
  let top = (options && options.top !== undefined) ? options.top : undefined;
  let skip = (options && options.skip !== undefined) ? options.skip : undefined;
  let select = (options && options.select !== undefined) ? options.select : undefined;
  let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined;
  let count = (options && options.count !== undefined) ? options.count : undefined;
  // Validate
  try {
    if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
      throw new Error('accountName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.adlaCatalogDnsSuffix === null || this.client.adlaCatalogDnsSuffix === undefined || typeof this.client.adlaCatalogDnsSuffix.valueOf() !== 'string') {
      throw new Error('this.client.adlaCatalogDnsSuffix cannot be null or undefined and it must be of type string.');
    }
    if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') {
      throw new Error('filter must be of type string.');
    }
    if (top !== null && top !== undefined && typeof top !== 'number') {
      throw new Error('top must be of type number.');
    }
    if (top !== null && top !== undefined) {
      if (top < 1)
      {
        throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (skip !== null && skip !== undefined && typeof skip !== 'number') {
      throw new Error('skip must be of type number.');
    }
    if (skip !== null && skip !== undefined) {
      if (skip < 1)
      {
        throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1');
      }
    }
    if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') {
      throw new Error('select must be of type string.');
    }
    if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') {
      throw new Error('orderby must be of type string.');
    }
    if (count !== null && count !== undefined && typeof count !== 'boolean') {
      throw new Error('count must be of type boolean.');
    }
    if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
      throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'catalog/usql/databases';
  requestUrl = requestUrl.replace('{accountName}', accountName);
  requestUrl = requestUrl.replace('{adlaCatalogDnsSuffix}', this.client.adlaCatalogDnsSuffix);
  let queryParameters = [];
  if (filter !== null && filter !== undefined) {
    queryParameters.push('$filter=' + encodeURIComponent(filter));
  }
  if (top !== null && top !== undefined) {
    queryParameters.push('$top=' + encodeURIComponent(top.toString()));
  }
  if (skip !== null && skip !== undefined) {
    queryParameters.push('$skip=' + encodeURIComponent(skip.toString()));
  }
  if (select !== null && select !== undefined) {
    queryParameters.push('$select=' + encodeURIComponent(select));
  }
  if (orderby !== null && orderby !== undefined) {
    queryParameters.push('$orderby=' + encodeURIComponent(orderby));
  }
  if (count !== null && count !== undefined) {
    queryParameters.push('$count=' + encodeURIComponent(count.toString()));
  }
  queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlDatabaseList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of credentials from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlCredentialList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listCredentialsNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlCredentialList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of external data sources from the Data Lake Analytics
 * catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlExternalDataSourceList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listExternalDataSourcesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlExternalDataSourceList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of procedures from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlProcedureList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listProceduresNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlProcedureList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of tables from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTablesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all table statistics within the specified schema from
 * the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatisticsByDatabaseAndSchemaNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table types from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableTypeList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableTypesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableTypeList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of packages from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlPackageList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listPackagesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlPackageList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of views from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlViewList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listViewsNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlViewList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table statistics from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatisticsNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table partitions from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTablePartitionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTablePartitionsNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTablePartitionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of types within the specified database and schema from
 * the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTypeList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTypesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTypeList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of table valued functions from the Data Lake Analytics
 * catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableValuedFunctionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableValuedFunctionsNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableValuedFunctionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of assemblies from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlAssemblyList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listAssembliesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlAssemblyList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of schemas from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlSchemaList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listSchemasNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlSchemaList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all statistics in a database from the Data Lake
 * Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableStatisticsList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableStatisticsByDatabaseNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableStatisticsList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all tables in a database from the Data Lake Analytics
 * catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTablesByDatabaseNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all table valued functions in a database from the Data
 * Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlTableValuedFunctionList} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listTableValuedFunctionsByDatabaseNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlTableValuedFunctionList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of all views in a database from the Data Lake Analytics
 * catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlViewList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listViewsByDatabaseNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlViewList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Retrieves the list of databases from the Data Lake Analytics catalog.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link USqlDatabaseList} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listDatabasesNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['USqlDatabaseList']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/** Class representing a Catalog. */
class Catalog {
  /**
   * Create a Catalog.
   * @param {DataLakeAnalyticsCatalogManagementClient} client Reference to the service client.
   */
  constructor(client) {
    this.client = client;
    this._createSecret = _createSecret;
    this._updateSecret = _updateSecret;
    this._deleteSecret = _deleteSecret;
    this._getSecret = _getSecret;
    this._deleteAllSecrets = _deleteAllSecrets;
    this._createCredential = _createCredential;
    this._updateCredential = _updateCredential;
    this._deleteCredential = _deleteCredential;
    this._getCredential = _getCredential;
    this._listCredentials = _listCredentials;
    this._getExternalDataSource = _getExternalDataSource;
    this._listExternalDataSources = _listExternalDataSources;
    this._getProcedure = _getProcedure;
    this._listProcedures = _listProcedures;
    this._getTable = _getTable;
    this._listTables = _listTables;
    this._listTableStatisticsByDatabaseAndSchema = _listTableStatisticsByDatabaseAndSchema;
    this._getTableType = _getTableType;
    this._listTableTypes = _listTableTypes;
    this._getPackage = _getPackage;
    this._listPackages = _listPackages;
    this._getView = _getView;
    this._listViews = _listViews;
    this._getTableStatistic = _getTableStatistic;
    this._listTableStatistics = _listTableStatistics;
    this._getTablePartition = _getTablePartition;
    this._listTablePartitions = _listTablePartitions;
    this._listTypes = _listTypes;
    this._getTableValuedFunction = _getTableValuedFunction;
    this._listTableValuedFunctions = _listTableValuedFunctions;
    this._getAssembly = _getAssembly;
    this._listAssemblies = _listAssemblies;
    this._getSchema = _getSchema;
    this._listSchemas = _listSchemas;
    this._listTableStatisticsByDatabase = _listTableStatisticsByDatabase;
    this._listTablesByDatabase = _listTablesByDatabase;
    this._listTableValuedFunctionsByDatabase = _listTableValuedFunctionsByDatabase;
    this._listViewsByDatabase = _listViewsByDatabase;
    this._getDatabase = _getDatabase;
    this._listDatabases = _listDatabases;
    this._listCredentialsNext = _listCredentialsNext;
    this._listExternalDataSourcesNext = _listExternalDataSourcesNext;
    this._listProceduresNext = _listProceduresNext;
    this._listTablesNext = _listTablesNext;
    this._listTableStatisticsByDatabaseAndSchemaNext = _listTableStatisticsByDatabaseAndSchemaNext;
    this._listTableTypesNext = _listTableTypesNext;
    this._listPackagesNext = _listPackagesNext;
    this._listViewsNext = _listViewsNext;
    this._listTableStatisticsNext = _listTableStatisticsNext;
    this._listTablePartitionsNext = _listTablePartitionsNext;
    this._listTypesNext = _listTypesNext;
    this._listTableValuedFunctionsNext = _listTableValuedFunctionsNext;
    this._listAssembliesNext = _listAssembliesNext;
    this._listSchemasNext = _listSchemasNext;
    this._listTableStatisticsByDatabaseNext = _listTableStatisticsByDatabaseNext;
    this._listTablesByDatabaseNext = _listTablesByDatabaseNext;
    this._listTableValuedFunctionsByDatabaseNext = _listTableValuedFunctionsByDatabaseNext;
    this._listViewsByDatabaseNext = _listViewsByDatabaseNext;
    this._listDatabasesNext = _listDatabasesNext;
  }

  /**
   * Creates the specified secret for use with external data sources in the
   * specified database. This is deprecated and will be removed in the next
   * release. Please use CreateCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database in which to create the
   * secret.
   *
   * @param {string} secretName The name of the secret.
   *
   * @param {object} parameters The parameters required to create the secret
   * (name and password)
   *
   * @param {string} parameters.password the password for the secret to pass in
   *
   * @param {string} [parameters.uri] the URI identifier for the secret in the
   * format <hostname>:<port>
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  createSecretWithHttpOperationResponse(accountName, databaseName, secretName, parameters, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._createSecret(accountName, databaseName, secretName, parameters, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Creates the specified secret for use with external data sources in the
   * specified database. This is deprecated and will be removed in the next
   * release. Please use CreateCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database in which to create the
   * secret.
   *
   * @param {string} secretName The name of the secret.
   *
   * @param {object} parameters The parameters required to create the secret
   * (name and password)
   *
   * @param {string} parameters.password the password for the secret to pass in
   *
   * @param {string} [parameters.uri] the URI identifier for the secret in the
   * format <hostname>:<port>
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  createSecret(accountName, databaseName, secretName, parameters, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._createSecret(accountName, databaseName, secretName, parameters, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._createSecret(accountName, databaseName, secretName, parameters, options, optionalCallback);
    }
  }

  /**
   * Modifies the specified secret for use with external data sources in the
   * specified database. This is deprecated and will be removed in the next
   * release. Please use UpdateCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret.
   *
   * @param {object} parameters The parameters required to modify the secret
   * (name and password)
   *
   * @param {string} parameters.password the password for the secret to pass in
   *
   * @param {string} [parameters.uri] the URI identifier for the secret in the
   * format <hostname>:<port>
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  updateSecretWithHttpOperationResponse(accountName, databaseName, secretName, parameters, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._updateSecret(accountName, databaseName, secretName, parameters, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Modifies the specified secret for use with external data sources in the
   * specified database. This is deprecated and will be removed in the next
   * release. Please use UpdateCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret.
   *
   * @param {object} parameters The parameters required to modify the secret
   * (name and password)
   *
   * @param {string} parameters.password the password for the secret to pass in
   *
   * @param {string} [parameters.uri] the URI identifier for the secret in the
   * format <hostname>:<port>
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  updateSecret(accountName, databaseName, secretName, parameters, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._updateSecret(accountName, databaseName, secretName, parameters, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._updateSecret(accountName, databaseName, secretName, parameters, options, optionalCallback);
    }
  }

  /**
   * Deletes the specified secret in the specified database. This is deprecated
   * and will be removed in the next release. Please use DeleteCredential
   * instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret to delete
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  deleteSecretWithHttpOperationResponse(accountName, databaseName, secretName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._deleteSecret(accountName, databaseName, secretName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Deletes the specified secret in the specified database. This is deprecated
   * and will be removed in the next release. Please use DeleteCredential
   * instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret to delete
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  deleteSecret(accountName, databaseName, secretName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._deleteSecret(accountName, databaseName, secretName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._deleteSecret(accountName, databaseName, secretName, options, optionalCallback);
    }
  }

  /**
   * Gets the specified secret in the specified database. This is deprecated and
   * will be removed in the next release. Please use GetCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret to get
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlSecret>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getSecretWithHttpOperationResponse(accountName, databaseName, secretName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getSecret(accountName, databaseName, secretName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets the specified secret in the specified database. This is deprecated and
   * will be removed in the next release. Please use GetCredential instead.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {string} secretName The name of the secret to get
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlSecret} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlSecret} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getSecret(accountName, databaseName, secretName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getSecret(accountName, databaseName, secretName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getSecret(accountName, databaseName, secretName, options, optionalCallback);
    }
  }

  /**
   * Deletes all secrets in the specified database. This is deprecated and will
   * be removed in the next release. In the future, please only drop individual
   * credentials using DeleteCredential
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  deleteAllSecretsWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._deleteAllSecrets(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Deletes all secrets in the specified database. This is deprecated and will
   * be removed in the next release. In the future, please only drop individual
   * credentials using DeleteCredential
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the secret.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  deleteAllSecrets(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._deleteAllSecrets(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._deleteAllSecrets(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Creates the specified credential for use with external data sources in the
   * specified database.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database in which to create the
   * credential. Note: This is NOT an external database name, but the name of an
   * existing U-SQL database that should contain the new credential object.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} parameters The parameters required to create the credential
   * (name and password)
   *
   * @param {string} parameters.password the password for the credential and user
   * with access to the data source.
   *
   * @param {string} parameters.uri the URI identifier for the data source this
   * credential can connect to in the format <hostname>:<port>
   *
   * @param {string} parameters.userId the object identifier for the user
   * associated with this credential with access to the data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  createCredentialWithHttpOperationResponse(accountName, databaseName, credentialName, parameters, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._createCredential(accountName, databaseName, credentialName, parameters, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Creates the specified credential for use with external data sources in the
   * specified database.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database in which to create the
   * credential. Note: This is NOT an external database name, but the name of an
   * existing U-SQL database that should contain the new credential object.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} parameters The parameters required to create the credential
   * (name and password)
   *
   * @param {string} parameters.password the password for the credential and user
   * with access to the data source.
   *
   * @param {string} parameters.uri the URI identifier for the data source this
   * credential can connect to in the format <hostname>:<port>
   *
   * @param {string} parameters.userId the object identifier for the user
   * associated with this credential with access to the data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  createCredential(accountName, databaseName, credentialName, parameters, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._createCredential(accountName, databaseName, credentialName, parameters, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._createCredential(accountName, databaseName, credentialName, parameters, options, optionalCallback);
    }
  }

  /**
   * Modifies the specified credential for use with external data sources in the
   * specified database
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * credential.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} parameters The parameters required to modify the credential
   * (name and password)
   *
   * @param {string} [parameters.password] the current password for the
   * credential and user with access to the data source. This is required if the
   * requester is not the account owner.
   *
   * @param {string} [parameters.newPassword] the new password for the credential
   * and user with access to the data source.
   *
   * @param {string} [parameters.uri] the URI identifier for the data source this
   * credential can connect to in the format <hostname>:<port>
   *
   * @param {string} [parameters.userId] the object identifier for the user
   * associated with this credential with access to the data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  updateCredentialWithHttpOperationResponse(accountName, databaseName, credentialName, parameters, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._updateCredential(accountName, databaseName, credentialName, parameters, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Modifies the specified credential for use with external data sources in the
   * specified database
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * credential.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} parameters The parameters required to modify the credential
   * (name and password)
   *
   * @param {string} [parameters.password] the current password for the
   * credential and user with access to the data source. This is required if the
   * requester is not the account owner.
   *
   * @param {string} [parameters.newPassword] the new password for the credential
   * and user with access to the data source.
   *
   * @param {string} [parameters.uri] the URI identifier for the data source this
   * credential can connect to in the format <hostname>:<port>
   *
   * @param {string} [parameters.userId] the object identifier for the user
   * associated with this credential with access to the data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  updateCredential(accountName, databaseName, credentialName, parameters, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._updateCredential(accountName, databaseName, credentialName, parameters, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._updateCredential(accountName, databaseName, credentialName, parameters, options, optionalCallback);
    }
  }

  /**
   * Deletes the specified credential in the specified database
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * credential.
   *
   * @param {string} credentialName The name of the credential to delete
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.parameters] The parameters to delete a credential
   * if the current user is not the account owner.
   *
   * @param {string} [options.parameters.password] the current password for the
   * credential and user with access to the data source. This is required if the
   * requester is not the account owner.
   *
   * @param {boolean} [options.cascade] Indicates if the delete should be a
   * cascading delete (which deletes all resources dependent on the credential as
   * well as the credential) or not. If false will fail if there are any
   * resources relying on the credential.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<null>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  deleteCredentialWithHttpOperationResponse(accountName, databaseName, credentialName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._deleteCredential(accountName, databaseName, credentialName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Deletes the specified credential in the specified database
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * credential.
   *
   * @param {string} credentialName The name of the credential to delete
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.parameters] The parameters to delete a credential
   * if the current user is not the account owner.
   *
   * @param {string} [options.parameters.password] the current password for the
   * credential and user with access to the data source. This is required if the
   * requester is not the account owner.
   *
   * @param {boolean} [options.cascade] Indicates if the delete should be a
   * cascading delete (which deletes all resources dependent on the credential as
   * well as the credential) or not. If false will fail if there are any
   * resources relying on the credential.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {null} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {null} [result]   - The deserialized result object if an error did not occur.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  deleteCredential(accountName, databaseName, credentialName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._deleteCredential(accountName, databaseName, credentialName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._deleteCredential(accountName, databaseName, credentialName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified credential from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlCredential>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getCredentialWithHttpOperationResponse(accountName, databaseName, credentialName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getCredential(accountName, databaseName, credentialName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified credential from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {string} credentialName The name of the credential.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlCredential} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlCredential} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getCredential(accountName, databaseName, credentialName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getCredential(accountName, databaseName, credentialName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getCredential(accountName, databaseName, credentialName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of credentials from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlCredentialList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listCredentialsWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listCredentials(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of credentials from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlCredentialList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlCredentialList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listCredentials(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listCredentials(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listCredentials(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified external data source from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * external data source.
   *
   * @param {string} externalDataSourceName The name of the external data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlExternalDataSource>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getExternalDataSourceWithHttpOperationResponse(accountName, databaseName, externalDataSourceName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getExternalDataSource(accountName, databaseName, externalDataSourceName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified external data source from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * external data source.
   *
   * @param {string} externalDataSourceName The name of the external data source.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlExternalDataSource} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlExternalDataSource} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getExternalDataSource(accountName, databaseName, externalDataSourceName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getExternalDataSource(accountName, databaseName, externalDataSourceName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getExternalDataSource(accountName, databaseName, externalDataSourceName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of external data sources from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * external data sources.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlExternalDataSourceList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listExternalDataSourcesWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listExternalDataSources(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of external data sources from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * external data sources.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlExternalDataSourceList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlExternalDataSourceList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listExternalDataSources(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listExternalDataSources(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listExternalDataSources(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified procedure from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * procedure.
   *
   * @param {string} schemaName The name of the schema containing the procedure.
   *
   * @param {string} procedureName The name of the procedure.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlProcedure>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getProcedureWithHttpOperationResponse(accountName, databaseName, schemaName, procedureName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getProcedure(accountName, databaseName, schemaName, procedureName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified procedure from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * procedure.
   *
   * @param {string} schemaName The name of the schema containing the procedure.
   *
   * @param {string} procedureName The name of the procedure.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlProcedure} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlProcedure} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getProcedure(accountName, databaseName, schemaName, procedureName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getProcedure(accountName, databaseName, schemaName, procedureName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getProcedure(accountName, databaseName, schemaName, procedureName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of procedures from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * procedures.
   *
   * @param {string} schemaName The name of the schema containing the procedures.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlProcedureList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listProceduresWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listProcedures(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of procedures from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * procedures.
   *
   * @param {string} schemaName The name of the schema containing the procedures.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlProcedureList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlProcedureList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listProcedures(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listProcedures(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listProcedures(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified table from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table.
   *
   * @param {string} schemaName The name of the schema containing the table.
   *
   * @param {string} tableName The name of the table.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTable>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getTableWithHttpOperationResponse(accountName, databaseName, schemaName, tableName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getTable(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified table from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table.
   *
   * @param {string} schemaName The name of the schema containing the table.
   *
   * @param {string} tableName The name of the table.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTable} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTable} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getTable(accountName, databaseName, schemaName, tableName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getTable(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getTable(accountName, databaseName, schemaName, tableName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of tables from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the tables.
   *
   * @param {string} schemaName The name of the schema containing the tables.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {boolean} [options.basic] The basic switch indicates what level of
   * information to return when listing tables. When basic is true, only
   * database_name, schema_name, table_name and version are returned for each
   * table, otherwise all table metadata is returned. By default, it is false.
   * Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablesWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTables(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of tables from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the tables.
   *
   * @param {string} schemaName The name of the schema containing the tables.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {boolean} [options.basic] The basic switch indicates what level of
   * information to return when listing tables. When basic is true, only
   * database_name, schema_name, table_name and version are returned for each
   * table, otherwise all table metadata is returned. By default, it is false.
   * Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTables(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTables(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTables(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all table statistics within the specified schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsByDatabaseAndSchemaWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatisticsByDatabaseAndSchema(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all table statistics within the specified schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatisticsByDatabaseAndSchema(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatisticsByDatabaseAndSchema(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatisticsByDatabaseAndSchema(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified table type from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * type.
   *
   * @param {string} schemaName The name of the schema containing the table type.
   *
   * @param {string} tableTypeName The name of the table type to retrieve.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableType>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getTableTypeWithHttpOperationResponse(accountName, databaseName, schemaName, tableTypeName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getTableType(accountName, databaseName, schemaName, tableTypeName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified table type from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * type.
   *
   * @param {string} schemaName The name of the schema containing the table type.
   *
   * @param {string} tableTypeName The name of the table type to retrieve.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableType} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableType} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getTableType(accountName, databaseName, schemaName, tableTypeName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getTableType(accountName, databaseName, schemaName, tableTypeName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getTableType(accountName, databaseName, schemaName, tableTypeName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table types from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * types.
   *
   * @param {string} schemaName The name of the schema containing the table
   * types.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableTypeList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableTypesWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableTypes(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table types from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * types.
   *
   * @param {string} schemaName The name of the schema containing the table
   * types.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableTypeList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableTypeList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableTypes(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableTypes(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableTypes(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified package from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * package.
   *
   * @param {string} schemaName The name of the schema containing the package.
   *
   * @param {string} packageName The name of the package.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlPackage>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getPackageWithHttpOperationResponse(accountName, databaseName, schemaName, packageName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getPackage(accountName, databaseName, schemaName, packageName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified package from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * package.
   *
   * @param {string} schemaName The name of the schema containing the package.
   *
   * @param {string} packageName The name of the package.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlPackage} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlPackage} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getPackage(accountName, databaseName, schemaName, packageName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getPackage(accountName, databaseName, schemaName, packageName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getPackage(accountName, databaseName, schemaName, packageName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of packages from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * packages.
   *
   * @param {string} schemaName The name of the schema containing the packages.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlPackageList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listPackagesWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listPackages(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of packages from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * packages.
   *
   * @param {string} schemaName The name of the schema containing the packages.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlPackageList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlPackageList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listPackages(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listPackages(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listPackages(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified view from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the view.
   *
   * @param {string} schemaName The name of the schema containing the view.
   *
   * @param {string} viewName The name of the view.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlView>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getViewWithHttpOperationResponse(accountName, databaseName, schemaName, viewName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getView(accountName, databaseName, schemaName, viewName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified view from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the view.
   *
   * @param {string} schemaName The name of the schema containing the view.
   *
   * @param {string} viewName The name of the view.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlView} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlView} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getView(accountName, databaseName, schemaName, viewName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getView(accountName, databaseName, schemaName, viewName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getView(accountName, databaseName, schemaName, viewName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of views from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the views.
   *
   * @param {string} schemaName The name of the schema containing the views.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlViewList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listViewsWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listViews(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of views from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the views.
   *
   * @param {string} schemaName The name of the schema containing the views.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlViewList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlViewList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listViews(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listViews(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listViews(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified table statistics from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {string} tableName The name of the table containing the statistics.
   *
   * @param {string} statisticsName The name of the table statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatistics>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getTableStatisticWithHttpOperationResponse(accountName, databaseName, schemaName, tableName, statisticsName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getTableStatistic(accountName, databaseName, schemaName, tableName, statisticsName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified table statistics from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {string} tableName The name of the table containing the statistics.
   *
   * @param {string} statisticsName The name of the table statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatistics} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatistics} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getTableStatistic(accountName, databaseName, schemaName, tableName, statisticsName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getTableStatistic(accountName, databaseName, schemaName, tableName, statisticsName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getTableStatistic(accountName, databaseName, schemaName, tableName, statisticsName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table statistics from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {string} tableName The name of the table containing the statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsWithHttpOperationResponse(accountName, databaseName, schemaName, tableName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatistics(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table statistics from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * statistics.
   *
   * @param {string} schemaName The name of the schema containing the statistics.
   *
   * @param {string} tableName The name of the table containing the statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatistics(accountName, databaseName, schemaName, tableName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatistics(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatistics(accountName, databaseName, schemaName, tableName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified table partition from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * partition.
   *
   * @param {string} schemaName The name of the schema containing the partition.
   *
   * @param {string} tableName The name of the table containing the partition.
   *
   * @param {string} partitionName The name of the table partition.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTablePartition>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getTablePartitionWithHttpOperationResponse(accountName, databaseName, schemaName, tableName, partitionName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getTablePartition(accountName, databaseName, schemaName, tableName, partitionName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified table partition from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * partition.
   *
   * @param {string} schemaName The name of the schema containing the partition.
   *
   * @param {string} tableName The name of the table containing the partition.
   *
   * @param {string} partitionName The name of the table partition.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTablePartition} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTablePartition} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getTablePartition(accountName, databaseName, schemaName, tableName, partitionName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getTablePartition(accountName, databaseName, schemaName, tableName, partitionName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getTablePartition(accountName, databaseName, schemaName, tableName, partitionName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table partitions from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * partitions.
   *
   * @param {string} schemaName The name of the schema containing the partitions.
   *
   * @param {string} tableName The name of the table containing the partitions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTablePartitionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablePartitionsWithHttpOperationResponse(accountName, databaseName, schemaName, tableName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTablePartitions(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table partitions from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * partitions.
   *
   * @param {string} schemaName The name of the schema containing the partitions.
   *
   * @param {string} tableName The name of the table containing the partitions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTablePartitionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTablePartitionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTablePartitions(accountName, databaseName, schemaName, tableName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTablePartitions(accountName, databaseName, schemaName, tableName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTablePartitions(accountName, databaseName, schemaName, tableName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of types within the specified database and schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the types.
   *
   * @param {string} schemaName The name of the schema containing the types.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTypeList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTypesWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTypes(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of types within the specified database and schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the types.
   *
   * @param {string} schemaName The name of the schema containing the types.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTypeList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTypeList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTypes(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTypes(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTypes(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified table valued function from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued function.
   *
   * @param {string} schemaName The name of the schema containing the table
   * valued function.
   *
   * @param {string} tableValuedFunctionName The name of the tableValuedFunction.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableValuedFunction>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getTableValuedFunctionWithHttpOperationResponse(accountName, databaseName, schemaName, tableValuedFunctionName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getTableValuedFunction(accountName, databaseName, schemaName, tableValuedFunctionName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified table valued function from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued function.
   *
   * @param {string} schemaName The name of the schema containing the table
   * valued function.
   *
   * @param {string} tableValuedFunctionName The name of the tableValuedFunction.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableValuedFunction} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableValuedFunction} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getTableValuedFunction(accountName, databaseName, schemaName, tableValuedFunctionName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getTableValuedFunction(accountName, databaseName, schemaName, tableValuedFunctionName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getTableValuedFunction(accountName, databaseName, schemaName, tableValuedFunctionName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table valued functions from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued functions.
   *
   * @param {string} schemaName The name of the schema containing the table
   * valued functions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableValuedFunctionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableValuedFunctionsWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableValuedFunctions(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table valued functions from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued functions.
   *
   * @param {string} schemaName The name of the schema containing the table
   * valued functions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableValuedFunctionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableValuedFunctionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableValuedFunctions(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableValuedFunctions(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableValuedFunctions(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified assembly from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * assembly.
   *
   * @param {string} assemblyName The name of the assembly.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlAssembly>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getAssemblyWithHttpOperationResponse(accountName, databaseName, assemblyName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getAssembly(accountName, databaseName, assemblyName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified assembly from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * assembly.
   *
   * @param {string} assemblyName The name of the assembly.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlAssembly} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlAssembly} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getAssembly(accountName, databaseName, assemblyName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getAssembly(accountName, databaseName, assemblyName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getAssembly(accountName, databaseName, assemblyName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of assemblies from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * assembly.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlAssemblyList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listAssembliesWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listAssemblies(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of assemblies from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the
   * assembly.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlAssemblyList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlAssemblyList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listAssemblies(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listAssemblies(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listAssemblies(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified schema from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {string} schemaName The name of the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlSchema>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getSchemaWithHttpOperationResponse(accountName, databaseName, schemaName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getSchema(accountName, databaseName, schemaName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified schema from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {string} schemaName The name of the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlSchema} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlSchema} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getSchema(accountName, databaseName, schemaName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getSchema(accountName, databaseName, schemaName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getSchema(accountName, databaseName, schemaName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of schemas from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlSchemaList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listSchemasWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listSchemas(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of schemas from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the schema.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlSchemaList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlSchemaList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listSchemas(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listSchemas(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listSchemas(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all statistics in a database from the Data Lake
   * Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsByDatabaseWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatisticsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all statistics in a database from the Data Lake
   * Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * statistics.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatisticsByDatabase(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatisticsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatisticsByDatabase(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all tables in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the tables.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {boolean} [options.basic] The basic switch indicates what level of
   * information to return when listing tables. When basic is true, only
   * database_name, schema_name, table_name and version are returned for each
   * table, otherwise all table metadata is returned. By default, it is false
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablesByDatabaseWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTablesByDatabase(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all tables in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the tables.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {boolean} [options.basic] The basic switch indicates what level of
   * information to return when listing tables. When basic is true, only
   * database_name, schema_name, table_name and version are returned for each
   * table, otherwise all table metadata is returned. By default, it is false
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTablesByDatabase(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTablesByDatabase(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTablesByDatabase(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all table valued functions in a database from the Data
   * Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued functions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableValuedFunctionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableValuedFunctionsByDatabaseWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableValuedFunctionsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all table valued functions in a database from the Data
   * Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the table
   * valued functions.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableValuedFunctionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableValuedFunctionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableValuedFunctionsByDatabase(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableValuedFunctionsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableValuedFunctionsByDatabase(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all views in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the views.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlViewList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listViewsByDatabaseWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listViewsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all views in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database containing the views.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlViewList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlViewList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listViewsByDatabase(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listViewsByDatabase(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listViewsByDatabase(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the specified database from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlDatabase>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getDatabaseWithHttpOperationResponse(accountName, databaseName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getDatabase(accountName, databaseName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the specified database from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {string} databaseName The name of the database.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlDatabase} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlDatabase} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  getDatabase(accountName, databaseName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._getDatabase(accountName, databaseName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getDatabase(accountName, databaseName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of databases from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlDatabaseList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listDatabasesWithHttpOperationResponse(accountName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listDatabases(accountName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of databases from the Data Lake Analytics catalog.
   *
   * @param {string} accountName The Azure Data Lake Analytics account upon which
   * to execute catalog operations.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {string} [options.filter] OData filter. Optional.
   *
   * @param {number} [options.top] The number of items to return. Optional.
   *
   * @param {number} [options.skip] The number of items to skip over before
   * returning elements. Optional.
   *
   * @param {string} [options.select] OData Select statement. Limits the
   * properties on each entry to just those requested, e.g.
   * Categories?$select=CategoryName,Description. Optional.
   *
   * @param {string} [options.orderby] OrderBy clause. One or more
   * comma-separated expressions with an optional "asc" (the default) or "desc"
   * depending on the order you'd like the values sorted, e.g.
   * Categories?$orderby=CategoryName desc. Optional.
   *
   * @param {boolean} [options.count] The Boolean value of true or false to
   * request a count of the matching resources included with the resources in the
   * response, e.g. Categories?$count=true. Optional.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlDatabaseList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlDatabaseList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listDatabases(accountName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listDatabases(accountName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listDatabases(accountName, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of credentials from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlCredentialList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listCredentialsNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listCredentialsNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of credentials from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlCredentialList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlCredentialList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listCredentialsNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listCredentialsNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listCredentialsNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of external data sources from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlExternalDataSourceList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listExternalDataSourcesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listExternalDataSourcesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of external data sources from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlExternalDataSourceList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlExternalDataSourceList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listExternalDataSourcesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listExternalDataSourcesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listExternalDataSourcesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of procedures from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlProcedureList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listProceduresNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listProceduresNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of procedures from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlProcedureList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlProcedureList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listProceduresNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listProceduresNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listProceduresNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of tables from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTablesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of tables from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTablesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTablesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTablesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all table statistics within the specified schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsByDatabaseAndSchemaNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatisticsByDatabaseAndSchemaNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all table statistics within the specified schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatisticsByDatabaseAndSchemaNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatisticsByDatabaseAndSchemaNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatisticsByDatabaseAndSchemaNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table types from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableTypeList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableTypesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableTypesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table types from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableTypeList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableTypeList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableTypesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableTypesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableTypesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of packages from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlPackageList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listPackagesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listPackagesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of packages from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlPackageList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlPackageList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listPackagesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listPackagesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listPackagesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of views from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlViewList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listViewsNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listViewsNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of views from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlViewList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlViewList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listViewsNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listViewsNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listViewsNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table statistics from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatisticsNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table statistics from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatisticsNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatisticsNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatisticsNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table partitions from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTablePartitionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablePartitionsNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTablePartitionsNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table partitions from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTablePartitionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTablePartitionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTablePartitionsNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTablePartitionsNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTablePartitionsNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of types within the specified database and schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTypeList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTypesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTypesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of types within the specified database and schema from
   * the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTypeList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTypeList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTypesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTypesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTypesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of table valued functions from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableValuedFunctionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableValuedFunctionsNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableValuedFunctionsNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of table valued functions from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableValuedFunctionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableValuedFunctionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableValuedFunctionsNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableValuedFunctionsNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableValuedFunctionsNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of assemblies from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlAssemblyList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listAssembliesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listAssembliesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of assemblies from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlAssemblyList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlAssemblyList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listAssembliesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listAssembliesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listAssembliesNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of schemas from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlSchemaList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listSchemasNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listSchemasNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of schemas from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlSchemaList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlSchemaList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listSchemasNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listSchemasNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listSchemasNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all statistics in a database from the Data Lake
   * Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableStatisticsList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableStatisticsByDatabaseNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableStatisticsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all statistics in a database from the Data Lake
   * Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableStatisticsList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableStatisticsList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableStatisticsByDatabaseNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableStatisticsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableStatisticsByDatabaseNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all tables in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTablesByDatabaseNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTablesByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all tables in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTablesByDatabaseNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTablesByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTablesByDatabaseNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all table valued functions in a database from the Data
   * Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlTableValuedFunctionList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listTableValuedFunctionsByDatabaseNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listTableValuedFunctionsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all table valued functions in a database from the Data
   * Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlTableValuedFunctionList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlTableValuedFunctionList} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listTableValuedFunctionsByDatabaseNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listTableValuedFunctionsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listTableValuedFunctionsByDatabaseNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of all views in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlViewList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listViewsByDatabaseNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listViewsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of all views in a database from the Data Lake Analytics
   * catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlViewList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlViewList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listViewsByDatabaseNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listViewsByDatabaseNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listViewsByDatabaseNext(nextPageLink, options, optionalCallback);
    }
  }

  /**
   * Retrieves the list of databases from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<USqlDatabaseList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listDatabasesNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listDatabasesNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Retrieves the list of databases from the Data Lake Analytics catalog.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {USqlDatabaseList} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link USqlDatabaseList} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listDatabasesNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listDatabasesNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listDatabasesNext(nextPageLink, options, optionalCallback);
    }
  }

}

module.exports = Catalog;
