33package com .microsoft .durabletask ;
44
55import java .time .Instant ;
6+ import java .util .Collections ;
7+ import java .util .HashMap ;
8+ import java .util .Map ;
69
710/**
811 * Options for starting a new instance of an orchestration.
@@ -12,6 +15,7 @@ public final class NewOrchestrationInstanceOptions {
1215 private String instanceId ;
1316 private Object input ;
1417 private Instant startTime ;
18+ private Map <String , String > tags ;
1519
1620 /**
1721 * Default constructor for the {@link NewOrchestrationInstanceOptions} class.
@@ -71,6 +75,21 @@ public NewOrchestrationInstanceOptions setStartTime(Instant startTime) {
7175 return this ;
7276 }
7377
78+ /**
79+ * Sets the tags associated with the new orchestration instance.
80+ *
81+ * @param tags the tags to associate with the new orchestration instance
82+ * @return this {@link NewOrchestrationInstanceOptions} object
83+ */
84+ public NewOrchestrationInstanceOptions setTags (Map <String , String > tags ) {
85+ if (this .tags == null ) {
86+ this .tags = new HashMap <>(tags );
87+ } else {
88+ this .tags .putAll (tags );
89+ }
90+ return this ;
91+ }
92+
7493 /**
7594 * Gets the user-specified version of the new orchestration.
7695 *
@@ -106,4 +125,13 @@ public Object getInput() {
106125 public Instant getStartTime () {
107126 return this .startTime ;
108127 }
128+
129+ /**
130+ * Gets the tags associated with the new orchestration instance. If no tags were set, an empty map is returned.
131+ *
132+ * @return a map of tags associated with the new orchestration instance.
133+ */
134+ public Map <String , String > getTags () {
135+ return this .tags == null ? Collections .emptyMap () : new HashMap <>(this .tags );
136+ }
109137}
0 commit comments