Skip to content

Commit 23f0dfb

Browse files
committed
added base object models for policy
1 parent be8a5fc commit 23f0dfb

File tree

6 files changed

+659
-1
lines changed

6 files changed

+659
-1
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/BaseObjects.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,29 @@ public class AzureRmRecoveryServicesItemBase
3737
{
3838
}
3939

40+
public class AzureRmRecoveryServicesRecoveryPointBase
41+
{
42+
}
43+
4044
public class AzureRmRecoveryServicesPolicyBase
4145
{
46+
public BackupManagementType BackupManagementType { get; set; }
47+
48+
public WorkloadType WorkloadType { get; set; }
49+
4250
}
4351

44-
public class AzureRmRecoveryServicesRecoveryPointBase
52+
public class AzureRmRecoveryServicesRetentionPolicyBase
4553
{
54+
public virtual void Validate()
55+
{
56+
}
4657
}
58+
59+
public class AzureRmRecoveryServicesSchedulePolicyBase
60+
{
61+
public virtual void Validate()
62+
{
63+
}
64+
}
4765
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/Commands.RecoveryServices.Backup.Models.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
<Compile Include="BaseObjects.cs" />
4343
<Compile Include="CmdletParamEnums.cs" />
4444
<Compile Include="CommonEnums.cs" />
45+
<Compile Include="CommonPolicyRetentionObjects.cs" />
46+
<Compile Include="CommonPolicyScheduleObjects.cs" />
4547
<Compile Include="IaasVmModels\AzureRmRecoveryServicesIaasVmPolicy.cs" />
4648
<Compile Include="IaasVmModels\AzureRmRecoveryServicesIaasVmItem.cs" />
4749
<Compile Include="IaasVmModels\AzureRmRecoveryServicesIaasVmContainer.cs" />

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/CommonEnums.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,60 @@ public enum ContainerRegistrationStatus
4343
Registered = 1,
4444
Registering,
4545
}
46+
47+
public enum WeekNumber
48+
{
49+
First,
50+
Second,
51+
Third,
52+
Fourth,
53+
Last
54+
}
55+
56+
public enum Month
57+
{
58+
Invalid = 0,
59+
January = 1,
60+
February = 2,
61+
March = 3,
62+
April = 4,
63+
May = 5,
64+
June = 6,
65+
July = 7,
66+
August = 8,
67+
September = 9,
68+
October = 10,
69+
November = 11,
70+
December = 12
71+
}
72+
73+
public enum ScheduleRunType
74+
{
75+
Invalid = 0,
76+
Daily = 1,
77+
Weekly = 2,
78+
}
79+
80+
public class PolicyConstants
81+
{
82+
public const int MaxAllowedRetentionDurationCount = 9999;
83+
}
84+
85+
public class TraceUtils
86+
{
87+
public static string GetString(IEnumerable<Object> objList)
88+
{
89+
return (objList == null) ? "null" : "{" + string.Join("}, {", objList) + "}";
90+
}
91+
92+
public static string GetString(IEnumerable<DateTime> objList)
93+
{
94+
return (objList == null) ? "null" : "{" + string.Join("}, {", objList) + "}";
95+
}
96+
97+
public static string GetString(IEnumerable<DayOfWeek> objList)
98+
{
99+
return (objList == null) ? "null" : "{" + string.Join("}, {", objList) + "}";
100+
}
101+
}
46102
}

0 commit comments

Comments
 (0)