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

/**
 * Base class for generic container of backup items
 *
 * @extends models['ProtectionContainer']
 */
class GenericContainer extends models['ProtectionContainer'] {
  /**
   * Create a GenericContainer.
   * @member {string} [fabricName] Name of the container's fabric
   * @member {object} [extendedInformation] Extended information (not returned
   * in List container API calls)
   * @member {string} [extendedInformation.rawCertData] Public key of container
   * cert
   * @member {object} [extendedInformation.containerIdentityInfo] Container
   * identity information
   * @member {string} [extendedInformation.containerIdentityInfo.uniqueName]
   * Unique name of the container
   * @member {string} [extendedInformation.containerIdentityInfo.aadTenantId]
   * Protection container identity - AAD Tenant
   * @member {string}
   * [extendedInformation.containerIdentityInfo.servicePrincipalClientId]
   * Protection container identity - AAD Service Principal
   * @member {string} [extendedInformation.containerIdentityInfo.audience]
   * Protection container identity - Audience
   * @member {object} [extendedInformation.serviceEndpoints] Azure Backup
   * Service Endpoints for the container
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of GenericContainer
   *
   * @returns {object} metadata of GenericContainer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GenericContainer',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'containerType',
          clientName: 'containerType'
        },
        uberParent: 'ProtectionContainer',
        className: 'GenericContainer',
        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'
            }
          },
          fabricName: {
            required: false,
            serializedName: 'fabricName',
            type: {
              name: 'String'
            }
          },
          extendedInformation: {
            required: false,
            serializedName: 'extendedInformation',
            type: {
              name: 'Composite',
              className: 'GenericContainerExtendedInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = GenericContainer;
