/*
 * 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;

/**
 * @summary Get all assessments created for the specified group.
 *
 * Get all assessments created for the specified group.
 *
 * Returns a json array of objects of type 'assessment' as specified in Models
 * section.
 *
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @param {string} groupName Unique name of a group within a project.
 *
 * @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 AssessmentResultList} 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 _listByGroup(resourceGroupName, projectName, groupName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName cannot be null or undefined and it must be of type string.');
    }
    if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') {
      throw new Error('groupName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName));
  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 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) {
      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['AssessmentResultList']().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);
  });
}

/**
 * @summary Get all assessments created in the project.
 *
 * Get all assessments created in the project.
 *
 * Returns a json array of objects of type 'assessment' as specified in Models
 * section.
 *
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @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 AssessmentResultList} 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 _listByProject(resourceGroupName, projectName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/assessments';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  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 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) {
      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['AssessmentResultList']().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);
  });
}

/**
 * @summary Get an assessment.
 *
 * Get an existing assessment with the specified name. Returns a json object of
 * type 'assessment' as specified in Models section.
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @param {string} groupName Unique name of a group within a project.
 *
 * @param {string} assessmentName Unique name of an assessment within a
 * project.
 *
 * @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 Assessment} 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 _get(resourceGroupName, projectName, groupName, assessmentName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName cannot be null or undefined and it must be of type string.');
    }
    if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') {
      throw new Error('groupName cannot be null or undefined and it must be of type string.');
    }
    if (assessmentName === null || assessmentName === undefined || typeof assessmentName.valueOf() !== 'string') {
      throw new Error('assessmentName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName));
  requestUrl = requestUrl.replace('{assessmentName}', encodeURIComponent(assessmentName));
  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 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) {
      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['Assessment']().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);
  });
}

/**
 * @summary Create or Update assessment.
 *
 * Create a new assessment with the given name and the specified settings.
 * Since name of an assessment in a project is a unique identiefier, if an
 * assessment with the name provided already exists, then the existing
 * assessment is updated.
 *
 * Any PUT operation, resulting in either create or update on an assessment,
 * will cause the assessment to go in a "InProgress" state. This will be
 * indicated by the field 'computationState' on the Assessment object. During
 * this time no other PUT operation will be allowed on that assessment object,
 * nor will a Delete operation. Once the computation for the assessment is
 * complete, the field 'computationState' will be updated to 'Ready', and then
 * other PUT or DELETE operations can happen on the assessment.
 *
 * When assessment is under computation, any PUT will lead to a 400 - Bad
 * Request error.
 *
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @param {string} groupName Unique name of a group within a project.
 *
 * @param {string} assessmentName Unique name of an assessment within a
 * project.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.assessment] New or Updated Assessment object.
 *
 * @param {string} [options.assessment.eTag] For optimistic concurrency
 * control.
 *
 * @param {string} options.assessment.azureLocation Target Azure location for
 * which the machines should be assessed. These enums are the same as used by
 * Compute API. Possible values include: 'Unknown', 'EastAsia',
 * 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth',
 * 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia',
 * 'SouthIndia', 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral',
 * 'KoreaSouth', 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2',
 * 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs',
 * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'
 *
 * @param {string} options.assessment.azureOfferCode Offer code according to
 * which cost estimation is done. Possible values include: 'Unknown',
 * 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P',
 * 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P',
 * 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P',
 * 'MSAZR0122P', 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P',
 * 'MSAZR0127P', 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P',
 * 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P',
 * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P',
 * 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'
 *
 * @param {string} options.assessment.azurePricingTier Pricing tier for Size
 * evaluation. Possible values include: 'Standard', 'Basic'
 *
 * @param {string} options.assessment.azureStorageRedundancy Storage Redundancy
 * type offered by Azure. Possible values include: 'Unknown',
 * 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant',
 * 'ReadAccessGeoRedundant'
 *
 * @param {number} options.assessment.scalingFactor Scaling factor used over
 * utilization data to add a performance buffer for new machines to be created
 * in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3.
 *
 * @param {string} options.assessment.percentile Percentile of performance data
 * used to recommend Azure size. Possible values include: 'Percentile50',
 * 'Percentile90', 'Percentile95', 'Percentile99'
 *
 * @param {string} options.assessment.timeRange Time range of performance data
 * used to recommend a size. Possible values include: 'Day', 'Week', 'Month'
 *
 * @param {string} options.assessment.stage User configurable setting that
 * describes the status of the assessment. Possible values include:
 * 'InProgress', 'UnderReview', 'Approved'
 *
 * @param {string} options.assessment.currency Currency to report prices in.
 * Possible values include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY',
 * 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR',
 * 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'
 *
 * @param {string} options.assessment.azureHybridUseBenefit AHUB discount on
 * windows virtual machines. Possible values include: 'Unknown', 'Yes', 'No'
 *
 * @param {number} options.assessment.discountPercentage Custom discount
 * percentage to be applied on final costs. Can be in the range [0, 100].
 *
 * @param {string} options.assessment.sizingCriterion Assessment sizing
 * criterion. Possible values include: 'PerformanceBased', 'AsOnPremises'
 *
 * @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 Assessment} 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 _create(resourceGroupName, projectName, groupName, assessmentName, 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 assessment = (options && options.assessment !== undefined) ? options.assessment : undefined;
  // Validate
  try {
    if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName cannot be null or undefined and it must be of type string.');
    }
    if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') {
      throw new Error('groupName cannot be null or undefined and it must be of type string.');
    }
    if (assessmentName === null || assessmentName === undefined || typeof assessmentName.valueOf() !== 'string') {
      throw new Error('assessmentName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName));
  requestUrl = requestUrl.replace('{assessmentName}', encodeURIComponent(assessmentName));
  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 (assessment !== null && assessment !== undefined) {
      let requestModelMapper = new client.models['Assessment']().mapper();
      requestModel = client.serialize(requestModelMapper, assessment, 'assessment');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
        `payload - ${JSON.stringify(assessment, 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 && statusCode !== 201 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) {
      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['Assessment']().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);
      }
    }
    // Deserialize Response
    if (statusCode === 201) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['Assessment']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError1.request = msRest.stripRequest(httpRequest);
        deserializationError1.response = msRest.stripResponse(response);
        return callback(deserializationError1);
      }
    }

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

/**
 * @summary Deletes an assessment from the project.
 *
 * Delete an assessment from the project. The machines remain in the
 * assessment. Deleting a non-existent assessment results in a no-operation.
 *
 * When an assessment is under computation, as indicated by the
 * 'computationState' field, it cannot be deleted. Any such attempt will return
 * a 400 - Bad Request.
 *
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @param {string} groupName Unique name of a group within a project.
 *
 * @param {string} assessmentName Unique name of an assessment within a
 * project.
 *
 * @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 _deleteMethod(resourceGroupName, projectName, groupName, assessmentName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName cannot be null or undefined and it must be of type string.');
    }
    if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') {
      throw new Error('groupName cannot be null or undefined and it must be of type string.');
    }
    if (assessmentName === null || assessmentName === undefined || typeof assessmentName.valueOf() !== 'string') {
      throw new Error('assessmentName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName));
  requestUrl = requestUrl.replace('{assessmentName}', encodeURIComponent(assessmentName));
  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 && statusCode !== 204 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) {
      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);
  });
}

/**
 * @summary Get download URL for the assessment report.
 *
 * Get the URL for downloading the assessment in a report format.
 *
 * @param {string} resourceGroupName Name of the Azure Resource Group that
 * project is part of.
 *
 * @param {string} projectName Name of the Azure Migrate project.
 *
 * @param {string} groupName Unique name of a group within a project.
 *
 * @param {string} assessmentName Unique name of an assessment within a
 * project.
 *
 * @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 DownloadUrl} 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 _getReportDownloadUrl(resourceGroupName, projectName, groupName, assessmentName, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') {
      throw new Error('projectName cannot be null or undefined and it must be of type string.');
    }
    if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') {
      throw new Error('groupName cannot be null or undefined and it must be of type string.');
    }
    if (assessmentName === null || assessmentName === undefined || typeof assessmentName.valueOf() !== 'string') {
      throw new Error('assessmentName 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl';
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName));
  requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName));
  requestUrl = requestUrl.replace('{assessmentName}', encodeURIComponent(assessmentName));
  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 = '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];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) {
      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['DownloadUrl']().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 Assessments. */
