/// <summary>
 /// Update the schedule identified by schedule name.  (see
 /// http://aka.ms/azureautomationsdk/scheduleoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IScheduleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the patch schedule operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Patch(this IScheduleOperations operations, string resourceGroupName, string automationAccount, SchedulePatchParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IScheduleOperations)s).PatchAsync(resourceGroupName, automationAccount, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Update the schedule identified by schedule name.  (see
 /// http://aka.ms/azureautomationsdk/scheduleoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IScheduleOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the patch schedule operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<AzureOperationResponse> PatchAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccount, SchedulePatchParameters parameters)
 {
     return operations.PatchAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None);
 }
        private Schedule UpdateScheduleHelper(string resourceGroupName, string automationAccountName,
            string scheduleName, bool? isEnabled, string description)
        {
            var scheduleUpdateParameters = new AutomationManagement.Models.SchedulePatchParameters
            {
                Name = scheduleName,
                Properties = new AutomationManagement.Models.SchedulePatchProperties
                {
                    Description = description,
                    IsEnabled = isEnabled
                }
            };

            this.automationManagementClient.Schedules.Patch(
                resourceGroupName,
                automationAccountName,
                scheduleUpdateParameters);

            return this.GetSchedule(resourceGroupName, automationAccountName, scheduleName);
        }