Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JobSchedule"/> class.
 /// </summary>
 /// <param name="jobSchedule">
 /// The job schedule.
 /// </param>
 public JobSchedule(string automationAccountName, Azure.Management.Automation.Models.JobSchedule jobSchedule)
 {
     Requires.Argument("jobSchedule", jobSchedule).NotNull();
     this.AutomationAccountName = automationAccountName;
     this.JobScheduleId         = jobSchedule.Properties.Id;
     this.RunbookName           = jobSchedule.Properties.Runbook.Name;
     this.ScheduleName          = jobSchedule.Properties.Schedule.Name;
     this.Parameters            = jobSchedule.Properties.Parameters ?? new Dictionary <string, string>();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JobSchedule"/> class.
 /// </summary>
 /// <param name="resourceGroupName">
 /// The resource group name.
 /// </param>
 /// <param name="automationAccountName">
 /// The account name.
 /// </param>
 /// <param name="jobSchedule">
 /// The job schedule.
 /// </param>
 public JobSchedule(string resourceGroupName, string automationAccountName, Azure.Management.Automation.Models.JobSchedule jobSchedule)
 {
     Requires.Argument("jobSchedule", jobSchedule).NotNull();
     this.ResourceGroupName     = resourceGroupName;
     this.AutomationAccountName = automationAccountName;
     this.JobScheduleId         = jobSchedule.Properties.Id.ToString();
     this.RunbookName           = jobSchedule.Properties.Runbook.Name;
     this.ScheduleName          = jobSchedule.Properties.Schedule.Name;
     this.Parameters            = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
     foreach (var kvp in jobSchedule.Properties.Parameters.Where(kvp => 0 != String.Compare(kvp.Key, Constants.JobStartedByParameterName, CultureInfo.InvariantCulture,
                                                                                            CompareOptions.IgnoreCase)))
     {
         this.Parameters.Add(kvp.Key, (object)PowerShellJsonConverter.Deserialize(kvp.Value));
     }
 }