@@ -37,6 +37,9 @@ public LifecycleActions(IDictionary<string, ILifecycleAction> container) : base(
3737 /// <inheritdoc cref="IRolloverLifecycleAction"/>
3838 public void Add ( IRolloverLifecycleAction action ) => BackingDictionary . Add ( "rollover" , action ) ;
3939
40+ /// <inheritdoc cref="ISearchableSnapshotAction"/>
41+ public void Add ( ISearchableSnapshotAction action ) => BackingDictionary . Add ( "searchable_snapshot" , action ) ;
42+
4043 /// <inheritdoc cref="ISetPriorityLifecycleAction"/>
4144 public void Add ( ISetPriorityLifecycleAction action ) => BackingDictionary . Add ( "set_priority" , action ) ;
4245
@@ -64,6 +67,7 @@ internal class LifecycleActionsJsonFormatter : IJsonFormatter<ILifecycleActions>
6467 { "shrink" , 7 } ,
6568 { "unfollow" , 8 } ,
6669 { "wait_for_snapshot" , 9 } ,
70+ { "searchable_snapshot" , 10 } ,
6771 } ;
6872
6973 public ILifecycleActions Deserialize ( ref JsonReader reader , IJsonFormatterResolver formatterResolver )
@@ -125,6 +129,10 @@ public ILifecycleActions Deserialize(ref JsonReader reader, IJsonFormatterResolv
125129 lifecycleAction = formatterResolver . GetFormatter < WaitForSnapshotLifecycleAction > ( )
126130 . Deserialize ( ref reader , formatterResolver ) ;
127131 break ;
132+ case 10 :
133+ lifecycleAction = formatterResolver . GetFormatter < SearchableSnapshotAction > ( )
134+ . Deserialize ( ref reader , formatterResolver ) ;
135+ break ;
128136 }
129137
130138 lifecycles . Add ( type . Utf8String ( ) , lifecycleAction ) ;
@@ -173,6 +181,9 @@ public void Serialize(ref JsonWriter writer, ILifecycleActions value, IJsonForma
173181 case "rollover" :
174182 Serialize < IRolloverLifecycleAction > ( ref writer , action . Value , formatterResolver ) ;
175183 break ;
184+ case "searchable_snapshot" :
185+ Serialize < ISearchableSnapshotAction > ( ref writer , action . Value , formatterResolver ) ;
186+ break ;
176187 case "set_priority" :
177188 Serialize < ISetPriorityLifecycleAction > ( ref writer , action . Value , formatterResolver ) ;
178189 break ;
@@ -229,6 +240,10 @@ public LifecycleActionsDescriptor ReadOnly(Func<ReadOnlyLifecycleActionDescripto
229240 public LifecycleActionsDescriptor Rollover ( Func < RolloverLifecycleActionDescriptor , IRolloverLifecycleAction > selector ) =>
230241 Assign ( "rollover" , selector . InvokeOrDefault ( new RolloverLifecycleActionDescriptor ( ) ) ) ;
231242
243+ /// <inheritdoc cref="ISearchableSnapshotAction"/>
244+ public LifecycleActionsDescriptor SearchableSnapshot ( Func < SearchableSnapshotAction , ISearchableSnapshotAction > selector ) =>
245+ Assign ( "searchable_snapshot" , selector . InvokeOrDefault ( new SearchableSnapshotAction ( ) ) ) ;
246+
232247 /// <inheritdoc cref="ISetPriorityLifecycleAction"/>
233248 public LifecycleActionsDescriptor SetPriority ( Func < SetPriorityLifecycleActionDescriptor , ISetPriorityLifecycleAction > selector ) =>
234249 Assign ( "set_priority" , selector . InvokeOrDefault ( new SetPriorityLifecycleActionDescriptor ( ) ) ) ;
0 commit comments