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

/**
 * Implements InnerHealthError class. HealthError object has a list of
 * InnerHealthErrors as child errors. InnerHealthError is used because this
 * will prevent an infinite loop of structures when Hydra tries to
 * auto-generate the contract. We are exposing the related health errors as
 * inner health errors and all API consumers can utilize this in the same
 * fashion as Exception -&gt; InnerException.
 *
 */
class InnerHealthError {
  /**
   * Create a InnerHealthError.
   * @member {string} [errorSource] Source of error.
   * @member {string} [errorType] Type of error.
   * @member {string} [errorLevel] Level of error.
   * @member {string} [errorCategory] Category of error.
   * @member {string} [errorCode] Error code.
   * @member {string} [summaryMessage] Summary message of the entity.
   * @member {string} [errorMessage] Error message.
   * @member {string} [possibleCauses] Possible causes of error.
   * @member {string} [recommendedAction] Recommended action to resolve error.
   * @member {date} [creationTimeUtc] Error creation time (UTC)
   * @member {string} [recoveryProviderErrorMessage] DRA error message.
   * @member {string} [entityId] ID of the entity.
   */
  constructor() {
  }

  /**
   * Defines the metadata of InnerHealthError
   *
   * @returns {object} metadata of InnerHealthError
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'InnerHealthError',
      type: {
        name: 'Composite',
        className: 'InnerHealthError',
        modelProperties: {
          errorSource: {
            required: false,
            serializedName: 'errorSource',
            type: {
              name: 'String'
            }
          },
          errorType: {
            required: false,
            serializedName: 'errorType',
            type: {
              name: 'String'
            }
          },
          errorLevel: {
            required: false,
            serializedName: 'errorLevel',
            type: {
              name: 'String'
            }
          },
          errorCategory: {
            required: false,
            serializedName: 'errorCategory',
            type: {
              name: 'String'
            }
          },
          errorCode: {
            required: false,
            serializedName: 'errorCode',
            type: {
              name: 'String'
            }
          },
          summaryMessage: {
            required: false,
            serializedName: 'summaryMessage',
            type: {
              name: 'String'
            }
          },
          errorMessage: {
            required: false,
            serializedName: 'errorMessage',
            type: {
              name: 'String'
            }
          },
          possibleCauses: {
            required: false,
            serializedName: 'possibleCauses',
            type: {
              name: 'String'
            }
          },
          recommendedAction: {
            required: false,
            serializedName: 'recommendedAction',
            type: {
              name: 'String'
            }
          },
          creationTimeUtc: {
            required: false,
            serializedName: 'creationTimeUtc',
            type: {
              name: 'DateTime'
            }
          },
          recoveryProviderErrorMessage: {
            required: false,
            serializedName: 'recoveryProviderErrorMessage',
            type: {
              name: 'String'
            }
          },
          entityId: {
            required: false,
            serializedName: 'entityId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = InnerHealthError;