class Assessments {
  /**
   * Create a Assessments.
   * @param {AzureMigrate} client Reference to the service client.
   */
  constructor(client) {
    this.client = client;
    this._listByGroup = _listByGroup;
    this._listByProject = _listByProject;
    this._get = _get;
    this._create = _create;
    this._deleteMethod = _deleteMethod;
    this._getReportDownloadUrl = _getReportDownloadUrl;
  }

  /**
   * @summary Get all assessments created for the specified group.
   *
   * Get all assessments created for the specified group.
   *
   * Returns a json array of objects of type 'assessment' as specified in Models
   * section.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @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<AssessmentResultList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listByGroupWithHttpOperationResponse(resourceGroupName, projectName, groupName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listByGroup(resourceGroupName, projectName, groupName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Get all assessments created for the specified group.
   *
   * Get all assessments created for the specified group.
   *
   * Returns a json array of objects of type 'assessment' as specified in Models
   * section.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @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 {AssessmentResultList} - 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 AssessmentResultList} 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.
   */
  listByGroup(resourceGroupName, projectName, groupName, 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._listByGroup(resourceGroupName, projectName, groupName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listByGroup(resourceGroupName, projectName, groupName, options, optionalCallback);
    }
  }

  /**
   * @summary Get all assessments created in the project.
   *
   * Get all assessments created in the project.
   *
   * Returns a json array of objects of type 'assessment' as specified in Models
   * section.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @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<AssessmentResultList>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listByProjectWithHttpOperationResponse(resourceGroupName, projectName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listByProject(resourceGroupName, projectName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Get all assessments created in the project.
   *
   * Get all assessments created in the project.
   *
   * Returns a json array of objects of type 'assessment' as specified in Models
   * section.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @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 {AssessmentResultList} - 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 AssessmentResultList} 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.
   */
  listByProject(resourceGroupName, projectName, 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._listByProject(resourceGroupName, projectName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listByProject(resourceGroupName, projectName, options, optionalCallback);
    }
  }

