2626import co .elastic .clients .json .JsonpUtils ;
2727import co .elastic .clients .json .ObjectBuilderDeserializer ;
2828import co .elastic .clients .json .ObjectDeserializer ;
29- import co .elastic .clients .util .ApiTypeHelper ;
3029import co .elastic .clients .util .ObjectBuilder ;
3130import co .elastic .clients .util .WithJsonObjectBuilderBase ;
3231import jakarta .json .stream .JsonGenerator ;
3332import java .lang .Integer ;
3433import java .util .Objects ;
3534import java .util .function .Function ;
35+ import javax .annotation .Nullable ;
3636
3737//----------------------------------------------------------------
3838// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
5959 */
6060@ JsonpDeserializable
6161public class TextIndexPrefixes implements JsonpSerializable {
62- private final int maxChars ;
62+ @ Nullable
63+ private final Integer maxChars ;
6364
64- private final int minChars ;
65+ @ Nullable
66+ private final Integer minChars ;
6567
6668 // ---------------------------------------------------------------------------------------------
6769
6870 private TextIndexPrefixes (Builder builder ) {
6971
70- this .maxChars = ApiTypeHelper . requireNonNull ( builder .maxChars , this , "maxChars" , 0 ) ;
71- this .minChars = ApiTypeHelper . requireNonNull ( builder .minChars , this , "minChars" , 0 ) ;
72+ this .maxChars = builder .maxChars ;
73+ this .minChars = builder .minChars ;
7274
7375 }
7476
@@ -77,16 +79,18 @@ public static TextIndexPrefixes of(Function<Builder, ObjectBuilder<TextIndexPref
7779 }
7880
7981 /**
80- * Required - API name: {@code max_chars}
82+ * API name: {@code max_chars}
8183 */
82- public final int maxChars () {
84+ @ Nullable
85+ public final Integer maxChars () {
8386 return this .maxChars ;
8487 }
8588
8689 /**
87- * Required - API name: {@code min_chars}
90+ * API name: {@code min_chars}
8891 */
89- public final int minChars () {
92+ @ Nullable
93+ public final Integer minChars () {
9094 return this .minChars ;
9195 }
9296
@@ -101,11 +105,16 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
101105
102106 protected void serializeInternal (JsonGenerator generator , JsonpMapper mapper ) {
103107
104- generator .writeKey ("max_chars" );
105- generator .write (this .maxChars );
108+ if (this .maxChars != null ) {
109+ generator .writeKey ("max_chars" );
110+ generator .write (this .maxChars );
106111
107- generator .writeKey ("min_chars" );
108- generator .write (this .minChars );
112+ }
113+ if (this .minChars != null ) {
114+ generator .writeKey ("min_chars" );
115+ generator .write (this .minChars );
116+
117+ }
109118
110119 }
111120
@@ -121,8 +130,10 @@ public String toString() {
121130 */
122131
123132 public static class Builder extends WithJsonObjectBuilderBase <Builder > implements ObjectBuilder <TextIndexPrefixes > {
133+ @ Nullable
124134 private Integer maxChars ;
125135
136+ @ Nullable
126137 private Integer minChars ;
127138
128139 public Builder () {
@@ -133,17 +144,17 @@ private Builder(TextIndexPrefixes instance) {
133144
134145 }
135146 /**
136- * Required - API name: {@code max_chars}
147+ * API name: {@code max_chars}
137148 */
138- public final Builder maxChars (int value ) {
149+ public final Builder maxChars (@ Nullable Integer value ) {
139150 this .maxChars = value ;
140151 return this ;
141152 }
142153
143154 /**
144- * Required - API name: {@code min_chars}
155+ * API name: {@code min_chars}
145156 */
146- public final Builder minChars (int value ) {
157+ public final Builder minChars (@ Nullable Integer value ) {
147158 this .minChars = value ;
148159 return this ;
149160 }
0 commit comments