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 19, 2024
1 parent 770d42a commit 6db38a9
Show file tree
Hide file tree
Showing 15 changed files with 1,324 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,9 @@
'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L311-L317',
'indices._types.IndexSettingsTimeSeries': 'indices/_types/IndexSettings.ts#L327-L330',
'indices._types.IndexState': 'indices/_types/IndexState.ts#L27-L40',
'indices._types.IndexTemplate': 'indices/_types/IndexTemplate.ts#L28-L67',
'indices._types.IndexTemplateDataStreamConfiguration': 'indices/_types/IndexTemplate.ts#L69-L80',
'indices._types.IndexTemplateSummary': 'indices/_types/IndexTemplate.ts#L82-L104',
'indices._types.IndexTemplate': 'indices/_types/IndexTemplate.ts#L28-L81',
'indices._types.IndexTemplateDataStreamConfiguration': 'indices/_types/IndexTemplate.ts#L83-L94',
'indices._types.IndexTemplateSummary': 'indices/_types/IndexTemplate.ts#L96-L118',
'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L271-L274',
'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L550-L552',
'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L554-L561',
Expand Down Expand Up @@ -1815,7 +1815,7 @@
'migration.deprecations.Deprecation': 'migration/deprecations/types.ts#L29-L35',
'migration.deprecations.DeprecationLevel': 'migration/deprecations/types.ts#L20-L27',
'migration.deprecations.Request': 'migration/deprecations/DeprecationInfoRequest.ts#L23-L32',
'migration.deprecations.Response': 'migration/deprecations/DeprecationInfoResponse.ts#L23-L30',
'migration.deprecations.Response': 'migration/deprecations/DeprecationInfoResponse.ts#L23-L31',
'migration.get_feature_upgrade_status.MigrationFeature': 'migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L37-L42',
'migration.get_feature_upgrade_status.MigrationFeatureIndexInfo': 'migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L44-L48',
'migration.get_feature_upgrade_status.MigrationStatus': 'migration/get_feature_upgrade_status/GetFeatureUpgradeStatusResponse.ts#L30-L35',
Expand Down Expand Up @@ -2393,35 +2393,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#L372-L374',
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L409-L411',
'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-L195',
'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#L368-L370',
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L405-L407',
'security._types.GrantType': 'security/_types/GrantType.ts#L20-L29',
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L324-L366',
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L198-L222',
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L279-L287',
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L376-L378',
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L361-L403',
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L216-L242',
'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L316-L324',
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L413-L415',
'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25',
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L225-L253',
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L380-L385',
'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L31-L64',
'security._types.RoleDescriptorRead': 'security/_types/RoleDescriptor.ts#L66-L98',
'security._types.RemoteClusterPrivilege': 'security/_types/Privileges.ts#L201-L213',
'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L278-L290',
'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L244-L276',
'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L417-L427',
'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#L321-L322',
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L289-L299',
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L301-L319',
'security._types.SearchAccess': 'security/_types/Privileges.ts#L387-L407',
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L358-L359',
'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L326-L336',
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L338-L356',
'security._types.SearchAccess': 'security/_types/Privileges.ts#L429-L449',
'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#L255-L277',
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L292-L314',
'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 @@ -2481,12 +2485,12 @@
'security.get_api_key.Request': 'security/get_api_key/SecurityGetApiKeyRequest.ts#L23-L88',
'security.get_api_key.Response': 'security/get_api_key/SecurityGetApiKeyResponse.ts#L22-L24',
'security.get_builtin_privileges.Request': 'security/get_builtin_privileges/SecurityGetBuiltinPrivilegesRequest.ts#L22-L32',
'security.get_builtin_privileges.Response': 'security/get_builtin_privileges/SecurityGetBuiltinPrivilegesResponse.ts#L22-L24',
'security.get_builtin_privileges.Response': 'security/get_builtin_privileges/SecurityGetBuiltinPrivilegesResponse.ts#L26-L35',
'security.get_privileges.Request': 'security/get_privileges/SecurityGetPrivilegesRequest.ts#L23-L35',
'security.get_privileges.Response': 'security/get_privileges/SecurityGetPrivilegesResponse.ts#L23-L26',
'security.get_role.Request': 'security/get_role/SecurityGetRoleRequest.ts#L23-L39',
'security.get_role.Response': 'security/get_role/SecurityGetRoleResponse.ts#L23-L26',
'security.get_role.Role': 'security/get_role/types.ts#L29-L42',
'security.get_role.Role': 'security/get_role/types.ts#L32-L53',
'security.get_role_mapping.Request': 'security/get_role_mapping/SecurityGetRoleMappingRequest.ts#L23-L42',
'security.get_role_mapping.Response': 'security/get_role_mapping/SecurityGetRoleMappingResponse.ts#L23-L26',
'security.get_service_accounts.Request': 'security/get_service_accounts/GetServiceAccountsRequest.ts#L23-L44',
Expand Down Expand Up @@ -2528,7 +2532,7 @@
'security.put_privileges.Actions': 'security/put_privileges/types.ts#L22-L27',
'security.put_privileges.Request': 'security/put_privileges/SecurityPutPrivilegesRequest.ts#L25-L38',
'security.put_privileges.Response': 'security/put_privileges/SecurityPutPrivilegesResponse.ts#L23-L26',
'security.put_role.Request': 'security/put_role/SecurityPutRoleRequest.ts#L31-L95',
'security.put_role.Request': 'security/put_role/SecurityPutRoleRequest.ts#L32-L101',
'security.put_role.Response': 'security/put_role/SecurityPutRoleResponse.ts#L22-L24',
'security.put_role_mapping.Request': 'security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L25-L56',
'security.put_role_mapping.Response': 'security/put_role_mapping/SecurityPutRoleMappingResponse.ts#L22-L24',
Expand Down Expand Up @@ -2953,10 +2957,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/55d431ab4ffe02043ba6f6a41d27f14542f4c792/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/cf7d574e642f871f48b16f316b56acc17acf4752/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/55d431ab4ffe02043ba6f6a41d27f14542f4c792/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/cf7d574e642f871f48b16f316b56acc17acf4752/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ public class IndexTemplate implements JsonpSerializable {
@Nullable
private final IndexTemplateDataStreamConfiguration dataStream;

@Nullable
private final Boolean deprecated;

private final List<String> ignoreMissingComponentTemplates;

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

private IndexTemplate(Builder builder) {
Expand All @@ -97,6 +102,8 @@ private IndexTemplate(Builder builder) {
this.meta = ApiTypeHelper.unmodifiable(builder.meta);
this.allowAutoCreate = builder.allowAutoCreate;
this.dataStream = builder.dataStream;
this.deprecated = builder.deprecated;
this.ignoreMissingComponentTemplates = ApiTypeHelper.unmodifiable(builder.ignoreMissingComponentTemplates);

}

Expand Down Expand Up @@ -190,6 +197,27 @@ public final IndexTemplateDataStreamConfiguration dataStream() {
return this.dataStream;
}

/**
* Marks this index template as deprecated. When creating or updating a
* non-deprecated index template that uses deprecated components, Elasticsearch
* will emit a deprecation warning.
* <p>
* API name: {@code deprecated}
*/
@Nullable
public final Boolean deprecated() {
return this.deprecated;
}

/**
* A list of component template names that are allowed to be absent.
* <p>
* API name: {@code ignore_missing_component_templates}
*/
public final List<String> ignoreMissingComponentTemplates() {
return this.ignoreMissingComponentTemplates;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -257,6 +285,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.dataStream.serialize(generator, mapper);

}
if (this.deprecated != null) {
generator.writeKey("deprecated");
generator.write(this.deprecated);

}
if (ApiTypeHelper.isDefined(this.ignoreMissingComponentTemplates)) {
generator.writeKey("ignore_missing_component_templates");
generator.writeStartArray();
for (String item0 : this.ignoreMissingComponentTemplates) {
generator.write(item0);

}
generator.writeEnd();

}

}

Expand Down Expand Up @@ -294,6 +337,12 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private IndexTemplateDataStreamConfiguration dataStream;

@Nullable
private Boolean deprecated;

@Nullable
private List<String> ignoreMissingComponentTemplates;

/**
* Required - Name of the index template.
* <p>
Expand Down Expand Up @@ -450,6 +499,43 @@ public final Builder dataStream(
return this.dataStream(fn.apply(new IndexTemplateDataStreamConfiguration.Builder()).build());
}

/**
* Marks this index template as deprecated. When creating or updating a
* non-deprecated index template that uses deprecated components, Elasticsearch
* will emit a deprecation warning.
* <p>
* API name: {@code deprecated}
*/
public final Builder deprecated(@Nullable Boolean value) {
this.deprecated = value;
return this;
}

/**
* A list of component template names that are allowed to be absent.
* <p>
* API name: {@code ignore_missing_component_templates}
* <p>
* Adds all elements of <code>list</code> to
* <code>ignoreMissingComponentTemplates</code>.
*/
public final Builder ignoreMissingComponentTemplates(List<String> list) {
this.ignoreMissingComponentTemplates = _listAddAll(this.ignoreMissingComponentTemplates, list);
return this;
}

/**
* A list of component template names that are allowed to be absent.
* <p>
* API name: {@code ignore_missing_component_templates}
* <p>
* Adds one or more values to <code>ignoreMissingComponentTemplates</code>.
*/
public final Builder ignoreMissingComponentTemplates(String value, String... values) {
this.ignoreMissingComponentTemplates = _listAdd(this.ignoreMissingComponentTemplates, value, values);
return this;
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -488,6 +574,10 @@ protected static void setupIndexTemplateDeserializer(ObjectDeserializer<IndexTem
op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta");
op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create");
op.add(Builder::dataStream, IndexTemplateDataStreamConfiguration._DESERIALIZER, "data_stream");
op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated");
op.add(Builder::ignoreMissingComponentTemplates,
JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()),
"ignore_missing_component_templates");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public class DeprecationsResponse implements JsonpSerializable {

private final Map<String, List<Deprecation>> indexSettings;

private final Map<String, List<Deprecation>> dataStreams;

private final List<Deprecation> nodeSettings;

private final List<Deprecation> mlSettings;
Expand All @@ -76,6 +78,7 @@ private DeprecationsResponse(Builder builder) {

this.clusterSettings = ApiTypeHelper.unmodifiableRequired(builder.clusterSettings, this, "clusterSettings");
this.indexSettings = ApiTypeHelper.unmodifiableRequired(builder.indexSettings, this, "indexSettings");
this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams");
this.nodeSettings = ApiTypeHelper.unmodifiableRequired(builder.nodeSettings, this, "nodeSettings");
this.mlSettings = ApiTypeHelper.unmodifiableRequired(builder.mlSettings, this, "mlSettings");

Expand All @@ -99,6 +102,13 @@ public final Map<String, List<Deprecation>> indexSettings() {
return this.indexSettings;
}

/**
* Required - API name: {@code data_streams}
*/
public final Map<String, List<Deprecation>> dataStreams() {
return this.dataStreams;
}

/**
* Required - API name: {@code node_settings}
*/
Expand Down Expand Up @@ -151,6 +161,24 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
generator.writeEnd();

}
if (ApiTypeHelper.isDefined(this.dataStreams)) {
generator.writeKey("data_streams");
generator.writeStartObject();
for (Map.Entry<String, List<Deprecation>> item0 : this.dataStreams.entrySet()) {
generator.writeKey(item0.getKey());
generator.writeStartArray();
if (item0.getValue() != null) {
for (Deprecation item1 : item0.getValue()) {
item1.serialize(generator, mapper);

}
}
generator.writeEnd();

}
generator.writeEnd();

}
if (ApiTypeHelper.isDefined(this.nodeSettings)) {
generator.writeKey("node_settings");
Expand Down Expand Up @@ -193,6 +221,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>

private Map<String, List<Deprecation>> indexSettings;

private Map<String, List<Deprecation>> dataStreams;

private List<Deprecation> nodeSettings;

private List<Deprecation> mlSettings;
Expand Down Expand Up @@ -246,6 +276,26 @@ public final Builder indexSettings(String key, List<Deprecation> value) {
return this;
}

/**
* Required - API name: {@code data_streams}
* <p>
* Adds all entries of <code>map</code> to <code>dataStreams</code>.
*/
public final Builder dataStreams(Map<String, List<Deprecation>> map) {
this.dataStreams = _mapPutAll(this.dataStreams, map);
return this;
}

/**
* Required - API name: {@code data_streams}
* <p>
* Adds an entry to <code>dataStreams</code>.
*/
public final Builder dataStreams(String key, List<Deprecation> value) {
this.dataStreams = _mapPut(this.dataStreams, key, value);
return this;
}

/**
* Required - API name: {@code node_settings}
* <p>
Expand Down Expand Up @@ -337,6 +387,9 @@ protected static void setupDeprecationsResponseDeserializer(ObjectDeserializer<D
op.add(Builder::indexSettings,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(Deprecation._DESERIALIZER)),
"index_settings");
op.add(Builder::dataStreams,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(Deprecation._DESERIALIZER)),
"data_streams");
op.add(Builder::nodeSettings, JsonpDeserializer.arrayDeserializer(Deprecation._DESERIALIZER), "node_settings");
op.add(Builder::mlSettings, JsonpDeserializer.arrayDeserializer(Deprecation._DESERIALIZER), "ml_settings");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public enum ClusterPrivilege implements JsonEnum {

MonitorSnapshot("monitor_snapshot"),

MonitorStats("monitor_stats"),

MonitorTextStructure("monitor_text_structure"),

MonitorTransform("monitor_transform"),
Expand Down
Loading

0 comments on commit 6db38a9

Please sign in to comment.