Skip to content

Commit e7cc65f

Browse files
committed
[codegen] update to latest spec
1 parent 3c3db68 commit e7cc65f

File tree

3 files changed

+114
-21
lines changed

3 files changed

+114
-21
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/core/OpenPointInTimeRequest.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
*/
8585
@JsonpDeserializable
8686
public class OpenPointInTimeRequest extends RequestBase implements JsonpSerializable {
87+
@Nullable
88+
private final Boolean allowPartialSearchResults;
89+
8790
private final List<ExpandWildcard> expandWildcards;
8891

8992
@Nullable
@@ -106,6 +109,7 @@ public class OpenPointInTimeRequest extends RequestBase implements JsonpSerializ
106109

107110
private OpenPointInTimeRequest(Builder builder) {
108111

112+
this.allowPartialSearchResults = builder.allowPartialSearchResults;
109113
this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards);
110114
this.ignoreUnavailable = builder.ignoreUnavailable;
111115
this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index");
@@ -120,6 +124,19 @@ public static OpenPointInTimeRequest of(Function<Builder, ObjectBuilder<OpenPoin
120124
return fn.apply(new Builder()).build();
121125
}
122126

127+
/**
128+
* If <code>false</code>, creating a point in time request when a shard is
129+
* missing or unavailable will throw an exception. If <code>true</code>, the
130+
* point in time will contain all the shards that are available at the time of
131+
* the request.
132+
* <p>
133+
* API name: {@code allow_partial_search_results}
134+
*/
135+
@Nullable
136+
public final Boolean allowPartialSearchResults() {
137+
return this.allowPartialSearchResults;
138+
}
139+
123140
/**
124141
* Type of index that wildcard patterns can match. If the request can target
125142
* data streams, this argument determines whether wildcard expressions match
@@ -224,6 +241,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
224241
public static class Builder extends RequestBase.AbstractBuilder<Builder>
225242
implements
226243
ObjectBuilder<OpenPointInTimeRequest> {
244+
@Nullable
245+
private Boolean allowPartialSearchResults;
246+
227247
@Nullable
228248
private List<ExpandWildcard> expandWildcards;
229249

@@ -243,6 +263,19 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
243263
@Nullable
244264
private String routing;
245265

266+
/**
267+
* If <code>false</code>, creating a point in time request when a shard is
268+
* missing or unavailable will throw an exception. If <code>true</code>, the
269+
* point in time will contain all the shards that are available at the time of
270+
* the request.
271+
* <p>
272+
* API name: {@code allow_partial_search_results}
273+
*/
274+
public final Builder allowPartialSearchResults(@Nullable Boolean value) {
275+
this.allowPartialSearchResults = value;
276+
return this;
277+
}
278+
246279
/**
247280
* Type of index that wildcard patterns can match. If the request can target
248281
* data streams, this argument determines whether wildcard expressions match
@@ -462,6 +495,9 @@ protected static void setupOpenPointInTimeRequestDeserializer(
462495
if (request.routing != null) {
463496
params.put("routing", request.routing);
464497
}
498+
if (request.allowPartialSearchResults != null) {
499+
params.put("allow_partial_search_results", String.valueOf(request.allowPartialSearchResults));
500+
}
465501
if (request.ignoreUnavailable != null) {
466502
params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable));
467503
}

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
'_global.mtermvectors.Request': '_global/mtermvectors/MultiTermVectorsRequest.ts#L31-L116',
114114
'_global.mtermvectors.Response': '_global/mtermvectors/MultiTermVectorsResponse.ts#L22-L24',
115115
'_global.mtermvectors.TermVectorsResult': '_global/mtermvectors/types.ts#L96-L104',
116-
'_global.open_point_in_time.Request': '_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L81',
116+
'_global.open_point_in_time.Request': '_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L87',
117117
'_global.open_point_in_time.Response': '_global/open_point_in_time/OpenPointInTimeResponse.ts#L23-L29',
118118
'_global.ping.Request': '_global/ping/PingRequest.ts#L22-L30',
119119
'_global.put_script.Request': '_global/put_script/PutScriptRequest.ts#L25-L66',
@@ -2311,7 +2311,7 @@
23112311
'query_rules.get_rule.Response': 'query_rules/get_rule/QueryRuleGetResponse.ts#L22-L24',
23122312
'query_rules.get_ruleset.Request': 'query_rules/get_ruleset/QueryRulesetGetRequest.ts#L22-L35',
23132313
'query_rules.get_ruleset.Response': 'query_rules/get_ruleset/QueryRulesetGetResponse.ts#L22-L24',
2314-
'query_rules.list_rulesets.QueryRulesetListItem': 'query_rules/list_rulesets/types.ts#L23-L37',
2314+
'query_rules.list_rulesets.QueryRulesetListItem': 'query_rules/list_rulesets/types.ts#L23-L42',
23152315
'query_rules.list_rulesets.Request': 'query_rules/list_rulesets/QueryRulesetListRequest.ts#L22-L39',
23162316
'query_rules.list_rulesets.Response': 'query_rules/list_rulesets/QueryRulesetListResponse.ts#L23-L28',
23172317
'query_rules.put_rule.Request': 'query_rules/put_rule/QueryRulePutRequest.ts#L28-L56',
@@ -2390,39 +2390,39 @@
23902390
'searchable_snapshots.stats.Response': 'searchable_snapshots/stats/SearchableSnapshotsStatsResponse.ts#L22-L27',
23912391
'security._types.Access': 'security/_types/Access.ts#L22-L31',
23922392
'security._types.ApiKey': 'security/_types/ApiKey.ts#L26-L88',
2393-
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L408-L410',
2393+
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L410-L412',
23942394
'security._types.ApplicationPrivileges': 'security/_types/Privileges.ts#L27-L40',
23952395
'security._types.BulkError': 'security/_types/Bulk.ts#L24-L33',
23962396
'security._types.ClusterNode': 'security/_types/ClusterNode.ts#L22-L24',
23972397
'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L42-L199',
23982398
'security._types.CreatedStatus': 'security/_types/CreatedStatus.ts#L20-L22',
23992399
'security._types.FieldRule': 'security/_types/RoleMappingRule.ts#L35-L43',
24002400
'security._types.FieldSecurity': 'security/_types/FieldSecurity.ts#L22-L25',
2401-
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L404-L406',
2401+
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L406-L408',
24022402
'security._types.GrantType': 'security/_types/GrantType.ts#L20-L29',
2403-
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L360-L402',
2404-
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L217-L241',
2405-
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L315-L323',
2406-
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L412-L414',
2403+
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L362-L404',
2404+
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L217-L243',
2405+
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L317-L325',
2406+
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L414-L416',
24072407
'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25',
24082408
'security._types.RemoteClusterPrivilege': 'security/_types/Privileges.ts#L201-L214',
2409-
'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L277-L289',
2410-
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L243-L275',
2411-
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L416-L426',
2409+
'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L279-L291',
2410+
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L245-L277',
2411+
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L418-L428',
24122412
'security._types.Restriction': 'security/_types/RoleDescriptor.ts#L130-L132',
24132413
'security._types.RestrictionWorkflow': 'security/_types/RoleDescriptor.ts#L134-L137',
24142414
'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L33-L80',
24152415
'security._types.RoleDescriptorRead': 'security/_types/RoleDescriptor.ts#L82-L128',
24162416
'security._types.RoleMapping': 'security/_types/RoleMapping.ts#L25-L33',
24172417
'security._types.RoleMappingRule': 'security/_types/RoleMappingRule.ts#L22-L33',
24182418
'security._types.RoleTemplate': 'security/_types/RoleTemplate.ts#L28-L31',
2419-
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L357-L358',
2420-
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L325-L335',
2421-
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L337-L355',
2422-
'security._types.SearchAccess': 'security/_types/Privileges.ts#L428-L448',
2419+
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L359-L360',
2420+
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L327-L337',
2421+
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L339-L357',
2422+
'security._types.SearchAccess': 'security/_types/Privileges.ts#L430-L450',
24232423
'security._types.TemplateFormat': 'security/_types/RoleTemplate.ts#L22-L25',
24242424
'security._types.User': 'security/_types/User.ts#L23-L31',
2425-
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L291-L313',
2425+
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L293-L315',
24262426
'security._types.UserProfile': 'security/_types/UserProfile.ts#L41-L47',
24272427
'security._types.UserProfileHitMetadata': 'security/_types/UserProfile.ts#L27-L30',
24282428
'security._types.UserProfileUser': 'security/_types/UserProfile.ts#L32-L39',
@@ -2954,10 +2954,10 @@
29542954
if (hash.length > 1) {
29552955
hash = hash.substring(1);
29562956
}
2957-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/879785d054b9922350ada689427fb5659ce251c6/specification/" + (paths[hash] || "");
2957+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b7c7c41eabca623640a4fc51492d1cd7063ca8b7/specification/" + (paths[hash] || "");
29582958
</script>
29592959
</head>
29602960
<body>
2961-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/879785d054b9922350ada689427fb5659ce251c6/specification/">Elasticsearch API specification</a>.
2961+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b7c7c41eabca623640a4fc51492d1cd7063ca8b7/specification/">Elasticsearch API specification</a>.
29622962
</body>
29632963
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/list_rulesets/QueryRulesetListItem.java

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public class QueryRulesetListItem implements JsonpSerializable {
6868

6969
private final Map<String, Integer> ruleCriteriaTypesCounts;
7070

71+
private final Map<String, Integer> ruleTypeCounts;
72+
7173
// ---------------------------------------------------------------------------------------------
7274

7375
private QueryRulesetListItem(Builder builder) {
@@ -76,6 +78,7 @@ private QueryRulesetListItem(Builder builder) {
7678
this.ruleTotalCount = ApiTypeHelper.requireNonNull(builder.ruleTotalCount, this, "ruleTotalCount");
7779
this.ruleCriteriaTypesCounts = ApiTypeHelper.unmodifiableRequired(builder.ruleCriteriaTypesCounts, this,
7880
"ruleCriteriaTypesCounts");
81+
this.ruleTypeCounts = ApiTypeHelper.unmodifiableRequired(builder.ruleTypeCounts, this, "ruleTypeCounts");
7982

8083
}
8184

@@ -102,14 +105,25 @@ public final int ruleTotalCount() {
102105
}
103106

104107
/**
105-
* Required - A map of criteria type to the number of rules of that type
108+
* Required - A map of criteria type (e.g. exact) to the number of rules of that
109+
* type
106110
* <p>
107111
* API name: {@code rule_criteria_types_counts}
108112
*/
109113
public final Map<String, Integer> ruleCriteriaTypesCounts() {
110114
return this.ruleCriteriaTypesCounts;
111115
}
112116

117+
/**
118+
* Required - A map of rule type (e.g. pinned) to the number of rules of that
119+
* type
120+
* <p>
121+
* API name: {@code rule_type_counts}
122+
*/
123+
public final Map<String, Integer> ruleTypeCounts() {
124+
return this.ruleTypeCounts;
125+
}
126+
113127
/**
114128
* Serialize this object to JSON.
115129
*/
@@ -138,6 +152,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
138152
generator.writeEnd();
139153

140154
}
155+
if (ApiTypeHelper.isDefined(this.ruleTypeCounts)) {
156+
generator.writeKey("rule_type_counts");
157+
generator.writeStartObject();
158+
for (Map.Entry<String, Integer> item0 : this.ruleTypeCounts.entrySet()) {
159+
generator.writeKey(item0.getKey());
160+
generator.write(item0.getValue());
161+
162+
}
163+
generator.writeEnd();
164+
165+
}
141166

