private Schedule UpdateScheduleHelper(string automationAccountName, AutomationManagement.Models.Schedule schedule, bool?isEnabled, string description)
        {
            // StartTime and ExpiryTime need to specified as Utc
            schedule.StartTime  = DateTime.SpecifyKind(schedule.StartTime, DateTimeKind.Utc);
            schedule.ExpiryTime = DateTime.SpecifyKind(schedule.ExpiryTime, DateTimeKind.Utc);

            if (isEnabled.HasValue)
            {
                schedule.IsEnabled = isEnabled.Value;
            }

            if (description != null)
            {
                schedule.Description = description;
            }

            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Schedule =
                    schedule
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            var scheduleId = new Guid(schedule.Id);

            return(this.GetSchedule(automationAccountName, scheduleId));
        }
        private Schedule UpdateScheduleHelper(string automationAccountName, AutomationManagement.Models.Schedule schedule, bool? isEnabled, string description)
        {
            // StartTime and ExpiryTime need to specified as Utc
            schedule.StartTime = DateTime.SpecifyKind(schedule.StartTime, DateTimeKind.Utc);
            schedule.ExpiryTime = DateTime.SpecifyKind(schedule.ExpiryTime, DateTimeKind.Utc);

            if (isEnabled.HasValue)
            {
                schedule.IsEnabled = isEnabled.Value;
            }

            if (description != null)
            {
                schedule.Description = description;
            }

            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Schedule =
                    schedule
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            var scheduleId = new Guid(schedule.Id);
            return this.GetSchedule(automationAccountName, scheduleId);
        }