@@ -64,8 +64,8 @@ public class ShardProfile implements PlainJsonSerializable, ToCopyableBuilder<Sh
6464 @ Nonnull
6565 private final List <AggregationProfile > aggregations ;
6666
67- @ Nullable
68- private final FetchProfile fetch ;
67+ @ Nonnull
68+ private final List < FetchProfile > fetch ;
6969
7070 @ Nonnull
7171 private final String id ;
@@ -77,7 +77,7 @@ public class ShardProfile implements PlainJsonSerializable, ToCopyableBuilder<Sh
7777
7878 private ShardProfile (Builder builder ) {
7979 this .aggregations = ApiTypeHelper .unmodifiableRequired (builder .aggregations , this , "aggregations" );
80- this .fetch = builder .fetch ;
80+ this .fetch = ApiTypeHelper . unmodifiable ( builder .fetch ) ;
8181 this .id = ApiTypeHelper .requireNonNull (builder .id , this , "id" );
8282 this .searches = ApiTypeHelper .unmodifiableRequired (builder .searches , this , "searches" );
8383 }
@@ -97,8 +97,8 @@ public final List<AggregationProfile> aggregations() {
9797 /**
9898 * API name: {@code fetch}
9999 */
100- @ Nullable
101- public final FetchProfile fetch () {
100+ @ Nonnull
101+ public final List < FetchProfile > fetch () {
102102 return this .fetch ;
103103 }
104104
@@ -136,9 +136,13 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
136136 }
137137 generator .writeEnd ();
138138
139- if (this .fetch != null ) {
139+ if (ApiTypeHelper . isDefined ( this .fetch ) ) {
140140 generator .writeKey ("fetch" );
141- this .fetch .serialize (generator , mapper );
141+ generator .writeStartArray ();
142+ for (FetchProfile item0 : this .fetch ) {
143+ item0 .serialize (generator , mapper );
144+ }
145+ generator .writeEnd ();
142146 }
143147
144148 generator .writeKey ("id" );
@@ -171,22 +175,22 @@ public static Builder builder() {
171175 public static class Builder extends ObjectBuilderBase implements CopyableBuilder <Builder , ShardProfile > {
172176 private List <AggregationProfile > aggregations ;
173177 @ Nullable
174- private FetchProfile fetch ;
178+ private List < FetchProfile > fetch ;
175179 private String id ;
176180 private List <SearchProfile > searches ;
177181
178182 public Builder () {}
179183
180184 private Builder (ShardProfile o ) {
181185 this .aggregations = _listCopy (o .aggregations );
182- this .fetch = o .fetch ;
186+ this .fetch = _listCopy ( o .fetch ) ;
183187 this .id = o .id ;
184188 this .searches = _listCopy (o .searches );
185189 }
186190
187191 private Builder (Builder o ) {
188192 this .aggregations = _listCopy (o .aggregations );
189- this .fetch = o .fetch ;
193+ this .fetch = _listCopy ( o .fetch ) ;
190194 this .id = o .id ;
191195 this .searches = _listCopy (o .searches );
192196 }
@@ -237,15 +241,36 @@ public final Builder aggregations(Function<AggregationProfile.Builder, ObjectBui
237241
238242 /**
239243 * API name: {@code fetch}
244+ *
245+ * <p>
246+ * Adds all elements of <code>list</code> to <code>fetch</code>.
247+ * </p>
248+ */
249+ @ Nonnull
250+ public final Builder fetch (List <FetchProfile > list ) {
251+ this .fetch = _listAddAll (this .fetch , list );
252+ return this ;
253+ }
254+
255+ /**
256+ * API name: {@code fetch}
257+ *
258+ * <p>
259+ * Adds one or more values to <code>fetch</code>.
260+ * </p>
240261 */
241262 @ Nonnull
242- public final Builder fetch (@ Nullable FetchProfile value ) {
243- this .fetch = value ;
263+ public final Builder fetch (FetchProfile value , FetchProfile ... values ) {
264+ this .fetch = _listAdd ( this . fetch , value , values ) ;
244265 return this ;
245266 }
246267
247268 /**
248269 * API name: {@code fetch}
270+ *
271+ * <p>
272+ * Adds a value to <code>fetch</code> using a builder lambda.
273+ * </p>
249274 */
250275 @ Nonnull
251276 public final Builder fetch (Function <FetchProfile .Builder , ObjectBuilder <FetchProfile >> fn ) {
@@ -325,7 +350,7 @@ public ShardProfile build() {
325350
326351 protected static void setupShardProfileDeserializer (ObjectDeserializer <ShardProfile .Builder > op ) {
327352 op .add (Builder ::aggregations , JsonpDeserializer .arrayDeserializer (AggregationProfile ._DESERIALIZER ), "aggregations" );
328- op .add (Builder ::fetch , FetchProfile ._DESERIALIZER , "fetch" );
353+ op .add (Builder ::fetch , JsonpDeserializer . arrayDeserializer ( FetchProfile ._DESERIALIZER ) , "fetch" );
329354 op .add (Builder ::id , JsonpDeserializer .stringDeserializer (), "id" );
330355 op .add (Builder ::searches , JsonpDeserializer .arrayDeserializer (SearchProfile ._DESERIALIZER ), "searches" );
331356 }
0 commit comments