Skip to content

Commit 6cb1399

Browse files
author
Sambit Rath
committed
resolving comments
1 parent 44e8623 commit 6cb1399

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/RecoveryServices/RecoveryServices.Backup.Models/AzureModels/AzureItem.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,10 @@ public class AzureItem : ItemBase
5757
/// </summary>
5858
public DateTime? DateOfPurge { get; set; }
5959

60-
/// <summary>
61-
/// Indicates if the item is in a softdeleted state
62-
/// </summary>
63-
public bool IsScheduledForPurge { get; set; }
64-
6560
/// <summary>
6661
/// Indicates if the delete state of the item
6762
/// </summary>
68-
public string DeleteState { get; set; }
63+
public ItemDeleteState DeleteState { get; set; }
6964

7065
public AzureItem(ProtectedItemResource protectedItemResource,
7166
string containerName, ContainerType containerType, string policyName)

src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmModels/AzureVmItem.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ public AzureVmItem(ProtectedItemResource protectedItemResource,
4747
VirtualMachineId = protectedItem.VirtualMachineId;
4848
HealthStatus = protectedItem.HealthStatus;
4949
DateOfPurge = null;
50-
DeleteState = "NotDeleted";
51-
if(protectedItem.IsScheduledForDeferredDelete.HasValue)
50+
DeleteState = EnumUtils.GetEnum<ItemDeleteState>("NotDeleted");
51+
if (protectedItem.IsScheduledForDeferredDelete.HasValue)
5252
{
53-
IsScheduledForPurge = true;
5453
DateOfPurge = protectedItem.DeferredDeleteTimeInUTC.Value.AddDays(14);
55-
DeleteState = "TobeDeleted";
54+
DeleteState = EnumUtils.GetEnum<ItemDeleteState>("ToBeDeleted");
5655
}
5756
}
5857
}

src/RecoveryServices/RecoveryServices.Backup.Providers/Providers/IaasVmPsBackupProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,12 @@ public List<ItemBase> ListProtectedItems()
795795
}).ToList();
796796
}
797797

798+
// 6. Filter by Delete State
798799
if (deleteState != 0)
799800
{
800-
string[] DeleteStateMap = { "TobeDeleted", "NotDeleted" };
801801
itemModels = itemModels.Where(itemModel =>
802802
{
803-
return ((AzureVmItem)itemModel).DeleteState == DeleteStateMap[(int)deleteState - 1];
803+
return ((AzureVmItem)itemModel).DeleteState == deleteState;
804804
}).ToList();
805805
}
806806

0 commit comments

Comments
 (0)