33package com .microsoft .durabletask ;
44
55import java .time .Instant ;
6+ import java .util .HashMap ;
7+ import java .util .Map ;
68
79/**
810 * Options for starting a new instance of an orchestration.
@@ -12,6 +14,7 @@ public final class NewOrchestrationInstanceOptions {
1214 private String instanceId ;
1315 private Object input ;
1416 private Instant startTime ;
17+ private Map <String , String > tags ;
1518
1619 /**
1720 * Default constructor for the {@link NewOrchestrationInstanceOptions} class.
@@ -71,6 +74,21 @@ public NewOrchestrationInstanceOptions setStartTime(Instant startTime) {
7174 return this ;
7275 }
7376
77+ /**
78+ * Sets the tags associated with the new orchestration instance.
79+ *
80+ * @param tags the tags to associate with the new orchestration instance
81+ * @return this {@link NewOrchestrationInstanceOptions} object
82+ */
83+ public NewOrchestrationInstanceOptions setTags (Map <String , String > tags ) {
84+ if (this .tags == null ) {
85+ this .tags = new HashMap <>(tags );
86+ } else {
87+ this .tags .putAll (tags );
88+ }
89+ return this ;
90+ }
91+
7492 /**
7593 * Gets the user-specified version of the new orchestration.
7694 *
@@ -106,4 +124,13 @@ public Object getInput() {
106124 public Instant getStartTime () {
107125 return this .startTime ;
108126 }
127+
128+ /**
129+ * Gets the tags associated with the new orchestration instance. If no tags were set, an empty map is returned.
130+ *
131+ * @return a map of tags associated with the new orchestration instance.
132+ */
133+ public Map <String , String > getTags () {
134+ return this .tags == null ? new HashMap <>() : new HashMap <>(this .tags );
135+ }
109136}
0 commit comments