# encoding: utf-8
# 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 1.0.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::RecoveryServicesBackup::Mgmt::V2017_07_01
  module Models
    #
    # Base class for backup ProtectionIntent.
    #
    class ProtectionIntent

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["RecoveryServiceVaultItem"] = "AzureRecoveryServiceVaultProtectionIntent"
      @@discriminatorMap["AzureResourceItem"] = "AzureResourceProtectionIntent"
      @@discriminatorMap["AzureWorkloadAutoProtectionIntent"] = "AzureWorkloadAutoProtectionIntent"
      @@discriminatorMap["AzureWorkloadSQLAutoProtectionIntent"] = "AzureWorkloadSQLAutoProtectionIntent"

      def initialize
        @protectionIntentItemType = "ProtectionIntent"
      end

      attr_accessor :protectionIntentItemType

      # @return [BackupManagementType] Type of backup managemenent for the
      # backed up item. Possible values include: 'Invalid', 'AzureIaasVM',
      # 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage',
      # 'AzureWorkload', 'DefaultBackup'
      attr_accessor :backup_management_type

      # @return [String] ARM ID of the resource to be backed up.
      attr_accessor :source_resource_id

      # @return [String] ID of the item which is getting protected, In case of
      # Azure Vm , it is ProtectedItemId
      attr_accessor :item_id

      # @return [String] ID of the backup policy with which this item is backed
      # up.
      attr_accessor :policy_id

      # @return [ProtectionStatus] Backup state of this backup item. Possible
      # values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected',
      # 'ProtectionFailed'
      attr_accessor :protection_state


      #
      # Mapper for ProtectionIntent class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ProtectionIntent',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'protectionIntentItemType',
            uber_parent: 'ProtectionIntent',
            class_name: 'ProtectionIntent',
            model_properties: {
              backup_management_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'backupManagementType',
                type: {
                  name: 'String'
                }
              },
              source_resource_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sourceResourceId',
                type: {
                  name: 'String'
                }
              },
              item_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'itemId',
                type: {
                  name: 'String'
                }
              },
              policy_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'policyId',
                type: {
                  name: 'String'
                }
              },
              protection_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'protectionState',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
