private static ServiceClientModel.MonthlyRetentionSchedule GetServiceClientLTRMonthlySchedule(MonthlyRetentionSchedule psMonthly)
        {
            if (psMonthly == null)
            {
                return(null);
            }

            ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly = new ServiceClientModel.MonthlyRetentionSchedule();

            serviceClientMonthly.RetentionDuration = new ServiceClientModel.RetentionDuration()
            {
                Count        = psMonthly.DurationCountInMonths,
                DurationType = ServiceClientModel.RetentionDurationType.Months
            };
            serviceClientMonthly.RetentionTimes = GetNullableDateTimeListFromDateTimeList(
                psMonthly.RetentionTimes);

            serviceClientMonthly.RetentionScheduleFormatType =
                ServiceClientHelpers.GetServiceClientRetentionScheduleFormat(
                    psMonthly.RetentionScheduleFormatType);

            if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
            {
                serviceClientMonthly.RetentionScheduleDaily = GetServiceClientLTRDailyRetentionFormat(psMonthly.RetentionScheduleDaily);
            }
            else if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Weekly)
            {
                serviceClientMonthly.RetentionScheduleWeekly = GetServiceClientLTRWeeklyRetentionFormat(psMonthly.RetentionScheduleWeekly);
            }

            return(serviceClientMonthly);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the LongTermRetentionPolicy class.
 /// </summary>
 /// <param name="dailySchedule">Daily retention schedule of the
 /// protection policy.</param>
 /// <param name="weeklySchedule">Weekly retention schedule of the
 /// protection policy.</param>
 /// <param name="monthlySchedule">Monthly retention schedule of the
 /// protection policy.</param>
 /// <param name="yearlySchedule">Yearly retention schedule of the
 /// protection policy.</param>
 public LongTermRetentionPolicy(DailyRetentionSchedule dailySchedule = default(DailyRetentionSchedule), WeeklyRetentionSchedule weeklySchedule = default(WeeklyRetentionSchedule), MonthlyRetentionSchedule monthlySchedule = default(MonthlyRetentionSchedule), YearlyRetentionSchedule yearlySchedule = default(YearlyRetentionSchedule))
 {
     DailySchedule   = dailySchedule;
     WeeklySchedule  = weeklySchedule;
     MonthlySchedule = monthlySchedule;
     YearlySchedule  = yearlySchedule;
     CustomInit();
 }
示例#3
0
        private static MonthlyRetentionSchedule GetPSLTRMonthlySchedule(ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly)
        {
            if (serviceClientMonthly == null)
            {
                return(null);
            }

            MonthlyRetentionSchedule psMonthly = new MonthlyRetentionSchedule();

            psMonthly.DurationCountInMonths       = GetRetentionDurationInMonths(serviceClientMonthly.RetentionDuration);
            psMonthly.RetentionTimes              = ParseDateTimesToUTC(serviceClientMonthly.RetentionTimes);
            psMonthly.RetentionScheduleFormatType = (RetentionScheduleFormat)Enum.Parse(typeof(RetentionScheduleFormat),
                                                                                        serviceClientMonthly.RetentionScheduleFormatType);
            psMonthly.RetentionScheduleDaily  = GetPSLTRDailyRetentionFormat(serviceClientMonthly.RetentionScheduleDaily);
            psMonthly.RetentionScheduleWeekly = GetPSLTRWeeklyRetentionFormat(serviceClientMonthly.RetentionScheduleWeekly);

            return(psMonthly);
        }
        private static MonthlyRetentionSchedule GetPSLTRMonthlySchedule(ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly,
                                                                        string timeZone)
        {
            if (serviceClientMonthly == null)
            {
                return(null);
            }

            MonthlyRetentionSchedule psMonthly = new MonthlyRetentionSchedule();

            psMonthly.DurationCountInMonths       = GetRetentionDurationInMonths(serviceClientMonthly.RetentionDuration);
            psMonthly.RetentionTimes              = ParseDateTimesToUTC(serviceClientMonthly.RetentionTimes, timeZone);
            psMonthly.RetentionScheduleFormatType =
                serviceClientMonthly.RetentionScheduleFormatType.ToEnum <RetentionScheduleFormat>();
            psMonthly.RetentionScheduleDaily  = GetPSLTRDailyRetentionFormat(serviceClientMonthly.RetentionScheduleDaily);
            psMonthly.RetentionScheduleWeekly = GetPSLTRWeeklyRetentionFormat(serviceClientMonthly.RetentionScheduleWeekly);

            return(psMonthly);
        }
        private static ServiceClientModel.MonthlyRetentionSchedule GetServiceClientLTRMonthlySchedule(MonthlyRetentionSchedule psMonthly)
        {
            if (psMonthly == null)
            {
                return null;
            }

            ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly = new ServiceClientModel.MonthlyRetentionSchedule();

            serviceClientMonthly.RetentionDuration = new ServiceClientModel.RetentionDuration()
            {
                Count = psMonthly.DurationCountInMonths,
                DurationType = ServiceClientModel.RetentionDurationType.Months
            };
            serviceClientMonthly.RetentionTimes = psMonthly.RetentionTimes;

            serviceClientMonthly.RetentionScheduleFormatType = psMonthly.RetentionScheduleFormatType.ToString();
            if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
            {
                serviceClientMonthly.RetentionScheduleDaily = GetServiceClientLTRDailyRetentionFormat(psMonthly.RetentionScheduleDaily);
            }
            else if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Weekly)
            {
                serviceClientMonthly.RetentionScheduleWeekly = GetServiceClientLTRWeeklyRetentionFormat(psMonthly.RetentionScheduleWeekly);
            }

            return serviceClientMonthly;
        }