Skip to content

Commit

Permalink
[codegen] update to latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed Nov 20, 2024
1 parent 3c3db68 commit e7cc65f
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
*/
@JsonpDeserializable
public class OpenPointInTimeRequest extends RequestBase implements JsonpSerializable {
@Nullable
private final Boolean allowPartialSearchResults;

private final List<ExpandWildcard> expandWildcards;

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

private OpenPointInTimeRequest(Builder builder) {

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

/**
* If <code>false</code>, creating a point in time request when a shard is
* missing or unavailable will throw an exception. If <code>true</code>, the
* point in time will contain all the shards that are available at the time of
* the request.
* <p>
* API name: {@code allow_partial_search_results}
*/
@Nullable
public final Boolean allowPartialSearchResults() {
return this.allowPartialSearchResults;
}

/**
* Type of index that wildcard patterns can match. If the request can target
* data streams, this argument determines whether wildcard expressions match
Expand Down Expand Up @@ -224,6 +241,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
public static class Builder extends RequestBase.AbstractBuilder<Builder>
implements
ObjectBuilder<OpenPointInTimeRequest> {
@Nullable
private Boolean allowPartialSearchResults;

@Nullable
private List<ExpandWildcard> expandWildcards;

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

/**
* If <code>false</code>, creating a point in time request when a shard is
* missing or unavailable will throw an exception. If <code>true</code>, the
* point in time will contain all the shards that are available at the time of
* the request.
* <p>
* API name: {@code allow_partial_search_results}
*/
public final Builder allowPartialSearchResults(@Nullable Boolean value) {
this.allowPartialSearchResults = value;
return this;
}

/**
* Type of index that wildcard patterns can match. If the request can target
* data streams, this argument determines whether wildcard expressions match
Expand Down Expand Up @@ -462,6 +495,9 @@ protected static void setupOpenPointInTimeRequestDeserializer(
if (request.routing != null) {
params.put("routing", request.routing);
}
if (request.allowPartialSearchResults != null) {
params.put("allow_partial_search_results", String.valueOf(request.allowPartialSearchResults));
}
if (request.ignoreUnavailable != null) {
params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
'_global.mtermvectors.Request': '_global/mtermvectors/MultiTermVectorsRequest.ts#L31-L116',
'_global.mtermvectors.Response': '_global/mtermvectors/MultiTermVectorsResponse.ts#L22-L24',
'_global.mtermvectors.TermVectorsResult': '_global/mtermvectors/types.ts#L96-L104',
'_global.open_point_in_time.Request': '_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L81',
'_global.open_point_in_time.Request': '_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L87',
'_global.open_point_in_time.Response': '_global/open_point_in_time/OpenPointInTimeResponse.ts#L23-L29',
'_global.ping.Request': '_global/ping/PingRequest.ts#L22-L30',
'_global.put_script.Request': '_global/put_script/PutScriptRequest.ts#L25-L66',
Expand Down Expand Up @@ -2311,7 +2311,7 @@
'query_rules.get_rule.Response': 'query_rules/get_rule/QueryRuleGetResponse.ts#L22-L24',
'query_rules.get_ruleset.Request': 'query_rules/get_ruleset/QueryRulesetGetRequest.ts#L22-L35',
'query_rules.get_ruleset.Response': 'query_rules/get_ruleset/QueryRulesetGetResponse.ts#L22-L24',
'query_rules.list_rulesets.QueryRulesetListItem': 'query_rules/list_rulesets/types.ts#L23-L37',
'query_rules.list_rulesets.QueryRulesetListItem': 'query_rules/list_rulesets/types.ts#L23-L42',
'query_rules.list_rulesets.Request': 'query_rules/list_rulesets/QueryRulesetListRequest.ts#L22-L39',
'query_rules.list_rulesets.Response': 'query_rules/list_rulesets/QueryRulesetListResponse.ts#L23-L28',
'query_rules.put_rule.Request': 'query_rules/put_rule/QueryRulePutRequest.ts#L28-L56',
Expand Down Expand Up @@ -2390,39 +2390,39 @@
'searchable_snapshots.stats.Response': 'searchable_snapshots/stats/SearchableSnapshotsStatsResponse.ts#L22-L27',
'security._types.Access': 'security/_types/Access.ts#L22-L31',
'security._types.ApiKey': 'security/_types/ApiKey.ts#L26-L88',
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L408-L410',
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L410-L412',
'security._types.ApplicationPrivileges': 'security/_types/Privileges.ts#L27-L40',
'security._types.BulkError': 'security/_types/Bulk.ts#L24-L33',
'security._types.ClusterNode': 'security/_types/ClusterNode.ts#L22-L24',
'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L42-L199',
'security._types.CreatedStatus': 'security/_types/CreatedStatus.ts#L20-L22',
'security._types.FieldRule': 'security/_types/RoleMappingRule.ts#L35-L43',
'security._types.FieldSecurity': 'security/_types/FieldSecurity.ts#L22-L25',
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L404-L406',
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L406-L408',
'security._types.GrantType': 'security/_types/GrantType.ts#L20-L29',
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L360-L402',
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L217-L241',
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L315-L323',
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L412-L414',
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L362-L404',
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L217-L243',
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L317-L325',
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L414-L416',
'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25',
'security._types.RemoteClusterPrivilege': 'security/_types/Privileges.ts#L201-L214',
'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L277-L289',
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L243-L275',
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L416-L426',
'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L279-L291',
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L245-L277',
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L418-L428',
'security._types.Restriction': 'security/_types/RoleDescriptor.ts#L130-L132',
'security._types.RestrictionWorkflow': 'security/_types/RoleDescriptor.ts#L134-L137',
'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L33-L80',
'security._types.RoleDescriptorRead': 'security/_types/RoleDescriptor.ts#L82-L128',
'security._types.RoleMapping': 'security/_types/RoleMapping.ts#L25-L33',
'security._types.RoleMappingRule': 'security/_types/RoleMappingRule.ts#L22-L33',
'security._types.RoleTemplate': 'security/_types/RoleTemplate.ts#L28-L31',
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L357-L358',
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L325-L335',
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L337-L355',
'security._types.SearchAccess': 'security/_types/Privileges.ts#L428-L448',
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L359-L360',
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L327-L337',
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L339-L357',
'security._types.SearchAccess': 'security/_types/Privileges.ts#L430-L450',
'security._types.TemplateFormat': 'security/_types/RoleTemplate.ts#L22-L25',
'security._types.User': 'security/_types/User.ts#L23-L31',
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L291-L313',
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L293-L315',
'security._types.UserProfile': 'security/_types/UserProfile.ts#L41-L47',
'security._types.UserProfileHitMetadata': 'security/_types/UserProfile.ts#L27-L30',
'security._types.UserProfileUser': 'security/_types/UserProfile.ts#L32-L39',
Expand Down Expand Up @@ -2954,10 +2954,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/879785d054b9922350ada689427fb5659ce251c6/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b7c7c41eabca623640a4fc51492d1cd7063ca8b7/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/879785d054b9922350ada689427fb5659ce251c6/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b7c7c41eabca623640a4fc51492d1cd7063ca8b7/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public class QueryRulesetListItem implements JsonpSerializable {

private final Map<String, Integer> ruleCriteriaTypesCounts;

private final Map<String, Integer> ruleTypeCounts;

// ---------------------------------------------------------------------------------------------

private QueryRulesetListItem(Builder builder) {
Expand All @@ -76,6 +78,7 @@ private QueryRulesetListItem(Builder builder) {
this.ruleTotalCount = ApiTypeHelper.requireNonNull(builder.ruleTotalCount, this, "ruleTotalCount");
this.ruleCriteriaTypesCounts = ApiTypeHelper.unmodifiableRequired(builder.ruleCriteriaTypesCounts, this,
"ruleCriteriaTypesCounts");
this.ruleTypeCounts = ApiTypeHelper.unmodifiableRequired(builder.ruleTypeCounts, this, "ruleTypeCounts");

}

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

/**
* Required - A map of criteria type to the number of rules of that type
* Required - A map of criteria type (e.g. exact) to the number of rules of that
* type
* <p>
* API name: {@code rule_criteria_types_counts}
*/
public final Map<String, Integer> ruleCriteriaTypesCounts() {
return this.ruleCriteriaTypesCounts;
}

/**
* Required - A map of rule type (e.g. pinned) to the number of rules of that
* type
* <p>
* API name: {@code rule_type_counts}
*/
public final Map<String, Integer> ruleTypeCounts() {
return this.ruleTypeCounts;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -138,6 +152,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();

}
if (ApiTypeHelper.isDefined(this.ruleTypeCounts)) {
generator.writeKey("rule_type_counts");
generator.writeStartObject();
for (Map.Entry<String, Integer> item0 : this.ruleTypeCounts.entrySet()) {
generator.writeKey(item0.getKey());
generator.write(item0.getValue());

}
generator.writeEnd();

}

}

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

private Map<String, Integer> ruleCriteriaTypesCounts;

private Map<String, Integer> ruleTypeCounts;

/**
* Required - Ruleset unique identifier
* <p>
Expand All @@ -182,7 +209,8 @@ public final Builder ruleTotalCount(int value) {
}

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

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

/**
* Required - A map of rule type (e.g. pinned) to the number of rules of that
* type
* <p>
* API name: {@code rule_type_counts}
* <p>
* Adds all entries of <code>map</code> to <code>ruleTypeCounts</code>.
*/
public final Builder ruleTypeCounts(Map<String, Integer> map) {
this.ruleTypeCounts = _mapPutAll(this.ruleTypeCounts, map);
return this;
}

/**
* Required - A map of rule type (e.g. pinned) to the number of rules of that
* type
* <p>
* API name: {@code rule_type_counts}
* <p>
* Adds an entry to <code>ruleTypeCounts</code>.
*/
public final Builder ruleTypeCounts(String key, Integer value) {
this.ruleTypeCounts = _mapPut(this.ruleTypeCounts, key, value);
return this;
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -238,6 +293,8 @@ protected static void setupQueryRulesetListItemDeserializer(ObjectDeserializer<Q
op.add(Builder::ruleCriteriaTypesCounts,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()),
"rule_criteria_types_counts");
op.add(Builder::ruleTypeCounts,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), "rule_type_counts");

}

Expand Down

0 comments on commit e7cc65f

Please sign in to comment.