@@ -15,37 +15,35 @@ public interface IIndicesPrivileges
1515 [ JsonProperty ( "privileges" ) ]
1616 IEnumerable < string > Privileges { get ; set ; }
1717
18- [ JsonProperty ( "fields " ) ]
19- Fields Fields { get ; set ; }
18+ [ JsonProperty ( "field_security " ) ]
19+ IFieldSecurity FieldSecurity { get ; set ; }
2020
2121 [ JsonProperty ( "query" ) ]
2222 QueryContainer Query { get ; set ; }
23-
2423 }
2524 public class IndicesPrivileges : IIndicesPrivileges
2625 {
2726 [ JsonConverter ( typeof ( IndicesJsonConverter ) ) ]
2827 public Indices Names { get ; set ; }
2928 public IEnumerable < string > Privileges { get ; set ; }
30- public Fields Fields { get ; set ; }
29+ public IFieldSecurity FieldSecurity { get ; set ; }
3130 public QueryContainer Query { get ; set ; }
3231 }
3332
34-
3533 public class IndicesPrivilegesDescriptor : DescriptorPromiseBase < IndicesPrivilegesDescriptor , IList < IIndicesPrivileges > >
3634 {
3735 public IndicesPrivilegesDescriptor ( ) : base ( new List < IIndicesPrivileges > ( ) ) { }
3836
3937 public IndicesPrivilegesDescriptor Add < T > ( Func < IndicesPrivilegesDescriptor < T > , IIndicesPrivileges > selector ) where T : class =>
4038 Assign ( a => a . AddIfNotNull ( selector ? . Invoke ( new IndicesPrivilegesDescriptor < T > ( ) ) ) ) ;
41-
4239 }
40+
4341 public class IndicesPrivilegesDescriptor < T > : DescriptorBase < IndicesPrivilegesDescriptor < T > , IIndicesPrivileges > , IIndicesPrivileges
4442 where T : class
4543 {
4644 Indices IIndicesPrivileges . Names { get ; set ; }
4745 IEnumerable < string > IIndicesPrivileges . Privileges { get ; set ; }
48- Fields IIndicesPrivileges . Fields { get ; set ; }
46+ IFieldSecurity IIndicesPrivileges . FieldSecurity { get ; set ; }
4947 QueryContainer IIndicesPrivileges . Query { get ; set ; }
5048
5149 public IndicesPrivilegesDescriptor < T > Names ( Indices indices ) => Assign ( a => a . Names = indices ) ;
@@ -55,13 +53,10 @@ public class IndicesPrivilegesDescriptor<T>: DescriptorBase<IndicesPrivilegesDes
5553 public IndicesPrivilegesDescriptor < T > Privileges ( params string [ ] privileges ) => Assign ( a => a . Privileges = privileges ) ;
5654 public IndicesPrivilegesDescriptor < T > Privileges ( IEnumerable < string > privileges ) => Assign ( a => a . Privileges = privileges ) ;
5755
58- public IndicesPrivilegesDescriptor < T > Fields ( Func < FieldsDescriptor < T > , IPromise < Fields > > fields ) =>
59- Assign ( a => a . Fields = fields ? . Invoke ( new FieldsDescriptor < T > ( ) ) ? . Value ) ;
60-
61- public IndicesPrivilegesDescriptor < T > Fields ( Fields fields ) => Assign ( a => a . Fields = fields ) ;
56+ public IndicesPrivilegesDescriptor < T > FieldSecurity ( Func < FieldSecurityDescriptor < T > , IFieldSecurity > fields ) =>
57+ Assign ( a => a . FieldSecurity = fields ? . Invoke ( new FieldSecurityDescriptor < T > ( ) ) ) ;
6258
6359 public IndicesPrivilegesDescriptor < T > Query ( Func < QueryContainerDescriptor < T > , QueryContainer > query ) =>
6460 Assign ( a => a . Query = query ? . Invoke ( new QueryContainerDescriptor < T > ( ) ) ) ;
65-
6661 }
6762}
0 commit comments