142167
}
143168

@@ -161,6 +186,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
161186

162187
private Map<String, Integer> ruleCriteriaTypesCounts;
163188

189+
private Map<String, Integer> ruleTypeCounts;
190+
164191
/**
165192
* Required - Ruleset unique identifier
166193
* <p>
@@ -182,7 +209,8 @@ public final Builder ruleTotalCount(int value) {
182209
}
183210

184211
/**
185-
* Required - A map of criteria type to the number of rules of that type
212+
* Required - A map of criteria type (e.g. exact) to the number of rules of that
213+
* type
186214
* <p>
187215
* API name: {@code rule_criteria_types_counts}
188216
* <p>
@@ -194,7 +222,8 @@ public final Builder ruleCriteriaTypesCounts(Map<String, Integer> map) {
194222
}
195223

196224
/**
197-
* Required - A map of criteria type to the number of rules of that type
225+
* Required - A map of criteria type (e.g. exact) to the number of rules of that
226+
* type
198227
* <p>
199228
* API name: {@code rule_criteria_types_counts}
200229
* <p>
@@ -205,6 +234,32 @@ public final Builder ruleCriteriaTypesCounts(String key, Integer value) {
205234
return this;
206235
}
207236

237+
/**
238+
* Required - A map of rule type (e.g. pinned) to the number of rules of that
239+
* type
240+
* <p>
241+
* API name: {@code rule_type_counts}
242+
* <p>
243+
* Adds all entries of <code>map</code> to <code>ruleTypeCounts</code>.
244+
*/
245+
public final Builder ruleTypeCounts(Map<String, Integer> map) {
246+
this.ruleTypeCounts = _mapPutAll(this.ruleTypeCounts, map);
247+
return this;
248+
}
249+
250+
/**
251+
* Required - A map of rule type (e.g. pinned) to the number of rules of that
252+
* type
253+
* <p>
254+
* API name: {@code rule_type_counts}
255+
* <p>
256+
* Adds an entry to <code>ruleTypeCounts</code>.
257+
*/
258+
public final Builder ruleTypeCounts(String key, Integer value) {
259+
this.ruleTypeCounts = _mapPut(this.ruleTypeCounts, key, value);
260+
return this;
261+
}
262+
208263
@Override
209264
protected Builder self() {
210265
return this;
@@ -238,6 +293,8 @@ protected static void setupQueryRulesetListItemDeserializer(ObjectDeserializer<Q
238293
op.add(Builder::ruleCriteriaTypesCounts,
239294
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()),
240295
"rule_criteria_types_counts");
296+
op.add(Builder::ruleTypeCounts,
297+
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), "rule_type_counts");
241298

242299
}
243300

0 commit comments

Comments
 (0)