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

const models = require('./index');

/**
 * Additional information on Backup engine specific backup item.
 *
 * @extends models['ProtectedItem']
 */
class DPMProtectedItem extends models['ProtectedItem'] {
  /**
   * Create a DPMProtectedItem.
   * @member {string} [friendlyName] Friendly name of the managed item
   * @member {string} [backupEngineName] Backup Management server protecting
   * this backup item
   * @member {string} [protectionState] Protection state of the backupengine.
   * Possible values include: 'Invalid', 'IRPending', 'Protected',
   * 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'
   * @member {boolean} [isScheduledForDeferredDelete] To check if backup item
   * is scheduled for deferred delete
   * @member {object} [extendedInfo] Extended info of the backup item.
   * @member {object} [extendedInfo.protectableObjectLoadPath] Attribute to
   * provide information on various DBs.
   * @member {boolean} [extendedInfo.protectedProperty] To check if backup item
   * is disk protected.
   * @member {boolean} [extendedInfo.isPresentOnCloud] To check if backup item
   * is cloud protected.
   * @member {string} [extendedInfo.lastBackupStatus] Last backup status
   * information on backup item.
   * @member {date} [extendedInfo.lastRefreshedAt] Last refresh time on backup
   * item.
   * @member {date} [extendedInfo.oldestRecoveryPoint] Oldest cloud recovery
   * point time.
   * @member {number} [extendedInfo.recoveryPointCount] cloud recovery point
   * count.
   * @member {date} [extendedInfo.onPremiseOldestRecoveryPoint] Oldest disk
   * recovery point time.
   * @member {date} [extendedInfo.onPremiseLatestRecoveryPoint] latest disk
   * recovery point time.
   * @member {number} [extendedInfo.onPremiseRecoveryPointCount] disk recovery
   * point count.
   * @member {boolean} [extendedInfo.isCollocated] To check if backup item is
   * collocated.
   * @member {string} [extendedInfo.protectionGroupName] Protection group name
   * of the backup item.
   * @member {string} [extendedInfo.diskStorageUsedInBytes] Used Disk storage
   * in bytes.
   * @member {string} [extendedInfo.totalDiskStorageSizeInBytes] total Disk
   * storage in bytes.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DPMProtectedItem
   *
   * @returns {object} metadata of DPMProtectedItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DPMProtectedItem',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'protectedItemType',
          clientName: 'protectedItemType'
        },
        uberParent: 'ProtectedItem',
        className: 'DPMProtectedItem',
        modelProperties: {
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          workloadType: {
            required: false,
            serializedName: 'workloadType',
            type: {
              name: 'String'
            }
          },
          containerName: {
            required: false,
            serializedName: 'containerName',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'sourceResourceId',
            type: {
              name: 'String'
            }
          },
          policyId: {
            required: false,
            serializedName: 'policyId',
            type: {
              name: 'String'
            }
          },
          lastRecoveryPoint: {
            required: false,
            serializedName: 'lastRecoveryPoint',
            type: {
              name: 'DateTime'
            }
          },
          backupSetName: {
            required: false,
            serializedName: 'backupSetName',
            type: {
              name: 'String'
            }
          },
          createMode: {
            required: false,
            serializedName: 'createMode',
            type: {
              name: 'String'
            }
          },
          protectedItemType: {
            required: true,
            serializedName: 'protectedItemType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          backupEngineName: {
            required: false,
            serializedName: 'backupEngineName',
            type: {
              name: 'String'
            }
          },
          protectionState: {
            required: false,
            serializedName: 'protectionState',
            type: {
              name: 'String'
            }
          },
          isScheduledForDeferredDelete: {
            required: false,
            serializedName: 'isScheduledForDeferredDelete',
            type: {
              name: 'Boolean'
            }
          },
          extendedInfo: {
            required: false,
            serializedName: 'extendedInfo',
            type: {
              name: 'Composite',
              className: 'DPMProtectedItemExtendedInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = DPMProtectedItem;
