@@ -30,6 +30,17 @@ public TaskOptions(TaskRetryOptions? retry = null, IDictionary<string, string>?
3030 this . Tags = tags ;
3131 }
3232
33+ /// <summary>
34+ /// Initializes a new instance of the <see cref="TaskOptions"/> class by copying from another instance.
35+ /// </summary>
36+ /// <param name="options">The task options to copy from.</param>
37+ public TaskOptions ( TaskOptions options )
38+ {
39+ Check . NotNull ( options ) ;
40+ this . Retry = options . Retry ;
41+ this . Tags = options . Tags ;
42+ }
43+
3344 /// <summary>
3445 /// Gets the task retry options.
3546 /// </summary>
@@ -96,12 +107,29 @@ public SubOrchestrationOptions(TaskOptions options, string? instanceId = null)
96107 : base ( options )
97108 {
98109 this . InstanceId = instanceId ;
99- if ( instanceId is null && options is SubOrchestrationOptions derived )
110+ if ( options is SubOrchestrationOptions derived )
100111 {
101- this . InstanceId = derived . InstanceId ;
112+ if ( instanceId is null )
113+ {
114+ this . InstanceId = derived . InstanceId ;
115+ }
116+
117+ this . Version = derived . Version ;
102118 }
103119 }
104120
121+ /// <summary>
122+ /// Initializes a new instance of the <see cref="SubOrchestrationOptions"/> class by copying from another instance.
123+ /// </summary>
124+ /// <param name="options">The sub-orchestration options to copy from.</param>
125+ public SubOrchestrationOptions ( SubOrchestrationOptions options )
126+ : base ( options )
127+ {
128+ Check . NotNull ( options ) ;
129+ this . InstanceId = options . InstanceId ;
130+ this . Version = options . Version ;
131+ }
132+
105133 /// <summary>
106134 /// Gets the orchestration instance ID.
107135 /// </summary>
@@ -116,15 +144,49 @@ public SubOrchestrationOptions(TaskOptions options, string? instanceId = null)
116144/// <summary>
117145/// Options for submitting new orchestrations via the client.
118146/// </summary>
119- /// <param name="InstanceId">
120- /// The unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used.
121- /// </param>
122- /// <param name="StartAt">
123- /// The time when the orchestration instance should start executing. If not specified or if a date-time in the past
124- /// is specified, the orchestration instance will be scheduled immediately.
125- /// </param>
126- public record StartOrchestrationOptions ( string ? InstanceId = null , DateTimeOffset ? StartAt = null )
147+ public record StartOrchestrationOptions
127148{
149+ /// <summary>
150+ /// Initializes a new instance of the <see cref="StartOrchestrationOptions"/> class.
151+ /// </summary>
152+ /// <param name="instanceId">
153+ /// The unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used.
154+ /// </param>
155+ /// <param name="startAt">
156+ /// The time when the orchestration instance should start executing. If not specified or if a date-time in the past
157+ /// is specified, the orchestration instance will be scheduled immediately.
158+ /// </param>
159+ public StartOrchestrationOptions ( string ? instanceId = null , DateTimeOffset ? startAt = null )
160+ {
161+ this . InstanceId = instanceId ;
162+ this . StartAt = startAt ;
163+ }
164+
165+ /// <summary>
166+ /// Initializes a new instance of the <see cref="StartOrchestrationOptions"/> class by copying from another instance.
167+ /// </summary>
168+ /// <param name="options">The start orchestration options to copy from.</param>
169+ public StartOrchestrationOptions ( StartOrchestrationOptions options )
170+ {
171+ Check . NotNull ( options ) ;
172+ this . InstanceId = options . InstanceId ;
173+ this . StartAt = options . StartAt ;
174+ this . Tags = options . Tags ;
175+ this . Version = options . Version ;
176+ this . DedupeStatuses = options . DedupeStatuses ;
177+ }
178+
179+ /// <summary>
180+ /// Gets the unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used.
181+ /// </summary>
182+ public string ? InstanceId { get ; init ; }
183+
184+ /// <summary>
185+ /// Gets the time when the orchestration instance should start executing. If not specified or if a date-time in the past
186+ /// is specified, the orchestration instance will be scheduled immediately.
187+ /// </summary>
188+ public DateTimeOffset ? StartAt { get ; init ; }
189+
128190 /// <summary>
129191 /// Gets the tags to associate with the orchestration instance.
130192 /// </summary>
0 commit comments