Skip to content

Commit a8e0179

Browse files
committed
CalandarSchedule change - changing the response of the cmdlet
1 parent 12c40a8 commit a8e0179

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/ResourceManager/Automation/Commands.Automation/Cmdlet/NewAzureAutomationSchedule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ public NewAzureAutomationSchedule()
6262
/// <summary>
6363
/// Gets or sets the schedule days of the week.
6464
/// </summary>
65-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByWeekly, Mandatory = false, HelpMessage = "The list of days of the week for weekly schedule.")]
65+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByWeekly, Mandatory = false, HelpMessage = "The list of days of week for the weekly schedule.")]
6666
public DayOfWeek[] DaysOfWeek { get; set; }
6767

6868
/// <summary>
6969
/// Gets or sets the schedule days of the month.
7070
/// </summary>
71-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByMonthlyDaysOfMonth, Mandatory = false, HelpMessage = "The list of days of the month for monthly schedule.")]
71+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByMonthlyDaysOfMonth, Mandatory = false, HelpMessage = "The list of days of month for the monthly schedule.")]
7272
public DaysOfMonth[] DaysOfMonth { get; set; }
7373

7474
/// <summary>
7575
/// Gets or sets the schedule day of the week.
7676
/// </summary>
77-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByMonthlyDayOfWeek, Mandatory = false, HelpMessage = "The day of week for monthly occurrence.")]
77+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByMonthlyDayOfWeek, Mandatory = false, HelpMessage = "The day of week for the monthly occurrence.")]
7878
public DayOfWeek? DayOfWeek { get; set; }
7979

8080
/// <summary>
@@ -196,7 +196,7 @@ private Schedule CreateMonthlyScheduleModel()
196196
Frequency = ScheduleFrequency.Month,
197197
Interval = this.MonthInterval,
198198
DaysOfMonth = this.DaysOfMonth,
199-
DayOfWeek = dayOfWeek,
199+
DayOfWeekMonthlySchedule = dayOfWeek,
200200
DayOfWeekOccurrence = this.DayOfWeekOccurrence == 0 ? null : this.DayOfWeekOccurrence.ToString()
201201
};
202202

@@ -219,7 +219,7 @@ private Schedule CreateWeeklyScheduleModel()
219219
ExpiryTime = this.ExpiryTime,
220220
Frequency = ScheduleFrequency.Week,
221221
Interval = this.WeekInterval,
222-
DaysOfWeek = this.DaysOfWeek == null
222+
DaysOfWeekWeeklySchedule = this.DaysOfWeek == null
223223
? null
224224
: this.DaysOfWeek.Select(day => day.ToString()).ToList()
225225
};

src/ResourceManager/Automation/Commands.Automation/Model/Schedule.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ public Schedule(string resourceGroupName, string automationAccountName, Azure.Ma
5858
: this.NextRun;
5959
this.Interval = schedule.Properties.Interval.HasValue ? schedule.Properties.Interval.Value : this.Interval;
6060
this.Frequency = (ScheduleFrequency)Enum.Parse(typeof(ScheduleFrequency), schedule.Properties.Frequency, true);
61-
this.DaysOfWeek = schedule.Properties.AdvancedSchedule == null
61+
this.DaysOfWeekWeeklySchedule = schedule.Properties.AdvancedSchedule == null
6262
? null
6363
: schedule.Properties.AdvancedSchedule.WeekDays;
6464
this.DaysOfMonth = schedule.Properties.AdvancedSchedule == null
6565
? null
6666
: this.GetDaysOfMonth(schedule.Properties.AdvancedSchedule.MonthDays);
67-
this.DayOfWeek = this.IsMonthlyOccurrenceNull(schedule.Properties.AdvancedSchedule)
67+
this.DayOfWeekMonthlySchedule = this.IsMonthlyOccurrenceNull(schedule.Properties.AdvancedSchedule)
6868
? null
6969
: schedule.Properties.AdvancedSchedule.MonthlyOccurrences.First().Day;
7070
this.DayOfWeekOccurrence = this.IsMonthlyOccurrenceNull(schedule.Properties.AdvancedSchedule)
@@ -112,7 +112,7 @@ public Schedule()
112112
/// <summary>
113113
/// Gets or sets the schedule days of the week.
114114
/// </summary>
115-
public IList<string> DaysOfWeek { get; set; }
115+
public IList<string> DaysOfWeekWeeklySchedule { get; set; }
116116

117117
/// <summary>
118118
/// Gets or sets the schedule days of the month.
@@ -122,7 +122,7 @@ public Schedule()
122122
/// <summary>
123123
/// Gets or sets the schedule day of the week.
124124
/// </summary>
125-
public string DayOfWeek { get; set; }
125+
public string DayOfWeekMonthlySchedule { get; set; }
126126

127127
/// <summary>
128128
/// Gets or sets the schedule day of the week occurrence.
@@ -144,15 +144,15 @@ public AdvancedSchedule GetAdvancedSchedule()
144144

145145
var advancedSchedule = new AdvancedSchedule()
146146
{
147-
WeekDays = this.DaysOfWeek,
147+
WeekDays = this.DaysOfWeekWeeklySchedule,
148148
MonthDays = this.DaysOfMonth == null ? null : this.DaysOfMonth.Select(v => Convert.ToInt32(v)).ToList(),
149-
MonthlyOccurrences = string.IsNullOrWhiteSpace(this.DayOfWeek) && this.DayOfWeekOccurrence == null
149+
MonthlyOccurrences = string.IsNullOrWhiteSpace(this.DayOfWeekMonthlySchedule) && this.DayOfWeekOccurrence == null
150150
? null
151151
: new AdvancedScheduleMonthlyOccurrence[]
152152
{
153153
new AdvancedScheduleMonthlyOccurrence()
154154
{
155-
Day = this.DayOfWeek,
155+
Day = this.DayOfWeekMonthlySchedule,
156156
Occurrence = this.GetDayOfWeekOccurrence(this.DayOfWeekOccurrence)
157157
}
158158
}
@@ -202,9 +202,9 @@ private bool IsMonthlyOccurrenceNull(Azure.Management.Automation.Models.Advanced
202202
/// </returns>
203203
private bool AdvancedScheduleIsNull(Schedule schedule)
204204
{
205-
return (schedule.DaysOfWeek == null
205+
return (schedule.DaysOfWeekWeeklySchedule == null
206206
&& schedule.DaysOfMonth == null
207-
&& string.IsNullOrWhiteSpace(schedule.DayOfWeek)
207+
&& string.IsNullOrWhiteSpace(schedule.DayOfWeekMonthlySchedule)
208208
&& schedule.DayOfWeekOccurrence == null);
209209
}
210210

0 commit comments

Comments
 (0)