  /**
   * @summary Get an assessment.
   *
   * Get an existing assessment with the specified name. Returns a json object of
   * type 'assessment' as specified in Models section.
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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<Assessment>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getWithHttpOperationResponse(resourceGroupName, projectName, groupName, assessmentName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._get(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Get an assessment.
   *
   * Get an existing assessment with the specified name. Returns a json object of
   * type 'assessment' as specified in Models section.
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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 {Assessment} - 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 Assessment} 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.
   */
  get(resourceGroupName, projectName, groupName, assessmentName, 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._get(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._get(resourceGroupName, projectName, groupName, assessmentName, options, optionalCallback);
    }
  }

  /**
   * @summary Create or Update assessment.
   *
   * Create a new assessment with the given name and the specified settings.
   * Since name of an assessment in a project is a unique identiefier, if an
   * assessment with the name provided already exists, then the existing
   * assessment is updated.
   *
   * Any PUT operation, resulting in either create or update on an assessment,
   * will cause the assessment to go in a "InProgress" state. This will be
   * indicated by the field 'computationState' on the Assessment object. During
   * this time no other PUT operation will be allowed on that assessment object,
   * nor will a Delete operation. Once the computation for the assessment is
   * complete, the field 'computationState' will be updated to 'Ready', and then
   * other PUT or DELETE operations can happen on the assessment.
   *
   * When assessment is under computation, any PUT will lead to a 400 - Bad
   * Request error.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.assessment] New or Updated Assessment object.
   *
   * @param {string} [options.assessment.eTag] For optimistic concurrency
   * control.
   *
   * @param {string} options.assessment.azureLocation Target Azure location for
   * which the machines should be assessed. These enums are the same as used by
   * Compute API. Possible values include: 'Unknown', 'EastAsia',
   * 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth',
   * 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia',
   * 'SouthIndia', 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral',
   * 'KoreaSouth', 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2',
   * 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs',
   * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'
   *
   * @param {string} options.assessment.azureOfferCode Offer code according to
   * which cost estimation is done. Possible values include: 'Unknown',
   * 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P',
   * 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P',
   * 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P',
   * 'MSAZR0122P', 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P',
   * 'MSAZR0127P', 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P',
   * 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P',
   * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P',
   * 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'
   *
   * @param {string} options.assessment.azurePricingTier Pricing tier for Size
   * evaluation. Possible values include: 'Standard', 'Basic'
   *
   * @param {string} options.assessment.azureStorageRedundancy Storage Redundancy
   * type offered by Azure. Possible values include: 'Unknown',
   * 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant',
   * 'ReadAccessGeoRedundant'
   *
   * @param {number} options.assessment.scalingFactor Scaling factor used over
   * utilization data to add a performance buffer for new machines to be created
   * in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3.
   *
   * @param {string} options.assessment.percentile Percentile of performance data
   * used to recommend Azure size. Possible values include: 'Percentile50',
   * 'Percentile90', 'Percentile95', 'Percentile99'
   *
   * @param {string} options.assessment.timeRange Time range of performance data
   * used to recommend a size. Possible values include: 'Day', 'Week', 'Month'
   *
   * @param {string} options.assessment.stage User configurable setting that
   * describes the status of the assessment. Possible values include:
   * 'InProgress', 'UnderReview', 'Approved'
   *
   * @param {string} options.assessment.currency Currency to report prices in.
   * Possible values include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY',
   * 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR',
   * 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'
   *
   * @param {string} options.assessment.azureHybridUseBenefit AHUB discount on
   * windows virtual machines. Possible values include: 'Unknown', 'Yes', 'No'
   *
   * @param {number} options.assessment.discountPercentage Custom discount
   * percentage to be applied on final costs. Can be in the range [0, 100].
   *
   * @param {string} options.assessment.sizingCriterion Assessment sizing
   * criterion. Possible values include: 'PerformanceBased', 'AsOnPremises'
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<Assessment>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  createWithHttpOperationResponse(resourceGroupName, projectName, groupName, assessmentName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._create(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Create or Update assessment.
   *
   * Create a new assessment with the given name and the specified settings.
   * Since name of an assessment in a project is a unique identiefier, if an
   * assessment with the name provided already exists, then the existing
   * assessment is updated.
   *
   * Any PUT operation, resulting in either create or update on an assessment,
   * will cause the assessment to go in a "InProgress" state. This will be
   * indicated by the field 'computationState' on the Assessment object. During
   * this time no other PUT operation will be allowed on that assessment object,
   * nor will a Delete operation. Once the computation for the assessment is
   * complete, the field 'computationState' will be updated to 'Ready', and then
   * other PUT or DELETE operations can happen on the assessment.
   *
   * When assessment is under computation, any PUT will lead to a 400 - Bad
   * Request error.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.assessment] New or Updated Assessment object.
   *
   * @param {string} [options.assessment.eTag] For optimistic concurrency
   * control.
   *
   * @param {string} options.assessment.azureLocation Target Azure location for
   * which the machines should be assessed. These enums are the same as used by
   * Compute API. Possible values include: 'Unknown', 'EastAsia',
   * 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth',
   * 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia',
   * 'SouthIndia', 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral',
   * 'KoreaSouth', 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2',
   * 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs',
   * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'
   *
   * @param {string} options.assessment.azureOfferCode Offer code according to
   * which cost estimation is done. Possible values include: 'Unknown',
   * 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P',
   * 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P',
   * 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P',
   * 'MSAZR0122P', 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P',
   * 'MSAZR0127P', 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P',
   * 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P',
   * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P',
   * 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'
   *
   * @param {string} options.assessment.azurePricingTier Pricing tier for Size
   * evaluation. Possible values include: 'Standard', 'Basic'
   *
   * @param {string} options.assessment.azureStorageRedundancy Storage Redundancy
   * type offered by Azure. Possible values include: 'Unknown',
   * 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant',
   * 'ReadAccessGeoRedundant'
   *
   * @param {number} options.assessment.scalingFactor Scaling factor used over
   * utilization data to add a performance buffer for new machines to be created
   * in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3.
   *
   * @param {string} options.assessment.percentile Percentile of performance data
   * used to recommend Azure size. Possible values include: 'Percentile50',
   * 'Percentile90', 'Percentile95', 'Percentile99'
   *
   * @param {string} options.assessment.timeRange Time range of performance data
   * used to recommend a size. Possible values include: 'Day', 'Week', 'Month'
   *
   * @param {string} options.assessment.stage User configurable setting that
   * describes the status of the assessment. Possible values include:
   * 'InProgress', 'UnderReview', 'Approved'
   *
   * @param {string} options.assessment.currency Currency to report prices in.
   * Possible values include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY',
   * 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR',
   * 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'
   *
   * @param {string} options.assessment.azureHybridUseBenefit AHUB discount on
   * windows virtual machines. Possible values include: 'Unknown', 'Yes', 'No'
   *
   * @param {number} options.assessment.discountPercentage Custom discount
   * percentage to be applied on final costs. Can be in the range [0, 100].
   *
   * @param {string} options.assessment.sizingCriterion Assessment sizing
   * criterion. Possible values include: 'PerformanceBased', 'AsOnPremises'
   *
   * @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 {Assessment} - 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 Assessment} 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.
   */
  create(resourceGroupName, projectName, groupName, assessmentName, 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._create(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._create(resourceGroupName, projectName, groupName, assessmentName, options, optionalCallback);
    }
  }

