Skip to content

Commit 8093ac0

Browse files
committed
save
1 parent 30a843e commit 8093ac0

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

src/ScheduledTasks/Models/ScheduleConfiguration.cs

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,23 @@ namespace Microsoft.DurableTask.ScheduledTasks;
88
/// </summary>
99
class ScheduleConfiguration
1010
{
11+
string orchestrationName;
12+
TimeSpan? interval;
13+
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="ScheduleConfiguration"/> class.
16+
/// </summary>
17+
/// <param name="orchestrationName">The name of the orchestration to schedule.</param>
18+
/// <param name="scheduleId">The ID of the schedule, or null to generate one.</param>
1119
public ScheduleConfiguration(string orchestrationName, string scheduleId)
1220
{
1321
this.orchestrationName = Check.NotNullOrEmpty(orchestrationName, nameof(orchestrationName));
1422
this.ScheduleId = scheduleId ?? Guid.NewGuid().ToString("N");
1523
}
1624

17-
string orchestrationName;
18-
25+
/// <summary>
26+
/// Gets or sets the name of the orchestration function to schedule.
27+
/// </summary>
1928
public string OrchestrationName
2029
{
2130
get => this.orchestrationName;
@@ -25,18 +34,34 @@ public string OrchestrationName
2534
}
2635
}
2736

37+
/// <summary>
38+
/// Gets the ID of the schedule.
39+
/// </summary>
2840
public string ScheduleId { get; init; }
2941

42+
/// <summary>
43+
/// Gets or sets the input to the orchestration function.
44+
/// </summary>
3045
public string? OrchestrationInput { get; set; }
3146

47+
/// <summary>
48+
/// Gets or sets the instance ID of the orchestration function.
49+
/// </summary>
3250
public string? OrchestrationInstanceId { get; set; } = Guid.NewGuid().ToString("N");
3351

52+
/// <summary>
53+
/// Gets or sets the start time of the schedule.
54+
/// </summary>
3455
public DateTimeOffset? StartAt { get; set; }
3556

57+
/// <summary>
58+
/// Gets or sets the end time of the schedule.
59+
/// </summary>
3660
public DateTimeOffset? EndAt { get; set; }
3761

38-
TimeSpan? interval;
39-
62+
/// <summary>
63+
/// Gets or sets the interval between schedule executions.
64+
/// </summary>
4065
public TimeSpan? Interval
4166
{
4267
get => this.interval;
@@ -61,12 +86,26 @@ public TimeSpan? Interval
6186
}
6287
}
6388

89+
/// <summary>
90+
/// Gets or sets the cron expression for the schedule.
91+
/// </summary>
6492
public string? CronExpression { get; set; }
6593

94+
/// <summary>
95+
/// Gets or sets the maximum number of times the schedule should run.
96+
/// </summary>
6697
public int MaxOccurrence { get; set; }
6798

99+
/// <summary>
100+
/// Gets or sets whether the schedule should start immediately if it's late.
101+
/// </summary>
68102
public bool? StartImmediatelyIfLate { get; set; }
69103

104+
/// <summary>
105+
/// Creates a new configuration from the provided creation options.
106+
/// </summary>
107+
/// <param name="createOptions">The options to create the configuration from.</param>
108+
/// <returns>A new schedule configuration.</returns>
70109
public static ScheduleConfiguration FromCreateOptions(ScheduleCreationOptions createOptions)
71110
{
72111
return new ScheduleConfiguration(createOptions.OrchestrationName, createOptions.ScheduleId)

0 commit comments

Comments
 (0)