-
Notifications
You must be signed in to change notification settings - Fork 53
Add tags to CreateInstanceRequest #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c3d667a
Add tags options
torosent e8ade39
Merge branch 'main' into torosent/add-tags
torosent 722bf6c
Add tags to prots and tests
torosent 8522cf9
Refresh protos
torosent 43a1c37
Fix comments
torosent 5c546b8
Imported sidecar for tests
torosent 50f1ed2
Fixed comments
torosent aad6759
Fixed tests
torosent df4c679
add codeql
torosent c668dbe
Bypass codeql issue
torosent ec04405
Change Dictionary type
torosent 2b44693
Address comments
torosent 8366fee
revert commit
torosent 31563cd
addressed comments
torosent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,103 +1,106 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Microsoft.DurableTask; | ||
|
|
||
| /// <summary> | ||
| /// Options that can be used to control the behavior of orchestrator task execution. | ||
| /// </summary> | ||
| public record TaskOptions | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="TaskOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="retry">The task retry options.</param> | ||
| public TaskOptions(TaskRetryOptions? retry = null) | ||
| { | ||
| this.Retry = retry; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the task retry options. | ||
| /// </summary> | ||
| public TaskRetryOptions? Retry { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="RetryPolicy" />. | ||
| /// </summary> | ||
| /// <param name="policy">The policy to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the policy.</returns> | ||
| public static TaskOptions FromRetryPolicy(RetryPolicy policy) => new(policy); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="AsyncRetryHandler" />. | ||
| /// </summary> | ||
| /// <param name="handler">The handler to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the handler.</returns> | ||
| public static TaskOptions FromRetryHandler(AsyncRetryHandler handler) => new(handler); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="RetryHandler" />. | ||
| /// </summary> | ||
| /// <param name="handler">The handler to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the handler.</returns> | ||
| public static TaskOptions FromRetryHandler(RetryHandler handler) => new(handler); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="SubOrchestrationOptions" /> with the provided instance ID. This can be used when | ||
| /// starting a new sub-orchestration to specify the instance ID. | ||
| /// </summary> | ||
| /// <param name="instanceId">The instance ID to use.</param> | ||
| /// <returns>A new <see cref="SubOrchestrationOptions" />.</returns> | ||
| public SubOrchestrationOptions WithInstanceId(string instanceId) => new(this, instanceId); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Options that can be used to control the behavior of orchestrator task execution. This derived type can be used to | ||
| /// supply extra options for orchestrations. | ||
| /// </summary> | ||
| public record SubOrchestrationOptions : TaskOptions | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="SubOrchestrationOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="retry">The task retry options.</param> | ||
| /// <param name="instanceId">The orchestration instance ID.</param> | ||
| public SubOrchestrationOptions(TaskRetryOptions? retry = null, string? instanceId = null) | ||
| : base(retry) | ||
| { | ||
| this.InstanceId = instanceId; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="SubOrchestrationOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="options">The task options to wrap.</param> | ||
| /// <param name="instanceId">The orchestration instance ID.</param> | ||
| public SubOrchestrationOptions(TaskOptions options, string? instanceId = null) | ||
| : base(options) | ||
| { | ||
| this.InstanceId = instanceId; | ||
| if (instanceId is null && options is SubOrchestrationOptions derived) | ||
| { | ||
| this.InstanceId = derived.InstanceId; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the orchestration instance ID. | ||
| /// </summary> | ||
| public string? InstanceId { get; init; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Options for submitting new orchestrations via the client. | ||
| /// </summary> | ||
| /// <param name="InstanceId"> | ||
| /// The unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used. | ||
| /// </param> | ||
| /// <param name="StartAt"> | ||
| /// The time when the orchestration instance should start executing. If not specified or if a date-time in the past | ||
| /// is specified, the orchestration instance will be scheduled immediately. | ||
| /// </param> | ||
| public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null); | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Microsoft.DurableTask; | ||
|
|
||
| /// <summary> | ||
| /// Options that can be used to control the behavior of orchestrator task execution. | ||
| /// </summary> | ||
| public record TaskOptions | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="TaskOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="retry">The task retry options.</param> | ||
| public TaskOptions(TaskRetryOptions? retry = null) | ||
| { | ||
| this.Retry = retry; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the task retry options. | ||
| /// </summary> | ||
| public TaskRetryOptions? Retry { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="RetryPolicy" />. | ||
| /// </summary> | ||
| /// <param name="policy">The policy to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the policy.</returns> | ||
| public static TaskOptions FromRetryPolicy(RetryPolicy policy) => new(policy); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="AsyncRetryHandler" />. | ||
| /// </summary> | ||
| /// <param name="handler">The handler to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the handler.</returns> | ||
| public static TaskOptions FromRetryHandler(AsyncRetryHandler handler) => new(handler); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="TaskOptions" /> from the provided <see cref="RetryHandler" />. | ||
| /// </summary> | ||
| /// <param name="handler">The handler to convert from.</param> | ||
| /// <returns>A <see cref="TaskOptions" /> built from the handler.</returns> | ||
| public static TaskOptions FromRetryHandler(RetryHandler handler) => new(handler); | ||
|
|
||
| /// <summary> | ||
| /// Returns a new <see cref="SubOrchestrationOptions" /> with the provided instance ID. This can be used when | ||
| /// starting a new sub-orchestration to specify the instance ID. | ||
| /// </summary> | ||
| /// <param name="instanceId">The instance ID to use.</param> | ||
| /// <returns>A new <see cref="SubOrchestrationOptions" />.</returns> | ||
| public SubOrchestrationOptions WithInstanceId(string instanceId) => new(this, instanceId); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Options that can be used to control the behavior of orchestrator task execution. This derived type can be used to | ||
| /// supply extra options for orchestrations. | ||
| /// </summary> | ||
| public record SubOrchestrationOptions : TaskOptions | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="SubOrchestrationOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="retry">The task retry options.</param> | ||
| /// <param name="instanceId">The orchestration instance ID.</param> | ||
| public SubOrchestrationOptions(TaskRetryOptions? retry = null, string? instanceId = null) | ||
| : base(retry) | ||
| { | ||
| this.InstanceId = instanceId; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="SubOrchestrationOptions"/> class. | ||
| /// </summary> | ||
| /// <param name="options">The task options to wrap.</param> | ||
| /// <param name="instanceId">The orchestration instance ID.</param> | ||
| public SubOrchestrationOptions(TaskOptions options, string? instanceId = null) | ||
| : base(options) | ||
| { | ||
| this.InstanceId = instanceId; | ||
| if (instanceId is null && options is SubOrchestrationOptions derived) | ||
| { | ||
| this.InstanceId = derived.InstanceId; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the orchestration instance ID. | ||
| /// </summary> | ||
| public string? InstanceId { get; init; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Options for submitting new orchestrations via the client. | ||
| /// </summary> | ||
| /// <param name="InstanceId"> | ||
| /// The unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used. | ||
| /// </param> | ||
| /// <param name="StartAt"> | ||
| /// The time when the orchestration instance should start executing. If not specified or if a date-time in the past | ||
| /// is specified, the orchestration instance will be scheduled immediately. | ||
| /// </param> | ||
| /// <param name="Tags"> | ||
| /// A dictionary of tags to associate with the orchestration instance. | ||
| /// </param> | ||
| public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null, IDictionary<string, string>? Tags = null); | ||
torosent marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.