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

var models = require('./index');

var util = require('util');

/**
 * @class
 * Initializes a new instance of the ErrorModel class.
 * @constructor
 * Generic resource error information.
 *
 * @member {string} [code] the HTTP status code or error code associated with
 * this error
 * 
 * @member {string} [message] the error message to display.
 * 
 * @member {string} [target] the target of the error.
 * 
 * @member {array} [details] the list of error details
 * 
 * @member {object} [innerError] the inner exceptions or errors, if any
 * 
 * @member {string} [innerError.trace] the stack trace for the error
 * 
 * @member {string} [innerError.context] the context for the error message
 * 
 */
function ErrorModel() {
}

/**
 * Defines the metadata of ErrorModel
 *
 * @returns {object} metadata of ErrorModel
 *
 */
ErrorModel.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'Error',
    type: {
      name: 'Composite',
      className: 'ErrorModel',
      modelProperties: {
        code: {
          required: false,
          readOnly: true,
          serializedName: 'code',
          type: {
            name: 'String'
          }
        },
        message: {
          required: false,
          readOnly: true,
          serializedName: 'message',
          type: {
            name: 'String'
          }
        },
        target: {
          required: false,
          readOnly: true,
          serializedName: 'target',
          type: {
            name: 'String'
          }
        },
        details: {
          required: false,
          readOnly: true,
          serializedName: 'details',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'ErrorDetailsElementType',
                type: {
                  name: 'Composite',
                  className: 'ErrorDetails'
                }
            }
          }
        },
        innerError: {
          required: false,
          readOnly: true,
          serializedName: 'innerError',
          type: {
            name: 'Composite',
            className: 'InnerError'
          }
        }
      }
    }
  };
};

module.exports = ErrorModel;
