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

/**
 * This class contains the error details per object.
 *
 */
class JobErrorDetails {
  /**
   * Create a JobErrorDetails.
   * @member {object} [serviceErrorDetails] The Service error details.
   * @member {string} [serviceErrorDetails.code] Error code.
   * @member {string} [serviceErrorDetails.message] Error message.
   * @member {string} [serviceErrorDetails.possibleCauses] Possible causes of
   * error.
   * @member {string} [serviceErrorDetails.recommendedAction] Recommended
   * action to resolve error.
   * @member {string} [serviceErrorDetails.activityId] Activity Id.
   * @member {object} [providerErrorDetails] The Provider error details.
   * @member {number} [providerErrorDetails.errorCode] The Error code.
   * @member {string} [providerErrorDetails.errorMessage] The Error message.
   * @member {string} [providerErrorDetails.errorId] The Provider error Id.
   * @member {string} [providerErrorDetails.possibleCauses] The possible causes
   * for the error.
   * @member {string} [providerErrorDetails.recommendedAction] The recommended
   * action to resolve the error.
   * @member {string} [errorLevel] Error level of error.
   * @member {date} [creationTime] The creation time of job error.
   * @member {string} [taskId] The Id of the task.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobErrorDetails
   *
   * @returns {object} metadata of JobErrorDetails
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobErrorDetails',
      type: {
        name: 'Composite',
        className: 'JobErrorDetails',
        modelProperties: {
          serviceErrorDetails: {
            required: false,
            serializedName: 'serviceErrorDetails',
            type: {
              name: 'Composite',
              className: 'ServiceError'
            }
          },
          providerErrorDetails: {
            required: false,
            serializedName: 'providerErrorDetails',
            type: {
              name: 'Composite',
              className: 'ProviderError'
            }
          },
          errorLevel: {
            required: false,
            serializedName: 'errorLevel',
            type: {
              name: 'String'
            }
          },
          creationTime: {
            required: false,
            serializedName: 'creationTime',
            type: {
              name: 'DateTime'
            }
          },
          taskId: {
            required: false,
            serializedName: 'taskId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = JobErrorDetails;