  /**
   * @summary Deletes an assessment from the project.
   *
   * Delete an assessment from the project. The machines remain in the
   * assessment. Deleting a non-existent assessment results in a no-operation.
   *
   * When an assessment is under computation, as indicated by the
   * 'computationState' field, it cannot be deleted. Any such attempt will return
   * a 400 - Bad Request.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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.
   */
  deleteMethodWithHttpOperationResponse(resourceGroupName, projectName, groupName, assessmentName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._deleteMethod(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Deletes an assessment from the project.
   *
   * Delete an assessment from the project. The machines remain in the
   * assessment. Deleting a non-existent assessment results in a no-operation.
   *
   * When an assessment is under computation, as indicated by the
   * 'computationState' field, it cannot be deleted. Any such attempt will return
   * a 400 - Bad Request.
   *
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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.
   */
  deleteMethod(resourceGroupName, projectName, groupName, assessmentName, 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._deleteMethod(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._deleteMethod(resourceGroupName, projectName, groupName, assessmentName, options, optionalCallback);
    }
  }

  /**
   * @summary Get download URL for the assessment report.
   *
   * Get the URL for downloading the assessment in a report format.
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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<DownloadUrl>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getReportDownloadUrlWithHttpOperationResponse(resourceGroupName, projectName, groupName, assessmentName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._getReportDownloadUrl(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * @summary Get download URL for the assessment report.
   *
   * Get the URL for downloading the assessment in a report format.
   *
   * @param {string} resourceGroupName Name of the Azure Resource Group that
   * project is part of.
   *
   * @param {string} projectName Name of the Azure Migrate project.
   *
   * @param {string} groupName Unique name of a group within a project.
   *
   * @param {string} assessmentName Unique name of an assessment within a
   * project.
   *
   * @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 {DownloadUrl} - 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 DownloadUrl} 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.
   */
  getReportDownloadUrl(resourceGroupName, projectName, groupName, assessmentName, 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._getReportDownloadUrl(resourceGroupName, projectName, groupName, assessmentName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._getReportDownloadUrl(resourceGroupName, projectName, groupName, assessmentName, options, optionalCallback);
    }
  }

}

module.exports = Assessments;
