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

/**
 * The retry history.
 *
 */
class RetryHistory {
  /**
   * Create a RetryHistory.
   * @property {date} [startTime] Gets the start time.
   * @property {date} [endTime] Gets the end time.
   * @property {string} [code] Gets the status code.
   * @property {string} [clientRequestId] Gets the client request Id.
   * @property {string} [serviceRequestId] Gets the service request Id.
   * @property {object} [error] Gets the error response.
   * @property {object} [error.error] The error properties.
   * @property {string} [error.error.code] Error code.
   * @property {string} [error.error.message] Error message indicating why the
   * operation failed.
   */
  constructor() {
  }

  /**
   * Defines the metadata of RetryHistory
   *
   * @returns {object} metadata of RetryHistory
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RetryHistory',
      type: {
        name: 'Composite',
        className: 'RetryHistory',
        modelProperties: {
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          code: {
            required: false,
            serializedName: 'code',
            type: {
              name: 'String'
            }
          },
          clientRequestId: {
            required: false,
            serializedName: 'clientRequestId',
            type: {
              name: 'String'
            }
          },
          serviceRequestId: {
            required: false,
            serializedName: 'serviceRequestId',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            serializedName: 'error',
            type: {
              name: 'Composite',
              className: 'ErrorResponse'
            }
          }
        }
      }
    };
  }
}

module.exports = RetryHistory;
