1- using System . Runtime . Serialization ;
1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Runtime . Serialization ;
24using Elasticsearch . Net . Utf8Json ;
35
46namespace Nest
@@ -18,6 +20,9 @@ public partial interface ISnapshotRequest
1820
1921 [ DataMember ( Name = "partial" ) ]
2022 bool ? Partial { get ; set ; }
23+
24+ [ DataMember ( Name = "metadata" ) ]
25+ IDictionary < string , object > Metadata { get ; set ; }
2126 }
2227
2328 public partial class SnapshotRequest
@@ -28,6 +33,8 @@ public partial class SnapshotRequest
2833 public Indices Indices { get ; set ; }
2934
3035 public bool ? Partial { get ; set ; }
36+
37+ public IDictionary < string , object > Metadata { get ; set ; }
3138 }
3239
3340 public partial class SnapshotDescriptor
@@ -39,6 +46,8 @@ public partial class SnapshotDescriptor
3946
4047 bool ? ISnapshotRequest . Partial { get ; set ; }
4148
49+ IDictionary < string , object > ISnapshotRequest . Metadata { get ; set ; }
50+
4251 public SnapshotDescriptor Index ( IndexName index ) => Indices ( index ) ;
4352
4453 public SnapshotDescriptor Index < T > ( ) where T : class => Indices ( typeof ( T ) ) ;
@@ -50,5 +59,10 @@ public partial class SnapshotDescriptor
5059 public SnapshotDescriptor IncludeGlobalState ( bool ? includeGlobalState = true ) => Assign ( includeGlobalState , ( a , v ) => a . IncludeGlobalState = v ) ;
5160
5261 public SnapshotDescriptor Partial ( bool ? partial = true ) => Assign ( partial , ( a , v ) => a . Partial = v ) ;
62+
63+ public SnapshotDescriptor Metadata ( IDictionary < string , object > metadata ) => Assign ( metadata , ( a , v ) => a . Metadata = v ) ;
64+
65+ public SnapshotDescriptor Metadata ( Func < FluentDictionary < string , object > , IDictionary < string , object > > selector ) =>
66+ Assign ( selector , ( a , v ) => a . Metadata = v ? . Invoke ( new FluentDictionary < string , object > ( ) ) ) ;
5367 }
5468}
0 commit comments