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

/**
 * DPM workload-specific protection container.
 *
 * @extends models['ProtectionContainer']
 */
class DpmContainer extends models['ProtectionContainer'] {
  /**
   * Create a DpmContainer.
   * @member {boolean} [canReRegister] Specifies whether the container is
   * re-registrable.
   * @member {string} [containerId] ID of container.
   * @member {number} [protectedItemCount] Number of protected items in the
   * BackupEngine
   * @member {string} [dpmAgentVersion] Backup engine Agent version
   * @member {array} [dpmServers] List of BackupEngines protecting the
   * container
   * @member {boolean} [upgradeAvailable] To check if upgrade available
   * @member {string} [protectionStatus] Protection status of the container.
   * @member {object} [extendedInfo] Extended Info of the container.
   * @member {date} [extendedInfo.lastRefreshedAt] Last refresh time of the
   * DPMContainer.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DpmContainer
   *
   * @returns {object} metadata of DpmContainer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DPMContainer',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'containerType',
          clientName: 'containerType'
        },
        uberParent: 'ProtectionContainer',
        className: 'DpmContainer',
        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: 'String'
            }
          },
          protectedItemCount: {
            required: false,
            serializedName: 'protectedItemCount',
            type: {
              name: 'Number'
            }
          },
          dpmAgentVersion: {
            required: false,
            serializedName: 'dpmAgentVersion',
            type: {
              name: 'String'
            }
          },
          dpmServers: {
            required: false,
            serializedName: 'dpmServers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          upgradeAvailable: {
            required: false,
            serializedName: 'upgradeAvailable',
            type: {
              name: 'Boolean'
            }
          },
          protectionStatus: {
            required: false,
            serializedName: 'protectionStatus',
            type: {
              name: 'String'
            }
          },
          extendedInfo: {
            required: false,
            serializedName: 'extendedInfo',
            type: {
              name: 'Composite',
              className: 'DPMContainerExtendedInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = DpmContainer;
