@@ -33,13 +33,17 @@ public sealed partial class IndexSettingBlocks
3333 [ JsonConverter ( typeof ( StringifiedBoolConverter ) ) ]
3434 public bool ? Metadata { get ; set ; }
3535 [ JsonInclude , JsonPropertyName ( "read" ) ]
36+ [ JsonConverter ( typeof ( StringifiedBoolConverter ) ) ]
3637 public bool ? Read { get ; set ; }
3738 [ JsonInclude , JsonPropertyName ( "read_only" ) ]
39+ [ JsonConverter ( typeof ( StringifiedBoolConverter ) ) ]
3840 public bool ? ReadOnly { get ; set ; }
3941 [ JsonInclude , JsonPropertyName ( "read_only_allow_delete" ) ]
42+ [ JsonConverter ( typeof ( StringifiedBoolConverter ) ) ]
4043 public bool ? ReadOnlyAllowDelete { get ; set ; }
4144 [ JsonInclude , JsonPropertyName ( "write" ) ]
42- public Union < bool ? , string ? > ? Write { get ; set ; }
45+ [ JsonConverter ( typeof ( StringifiedBoolConverter ) ) ]
46+ public bool ? Write { get ; set ; }
4347}
4448
4549public sealed partial class IndexSettingBlocksDescriptor : SerializableDescriptor < IndexSettingBlocksDescriptor >
@@ -54,7 +58,7 @@ public IndexSettingBlocksDescriptor() : base()
5458 private bool ? ReadValue { get ; set ; }
5559 private bool ? ReadOnlyValue { get ; set ; }
5660 private bool ? ReadOnlyAllowDeleteValue { get ; set ; }
57- private Union < bool ? , string ? > ? WriteValue { get ; set ; }
61+ private bool ? WriteValue { get ; set ; }
5862
5963 public IndexSettingBlocksDescriptor Metadata ( bool ? metadata = true )
6064 {
@@ -80,7 +84,7 @@ public IndexSettingBlocksDescriptor ReadOnlyAllowDelete(bool? readOnlyAllowDelet
8084 return Self ;
8185 }
8286
83- public IndexSettingBlocksDescriptor Write ( Union < bool ? , string ? > ? write )
87+ public IndexSettingBlocksDescriptor Write ( bool ? write = true )
8488 {
8589 WriteValue = write ;
8690 return Self ;
@@ -95,22 +99,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
9599 JsonSerializer . Serialize ( writer , MetadataValue , options ) ;
96100 }
97101
98- if ( ReadValue . HasValue )
102+ if ( ReadValue is not null )
99103 {
100104 writer . WritePropertyName ( "read" ) ;
101- writer . WriteBooleanValue ( ReadValue . Value ) ;
105+ JsonSerializer . Serialize ( writer , ReadValue , options ) ;
102106 }
103107
104- if ( ReadOnlyValue . HasValue )
108+ if ( ReadOnlyValue is not null )
105109 {
106110 writer . WritePropertyName ( "read_only" ) ;
107- writer . WriteBooleanValue ( ReadOnlyValue . Value ) ;
111+ JsonSerializer . Serialize ( writer , ReadOnlyValue , options ) ;
108112 }
109113
110- if ( ReadOnlyAllowDeleteValue . HasValue )
114+ if ( ReadOnlyAllowDeleteValue is not null )
111115 {
112116 writer . WritePropertyName ( "read_only_allow_delete" ) ;
113- writer . WriteBooleanValue ( ReadOnlyAllowDeleteValue . Value ) ;
117+ JsonSerializer . Serialize ( writer , ReadOnlyAllowDeleteValue , options ) ;
114118 }
115119
116120 if ( WriteValue is not null )
0 commit comments