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

/**
 * Container with items backed up using MAB backup engine.
 *
 * @extends models['ProtectionContainer']
 */
class MabContainer extends models['ProtectionContainer'] {
  /**
   * Create a MabContainer.
   * @member {boolean} [canReRegister] Can the container be registered one more
   * time.
   * @member {number} [containerId] ContainerID represents the container.
   * @member {number} [protectedItemCount] Number of items backed up in this
   * container.
   * @member {string} [agentVersion] Agent version of this container.
   * @member {object} [extendedInfo] Additional information for this container
   * @member {date} [extendedInfo.lastRefreshedAt] Time stamp when this
   * container was refreshed.
   * @member {string} [extendedInfo.backupItemType] Type of backup items
   * associated with this container. Possible values include: 'Invalid', 'VM',
   * 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM',
   * 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase',
   * 'AzureFileShare', 'SAPHanaDatabase'
   * @member {array} [extendedInfo.backupItems] List of backup items associated
   * with this container.
   * @member {string} [extendedInfo.policyName] Backup policy associated with
   * this container.
   * @member {string} [extendedInfo.lastBackupStatus] Latest backup status of
   * this container.
   * @member {array} [mabContainerHealthDetails] Health details on this mab
   * container.
   * @member {string} [containerHealthState] Health state of mab container.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of MabContainer
   *
   * @returns {object} metadata of MabContainer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Windows',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'containerType',
          clientName: 'containerType'
        },
        uberParent: 'ProtectionContainer',
        className: 'MabContainer',
        modelProperties: {
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          registrationStatus: {
            required: false,
            serializedName: 'registrationStatus',
            type: {
              name: 'String'
            }
          },
          healthStatus: {
            required: false,
            serializedName: 'healthStatus',
            type: {
              name: 'String'
            }
          },
          containerType: {
            required: true,
            serializedName: 'containerType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          canReRegister: {
            required: false,
            serializedName: 'canReRegister',
            type: {
              name: 'Boolean'
            }
          },
          containerId: {
            required: false,
            serializedName: 'containerId',
            type: {
              name: 'Number'
            }
          },
          protectedItemCount: {
            required: false,
            serializedName: 'protectedItemCount',
            type: {
              name: 'Number'
            }
          },
          agentVersion: {
            required: false,
            serializedName: 'agentVersion',
            type: {
              name: 'String'
            }
          },
          extendedInfo: {
            required: false,
            serializedName: 'extendedInfo',
            type: {
              name: 'Composite',
              className: 'MabContainerExtendedInfo'
            }
          },
          mabContainerHealthDetails: {
            required: false,
            serializedName: 'mabContainerHealthDetails',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MABContainerHealthDetailsElementType',
                  type: {
                    name: 'Composite',
                    className: 'MABContainerHealthDetails'
                  }
              }
            }
          },
          containerHealthState: {
            required: false,
            serializedName: 'containerHealthState',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = MabContainer;
