@@ -42,6 +42,9 @@ public interface IAction
4242 [ IgnoreDataMember ]
4343 string Foreach { get ; set ; }
4444
45+ [ IgnoreDataMember ]
46+ int ? MaxIterations { get ; set ; }
47+
4548 /// <summary>
4649 /// Transforms the payload before executing the action. The transformation is only applied
4750 /// for the payload for this action.
@@ -75,6 +78,9 @@ internal ActionBase() { }
7578 /// <inheritdoc />
7679 public string Foreach { get ; set ; }
7780
81+ /// <inheritdoc />
82+ public int ? MaxIterations { get ; set ; }
83+
7884 /// <inheritdoc />
7985 public TransformContainer Transform { get ; set ; }
8086
@@ -125,7 +131,8 @@ internal class ActionsFormatter : IJsonFormatter<Actions>
125131 { "pagerduty" , 6 } ,
126132 { "foreach" , 7 } ,
127133 { "transform" , 8 } ,
128- { "condition" , 9 }
134+ { "condition" , 9 } ,
135+ { "max_iterations" , 10 } ,
129136 } ;
130137
131138 public Actions Deserialize ( ref JsonReader reader , IJsonFormatterResolver formatterResolver )
@@ -140,6 +147,7 @@ public Actions Deserialize(ref JsonReader reader, IJsonFormatterResolver formatt
140147 Time throttlePeriod = null ;
141148 IAction action = null ;
142149 string @foreach = null ;
150+ int ? maxIterations = null ;
143151 TransformContainer transform = null ;
144152 ConditionContainer condition = null ;
145153
@@ -190,6 +198,9 @@ public Actions Deserialize(ref JsonReader reader, IJsonFormatterResolver formatt
190198 condition = formatterResolver . GetFormatter < ConditionContainer > ( )
191199 . Deserialize ( ref reader , formatterResolver ) ;
192200 break ;
201+ case 10 :
202+ maxIterations = reader . ReadInt32 ( ) ;
203+ break ;
193204 }
194205 }
195206 else
@@ -201,6 +212,7 @@ public Actions Deserialize(ref JsonReader reader, IJsonFormatterResolver formatt
201212 action . Name = name ;
202213 action . ThrottlePeriod = throttlePeriod ;
203214 action . Foreach = @foreach ;
215+ action . MaxIterations = maxIterations ;
204216 action . Transform = transform ;
205217 action . Condition = condition ;
206218 dictionary . Add ( name , action ) ;
@@ -238,6 +250,12 @@ public void Serialize(ref JsonWriter writer, Actions value, IJsonFormatterResolv
238250 writer . WriteString ( action . Foreach ) ;
239251 writer . WriteValueSeparator ( ) ;
240252 }
253+ if ( action . MaxIterations . HasValue )
254+ {
255+ writer . WritePropertyName ( "max_iterations" ) ;
256+ writer . WriteInt32 ( action . MaxIterations . Value ) ;
257+ writer . WriteValueSeparator ( ) ;
258+ }
241259
242260 if ( action . Transform != null )
243261 {
0 commit comments