private static CSMWeeklyRetentionSchedule ConvertToCSMWeeklyRetentionObject(AzureBackupWeeklyRetentionPolicy retentionPolicy, IList<DateTime> RetentionTimes) { CSMWeeklyRetentionSchedule csmWeeklyRetention = new CSMWeeklyRetentionSchedule(); csmWeeklyRetention.DaysOfTheWeek = retentionPolicy.DaysOfWeek; csmWeeklyRetention.CSMRetentionDuration = new CSMRetentionDuration(); csmWeeklyRetention.CSMRetentionDuration.Count = retentionPolicy.Retention; csmWeeklyRetention.CSMRetentionDuration.DurationType = RetentionDurationType.Weeks; csmWeeklyRetention.RetentionTimes = RetentionTimes; return csmWeeklyRetention; }
private static AzureBackupWeeklyRetentionPolicy ConvertToPowershellWeeklyRetentionObject(CSMWeeklyRetentionSchedule WeeklySchedule) { if (WeeklySchedule == null) return null; AzureBackupWeeklyRetentionPolicy weeklyRetention = new AzureBackupWeeklyRetentionPolicy("Weekly", WeeklySchedule.CSMRetentionDuration.Count, WeeklySchedule.DaysOfTheWeek); weeklyRetention.RetentionTimes = WeeklySchedule.RetentionTimes; return weeklyRetention; }