Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers.PolicyHelpers.GetServiceClientLTRMonthlySchedule C# (CSharp) Method

GetServiceClientLTRMonthlySchedule() private static method

private static GetServiceClientLTRMonthlySchedule ( MonthlyRetentionSchedule psMonthly ) : Microsoft.Azure.Management.RecoveryServices.Backup.Models.MonthlyRetentionSchedule
psMonthly MonthlyRetentionSchedule
return Microsoft.Azure.Management.RecoveryServices.Backup.Models.MonthlyRetentionSchedule
        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;
        }