/*
 * 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.
   * @member {string} code The error code that identifies the category of
   * error. Possible values include: 'None', 'ServerError', 'InvalidRequest',
   * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'.
   * Default value: 'None' .
   * @member {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'
   * @member {string} message A description of the error.
   * @member {string} [moreDetails] A description that provides additional
   * information about the error.
   * @member {string} [parameter] The parameter in the request that caused the
   * error.
   * @member {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: 'Enum',
              allowedValues: [ 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization' ]
            }
          },
          subCode: {
            required: false,
            readOnly: true,
            serializedName: 'subCode',
            type: {
              name: 'Enum',
              allowedValues: [ 'UnexpectedError', 'ResourceError', 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' ]
            }
          },
          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;
