@@ -33,13 +33,17 @@ public sealed partial class IndexSettingBlocks
33
33
[JsonConverter(typeof(StringifiedBoolConverter))]
34
34
public bool? Metadata { get; set; }
35
35
[JsonInclude, JsonPropertyName("read")]
36
+ [JsonConverter(typeof(StringifiedBoolConverter))]
36
37
public bool? Read { get; set; }
37
38
[JsonInclude, JsonPropertyName("read_only")]
39
+ [JsonConverter(typeof(StringifiedBoolConverter))]
38
40
public bool? ReadOnly { get; set; }
39
41
[JsonInclude, JsonPropertyName("read_only_allow_delete")]
42
+ [JsonConverter(typeof(StringifiedBoolConverter))]
40
43
public bool? ReadOnlyAllowDelete { get; set; }
41
44
[JsonInclude, JsonPropertyName("write")]
42
- public Union<bool?, string?>? Write { get; set; }
45
+ [JsonConverter(typeof(StringifiedBoolConverter))]
46
+ public bool? Write { get; set; }
43
47
}
44
48
45
49
public sealed partial class IndexSettingBlocksDescriptor : SerializableDescriptor<IndexSettingBlocksDescriptor>
@@ -54,7 +58,7 @@ public IndexSettingBlocksDescriptor() : base()
54
58
private bool? ReadValue { get; set; }
55
59
private bool? ReadOnlyValue { get; set; }
56
60
private bool? ReadOnlyAllowDeleteValue { get; set; }
57
- private Union< bool?, string?> ? WriteValue { get; set; }
61
+ private bool? WriteValue { get; set; }
58
62
59
63
public IndexSettingBlocksDescriptor Metadata(bool? metadata = true)
60
64
{
@@ -80,7 +84,7 @@ public IndexSettingBlocksDescriptor ReadOnlyAllowDelete(bool? readOnlyAllowDelet
80
84
return Self;
81
85
}
82
86
83
- public IndexSettingBlocksDescriptor Write(Union< bool?, string?>? write)
87
+ public IndexSettingBlocksDescriptor Write(bool? write = true )
84
88
{
85
89
WriteValue = write;
86
90
return Self;
@@ -95,22 +99,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
95
99
JsonSerializer.Serialize(writer, MetadataValue, options);
96
100
}
97
101
98
- if (ReadValue.HasValue )
102
+ if (ReadValue is not null )
99
103
{
100
104
writer.WritePropertyName("read");
101
- writer.WriteBooleanValue( ReadValue.Value );
105
+ JsonSerializer.Serialize(writer, ReadValue, options );
102
106
}
103
107
104
- if (ReadOnlyValue.HasValue )
108
+ if (ReadOnlyValue is not null )
105
109
{
106
110
writer.WritePropertyName("read_only");
107
- writer.WriteBooleanValue( ReadOnlyValue.Value );
111
+ JsonSerializer.Serialize(writer, ReadOnlyValue, options );
108
112
}
109
113
110
- if (ReadOnlyAllowDeleteValue.HasValue )
114
+ if (ReadOnlyAllowDeleteValue is not null )
111
115
{
112
116
writer.WritePropertyName("read_only_allow_delete");
113
- writer.WriteBooleanValue( ReadOnlyAllowDeleteValue.Value );
117
+ JsonSerializer.Serialize(writer, ReadOnlyAllowDeleteValue, options );
114
118
}
115
119
116
120
if (WriteValue is not null)
0 commit comments