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

/**
 * Base class for backup ProtectionIntent.
 *
 */
class ProtectionIntent {
  /**
   * Create a ProtectionIntent.
   * @member {string} [backupManagementType] Type of backup managemenent for
   * the backed up item. Possible values include: 'Invalid', 'AzureIaasVM',
   * 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage',
   * 'AzureWorkload', 'DefaultBackup'
   * @member {string} [sourceResourceId] ARM ID of the resource to be backed
   * up.
   * @member {string} [itemId] ID of the item which is getting protected, In
   * case of Azure Vm , it is ProtectedItemId
   * @member {string} [policyId] ID of the backup policy with which this item
   * is backed up.
   * @member {string} [protectionState] Backup state of this backup item.
   * Possible values include: 'Invalid', 'NotProtected', 'Protecting',
   * 'Protected', 'ProtectionFailed'
   * @member {string} protectionIntentItemType Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ProtectionIntent
   *
   * @returns {object} metadata of ProtectionIntent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ProtectionIntent',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'protectionIntentItemType',
          clientName: 'protectionIntentItemType'
        },
        uberParent: 'ProtectionIntent',
        className: 'ProtectionIntent',
        modelProperties: {
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'sourceResourceId',
            type: {
              name: 'String'
            }
          },
          itemId: {
            required: false,
            serializedName: 'itemId',
            type: {
              name: 'String'
            }
          },
          policyId: {
            required: false,
            serializedName: 'policyId',
            type: {
              name: 'String'
            }
          },
          protectionState: {
            required: false,
            serializedName: 'protectionState',
            type: {
              name: 'String'
            }
          },
          protectionIntentItemType: {
            required: true,
            serializedName: 'protectionIntentItemType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ProtectionIntent;
