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

/**
 * MAB workload-specific backup item.
 *
 * @extends models['ProtectedItem']
 */
class MabFileFolderProtectedItem extends models['ProtectedItem'] {
  /**
   * Create a MabFileFolderProtectedItem.
   * @member {string} [friendlyName] Friendly name of this backup item.
   * @member {string} [computerName] Name of the computer associated with this
   * backup item.
   * @member {string} [lastBackupStatus] Status of last backup operation.
   * @member {string} [protectionState] Protected, ProtectionStopped, IRPending
   * or ProtectionError
   * @member {boolean} [isScheduledForDeferredDelete] Specifies if the item is
   * scheduled for deferred deletion.
   * @member {number} [deferredDeleteSyncTimeInUTC] Sync time for deferred
   * deletion.
   * @member {object} [extendedInfo] Additional information with this backup
   * item.
   * @member {date} [extendedInfo.lastRefreshedAt] Last time when the agent
   * data synced to service.
   * @member {date} [extendedInfo.oldestRecoveryPoint] The oldest backup copy
   * available.
   * @member {number} [extendedInfo.recoveryPointCount] Number of backup copies
   * associated with the backup item.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of MabFileFolderProtectedItem
   *
   * @returns {object} metadata of MabFileFolderProtectedItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MabFileFolderProtectedItem',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'protectedItemType',
          clientName: 'protectedItemType'
        },
        uberParent: 'ProtectedItem',
        className: 'MabFileFolderProtectedItem',
        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'
            }
          },
          computerName: {
            required: false,
            serializedName: 'computerName',
            type: {
              name: 'String'
            }
          },
          lastBackupStatus: {
            required: false,
            serializedName: 'lastBackupStatus',
            type: {
              name: 'String'
            }
          },
          protectionState: {
            required: false,
            serializedName: 'protectionState',
            type: {
              name: 'String'
            }
          },
          isScheduledForDeferredDelete: {
            required: false,
            serializedName: 'isScheduledForDeferredDelete',
            type: {
              name: 'Boolean'
            }
          },
          deferredDeleteSyncTimeInUTC: {
            required: false,
            serializedName: 'deferredDeleteSyncTimeInUTC',
            type: {
              name: 'Number'
            }
          },
          extendedInfo: {
            required: false,
            serializedName: 'extendedInfo',
            type: {
              name: 'Composite',
              className: 'MabFileFolderProtectedItemExtendedInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = MabFileFolderProtectedItem;
