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

/**
 * Defines the error that occurred.
 *
 */
class ErrorModel {
  /**
   * Create a ErrorModel.
   * @property {string} code The error code that identifies the category of
   * error. Possible values include: 'None', 'ServerError', 'InvalidRequest',
   * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'.
   * Default value: 'None' .
   * @property {string} [subCode] The error code that further helps to identify
   * the error. Possible values include: 'UnexpectedError', 'ResourceError',
   * 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue',
   * 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing',
   * 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired'
   * @property {string} message A description of the error.
   * @property {string} [moreDetails] A description that provides additional
   * information about the error.
   * @property {string} [parameter] The parameter in the request that caused
   * the error.
   * @property {string} [value] The parameter's value in the request that was
   * not valid.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ErrorModel
   *
   * @returns {object} metadata of ErrorModel
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Error',
      type: {
        name: 'Composite',
        className: 'ErrorModel',
        modelProperties: {
          code: {
            required: true,
            serializedName: 'code',
            defaultValue: 'None',
            type: {
              name: 'String'
            }
          },
          subCode: {
            required: false,
            readOnly: true,
            serializedName: 'subCode',
            type: {
              name: 'String'
            }
          },
          message: {
            required: true,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          },
          moreDetails: {
            required: false,
            readOnly: true,
            serializedName: 'moreDetails',
            type: {
              name: 'String'
            }
          },
          parameter: {
            required: false,
            readOnly: true,
            serializedName: 'parameter',
            type: {
              name: 'String'
            }
          },
          value: {
            required: false,
            readOnly: true,
            serializedName: 'value',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ErrorModel;
