@@ -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,51 @@ 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+ #pragma warning disable SA1313 // Parameter names should begin with lower-case letter - using PascalCase to maintain backward compatibility with positional record syntax
160+ public StartOrchestrationOptions ( string ? InstanceId = null , DateTimeOffset ? StartAt = null )
161+ #pragma warning restore SA1313
162+ {
163+ this . InstanceId = InstanceId ;
164+ this . StartAt = StartAt ;
165+ }
166+
167+ /// <summary>
168+ /// Initializes a new instance of the <see cref="StartOrchestrationOptions"/> class by copying from another instance.
169+ /// </summary>
170+ /// <param name="options">The start orchestration options to copy from.</param>
171+ public StartOrchestrationOptions ( StartOrchestrationOptions options )
172+ {
173+ Check . NotNull ( options ) ;
174+ this . InstanceId = options . InstanceId ;
175+ this . StartAt = options . StartAt ;
176+ this . Tags = options . Tags ;
177+ this . Version = options . Version ;
178+ this . DedupeStatuses = options . DedupeStatuses ;
179+ }
180+
181+ /// <summary>
182+ /// Gets the unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used.
183+ /// </summary>
184+ public string ? InstanceId { get ; init ; }
185+
186+ /// <summary>
187+ /// Gets the time when the orchestration instance should start executing. If not specified or if a date-time in the past
188+ /// is specified, the orchestration instance will be scheduled immediately.
189+ /// </summary>
190+ public DateTimeOffset ? StartAt { get ; init ; }
191+
128192 /// <summary>
129193 /// Gets the tags to associate with the orchestration instance.
130194 /// </summary>
0 commit comments