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

/**
 * Operation status.
 *
 */
class OperationStatus {
  /**
   * Create a OperationStatus.
   * @member {string} [id] ID of the operation.
   * @member {string} [name] Name of the operation.
   * @member {string} [status] Operation status. Possible values include:
   * 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled'
   * @member {date} [startTime] Operation start time. Format: ISO-8601.
   * @member {date} [endTime] Operation end time. Format: ISO-8601.
   * @member {object} [error] Error information related to this operation.
   * @member {string} [error.code] Error code of the operation failure.
   * @member {string} [error.message] Error message displayed if the operation
   * failure.
   * @member {object} [properties] Additional information associated with this
   * operation.
   * @member {string} [properties.objectType] Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of OperationStatus
   *
   * @returns {object} metadata of OperationStatus
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'OperationStatus',
      type: {
        name: 'Composite',
        className: 'OperationStatus',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            serializedName: 'status',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          error: {
            required: false,
            serializedName: 'error',
            type: {
              name: 'Composite',
              className: 'OperationStatusError'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'objectType',
                clientName: 'objectType'
              },
              uberParent: 'OperationStatusExtendedInfo',
              className: 'OperationStatusExtendedInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = OperationStatus;
