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

/**
 * @summary The results and errors from an execution of a pool autoscale
 * formula.
  *
 */
class AutoScaleRun {
  /**
   * Create a AutoScaleRun.
   * @property {date} evaluationTime The time at which the autoscale formula
   * was last evaluated.
   * @property {string} [results] The final values of all variables used in the
   * evaluation of the autoscale formula. Each variable value is returned in
   * the form $variable=value, and variables are separated by semicolons.
   * @property {object} [error] Details of the error encountered evaluating the
   * autoscale formula on the pool, if the evaluation was unsuccessful.
   * @property {string} [error.code] An identifier for the error. Codes are
   * invariant and are intended to be consumed programmatically.
   * @property {string} [error.message] A message describing the error,
   * intended to be suitable for display in a user interface.
   * @property {array} [error.details]
   */
  constructor() {
  }

  /**
   * Defines the metadata of AutoScaleRun
   *
   * @returns {object} metadata of AutoScaleRun
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoScaleRun',
      type: {
        name: 'Composite',
        className: 'AutoScaleRun',
        modelProperties: {
          evaluationTime: {
            required: true,
            serializedName: 'evaluationTime',
            type: {
              name: 'DateTime'
            }
          },
          results: {
            required: false,
            serializedName: 'results',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            serializedName: 'error',
            type: {
              name: 'Composite',
              className: 'AutoScaleRunError'
            }
          }
        }
      }
    };
  }
}

module.exports = AutoScaleRun;
