|
59 | 59 | public class Datafeed implements JsonpSerializable {
|
60 | 60 | private final Map<String, Aggregation> aggregations;
|
61 | 61 |
|
| 62 | + @Nullable |
| 63 | + private final DatafeedAuthorization authorization; |
| 64 | + |
62 | 65 | @Nullable
|
63 | 66 | private final ChunkingConfig chunkingConfig;
|
64 | 67 |
|
@@ -98,6 +101,7 @@ public class Datafeed implements JsonpSerializable {
|
98 | 101 | private Datafeed(Builder builder) {
|
99 | 102 |
|
100 | 103 | this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations);
|
| 104 | + this.authorization = builder.authorization; |
101 | 105 | this.chunkingConfig = builder.chunkingConfig;
|
102 | 106 | this.datafeedId = ApiTypeHelper.requireNonNull(builder.datafeedId, this, "datafeedId");
|
103 | 107 | this.frequency = builder.frequency;
|
@@ -127,6 +131,18 @@ public final Map<String, Aggregation> aggregations() {
|
127 | 131 | return this.aggregations;
|
128 | 132 | }
|
129 | 133 |
|
| 134 | + /** |
| 135 | + * The security privileges that the datafeed uses to run its queries. If Elastic |
| 136 | + * Stack security features were disabled at the time of the most recent update |
| 137 | + * to the datafeed, this property is omitted. |
| 138 | + * <p> |
| 139 | + * API name: {@code authorization} |
| 140 | + */ |
| 141 | + @Nullable |
| 142 | + public final DatafeedAuthorization authorization() { |
| 143 | + return this.authorization; |
| 144 | + } |
| 145 | + |
130 | 146 | /**
|
131 | 147 | * API name: {@code chunking_config}
|
132 | 148 | */
|
@@ -252,6 +268,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
|
252 | 268 | }
|
253 | 269 | generator.writeEnd();
|
254 | 270 |
|
| 271 | + } |
| 272 | + if (this.authorization != null) { |
| 273 | + generator.writeKey("authorization"); |
| 274 | + this.authorization.serialize(generator, mapper); |
| 275 | + |
255 | 276 | }
|
256 | 277 | if (this.chunkingConfig != null) {
|
257 | 278 | generator.writeKey("chunking_config");
|
@@ -362,6 +383,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
|
362 | 383 | @Nullable
|
363 | 384 | private Map<String, Aggregation> aggregations;
|
364 | 385 |
|
| 386 | + @Nullable |
| 387 | + private DatafeedAuthorization authorization; |
| 388 | + |
365 | 389 | @Nullable
|
366 | 390 | private ChunkingConfig chunkingConfig;
|
367 | 391 |
|
@@ -428,6 +452,30 @@ public final Builder aggregations(String key, Function<Aggregation.Builder, Obje
|
428 | 452 | return aggregations(key, fn.apply(new Aggregation.Builder()).build());
|
429 | 453 | }
|
430 | 454 |
|
| 455 | + /** |
| 456 | + * The security privileges that the datafeed uses to run its queries. If Elastic |
| 457 | + * Stack security features were disabled at the time of the most recent update |
| 458 | + * to the datafeed, this property is omitted. |
| 459 | + * <p> |
| 460 | + * API name: {@code authorization} |
| 461 | + */ |
| 462 | + public final Builder authorization(@Nullable DatafeedAuthorization value) { |
| 463 | + this.authorization = value; |
| 464 | + return this; |
| 465 | + } |
| 466 | + |
| 467 | + /** |
| 468 | + * The security privileges that the datafeed uses to run its queries. If Elastic |
| 469 | + * Stack security features were disabled at the time of the most recent update |
| 470 | + * to the datafeed, this property is omitted. |
| 471 | + * <p> |
| 472 | + * API name: {@code authorization} |
| 473 | + */ |
| 474 | + public final Builder authorization( |
| 475 | + Function<DatafeedAuthorization.Builder, ObjectBuilder<DatafeedAuthorization>> fn) { |
| 476 | + return this.authorization(fn.apply(new DatafeedAuthorization.Builder()).build()); |
| 477 | + } |
| 478 | + |
431 | 479 | /**
|
432 | 480 | * API name: {@code chunking_config}
|
433 | 481 | */
|
@@ -670,6 +718,7 @@ protected static void setupDatafeedDeserializer(ObjectDeserializer<Datafeed.Buil
|
670 | 718 |
|
671 | 719 | op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER),
|
672 | 720 | "aggregations", "aggs");
|
| 721 | + op.add(Builder::authorization, DatafeedAuthorization._DESERIALIZER, "authorization"); |
673 | 722 | op.add(Builder::chunkingConfig, ChunkingConfig._DESERIALIZER, "chunking_config");
|
674 | 723 | op.add(Builder::datafeedId, JsonpDeserializer.stringDeserializer(), "datafeed_id");
|
675 | 724 | op.add(Builder::frequency, Time._DESERIALIZER, "frequency");
|
|
0 commit comments