Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e4be9c

Browse files
committedOct 19, 2022
[codegen] Update to latest API spec
1 parent 56741f9 commit 8e4be9c

25 files changed

+1733
-275
lines changed
 

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

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,13 +1426,13 @@
14261426
'indices.validate_query.IndicesValidationExplanation': 'indices/validate_query/IndicesValidateQueryResponse.ts#L32-L37',
14271427
'indices.validate_query.Request': 'indices/validate_query/IndicesValidateQueryRequest.ts#L25-L51',
14281428
'indices.validate_query.Response': 'indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30',
1429-
'ingest._types.AppendProcessor': 'ingest/_types/Processors.ts#L89-L93',
1430-
'ingest._types.AttachmentProcessor': 'ingest/_types/Processors.ts#L95-L103',
1431-
'ingest._types.BytesProcessor': 'ingest/_types/Processors.ts#L122-L126',
1432-
'ingest._types.CircleProcessor': 'ingest/_types/Processors.ts#L128-L134',
1433-
'ingest._types.ConvertProcessor': 'ingest/_types/Processors.ts#L146-L151',
1434-
'ingest._types.ConvertType': 'ingest/_types/Processors.ts#L136-L144',
1435-
'ingest._types.CsvProcessor': 'ingest/_types/Processors.ts#L153-L162',
1429+
'ingest._types.AppendProcessor': 'ingest/_types/Processors.ts#L90-L94',
1430+
'ingest._types.AttachmentProcessor': 'ingest/_types/Processors.ts#L96-L104',
1431+
'ingest._types.BytesProcessor': 'ingest/_types/Processors.ts#L123-L127',
1432+
'ingest._types.CircleProcessor': 'ingest/_types/Processors.ts#L129-L135',
1433+
'ingest._types.ConvertProcessor': 'ingest/_types/Processors.ts#L147-L152',
1434+
'ingest._types.ConvertType': 'ingest/_types/Processors.ts#L137-L145',
1435+
'ingest._types.CsvProcessor': 'ingest/_types/Processors.ts#L154-L162',
14361436
'ingest._types.DateIndexNameProcessor': 'ingest/_types/Processors.ts#L164-L177',
14371437
'ingest._types.DateProcessor': 'ingest/_types/Processors.ts#L179-L185',
14381438
'ingest._types.DissectProcessor': 'ingest/_types/Processors.ts#L187-L192',
@@ -1441,33 +1441,34 @@
14411441
'ingest._types.EnrichProcessor': 'ingest/_types/Processors.ts#L201-L209',
14421442
'ingest._types.FailProcessor': 'ingest/_types/Processors.ts#L211-L213',
14431443
'ingest._types.ForeachProcessor': 'ingest/_types/Processors.ts#L215-L219',
1444-
'ingest._types.GeoIpProcessor': 'ingest/_types/Processors.ts#L105-L112',
1444+
'ingest._types.GeoIpProcessor': 'ingest/_types/Processors.ts#L106-L113',
14451445
'ingest._types.GrokProcessor': 'ingest/_types/Processors.ts#L221-L227',
14461446
'ingest._types.GsubProcessor': 'ingest/_types/Processors.ts#L229-L235',
14471447
'ingest._types.InferenceConfig': 'ingest/_types/Processors.ts#L244-L250',
14481448
'ingest._types.InferenceConfigClassification': 'ingest/_types/Processors.ts#L257-L263',
14491449
'ingest._types.InferenceConfigRegression': 'ingest/_types/Processors.ts#L252-L255',
14501450
'ingest._types.InferenceProcessor': 'ingest/_types/Processors.ts#L237-L242',
14511451
'ingest._types.JoinProcessor': 'ingest/_types/Processors.ts#L265-L269',
1452-
'ingest._types.JsonProcessor': 'ingest/_types/Processors.ts#L271-L275',
1453-
'ingest._types.KeyValueProcessor': 'ingest/_types/Processors.ts#L277-L289',
1454-
'ingest._types.LowercaseProcessor': 'ingest/_types/Processors.ts#L291-L295',
1452+
'ingest._types.JsonProcessor': 'ingest/_types/Processors.ts#L271-L277',
1453+
'ingest._types.JsonProcessorConflictStrategy': 'ingest/_types/Processors.ts#L279-L284',
1454+
'ingest._types.KeyValueProcessor': 'ingest/_types/Processors.ts#L286-L298',
1455+
'ingest._types.LowercaseProcessor': 'ingest/_types/Processors.ts#L300-L304',
14551456
'ingest._types.Pipeline': 'ingest/_types/Pipeline.ts#L23-L28',
1456-
'ingest._types.PipelineProcessor': 'ingest/_types/Processors.ts#L297-L299',
1457-
'ingest._types.ProcessorBase': 'ingest/_types/Processors.ts#L69-L74',
1457+
'ingest._types.PipelineProcessor': 'ingest/_types/Processors.ts#L306-L309',
1458+
'ingest._types.ProcessorBase': 'ingest/_types/Processors.ts#L69-L75',
14581459
'ingest._types.ProcessorContainer': 'ingest/_types/Processors.ts#L28-L67',
1459-
'ingest._types.RemoveProcessor': 'ingest/_types/Processors.ts#L301-L304',
1460-
'ingest._types.RenameProcessor': 'ingest/_types/Processors.ts#L306-L310',
1461-
'ingest._types.SetProcessor': 'ingest/_types/Processors.ts#L319-L323',
1462-
'ingest._types.SetSecurityUserProcessor': 'ingest/_types/Processors.ts#L325-L328',
1463-
'ingest._types.ShapeType': 'ingest/_types/Processors.ts#L330-L333',
1464-
'ingest._types.SortProcessor': 'ingest/_types/Processors.ts#L335-L339',
1465-
'ingest._types.SplitProcessor': 'ingest/_types/Processors.ts#L341-L347',
1466-
'ingest._types.TrimProcessor': 'ingest/_types/Processors.ts#L349-L353',
1467-
'ingest._types.UppercaseProcessor': 'ingest/_types/Processors.ts#L355-L359',
1468-
'ingest._types.UrlDecodeProcessor': 'ingest/_types/Processors.ts#L361-L365',
1469-
'ingest._types.UserAgentProcessor': 'ingest/_types/Processors.ts#L114-L120',
1470-
'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L76-L87',
1460+
'ingest._types.RemoveProcessor': 'ingest/_types/Processors.ts#L311-L314',
1461+
'ingest._types.RenameProcessor': 'ingest/_types/Processors.ts#L316-L320',
1462+
'ingest._types.SetProcessor': 'ingest/_types/Processors.ts#L329-L336',
1463+
'ingest._types.SetSecurityUserProcessor': 'ingest/_types/Processors.ts#L338-L341',
1464+
'ingest._types.ShapeType': 'ingest/_types/Processors.ts#L343-L346',
1465+
'ingest._types.SortProcessor': 'ingest/_types/Processors.ts#L348-L352',
1466+
'ingest._types.SplitProcessor': 'ingest/_types/Processors.ts#L354-L360',
1467+
'ingest._types.TrimProcessor': 'ingest/_types/Processors.ts#L362-L366',
1468+
'ingest._types.UppercaseProcessor': 'ingest/_types/Processors.ts#L368-L372',
1469+
'ingest._types.UrlDecodeProcessor': 'ingest/_types/Processors.ts#L374-L378',
1470+
'ingest._types.UserAgentProcessor': 'ingest/_types/Processors.ts#L115-L121',
1471+
'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L77-L88',
14711472
'ingest.delete_pipeline.Request': 'ingest/delete_pipeline/DeletePipelineRequest.ts#L24-L37',
14721473
'ingest.delete_pipeline.Response': 'ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24',
14731474
'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L35',
@@ -2034,26 +2035,30 @@
20342035
'searchable_snapshots.stats.Request': 'searchable_snapshots/stats/SearchableSnapshotsStatsRequest.ts#L24-L36',
20352036
'searchable_snapshots.stats.Response': 'searchable_snapshots/stats/SearchableSnapshotsStatsResponse.ts#L22-L27',
20362037
'security._types.ApiKey': 'security/_types/ApiKey.ts#L27-L41',
2037-
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L164-L166',
2038+
'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L191-L193',
20382039
'security._types.ApplicationPrivileges': 'security/_types/Privileges.ts#L26-L39',
20392040
'security._types.ClusterNode': 'security/_types/ClusterNode.ts#L22-L24',
20402041
'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L41-L79',
20412042
'security._types.CreatedStatus': 'security/_types/CreatedStatus.ts#L20-L22',
20422043
'security._types.FieldRule': 'security/_types/RoleMappingRule.ts#L33-L42',
20432044
'security._types.FieldSecurity': 'security/_types/FieldSecurity.ts#L22-L25',
2044-
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L160-L162',
2045+
'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L187-L189',
20452046
'security._types.GrantType': 'security/_types/GrantType.ts#L20-L23',
2046-
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L138-L158',
2047+
'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L165-L185',
20472048
'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L81-L104',
2048-
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L168-L170',
2049+
'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L195-L197',
20492050
'security._types.Realm': 'security/_types/RoleMappingRule.ts#L44-L46',
20502051
'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25',
20512052
'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L27-L36',
20522053
'security._types.RoleDescriptorRead': 'security/_types/RoleDescriptor.ts#L38-L47',
20532054
'security._types.RoleMapping': 'security/_types/RoleMapping.ts#L25-L31',
20542055
'security._types.RoleMappingRule': 'security/_types/RoleMappingRule.ts#L23-L31',
2056+
'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L159-L160',
2057+
'security._types.RoleTemplateInlineScript': 'security/_types/Privileges.ts#L152-L157',
2058+
'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L162-L163',
20552059
'security._types.TransientMetadataConfig': 'security/_types/TransientMetadataConfig.ts#L20-L22',
20562060
'security._types.User': 'security/_types/User.ts#L23-L31',
2061+
'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L106-L128',
20572062
'security._types.UserProfile': 'security/_types/UserProfile.ts#L42-L48',
20582063
'security._types.UserProfileHitMetadata': 'security/_types/UserProfile.ts#L28-L31',
20592064
'security._types.UserProfileUser': 'security/_types/UserProfile.ts#L33-L40',
@@ -2133,7 +2138,7 @@
21332138
'security.get_user.Request': 'security/get_user/SecurityGetUserRequest.ts#L23-L41',
21342139
'security.get_user.Response': 'security/get_user/SecurityGetUserResponse.ts#L23-L25',
21352140
'security.get_user_privileges.Request': 'security/get_user_privileges/SecurityGetUserPrivilegesRequest.ts#L23-L36',
2136-
'security.get_user_privileges.Response': 'security/get_user_privileges/SecurityGetUserPrivilegesResponse.ts#L26-L37',
2141+
'security.get_user_privileges.Response': 'security/get_user_privileges/SecurityGetUserPrivilegesResponse.ts#L27-L35',
21372142
'security.get_user_profile.GetUserProfileErrors': 'security/get_user_profile/types.ts#L25-L28',
21382143
'security.get_user_profile.Request': 'security/get_user_profile/Request.ts#L23-L46',
21392144
'security.get_user_profile.Response': 'security/get_user_profile/Response.ts#L23-L28',
@@ -2525,10 +2530,10 @@
25252530
if (hash.length > 1) {
25262531
hash = hash.substring(1);
25272532
}
2528-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/9b556a1c9fd30159115d6c15226d0cac53a1d1a7/specification/" + (paths[hash] || "");
2533+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/e7e16d652a197629b2c2d5df3abbcd5fb9c48d1a/specification/" + (paths[hash] || "");
25292534
</script>
25302535
</head>
25312536
<body>
2532-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/9b556a1c9fd30159115d6c15226d0cac53a1d1a7/specification/">Elasticsearch API specification</a>.
2537+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/e7e16d652a197629b2c2d5df3abbcd5fb9c48d1a/specification/">Elasticsearch API specification</a>.
25332538
</body>
25342539
</html>

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/CircleProcessor.java‎

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ public class CircleProcessor extends ProcessorBase implements ProcessorVariant {
5151

5252
private final String field;
5353

54-
private final boolean ignoreMissing;
54+
@Nullable
55+
private final Boolean ignoreMissing;
5556

5657
private final ShapeType shapeType;
5758

59+
@Nullable
5860
private final String targetField;
5961

6062
// ---------------------------------------------------------------------------------------------
@@ -64,9 +66,9 @@ private CircleProcessor(Builder builder) {
6466

6567
this.errorDistance = ApiTypeHelper.requireNonNull(builder.errorDistance, this, "errorDistance");
6668
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
67-
this.ignoreMissing = ApiTypeHelper.requireNonNull(builder.ignoreMissing, this, "ignoreMissing");
69+
this.ignoreMissing = builder.ignoreMissing;
6870
this.shapeType = ApiTypeHelper.requireNonNull(builder.shapeType, this, "shapeType");
69-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
71+
this.targetField = builder.targetField;
7072

7173
}
7274

@@ -97,9 +99,10 @@ public final String field() {
9799
}
98100

99101
/**
100-
* Required - API name: {@code ignore_missing}
102+
* API name: {@code ignore_missing}
101103
*/
102-
public final boolean ignoreMissing() {
104+
@Nullable
105+
public final Boolean ignoreMissing() {
103106
return this.ignoreMissing;
104107
}
105108

@@ -111,8 +114,9 @@ public final ShapeType shapeType() {
111114
}
112115

113116
/**
114-
* Required - API name: {@code target_field}
117+
* API name: {@code target_field}
115118
*/
119+
@Nullable
116120
public final String targetField() {
117121
return this.targetField;
118122
}
@@ -126,13 +130,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
126130
generator.writeKey("field");
127131
generator.write(this.field);
128132

129-
generator.writeKey("ignore_missing");
130-
generator.write(this.ignoreMissing);
133+
if (this.ignoreMissing != null) {
134+
generator.writeKey("ignore_missing");
135+
generator.write(this.ignoreMissing);
131136

137+
}
132138
generator.writeKey("shape_type");
133139
this.shapeType.serialize(generator, mapper);
134-
generator.writeKey("target_field");
135-
generator.write(this.targetField);
140+
if (this.targetField != null) {
141+
generator.writeKey("target_field");
142+
generator.write(this.targetField);
143+
144+
}
136145

137146
}
138147

@@ -149,10 +158,12 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
149158

150159
private String field;
151160

161+
@Nullable
152162
private Boolean ignoreMissing;
153163

154164
private ShapeType shapeType;
155165

166+
@Nullable
156167
private String targetField;
157168

158169
/**
@@ -172,9 +183,9 @@ public final Builder field(String value) {
172183
}
173184

174185
/**
175-
* Required - API name: {@code ignore_missing}
186+
* API name: {@code ignore_missing}
176187
*/
177-
public final Builder ignoreMissing(boolean value) {
188+
public final Builder ignoreMissing(@Nullable Boolean value) {
178189
this.ignoreMissing = value;
179190
return this;
180191
}
@@ -188,9 +199,9 @@ public final Builder shapeType(ShapeType value) {
188199
}
189200

190201
/**
191-
* Required - API name: {@code target_field}
202+
* API name: {@code target_field}
192203
*/
193-
public final Builder targetField(String value) {
204+
public final Builder targetField(@Nullable String value) {
194205
this.targetField = value;
195206
return this;
196207
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ConvertProcessor.java‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class ConvertProcessor extends ProcessorBase implements ProcessorVariant
5151
@Nullable
5252
private final Boolean ignoreMissing;
5353

54+
@Nullable
5455
private final String targetField;
5556

5657
private final ConvertType type;
@@ -62,7 +63,7 @@ private ConvertProcessor(Builder builder) {
6263

6364
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
6465
this.ignoreMissing = builder.ignoreMissing;
65-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
66+
this.targetField = builder.targetField;
6667
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
6768

6869
}
@@ -95,8 +96,9 @@ public final Boolean ignoreMissing() {
9596
}
9697

9798
/**
98-
* Required - API name: {@code target_field}
99+
* API name: {@code target_field}
99100
*/
101+
@Nullable
100102
public final String targetField() {
101103
return this.targetField;
102104
}
@@ -119,9 +121,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
119121
generator.write(this.ignoreMissing);
120122

121123
}
122-
generator.writeKey("target_field");
123-
generator.write(this.targetField);
124+
if (this.targetField != null) {
125+
generator.writeKey("target_field");
126+
generator.write(this.targetField);
124127

128+
}
125129
generator.writeKey("type");
126130
this.type.serialize(generator, mapper);
127131

@@ -141,6 +145,7 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
141145
@Nullable
142146
private Boolean ignoreMissing;
143147

148+
@Nullable
144149
private String targetField;
145150

146151
private ConvertType type;
@@ -162,9 +167,9 @@ public final Builder ignoreMissing(@Nullable Boolean value) {
162167
}
163168

164169
/**
165-
* Required - API name: {@code target_field}
170+
* API name: {@code target_field}
166171
*/
167-
public final Builder targetField(String value) {
172+
public final Builder targetField(@Nullable String value) {
168173
this.targetField = value;
169174
return this;
170175
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/CsvProcessor.java‎

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@
4848
*/
4949
@JsonpDeserializable
5050
public class CsvProcessor extends ProcessorBase implements ProcessorVariant {
51-
private final JsonData emptyValue;
52-
5351
@Nullable
54-
private final String description;
52+
private final JsonData emptyValue;
5553

5654
private final String field;
5755

@@ -66,21 +64,21 @@ public class CsvProcessor extends ProcessorBase implements ProcessorVariant {
6664

6765
private final List<String> targetFields;
6866

69-
private final boolean trim;
67+
@Nullable
68+
private final Boolean trim;
7069

7170
// ---------------------------------------------------------------------------------------------
7271

7372
private CsvProcessor(Builder builder) {
7473
super(builder);
7574

76-
this.emptyValue = ApiTypeHelper.requireNonNull(builder.emptyValue, this, "emptyValue");
77-
this.description = builder.description;
75+
this.emptyValue = builder.emptyValue;
7876
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
7977
this.ignoreMissing = builder.ignoreMissing;
8078
this.quote = builder.quote;
8179
this.separator = builder.separator;
8280
this.targetFields = ApiTypeHelper.unmodifiableRequired(builder.targetFields, this, "targetFields");
83-
this.trim = ApiTypeHelper.requireNonNull(builder.trim, this, "trim");
81+
this.trim = builder.trim;
8482

8583
}
8684

@@ -97,20 +95,13 @@ public Processor.Kind _processorKind() {
9795
}
9896

9997
/**
100-
* Required - API name: {@code empty_value}
98+
* API name: {@code empty_value}
10199
*/
100+
@Nullable
102101
public final JsonData emptyValue() {
103102
return this.emptyValue;
104103
}
105104

106-
/**
107-
* API name: {@code description}
108-
*/
109-
@Nullable
110-
public final String description() {
111-
return this.description;
112-
}
113-
114105
/**
115106
* Required - API name: {@code field}
116107
*/
@@ -150,21 +141,19 @@ public final List<String> targetFields() {
150141
}
151142

152143
/**
153-
* Required - API name: {@code trim}
144+
* API name: {@code trim}
154145
*/
155-
public final boolean trim() {
146+
@Nullable
147+
public final Boolean trim() {
156148
return this.trim;
157149
}
158150

159151
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
160152

161153
super.serializeInternal(generator, mapper);
162-
generator.writeKey("empty_value");
163-
this.emptyValue.serialize(generator, mapper);
164-
165-
if (this.description != null) {
166-
generator.writeKey("description");
167-
generator.write(this.description);
154+
if (this.emptyValue != null) {
155+
generator.writeKey("empty_value");
156+
this.emptyValue.serialize(generator, mapper);
168157

169158
}
170159
generator.writeKey("field");
@@ -195,8 +184,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
195184
generator.writeEnd();
196185

197186
}
198-
generator.writeKey("trim");
199-
generator.write(this.trim);
187+
if (this.trim != null) {
188+
generator.writeKey("trim");
189+
generator.write(this.trim);
190+
191+
}
200192

201193
}
202194

@@ -207,10 +199,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
207199
*/
208200

209201
public static class Builder extends ProcessorBase.AbstractBuilder<Builder> implements ObjectBuilder<CsvProcessor> {
210-
private JsonData emptyValue;
211-
212202
@Nullable
213-
private String description;
203+
private JsonData emptyValue;
214204

215205
private String field;
216206

@@ -225,24 +215,17 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder> imple
225215

226216
private List<String> targetFields;
227217

218+
@Nullable
228219
private Boolean trim;
229220

230221
/**
231-
* Required - API name: {@code empty_value}
222+
* API name: {@code empty_value}
232223
*/
233-
public final Builder emptyValue(JsonData value) {
224+
public final Builder emptyValue(@Nullable JsonData value) {
234225
this.emptyValue = value;
235226
return this;
236227
}
237228

238-
/**
239-
* API name: {@code description}
240-
*/
241-
public final Builder description(@Nullable String value) {
242-
this.description = value;
243-
return this;
244-
}
245-
246229
/**
247230
* Required - API name: {@code field}
248231
*/
@@ -296,9 +279,9 @@ public final Builder targetFields(String value, String... values) {
296279
}
297280

298281
/**
299-
* Required - API name: {@code trim}
282+
* API name: {@code trim}
300283
*/
301-
public final Builder trim(boolean value) {
284+
public final Builder trim(@Nullable Boolean value) {
302285
this.trim = value;
303286
return this;
304287
}
@@ -332,7 +315,6 @@ public CsvProcessor build() {
332315
protected static void setupCsvProcessorDeserializer(ObjectDeserializer<CsvProcessor.Builder> op) {
333316
ProcessorBase.setupProcessorBaseDeserializer(op);
334317
op.add(Builder::emptyValue, JsonData._DESERIALIZER, "empty_value");
335-
op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description");
336318
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
337319
op.add(Builder::ignoreMissing, JsonpDeserializer.booleanDeserializer(), "ignore_missing");
338320
op.add(Builder::quote, JsonpDeserializer.stringDeserializer(), "quote");

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DateIndexNameProcessor.java‎

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ public class DateIndexNameProcessor extends ProcessorBase implements ProcessorVa
5353

5454
private final String field;
5555

56+
@Nullable
5657
private final String indexNameFormat;
5758

59+
@Nullable
5860
private final String indexNamePrefix;
5961

62+
@Nullable
6063
private final String locale;
6164

65+
@Nullable
6266
private final String timezone;
6367

6468
// ---------------------------------------------------------------------------------------------
@@ -69,10 +73,10 @@ private DateIndexNameProcessor(Builder builder) {
6973
this.dateFormats = ApiTypeHelper.unmodifiableRequired(builder.dateFormats, this, "dateFormats");
7074
this.dateRounding = ApiTypeHelper.requireNonNull(builder.dateRounding, this, "dateRounding");
7175
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
72-
this.indexNameFormat = ApiTypeHelper.requireNonNull(builder.indexNameFormat, this, "indexNameFormat");
73-
this.indexNamePrefix = ApiTypeHelper.requireNonNull(builder.indexNamePrefix, this, "indexNamePrefix");
74-
this.locale = ApiTypeHelper.requireNonNull(builder.locale, this, "locale");
75-
this.timezone = ApiTypeHelper.requireNonNull(builder.timezone, this, "timezone");
76+
this.indexNameFormat = builder.indexNameFormat;
77+
this.indexNamePrefix = builder.indexNamePrefix;
78+
this.locale = builder.locale;
79+
this.timezone = builder.timezone;
7680

7781
}
7882

@@ -116,29 +120,33 @@ public final String field() {
116120
}
117121

118122
/**
119-
* Required - API name: {@code index_name_format}
123+
* API name: {@code index_name_format}
120124
*/
125+
@Nullable
121126
public final String indexNameFormat() {
122127
return this.indexNameFormat;
123128
}
124129

125130
/**
126-
* Required - API name: {@code index_name_prefix}
131+
* API name: {@code index_name_prefix}
127132
*/
133+
@Nullable
128134
public final String indexNamePrefix() {
129135
return this.indexNamePrefix;
130136
}
131137

132138
/**
133-
* Required - API name: {@code locale}
139+
* API name: {@code locale}
134140
*/
141+
@Nullable
135142
public final String locale() {
136143
return this.locale;
137144
}
138145

139146
/**
140-
* Required - API name: {@code timezone}
147+
* API name: {@code timezone}
141148
*/
149+
@Nullable
142150
public final String timezone() {
143151
return this.timezone;
144152
}
@@ -162,17 +170,26 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
162170
generator.writeKey("field");
163171
generator.write(this.field);
164172

165-
generator.writeKey("index_name_format");
166-
generator.write(this.indexNameFormat);
173+
if (this.indexNameFormat != null) {
174+
generator.writeKey("index_name_format");
175+
generator.write(this.indexNameFormat);
167176

168-
generator.writeKey("index_name_prefix");
169-
generator.write(this.indexNamePrefix);
177+
}
178+
if (this.indexNamePrefix != null) {
179+
generator.writeKey("index_name_prefix");
180+
generator.write(this.indexNamePrefix);
170181

171-
generator.writeKey("locale");
172-
generator.write(this.locale);
182+
}
183+
if (this.locale != null) {
184+
generator.writeKey("locale");
185+
generator.write(this.locale);
173186

174-
generator.writeKey("timezone");
175-
generator.write(this.timezone);
187+
}
188+
if (this.timezone != null) {
189+
generator.writeKey("timezone");
190+
generator.write(this.timezone);
191+
192+
}
176193

177194
}
178195

@@ -191,12 +208,16 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
191208

192209
private String field;
193210

211+
@Nullable
194212
private String indexNameFormat;
195213

214+
@Nullable
196215
private String indexNamePrefix;
197216

217+
@Nullable
198218
private String locale;
199219

220+
@Nullable
200221
private String timezone;
201222

202223
/**
@@ -242,33 +263,33 @@ public final Builder field(String value) {
242263
}
243264

244265
/**
245-
* Required - API name: {@code index_name_format}
266+
* API name: {@code index_name_format}
246267
*/
247-
public final Builder indexNameFormat(String value) {
268+
public final Builder indexNameFormat(@Nullable String value) {
248269
this.indexNameFormat = value;
249270
return this;
250271
}
251272

252273
/**
253-
* Required - API name: {@code index_name_prefix}
274+
* API name: {@code index_name_prefix}
254275
*/
255-
public final Builder indexNamePrefix(String value) {
276+
public final Builder indexNamePrefix(@Nullable String value) {
256277
this.indexNamePrefix = value;
257278
return this;
258279
}
259280

260281
/**
261-
* Required - API name: {@code locale}
282+
* API name: {@code locale}
262283
*/
263-
public final Builder locale(String value) {
284+
public final Builder locale(@Nullable String value) {
264285
this.locale = value;
265286
return this;
266287
}
267288

268289
/**
269-
* Required - API name: {@code timezone}
290+
* API name: {@code timezone}
270291
*/
271-
public final Builder timezone(String value) {
292+
public final Builder timezone(@Nullable String value) {
272293
this.timezone = value;
273294
return this;
274295
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DissectProcessor.java‎

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@
4646
*/
4747
@JsonpDeserializable
4848
public class DissectProcessor extends ProcessorBase implements ProcessorVariant {
49+
@Nullable
4950
private final String appendSeparator;
5051

5152
private final String field;
5253

53-
private final boolean ignoreMissing;
54+
@Nullable
55+
private final Boolean ignoreMissing;
5456

5557
private final String pattern;
5658

@@ -59,9 +61,9 @@ public class DissectProcessor extends ProcessorBase implements ProcessorVariant
5961
private DissectProcessor(Builder builder) {
6062
super(builder);
6163

62-
this.appendSeparator = ApiTypeHelper.requireNonNull(builder.appendSeparator, this, "appendSeparator");
64+
this.appendSeparator = builder.appendSeparator;
6365
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
64-
this.ignoreMissing = ApiTypeHelper.requireNonNull(builder.ignoreMissing, this, "ignoreMissing");
66+
this.ignoreMissing = builder.ignoreMissing;
6567
this.pattern = ApiTypeHelper.requireNonNull(builder.pattern, this, "pattern");
6668

6769
}
@@ -79,8 +81,9 @@ public Processor.Kind _processorKind() {
7981
}
8082

8183
/**
82-
* Required - API name: {@code append_separator}
84+
* API name: {@code append_separator}
8385
*/
86+
@Nullable
8487
public final String appendSeparator() {
8588
return this.appendSeparator;
8689
}
@@ -93,9 +96,10 @@ public final String field() {
9396
}
9497

9598
/**
96-
* Required - API name: {@code ignore_missing}
99+
* API name: {@code ignore_missing}
97100
*/
98-
public final boolean ignoreMissing() {
101+
@Nullable
102+
public final Boolean ignoreMissing() {
99103
return this.ignoreMissing;
100104
}
101105

@@ -109,15 +113,19 @@ public final String pattern() {
109113
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
110114

111115
super.serializeInternal(generator, mapper);
112-
generator.writeKey("append_separator");
113-
generator.write(this.appendSeparator);
116+
if (this.appendSeparator != null) {
117+
generator.writeKey("append_separator");
118+
generator.write(this.appendSeparator);
114119

120+
}
115121
generator.writeKey("field");
116122
generator.write(this.field);
117123

118-
generator.writeKey("ignore_missing");
119-
generator.write(this.ignoreMissing);
124+
if (this.ignoreMissing != null) {
125+
generator.writeKey("ignore_missing");
126+
generator.write(this.ignoreMissing);
120127

128+
}
121129
generator.writeKey("pattern");
122130
generator.write(this.pattern);
123131

@@ -132,18 +140,20 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
132140
public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
133141
implements
134142
ObjectBuilder<DissectProcessor> {
143+
@Nullable
135144
private String appendSeparator;
136145

137146
private String field;
138147

148+
@Nullable
139149
private Boolean ignoreMissing;
140150

141151
private String pattern;
142152

143153
/**
144-
* Required - API name: {@code append_separator}
154+
* API name: {@code append_separator}
145155
*/
146-
public final Builder appendSeparator(String value) {
156+
public final Builder appendSeparator(@Nullable String value) {
147157
this.appendSeparator = value;
148158
return this;
149159
}
@@ -157,9 +167,9 @@ public final Builder field(String value) {
157167
}
158168

159169
/**
160-
* Required - API name: {@code ignore_missing}
170+
* API name: {@code ignore_missing}
161171
*/
162-
public final Builder ignoreMissing(boolean value) {
172+
public final Builder ignoreMissing(@Nullable Boolean value) {
163173
this.ignoreMissing = value;
164174
return this;
165175
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GeoIpProcessor.java‎

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,33 @@
4747
*/
4848
@JsonpDeserializable
4949
public class GeoIpProcessor extends ProcessorBase implements ProcessorVariant {
50+
@Nullable
5051
private final String databaseFile;
5152

5253
private final String field;
5354

54-
private final boolean firstOnly;
55+
@Nullable
56+
private final Boolean firstOnly;
5557

56-
private final boolean ignoreMissing;
58+
@Nullable
59+
private final Boolean ignoreMissing;
5760

5861
private final List<String> properties;
5962

63+
@Nullable
6064
private final String targetField;
6165

6266
// ---------------------------------------------------------------------------------------------
6367

6468
private GeoIpProcessor(Builder builder) {
6569
super(builder);
6670

67-
this.databaseFile = ApiTypeHelper.requireNonNull(builder.databaseFile, this, "databaseFile");
71+
this.databaseFile = builder.databaseFile;
6872
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
69-
this.firstOnly = ApiTypeHelper.requireNonNull(builder.firstOnly, this, "firstOnly");
70-
this.ignoreMissing = ApiTypeHelper.requireNonNull(builder.ignoreMissing, this, "ignoreMissing");
71-
this.properties = ApiTypeHelper.unmodifiableRequired(builder.properties, this, "properties");
72-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
73+
this.firstOnly = builder.firstOnly;
74+
this.ignoreMissing = builder.ignoreMissing;
75+
this.properties = ApiTypeHelper.unmodifiable(builder.properties);
76+
this.targetField = builder.targetField;
7377

7478
}
7579

@@ -86,8 +90,9 @@ public Processor.Kind _processorKind() {
8690
}
8791

8892
/**
89-
* Required - API name: {@code database_file}
93+
* API name: {@code database_file}
9094
*/
95+
@Nullable
9196
public final String databaseFile() {
9297
return this.databaseFile;
9398
}
@@ -100,48 +105,57 @@ public final String field() {
100105
}
101106

102107
/**
103-
* Required - API name: {@code first_only}
108+
* API name: {@code first_only}
104109
*/
105-
public final boolean firstOnly() {
110+
@Nullable
111+
public final Boolean firstOnly() {
106112
return this.firstOnly;
107113
}
108114

109115
/**
110-
* Required - API name: {@code ignore_missing}
116+
* API name: {@code ignore_missing}
111117
*/
112-
public final boolean ignoreMissing() {
118+
@Nullable
119+
public final Boolean ignoreMissing() {
113120
return this.ignoreMissing;
114121
}
115122

116123
/**
117-
* Required - API name: {@code properties}
124+
* API name: {@code properties}
118125
*/
119126
public final List<String> properties() {
120127
return this.properties;
121128
}
122129

123130
/**
124-
* Required - API name: {@code target_field}
131+
* API name: {@code target_field}
125132
*/
133+
@Nullable
126134
public final String targetField() {
127135
return this.targetField;
128136
}
129137

130138
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
131139

132140
super.serializeInternal(generator, mapper);
133-
generator.writeKey("database_file");
134-
generator.write(this.databaseFile);
141+
if (this.databaseFile != null) {
142+
generator.writeKey("database_file");
143+
generator.write(this.databaseFile);
135144

145+
}
136146
generator.writeKey("field");
137147
generator.write(this.field);
138148

139-
generator.writeKey("first_only");
140-
generator.write(this.firstOnly);
149+
if (this.firstOnly != null) {
150+
generator.writeKey("first_only");
151+
generator.write(this.firstOnly);
141152

142-
generator.writeKey("ignore_missing");
143-
generator.write(this.ignoreMissing);
153+
}
154+
if (this.ignoreMissing != null) {
155+
generator.writeKey("ignore_missing");
156+
generator.write(this.ignoreMissing);
144157

158+
}
145159
if (ApiTypeHelper.isDefined(this.properties)) {
146160
generator.writeKey("properties");
147161
generator.writeStartArray();
@@ -152,8 +166,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
152166
generator.writeEnd();
153167

154168
}
155-
generator.writeKey("target_field");
156-
generator.write(this.targetField);
169+
if (this.targetField != null) {
170+
generator.writeKey("target_field");
171+
generator.write(this.targetField);
172+
173+
}
157174

158175
}
159176

@@ -166,22 +183,27 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
166183
public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
167184
implements
168185
ObjectBuilder<GeoIpProcessor> {
186+
@Nullable
169187
private String databaseFile;
170188

171189
private String field;
172190

191+
@Nullable
173192
private Boolean firstOnly;
174193

194+
@Nullable
175195
private Boolean ignoreMissing;
176196

197+
@Nullable
177198
private List<String> properties;
178199

200+
@Nullable
179201
private String targetField;
180202

181203
/**
182-
* Required - API name: {@code database_file}
204+
* API name: {@code database_file}
183205
*/
184-
public final Builder databaseFile(String value) {
206+
public final Builder databaseFile(@Nullable String value) {
185207
this.databaseFile = value;
186208
return this;
187209
}
@@ -195,23 +217,23 @@ public final Builder field(String value) {
195217
}
196218

197219
/**
198-
* Required - API name: {@code first_only}
220+
* API name: {@code first_only}
199221
*/
200-
public final Builder firstOnly(boolean value) {
222+
public final Builder firstOnly(@Nullable Boolean value) {
201223
this.firstOnly = value;
202224
return this;
203225
}
204226

205227
/**
206-
* Required - API name: {@code ignore_missing}
228+
* API name: {@code ignore_missing}
207229
*/
208-
public final Builder ignoreMissing(boolean value) {
230+
public final Builder ignoreMissing(@Nullable Boolean value) {
209231
this.ignoreMissing = value;
210232
return this;
211233
}
212234

213235
/**
214-
* Required - API name: {@code properties}
236+
* API name: {@code properties}
215237
* <p>
216238
* Adds all elements of <code>list</code> to <code>properties</code>.
217239
*/
@@ -221,7 +243,7 @@ public final Builder properties(List<String> list) {
221243
}
222244

223245
/**
224-
* Required - API name: {@code properties}
246+
* API name: {@code properties}
225247
* <p>
226248
* Adds one or more values to <code>properties</code>.
227249
*/
@@ -231,9 +253,9 @@ public final Builder properties(String value, String... values) {
231253
}
232254

233255
/**
234-
* Required - API name: {@code target_field}
256+
* API name: {@code target_field}
235257
*/
236-
public final Builder targetField(String value) {
258+
public final Builder targetField(@Nullable String value) {
237259
this.targetField = value;
238260
return this;
239261
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GrokProcessor.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ private GrokProcessor(Builder builder) {
6767

6868
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
6969
this.ignoreMissing = builder.ignoreMissing;
70-
this.patternDefinitions = ApiTypeHelper.unmodifiableRequired(builder.patternDefinitions, this,
71-
"patternDefinitions");
70+
this.patternDefinitions = ApiTypeHelper.unmodifiable(builder.patternDefinitions);
7271
this.patterns = ApiTypeHelper.unmodifiableRequired(builder.patterns, this, "patterns");
7372
this.traceMatch = builder.traceMatch;
7473

@@ -102,7 +101,7 @@ public final Boolean ignoreMissing() {
102101
}
103102

104103
/**
105-
* Required - API name: {@code pattern_definitions}
104+
* API name: {@code pattern_definitions}
106105
*/
107106
public final Map<String, String> patternDefinitions() {
108107
return this.patternDefinitions;
@@ -175,6 +174,7 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder> imple
175174
@Nullable
176175
private Boolean ignoreMissing;
177176

177+
@Nullable
178178
private Map<String, String> patternDefinitions;
179179

180180
private List<String> patterns;
@@ -199,7 +199,7 @@ public final Builder ignoreMissing(@Nullable Boolean value) {
199199
}
200200

201201
/**
202-
* Required - API name: {@code pattern_definitions}
202+
* API name: {@code pattern_definitions}
203203
* <p>
204204
* Adds all entries of <code>map</code> to <code>patternDefinitions</code>.
205205
*/
@@ -209,7 +209,7 @@ public final Builder patternDefinitions(Map<String, String> map) {
209209
}
210210

211211
/**
212-
* Required - API name: {@code pattern_definitions}
212+
* API name: {@code pattern_definitions}
213213
* <p>
214214
* Adds an entry to <code>patternDefinitions</code>.
215215
*/

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceProcessor.java‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
public class InferenceProcessor extends ProcessorBase implements ProcessorVariant {
5151
private final String modelId;
5252

53+
@Nullable
5354
private final String targetField;
5455

5556
private final Map<String, JsonData> fieldMap;
@@ -63,7 +64,7 @@ private InferenceProcessor(Builder builder) {
6364
super(builder);
6465

6566
this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
66-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
67+
this.targetField = builder.targetField;
6768
this.fieldMap = ApiTypeHelper.unmodifiable(builder.fieldMap);
6869
this.inferenceConfig = builder.inferenceConfig;
6970

@@ -89,8 +90,9 @@ public final String modelId() {
8990
}
9091

9192
/**
92-
* Required - API name: {@code target_field}
93+
* API name: {@code target_field}
9394
*/
95+
@Nullable
9496
public final String targetField() {
9597
return this.targetField;
9698
}
@@ -116,9 +118,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
116118
generator.writeKey("model_id");
117119
generator.write(this.modelId);
118120

119-
generator.writeKey("target_field");
120-
generator.write(this.targetField);
121+
if (this.targetField != null) {
122+
generator.writeKey("target_field");
123+
generator.write(this.targetField);
121124

125+
}
122126
if (ApiTypeHelper.isDefined(this.fieldMap)) {
123127
generator.writeKey("field_map");
124128
generator.writeStartObject();
@@ -149,6 +153,7 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
149153
ObjectBuilder<InferenceProcessor> {
150154
private String modelId;
151155

156+
@Nullable
152157
private String targetField;
153158

154159
@Nullable
@@ -166,9 +171,9 @@ public final Builder modelId(String value) {
166171
}
167172

168173
/**
169-
* Required - API name: {@code target_field}
174+
* API name: {@code target_field}
170175
*/
171-
public final Builder targetField(String value) {
176+
public final Builder targetField(@Nullable String value) {
172177
this.targetField = value;
173178
return this;
174179
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/JsonProcessor.java‎

Lines changed: 83 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,30 @@
4646
*/
4747
@JsonpDeserializable
4848
public class JsonProcessor extends ProcessorBase implements ProcessorVariant {
49-
private final boolean addToRoot;
49+
@Nullable
50+
private final Boolean addToRoot;
51+
52+
@Nullable
53+
private final JsonProcessorConflictStrategy addToRootConflictStrategy;
54+
55+
@Nullable
56+
private final Boolean allowDuplicateKeys;
5057

5158
private final String field;
5259

60+
@Nullable
5361
private final String targetField;
5462

5563
// ---------------------------------------------------------------------------------------------
5664

5765
private JsonProcessor(Builder builder) {
5866
super(builder);
5967

60-
this.addToRoot = ApiTypeHelper.requireNonNull(builder.addToRoot, this, "addToRoot");
68+
this.addToRoot = builder.addToRoot;
69+
this.addToRootConflictStrategy = builder.addToRootConflictStrategy;
70+
this.allowDuplicateKeys = builder.allowDuplicateKeys;
6171
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
62-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
72+
this.targetField = builder.targetField;
6373

6474
}
6575

@@ -76,12 +86,29 @@ public Processor.Kind _processorKind() {
7686
}
7787

7888
/**
79-
* Required - API name: {@code add_to_root}
89+
* API name: {@code add_to_root}
8090
*/
81-
public final boolean addToRoot() {
91+
@Nullable
92+
public final Boolean addToRoot() {
8293
return this.addToRoot;
8394
}
8495

96+
/**
97+
* API name: {@code add_to_root_conflict_strategy}
98+
*/
99+
@Nullable
100+
public final JsonProcessorConflictStrategy addToRootConflictStrategy() {
101+
return this.addToRootConflictStrategy;
102+
}
103+
104+
/**
105+
* API name: {@code allow_duplicate_keys}
106+
*/
107+
@Nullable
108+
public final Boolean allowDuplicateKeys() {
109+
return this.allowDuplicateKeys;
110+
}
111+
85112
/**
86113
* Required - API name: {@code field}
87114
*/
@@ -90,23 +117,38 @@ public final String field() {
90117
}
91118

92119
/**
93-
* Required - API name: {@code target_field}
120+
* API name: {@code target_field}
94121
*/
122+
@Nullable
95123
public final String targetField() {
96124
return this.targetField;
97125
}
98126

99127
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
100128

101129
super.serializeInternal(generator, mapper);
102-
generator.writeKey("add_to_root");
103-
generator.write(this.addToRoot);
130+
if (this.addToRoot != null) {
131+
generator.writeKey("add_to_root");
132+
generator.write(this.addToRoot);
104133

134+
}
135+
if (this.addToRootConflictStrategy != null) {
136+
generator.writeKey("add_to_root_conflict_strategy");
137+
this.addToRootConflictStrategy.serialize(generator, mapper);
138+
}
139+
if (this.allowDuplicateKeys != null) {
140+
generator.writeKey("allow_duplicate_keys");
141+
generator.write(this.allowDuplicateKeys);
142+
143+
}
105144
generator.writeKey("field");
106145
generator.write(this.field);
107146

108-
generator.writeKey("target_field");
109-
generator.write(this.targetField);
147+
if (this.targetField != null) {
148+
generator.writeKey("target_field");
149+
generator.write(this.targetField);
150+
151+
}
110152

111153
}
112154

@@ -117,20 +159,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
117159
*/
118160

119161
public static class Builder extends ProcessorBase.AbstractBuilder<Builder> implements ObjectBuilder<JsonProcessor> {
162+
@Nullable
120163
private Boolean addToRoot;
121164

165+
@Nullable
166+
private JsonProcessorConflictStrategy addToRootConflictStrategy;
167+
168+
@Nullable
169+
private Boolean allowDuplicateKeys;
170+
122171
private String field;
123172

173+
@Nullable
124174
private String targetField;
125175

126176
/**
127-
* Required - API name: {@code add_to_root}
177+
* API name: {@code add_to_root}
128178
*/
129-
public final Builder addToRoot(boolean value) {
179+
public final Builder addToRoot(@Nullable Boolean value) {
130180
this.addToRoot = value;
131181
return this;
132182
}
133183

184+
/**
185+
* API name: {@code add_to_root_conflict_strategy}
186+
*/
187+
public final Builder addToRootConflictStrategy(@Nullable JsonProcessorConflictStrategy value) {
188+
this.addToRootConflictStrategy = value;
189+
return this;
190+
}
191+
192+
/**
193+
* API name: {@code allow_duplicate_keys}
194+
*/
195+
public final Builder allowDuplicateKeys(@Nullable Boolean value) {
196+
this.allowDuplicateKeys = value;
197+
return this;
198+
}
199+
134200
/**
135201
* Required - API name: {@code field}
136202
*/
@@ -140,9 +206,9 @@ public final Builder field(String value) {
140206
}
141207

142208
/**
143-
* Required - API name: {@code target_field}
209+
* API name: {@code target_field}
144210
*/
145-
public final Builder targetField(String value) {
211+
public final Builder targetField(@Nullable String value) {
146212
this.targetField = value;
147213
return this;
148214
}
@@ -176,6 +242,9 @@ public JsonProcessor build() {
176242
protected static void setupJsonProcessorDeserializer(ObjectDeserializer<JsonProcessor.Builder> op) {
177243
ProcessorBase.setupProcessorBaseDeserializer(op);
178244
op.add(Builder::addToRoot, JsonpDeserializer.booleanDeserializer(), "add_to_root");
245+
op.add(Builder::addToRootConflictStrategy, JsonProcessorConflictStrategy._DESERIALIZER,
246+
"add_to_root_conflict_strategy");
247+
op.add(Builder::allowDuplicateKeys, JsonpDeserializer.booleanDeserializer(), "allow_duplicate_keys");
179248
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
180249
op.add(Builder::targetField, JsonpDeserializer.stringDeserializer(), "target_field");
181250

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.ingest;
25+
26+
import co.elastic.clients.json.JsonEnum;
27+
import co.elastic.clients.json.JsonpDeserializable;
28+
import co.elastic.clients.json.JsonpDeserializer;
29+
30+
/**
31+
*
32+
* @see <a href=
33+
* "../doc-files/api-spec.html#ingest._types.JsonProcessorConflictStrategy">API
34+
* specification</a>
35+
*/
36+
@JsonpDeserializable
37+
public enum JsonProcessorConflictStrategy implements JsonEnum {
38+
/**
39+
* Root fields that conflict with fields from the parsed JSON will be
40+
* overridden.
41+
*/
42+
Replace("replace"),
43+
44+
/**
45+
* Conflicting fields will be merged.
46+
*/
47+
Merge("merge"),
48+
49+
;
50+
51+
private final String jsonValue;
52+
53+
JsonProcessorConflictStrategy(String jsonValue) {
54+
this.jsonValue = jsonValue;
55+
}
56+
57+
public String jsonValue() {
58+
return this.jsonValue;
59+
}
60+
61+
public static final JsonEnum.Deserializer<JsonProcessorConflictStrategy> _DESERIALIZER = new JsonEnum.Deserializer<>(
62+
JsonProcessorConflictStrategy.values());
63+
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/PipelineProcessor.java‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import co.elastic.clients.util.ApiTypeHelper;
3232
import co.elastic.clients.util.ObjectBuilder;
3333
import jakarta.json.stream.JsonGenerator;
34+
import java.lang.Boolean;
3435
import java.lang.String;
3536
import java.util.Objects;
3637
import java.util.function.Function;
@@ -47,12 +48,16 @@
4748
public class PipelineProcessor extends ProcessorBase implements ProcessorVariant {
4849
private final String name;
4950

51+
@Nullable
52+
private final Boolean ignoreMissingPipeline;
53+
5054
// ---------------------------------------------------------------------------------------------
5155

5256
private PipelineProcessor(Builder builder) {
5357
super(builder);
5458

5559
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
60+
this.ignoreMissingPipeline = builder.ignoreMissingPipeline;
5661

5762
}
5863

@@ -75,12 +80,26 @@ public final String name() {
7580
return this.name;
7681
}
7782

83+
/**
84+
* API name: {@code ignore_missing_pipeline}
85+
*/
86+
@Nullable
87+
public final Boolean ignoreMissingPipeline() {
88+
return this.ignoreMissingPipeline;
89+
}
90+
7891
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
7992

8093
super.serializeInternal(generator, mapper);
8194
generator.writeKey("name");
8295
generator.write(this.name);
8396

97+
if (this.ignoreMissingPipeline != null) {
98+
generator.writeKey("ignore_missing_pipeline");
99+
generator.write(this.ignoreMissingPipeline);
100+
101+
}
102+
84103
}
85104

86105
// ---------------------------------------------------------------------------------------------
@@ -94,6 +113,9 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
94113
ObjectBuilder<PipelineProcessor> {
95114
private String name;
96115

116+
@Nullable
117+
private Boolean ignoreMissingPipeline;
118+
97119
/**
98120
* Required - API name: {@code name}
99121
*/
@@ -102,6 +124,14 @@ public final Builder name(String value) {
102124
return this;
103125
}
104126

127+
/**
128+
* API name: {@code ignore_missing_pipeline}
129+
*/
130+
public final Builder ignoreMissingPipeline(@Nullable Boolean value) {
131+
this.ignoreMissingPipeline = value;
132+
return this;
133+
}
134+
105135
@Override
106136
protected Builder self() {
107137
return this;
@@ -131,6 +161,7 @@ public PipelineProcessor build() {
131161
protected static void setupPipelineProcessorDeserializer(ObjectDeserializer<PipelineProcessor.Builder> op) {
132162
ProcessorBase.setupProcessorBaseDeserializer(op);
133163
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
164+
op.add(Builder::ignoreMissingPipeline, JsonpDeserializer.booleanDeserializer(), "ignore_missing_pipeline");
134165

135166
}
136167

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorBase.java‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
*/
5151

5252
public abstract class ProcessorBase implements JsonpSerializable {
53+
@Nullable
54+
private final String description;
55+
5356
@Nullable
5457
private final String if_;
5558

@@ -65,13 +68,22 @@ public abstract class ProcessorBase implements JsonpSerializable {
6568

6669
protected ProcessorBase(AbstractBuilder<?> builder) {
6770

71+
this.description = builder.description;
6872
this.if_ = builder.if_;
6973
this.ignoreFailure = builder.ignoreFailure;
7074
this.onFailure = ApiTypeHelper.unmodifiable(builder.onFailure);
7175
this.tag = builder.tag;
7276

7377
}
7478

79+
/**
80+
* API name: {@code description}
81+
*/
82+
@Nullable
83+
public final String description() {
84+
return this.description;
85+
}
86+
7587
/**
7688
* API name: {@code if}
7789
*/
@@ -114,6 +126,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
114126

115127
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
116128

129+
if (this.description != null) {
130+
generator.writeKey("description");
131+
generator.write(this.description);
132+
133+
}
117134
if (this.if_ != null) {
118135
generator.writeKey("if");
119136
generator.write(this.if_);
@@ -150,6 +167,9 @@ public String toString() {
150167
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
151168
extends
152169
WithJsonObjectBuilderBase<BuilderT> {
170+
@Nullable
171+
private String description;
172+
153173
@Nullable
154174
private String if_;
155175

@@ -162,6 +182,14 @@ protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder
162182
@Nullable
163183
private String tag;
164184

185+
/**
186+
* API name: {@code description}
187+
*/
188+
public final BuilderT description(@Nullable String value) {
189+
this.description = value;
190+
return self();
191+
}
192+
165193
/**
166194
* API name: {@code if}
167195
*/
@@ -223,6 +251,7 @@ public final BuilderT tag(@Nullable String value) {
223251
protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupProcessorBaseDeserializer(
224252
ObjectDeserializer<BuilderT> op) {
225253

254+
op.add(AbstractBuilder::description, JsonpDeserializer.stringDeserializer(), "description");
226255
op.add(AbstractBuilder::if_, JsonpDeserializer.stringDeserializer(), "if");
227256
op.add(AbstractBuilder::ignoreFailure, JsonpDeserializer.booleanDeserializer(), "ignore_failure");
228257
op.add(AbstractBuilder::onFailure, JsonpDeserializer.arrayDeserializer(Processor._DESERIALIZER), "on_failure");

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/SetProcessor.java‎

Lines changed: 99 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,34 @@
4747
*/
4848
@JsonpDeserializable
4949
public class SetProcessor extends ProcessorBase implements ProcessorVariant {
50+
@Nullable
51+
private final String copyFrom;
52+
5053
private final String field;
5154

55+
@Nullable
56+
private final Boolean ignoreEmptyValue;
57+
58+
@Nullable
59+
private final String mediaType;
60+
5261
@Nullable
5362
private final Boolean override;
5463

64+
@Nullable
5565
private final JsonData value;
5666

5767
// ---------------------------------------------------------------------------------------------
5868

5969
private SetProcessor(Builder builder) {
6070
super(builder);
6171

72+
this.copyFrom = builder.copyFrom;
6273
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
74+
this.ignoreEmptyValue = builder.ignoreEmptyValue;
75+
this.mediaType = builder.mediaType;
6376
this.override = builder.override;
64-
this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value");
77+
this.value = builder.value;
6578

6679
}
6780

@@ -77,13 +90,37 @@ public Processor.Kind _processorKind() {
7790
return Processor.Kind.Set;
7891
}
7992

93+
/**
94+
* API name: {@code copy_from}
95+
*/
96+
@Nullable
97+
public final String copyFrom() {
98+
return this.copyFrom;
99+
}
100+
80101
/**
81102
* Required - API name: {@code field}
82103
*/
83104
public final String field() {
84105
return this.field;
85106
}
86107

108+
/**
109+
* API name: {@code ignore_empty_value}
110+
*/
111+
@Nullable
112+
public final Boolean ignoreEmptyValue() {
113+
return this.ignoreEmptyValue;
114+
}
115+
116+
/**
117+
* API name: {@code media_type}
118+
*/
119+
@Nullable
120+
public final String mediaType() {
121+
return this.mediaType;
122+
}
123+
87124
/**
88125
* API name: {@code override}
89126
*/
@@ -93,25 +130,44 @@ public final Boolean override() {
93130
}
94131

95132
/**
96-
* Required - API name: {@code value}
133+
* API name: {@code value}
97134
*/
135+
@Nullable
98136
public final JsonData value() {
99137
return this.value;
100138
}
101139

102140
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
103141

104142
super.serializeInternal(generator, mapper);
143+
if (this.copyFrom != null) {
144+
generator.writeKey("copy_from");
145+
generator.write(this.copyFrom);
146+
147+
}
105148
generator.writeKey("field");
106149
generator.write(this.field);
107150

151+
if (this.ignoreEmptyValue != null) {
152+
generator.writeKey("ignore_empty_value");
153+
generator.write(this.ignoreEmptyValue);
154+
155+
}
156+
if (this.mediaType != null) {
157+
generator.writeKey("media_type");
158+
generator.write(this.mediaType);
159+
160+
}
108161
if (this.override != null) {
109162
generator.writeKey("override");
110163
generator.write(this.override);
111164

112165
}
113-
generator.writeKey("value");
114-
this.value.serialize(generator, mapper);
166+
if (this.value != null) {
167+
generator.writeKey("value");
168+
this.value.serialize(generator, mapper);
169+
170+
}
115171

116172
}
117173

@@ -122,13 +178,31 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
122178
*/
123179

124180
public static class Builder extends ProcessorBase.AbstractBuilder<Builder> implements ObjectBuilder<SetProcessor> {
181+
@Nullable
182+
private String copyFrom;
183+
125184
private String field;
126185

186+
@Nullable
187+
private Boolean ignoreEmptyValue;
188+
189+
@Nullable
190+
private String mediaType;
191+
127192
@Nullable
128193
private Boolean override;
129194

195+
@Nullable
130196
private JsonData value;
131197

198+
/**
199+
* API name: {@code copy_from}
200+
*/
201+
public final Builder copyFrom(@Nullable String value) {
202+
this.copyFrom = value;
203+
return this;
204+
}
205+
132206
/**
133207
* Required - API name: {@code field}
134208
*/
@@ -137,6 +211,22 @@ public final Builder field(String value) {
137211
return this;
138212
}
139213

214+
/**
215+
* API name: {@code ignore_empty_value}
216+
*/
217+
public final Builder ignoreEmptyValue(@Nullable Boolean value) {
218+
this.ignoreEmptyValue = value;
219+
return this;
220+
}
221+
222+
/**
223+
* API name: {@code media_type}
224+
*/
225+
public final Builder mediaType(@Nullable String value) {
226+
this.mediaType = value;
227+
return this;
228+
}
229+
140230
/**
141231
* API name: {@code override}
142232
*/
@@ -146,9 +236,9 @@ public final Builder override(@Nullable Boolean value) {
146236
}
147237

148238
/**
149-
* Required - API name: {@code value}
239+
* API name: {@code value}
150240
*/
151-
public final Builder value(JsonData value) {
241+
public final Builder value(@Nullable JsonData value) {
152242
this.value = value;
153243
return this;
154244
}
@@ -181,7 +271,10 @@ public SetProcessor build() {
181271

182272
protected static void setupSetProcessorDeserializer(ObjectDeserializer<SetProcessor.Builder> op) {
183273
ProcessorBase.setupProcessorBaseDeserializer(op);
274+
op.add(Builder::copyFrom, JsonpDeserializer.stringDeserializer(), "copy_from");
184275
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
276+
op.add(Builder::ignoreEmptyValue, JsonpDeserializer.booleanDeserializer(), "ignore_empty_value");
277+
op.add(Builder::mediaType, JsonpDeserializer.stringDeserializer(), "media_type");
185278
op.add(Builder::override, JsonpDeserializer.booleanDeserializer(), "override");
186279
op.add(Builder::value, JsonData._DESERIALIZER, "value");
187280

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/SortProcessor.java‎

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
public class SortProcessor extends ProcessorBase implements ProcessorVariant {
4949
private final String field;
5050

51+
@Nullable
5152
private final SortOrder order;
5253

54+
@Nullable
5355
private final String targetField;
5456

5557
// ---------------------------------------------------------------------------------------------
@@ -58,8 +60,8 @@ private SortProcessor(Builder builder) {
5860
super(builder);
5961

6062
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
61-
this.order = ApiTypeHelper.requireNonNull(builder.order, this, "order");
62-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
63+
this.order = builder.order;
64+
this.targetField = builder.targetField;
6365

6466
}
6567

@@ -83,15 +85,17 @@ public final String field() {
8385
}
8486

8587
/**
86-
* Required - API name: {@code order}
88+
* API name: {@code order}
8789
*/
90+
@Nullable
8891
public final SortOrder order() {
8992
return this.order;
9093
}
9194

9295
/**
93-
* Required - API name: {@code target_field}
96+
* API name: {@code target_field}
9497
*/
98+
@Nullable
9599
public final String targetField() {
96100
return this.targetField;
97101
}
@@ -102,10 +106,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
102106
generator.writeKey("field");
103107
generator.write(this.field);
104108

105-
generator.writeKey("order");
106-
this.order.serialize(generator, mapper);
107-
generator.writeKey("target_field");
108-
generator.write(this.targetField);
109+
if (this.order != null) {
110+
generator.writeKey("order");
111+
this.order.serialize(generator, mapper);
112+
}
113+
if (this.targetField != null) {
114+
generator.writeKey("target_field");
115+
generator.write(this.targetField);
116+
117+
}
109118

110119
}
111120

@@ -118,8 +127,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
118127
public static class Builder extends ProcessorBase.AbstractBuilder<Builder> implements ObjectBuilder<SortProcessor> {
119128
private String field;
120129

130+
@Nullable
121131
private SortOrder order;
122132

133+
@Nullable
123134
private String targetField;
124135

125136
/**
@@ -131,17 +142,17 @@ public final Builder field(String value) {
131142
}
132143

133144
/**
134-
* Required - API name: {@code order}
145+
* API name: {@code order}
135146
*/
136-
public final Builder order(SortOrder value) {
147+
public final Builder order(@Nullable SortOrder value) {
137148
this.order = value;
138149
return this;
139150
}
140151

141152
/**
142-
* Required - API name: {@code target_field}
153+
* API name: {@code target_field}
143154
*/
144-
public final Builder targetField(String value) {
155+
public final Builder targetField(@Nullable String value) {
145156
this.targetField = value;
146157
return this;
147158
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/UserAgentProcessor.java‎

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@
5050
public class UserAgentProcessor extends ProcessorBase implements ProcessorVariant {
5151
private final String field;
5252

53-
private final boolean ignoreMissing;
53+
@Nullable
54+
private final Boolean ignoreMissing;
5455

5556
private final List<UserAgentProperty> options;
5657

58+
@Nullable
5759
private final String regexFile;
5860

61+
@Nullable
5962
private final String targetField;
6063

6164
// ---------------------------------------------------------------------------------------------
@@ -64,10 +67,10 @@ private UserAgentProcessor(Builder builder) {
6467
super(builder);
6568

6669
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
67-
this.ignoreMissing = ApiTypeHelper.requireNonNull(builder.ignoreMissing, this, "ignoreMissing");
68-
this.options = ApiTypeHelper.unmodifiableRequired(builder.options, this, "options");
69-
this.regexFile = ApiTypeHelper.requireNonNull(builder.regexFile, this, "regexFile");
70-
this.targetField = ApiTypeHelper.requireNonNull(builder.targetField, this, "targetField");
70+
this.ignoreMissing = builder.ignoreMissing;
71+
this.options = ApiTypeHelper.unmodifiable(builder.options);
72+
this.regexFile = builder.regexFile;
73+
this.targetField = builder.targetField;
7174

7275
}
7376

@@ -91,29 +94,32 @@ public final String field() {
9194
}
9295

9396
/**
94-
* Required - API name: {@code ignore_missing}
97+
* API name: {@code ignore_missing}
9598
*/
96-
public final boolean ignoreMissing() {
99+
@Nullable
100+
public final Boolean ignoreMissing() {
97101
return this.ignoreMissing;
98102
}
99103

100104
/**
101-
* Required - API name: {@code options}
105+
* API name: {@code options}
102106
*/
103107
public final List<UserAgentProperty> options() {
104108
return this.options;
105109
}
106110

107111
/**
108-
* Required - API name: {@code regex_file}
112+
* API name: {@code regex_file}
109113
*/
114+
@Nullable
110115
public final String regexFile() {
111116
return this.regexFile;
112117
}
113118

114119
/**
115-
* Required - API name: {@code target_field}
120+
* API name: {@code target_field}
116121
*/
122+
@Nullable
117123
public final String targetField() {
118124
return this.targetField;
119125
}
@@ -124,9 +130,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
124130
generator.writeKey("field");
125131
generator.write(this.field);
126132

127-
generator.writeKey("ignore_missing");
128-
generator.write(this.ignoreMissing);
133+
if (this.ignoreMissing != null) {
134+
generator.writeKey("ignore_missing");
135+
generator.write(this.ignoreMissing);
129136

137+
}
130138
if (ApiTypeHelper.isDefined(this.options)) {
131139
generator.writeKey("options");
132140
generator.writeStartArray();
@@ -136,11 +144,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
136144
generator.writeEnd();
137145

138146
}
139-
generator.writeKey("regex_file");
140-
generator.write(this.regexFile);
147+
if (this.regexFile != null) {
148+
generator.writeKey("regex_file");
149+
generator.write(this.regexFile);
150+
151+
}
152+
if (this.targetField != null) {
153+
generator.writeKey("target_field");
154+
generator.write(this.targetField);
141155

142-
generator.writeKey("target_field");
143-
generator.write(this.targetField);
156+
}
144157

145158
}
146159

@@ -155,12 +168,16 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
155168
ObjectBuilder<UserAgentProcessor> {
156169
private String field;
157170

171+
@Nullable
158172
private Boolean ignoreMissing;
159173

174+
@Nullable
160175
private List<UserAgentProperty> options;
161176

177+
@Nullable
162178
private String regexFile;
163179

180+
@Nullable
164181
private String targetField;
165182

166183
/**
@@ -172,15 +189,15 @@ public final Builder field(String value) {
172189
}
173190

174191
/**
175-
* Required - API name: {@code ignore_missing}
192+
* API name: {@code ignore_missing}
176193
*/
177-
public final Builder ignoreMissing(boolean value) {
194+
public final Builder ignoreMissing(@Nullable Boolean value) {
178195
this.ignoreMissing = value;
179196
return this;
180197
}
181198

182199
/**
183-
* Required - API name: {@code options}
200+
* API name: {@code options}
184201
* <p>
185202
* Adds all elements of <code>list</code> to <code>options</code>.
186203
*/
@@ -190,7 +207,7 @@ public final Builder options(List<UserAgentProperty> list) {
190207
}
191208

192209
/**
193-
* Required - API name: {@code options}
210+
* API name: {@code options}
194211
* <p>
195212
* Adds one or more values to <code>options</code>.
196213
*/
@@ -200,17 +217,17 @@ public final Builder options(UserAgentProperty value, UserAgentProperty... value
200217
}
201218

202219
/**
203-
* Required - API name: {@code regex_file}
220+
* API name: {@code regex_file}
204221
*/
205-
public final Builder regexFile(String value) {
222+
public final Builder regexFile(@Nullable String value) {
206223
this.regexFile = value;
207224
return this;
208225
}
209226

210227
/**
211-
* Required - API name: {@code target_field}
228+
* API name: {@code target_field}
212229
*/
213-
public final Builder targetField(String value) {
230+
public final Builder targetField(@Nullable String value) {
214231
this.targetField = value;
215232
return this;
216233
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/security/FieldSecurity.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class FieldSecurity implements JsonpSerializable {
5858
private FieldSecurity(Builder builder) {
5959

6060
this.except = ApiTypeHelper.unmodifiable(builder.except);
61-
this.grant = ApiTypeHelper.unmodifiableRequired(builder.grant, this, "grant");
61+
this.grant = ApiTypeHelper.unmodifiable(builder.grant);
6262

6363
}
6464

@@ -74,7 +74,7 @@ public final List<String> except() {
7474
}
7575

7676
/**
77-
* Required - API name: {@code grant}
77+
* API name: {@code grant}
7878
*/
7979
public final List<String> grant() {
8080
return this.grant;
@@ -129,6 +129,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
129129
@Nullable
130130
private List<String> except;
131131

132+
@Nullable
132133
private List<String> grant;
133134

134135
/**
@@ -152,7 +153,7 @@ public final Builder except(String value, String... values) {
152153
}
153154

154155
/**
155-
* Required - API name: {@code grant}
156+
* API name: {@code grant}
156157
* <p>
157158
* Adds all elements of <code>list</code> to <code>grant</code>.
158159
*/
@@ -162,7 +163,7 @@ public final Builder grant(List<String> list) {
162163
}
163164

164165
/**
165-
* Required - API name: {@code grant}
166+
* API name: {@code grant}
166167
* <p>
167168
* Adds one or more values to <code>grant</code>.
168169
*/

‎java-client/src/main/java/co/elastic/clients/elasticsearch/security/GetUserPrivilegesResponse.java‎

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class GetUserPrivilegesResponse implements JsonpSerializable {
5656

5757
private final List<GlobalPrivilege> global;
5858

59-
private final List<IndicesPrivileges> indices;
59+
private final List<UserIndicesPrivileges> indices;
6060

6161
private final List<String> runAs;
6262

@@ -98,13 +98,9 @@ public final List<GlobalPrivilege> global() {
9898
}
9999

100100
/**
101-
* Required - In this context <code>IndicesPrivileges.query</code> property can
102-
* only be a string, see <code>IndicesPrivileges</code> documentation for
103-
* detail.
104-
* <p>
105-
* API name: {@code indices}
101+
* Required - API name: {@code indices}
106102
*/
107-
public final List<IndicesPrivileges> indices() {
103+
public final List<UserIndicesPrivileges> indices() {
108104
return this.indices;
109105
}
110106

@@ -159,7 +155,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
159155
if (ApiTypeHelper.isDefined(this.indices)) {
160156
generator.writeKey("indices");
161157
generator.writeStartArray();
162-
for (IndicesPrivileges item0 : this.indices) {
158+
for (UserIndicesPrivileges item0 : this.indices) {
163159
item0.serialize(generator, mapper);
164160

165161
}
@@ -199,7 +195,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
199195

200196
private List<GlobalPrivilege> global;
201197

202-
private List<IndicesPrivileges> indices;
198+
private List<UserIndicesPrivileges> indices;
203199

204200
private List<String> runAs;
205201

@@ -283,44 +279,32 @@ public final Builder global(Function<GlobalPrivilege.Builder, ObjectBuilder<Glob
283279
}
284280

285281
/**
286-
* Required - In this context <code>IndicesPrivileges.query</code> property can
287-
* only be a string, see <code>IndicesPrivileges</code> documentation for
288-
* detail.
289-
* <p>
290-
* API name: {@code indices}
282+
* Required - API name: {@code indices}
291283
* <p>
292284
* Adds all elements of <code>list</code> to <code>indices</code>.
293285
*/
294-
public final Builder indices(List<IndicesPrivileges> list) {
286+
public final Builder indices(List<UserIndicesPrivileges> list) {
295287
this.indices = _listAddAll(this.indices, list);
296288
return this;
297289
}
298290

299291
/**
300-
* Required - In this context <code>IndicesPrivileges.query</code> property can
301-
* only be a string, see <code>IndicesPrivileges</code> documentation for
302-
* detail.
303-
* <p>
304-
* API name: {@code indices}
292+
* Required - API name: {@code indices}
305293
* <p>
306294
* Adds one or more values to <code>indices</code>.
307295
*/
308-
public final Builder indices(IndicesPrivileges value, IndicesPrivileges... values) {
296+
public final Builder indices(UserIndicesPrivileges value, UserIndicesPrivileges... values) {
309297
this.indices = _listAdd(this.indices, value, values);
310298
return this;
311299
}
312300

313301
/**
314-
* Required - In this context <code>IndicesPrivileges.query</code> property can
315-
* only be a string, see <code>IndicesPrivileges</code> documentation for
316-
* detail.
317-
* <p>
318-
* API name: {@code indices}
302+
* Required - API name: {@code indices}
319303
* <p>
320304
* Adds a value to <code>indices</code> using a builder lambda.
321305
*/
322-
public final Builder indices(Function<IndicesPrivileges.Builder, ObjectBuilder<IndicesPrivileges>> fn) {
323-
return indices(fn.apply(new IndicesPrivileges.Builder()).build());
306+
public final Builder indices(Function<UserIndicesPrivileges.Builder, ObjectBuilder<UserIndicesPrivileges>> fn) {
307+
return indices(fn.apply(new UserIndicesPrivileges.Builder()).build());
324308
}
325309

326310
/**
@@ -377,7 +361,7 @@ protected static void setupGetUserPrivilegesResponseDeserializer(
377361
op.add(Builder::cluster, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()),
378362
"cluster");
379363
op.add(Builder::global, JsonpDeserializer.arrayDeserializer(GlobalPrivilege._DESERIALIZER), "global");
380-
op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(IndicesPrivileges._DESERIALIZER), "indices");
364+
op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(UserIndicesPrivileges._DESERIALIZER), "indices");
381365
op.add(Builder::runAs, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "run_as");
382366

383367
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ public final List<IndexPrivilege> privileges() {
110110
}
111111

112112
/**
113-
* A search query that defines the documents the owners of the role have read
114-
* access to. A document within the specified indices must match this query for
115-
* it to be accessible by the owners of the role.
113+
* A search query that defines the documents the owners of the role have access
114+
* to. A document within the specified indices must match this query for it to
115+
* be accessible by the owners of the role. Use a custom query of type
116+
* (<code>&quot;template&quot;</code>, <code>RoleTemplateScript</code>) for
117+
* templated queries
116118
* <p>
117119
* API name: {@code query}
118120
*/
@@ -178,7 +180,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
178180
}
179181
if (this.query != null) {
180182
generator.writeKey("query");
181-
this.query.serialize(generator, mapper);
183+
generator.write(JsonpUtils.toJsonString(this.query, mapper));
182184

183185
}
184186
if (this.allowRestrictedIndices != null) {
@@ -302,9 +304,11 @@ public final Builder privileges(IndexPrivilege value, IndexPrivilege... values)
302304
}
303305

304306
/**
305-
* A search query that defines the documents the owners of the role have read
306-
* access to. A document within the specified indices must match this query for
307-
* it to be accessible by the owners of the role.
307+
* A search query that defines the documents the owners of the role have access
308+
* to. A document within the specified indices must match this query for it to
309+
* be accessible by the owners of the role. Use a custom query of type
310+
* (<code>&quot;template&quot;</code>, <code>RoleTemplateScript</code>) for
311+
* templated queries
308312
* <p>
309313
* API name: {@code query}
310314
*/
@@ -314,9 +318,11 @@ public final Builder query(@Nullable Query value) {
314318
}
315319

316320
/**
317-
* A search query that defines the documents the owners of the role have read
318-
* access to. A document within the specified indices must match this query for
319-
* it to be accessible by the owners of the role.
321+
* A search query that defines the documents the owners of the role have access
322+
* to. A document within the specified indices must match this query for it to
323+
* be accessible by the owners of the role. Use a custom query of type
324+
* (<code>&quot;template&quot;</code>, <code>RoleTemplateScript</code>) for
325+
* templated queries
320326
* <p>
321327
* API name: {@code query}
322328
*/
@@ -371,7 +377,7 @@ protected static void setupIndicesPrivilegesDeserializer(ObjectDeserializer<Indi
371377
"field_security");
372378
op.add(Builder::names, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "names");
373379
op.add(Builder::privileges, JsonpDeserializer.arrayDeserializer(IndexPrivilege._DESERIALIZER), "privileges");
374-
op.add(Builder::query, Query._DESERIALIZER, "query");
380+
op.add(Builder::query, JsonpDeserializer.jsonString(Query._DESERIALIZER), "query");
375381
op.add(Builder::allowRestrictedIndices, JsonpDeserializer.booleanDeserializer(), "allow_restricted_indices");
376382

377383
}
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.security;
25+
26+
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
27+
import co.elastic.clients.json.JsonpDeserializable;
28+
import co.elastic.clients.json.JsonpDeserializer;
29+
import co.elastic.clients.json.JsonpMapper;
30+
import co.elastic.clients.json.JsonpSerializable;
31+
import co.elastic.clients.json.JsonpUtils;
32+
import co.elastic.clients.json.ObjectDeserializer;
33+
import co.elastic.clients.json.UnionDeserializer;
34+
import co.elastic.clients.util.ApiTypeHelper;
35+
import co.elastic.clients.util.ObjectBuilder;
36+
import co.elastic.clients.util.ObjectBuilderBase;
37+
import co.elastic.clients.util.TaggedUnion;
38+
import co.elastic.clients.util.TaggedUnionUtils;
39+
import jakarta.json.stream.JsonGenerator;
40+
import java.lang.Object;
41+
import java.lang.String;
42+
import java.util.Objects;
43+
import java.util.function.Function;
44+
import javax.annotation.Nullable;
45+
46+
// typedef: security._types.RoleTemplateInlineQuery
47+
48+
/**
49+
*
50+
* @see <a href=
51+
* "../doc-files/api-spec.html#security._types.RoleTemplateInlineQuery">API
52+
* specification</a>
53+
*/
54+
@JsonpDeserializable
55+
public class RoleTemplateInlineQuery implements TaggedUnion<RoleTemplateInlineQuery.Kind, Object>, JsonpSerializable {
56+
57+
public enum Kind {
58+
QueryObject, QueryString
59+
60+
}
61+
62+
private final Kind _kind;
63+
private final Object _value;
64+
65+
@Override
66+
public final Kind _kind() {
67+
return _kind;
68+
}
69+
70+
@Override
71+
public final Object _get() {
72+
return _value;
73+
}
74+
75+
private RoleTemplateInlineQuery(Kind kind, Object value) {
76+
this._kind = kind;
77+
this._value = value;
78+
}
79+
80+
private RoleTemplateInlineQuery(Builder builder) {
81+
82+
this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "<variant kind>");
83+
this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "<variant value>");
84+
85+
}
86+
87+
public static RoleTemplateInlineQuery of(Function<Builder, ObjectBuilder<RoleTemplateInlineQuery>> fn) {
88+
return fn.apply(new Builder()).build();
89+
}
90+
91+
/**
92+
* Is this variant instance of kind {@code query_object}?
93+
*/
94+
public boolean isQueryObject() {
95+
return _kind == Kind.QueryObject;
96+
}
97+
98+
/**
99+
* Get the {@code query_object} variant value.
100+
*
101+
* @throws IllegalStateException
102+
* if the current variant is not of the {@code query_object} kind.
103+
*/
104+
public Query queryObject() {
105+
return TaggedUnionUtils.get(this, Kind.QueryObject);
106+
}
107+
108+
/**
109+
* Is this variant instance of kind {@code query_string}?
110+
*/
111+
public boolean isQueryString() {
112+
return _kind == Kind.QueryString;
113+
}
114+
115+
/**
116+
* Get the {@code query_string} variant value.
117+
*
118+
* @throws IllegalStateException
119+
* if the current variant is not of the {@code query_string} kind.
120+
*/
121+
public String queryString() {
122+
return TaggedUnionUtils.get(this, Kind.QueryString);
123+
}
124+
125+
@Override
126+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
127+
if (_value instanceof JsonpSerializable) {
128+
((JsonpSerializable) _value).serialize(generator, mapper);
129+
} else {
130+
switch (_kind) {
131+
case QueryString :
132+
generator.write(((String) this._value));
133+
134+
break;
135+
}
136+
}
137+
138+
}
139+
140+
@Override
141+
public String toString() {
142+
return JsonpUtils.toString(this);
143+
}
144+
145+
public static class Builder extends ObjectBuilderBase implements ObjectBuilder<RoleTemplateInlineQuery> {
146+
private Kind _kind;
147+
private Object _value;
148+
149+
public ObjectBuilder<RoleTemplateInlineQuery> queryObject(Query v) {
150+
this._kind = Kind.QueryObject;
151+
this._value = v;
152+
return this;
153+
}
154+
155+
public ObjectBuilder<RoleTemplateInlineQuery> queryObject(Function<Query.Builder, ObjectBuilder<Query>> fn) {
156+
return this.queryObject(fn.apply(new Query.Builder()).build());
157+
}
158+
159+
public ObjectBuilder<RoleTemplateInlineQuery> queryString(String v) {
160+
this._kind = Kind.QueryString;
161+
this._value = v;
162+
return this;
163+
}
164+
165+
public RoleTemplateInlineQuery build() {
166+
_checkSingleUse();
167+
return new RoleTemplateInlineQuery(this);
168+
}
169+
170+
}
171+
172+
private static JsonpDeserializer<RoleTemplateInlineQuery> buildRoleTemplateInlineQueryDeserializer() {
173+
return new UnionDeserializer.Builder<RoleTemplateInlineQuery, Kind, Object>(RoleTemplateInlineQuery::new, false)
174+
.addMember(Kind.QueryObject, Query._DESERIALIZER)
175+
.addMember(Kind.QueryString, JsonpDeserializer.stringDeserializer()).build();
176+
}
177+
178+
public static final JsonpDeserializer<RoleTemplateInlineQuery> _DESERIALIZER = JsonpDeserializer
179+
.lazy(RoleTemplateInlineQuery::buildRoleTemplateInlineQueryDeserializer);
180+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.security;
25+
26+
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
27+
import co.elastic.clients.util.ObjectBuilder;
28+
import java.util.function.Function;
29+
30+
/**
31+
* Builders for {@link RoleTemplateInlineQuery} variants.
32+
* <p>
33+
* Variants <code>query_string</code> are not available here as they don't have
34+
* a dedicated class. Use {@link RoleTemplateInlineQuery}'s builder for these.
35+
*
36+
*/
37+
public class RoleTemplateInlineQueryBuilders {
38+
private RoleTemplateInlineQueryBuilders() {
39+
}
40+
41+
/**
42+
* Creates a builder for the {@link Query query_object}
43+
* {@code RoleTemplateInlineQuery} variant.
44+
*/
45+
public static Query.Builder queryObject() {
46+
return new Query.Builder();
47+
}
48+
49+
}
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.security;
25+
26+
import co.elastic.clients.elasticsearch._types.ScriptBase;
27+
import co.elastic.clients.elasticsearch._types.ScriptLanguage;
28+
import co.elastic.clients.json.JsonpDeserializable;
29+
import co.elastic.clients.json.JsonpDeserializer;
30+
import co.elastic.clients.json.JsonpMapper;
31+
import co.elastic.clients.json.ObjectBuilderDeserializer;
32+
import co.elastic.clients.json.ObjectDeserializer;
33+
import co.elastic.clients.util.ApiTypeHelper;
34+
import co.elastic.clients.util.ObjectBuilder;
35+
import jakarta.json.stream.JsonGenerator;
36+
import java.lang.String;
37+
import java.util.Map;
38+
import java.util.Objects;
39+
import java.util.function.Function;
40+
import javax.annotation.Nullable;
41+
42+
// typedef: security._types.RoleTemplateInlineScript
43+
44+
/**
45+
*
46+
* @see <a href=
47+
* "../doc-files/api-spec.html#security._types.RoleTemplateInlineScript">API
48+
* specification</a>
49+
*/
50+
@JsonpDeserializable
51+
public class RoleTemplateInlineScript extends ScriptBase {
52+
@Nullable
53+
private final String lang;
54+
55+
private final Map<String, String> options;
56+
57+
private final RoleTemplateInlineQuery source;
58+
59+
// ---------------------------------------------------------------------------------------------
60+
61+
private RoleTemplateInlineScript(Builder builder) {
62+
super(builder);
63+
64+
this.lang = builder.lang;
65+
this.options = ApiTypeHelper.unmodifiable(builder.options);
66+
this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source");
67+
68+
}
69+
70+
public static RoleTemplateInlineScript of(Function<Builder, ObjectBuilder<RoleTemplateInlineScript>> fn) {
71+
return fn.apply(new Builder()).build();
72+
}
73+
74+
/**
75+
* API name: {@code lang}
76+
*/
77+
@Nullable
78+
public final String lang() {
79+
return this.lang;
80+
}
81+
82+
/**
83+
* API name: {@code options}
84+
*/
85+
public final Map<String, String> options() {
86+
return this.options;
87+
}
88+
89+
/**
90+
* Required - API name: {@code source}
91+
*/
92+
public final RoleTemplateInlineQuery source() {
93+
return this.source;
94+
}
95+
96+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
97+
98+
super.serializeInternal(generator, mapper);
99+
if (this.lang != null) {
100+
generator.writeKey("lang");
101+
generator.write(this.lang);
102+
103+
}
104+
if (ApiTypeHelper.isDefined(this.options)) {
105+
generator.writeKey("options");
106+
generator.writeStartObject();
107+
for (Map.Entry<String, String> item0 : this.options.entrySet()) {
108+
generator.writeKey(item0.getKey());
109+
generator.write(item0.getValue());
110+
111+
}
112+
generator.writeEnd();
113+
114+
}
115+
generator.writeKey("source");
116+
this.source.serialize(generator, mapper);
117+
118+
}
119+
120+
// ---------------------------------------------------------------------------------------------
121+
122+
/**
123+
* Builder for {@link RoleTemplateInlineScript}.
124+
*/
125+
126+
public static class Builder extends ScriptBase.AbstractBuilder<Builder>
127+
implements
128+
ObjectBuilder<RoleTemplateInlineScript> {
129+
@Nullable
130+
private String lang;
131+
132+
@Nullable
133+
private Map<String, String> options;
134+
135+
private RoleTemplateInlineQuery source;
136+
137+
/**
138+
* API name: {@code lang}
139+
*/
140+
public final Builder lang(@Nullable String value) {
141+
this.lang = value;
142+
return this;
143+
}
144+
145+
/**
146+
* API name: {@code lang}
147+
*/
148+
public final Builder lang(@Nullable ScriptLanguage value) {
149+
this.lang = value == null ? null : value.jsonValue();
150+
return this;
151+
}
152+
153+
/**
154+
* API name: {@code options}
155+
* <p>
156+
* Adds all entries of <code>map</code> to <code>options</code>.
157+
*/
158+
public final Builder options(Map<String, String> map) {
159+
this.options = _mapPutAll(this.options, map);
160+
return this;
161+
}
162+
163+
/**
164+
* API name: {@code options}
165+
* <p>
166+
* Adds an entry to <code>options</code>.
167+
*/
168+
public final Builder options(String key, String value) {
169+
this.options = _mapPut(this.options, key, value);
170+
return this;
171+
}
172+
173+
/**
174+
* Required - API name: {@code source}
175+
*/
176+
public final Builder source(RoleTemplateInlineQuery value) {
177+
this.source = value;
178+
return this;
179+
}
180+
181+
/**
182+
* Required - API name: {@code source}
183+
*/
184+
public final Builder source(
185+
Function<RoleTemplateInlineQuery.Builder, ObjectBuilder<RoleTemplateInlineQuery>> fn) {
186+
return this.source(fn.apply(new RoleTemplateInlineQuery.Builder()).build());
187+
}
188+
189+
@Override
190+
protected Builder self() {
191+
return this;
192+
}
193+
194+
/**
195+
* Builds a {@link RoleTemplateInlineScript}.
196+
*
197+
* @throws NullPointerException
198+
* if some of the required fields are null.
199+
*/
200+
public RoleTemplateInlineScript build() {
201+
_checkSingleUse();
202+
203+
return new RoleTemplateInlineScript(this);
204+
}
205+
}
206+
207+
// ---------------------------------------------------------------------------------------------
208+
209+
/**
210+
* Json deserializer for {@link RoleTemplateInlineScript}
211+
*/
212+
public static final JsonpDeserializer<RoleTemplateInlineScript> _DESERIALIZER = ObjectBuilderDeserializer
213+
.lazy(Builder::new, RoleTemplateInlineScript::setupRoleTemplateInlineScriptDeserializer);
214+
215+
protected static void setupRoleTemplateInlineScriptDeserializer(
216+
ObjectDeserializer<RoleTemplateInlineScript.Builder> op) {
217+
ScriptBase.setupScriptBaseDeserializer(op);
218+
op.add(Builder::lang, JsonpDeserializer.stringDeserializer(), "lang");
219+
op.add(Builder::options, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()),
220+
"options");
221+
op.add(Builder::source, RoleTemplateInlineQuery._DESERIALIZER, "source");
222+
223+
op.shortcutProperty("source");
224+
225+
}
226+
227+
}
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.security;
25+
26+
import co.elastic.clients.elasticsearch._types.StoredScriptId;
27+
import co.elastic.clients.json.JsonpDeserializable;
28+
import co.elastic.clients.json.JsonpDeserializer;
29+
import co.elastic.clients.json.JsonpMapper;
30+
import co.elastic.clients.json.JsonpSerializable;
31+
import co.elastic.clients.json.JsonpUtils;
32+
import co.elastic.clients.json.ObjectDeserializer;
33+
import co.elastic.clients.json.UnionDeserializer;
34+
import co.elastic.clients.util.ApiTypeHelper;
35+
import co.elastic.clients.util.ObjectBuilder;
36+
import co.elastic.clients.util.ObjectBuilderBase;
37+
import co.elastic.clients.util.TaggedUnion;
38+
import co.elastic.clients.util.TaggedUnionUtils;
39+
import jakarta.json.stream.JsonGenerator;
40+
import java.lang.Object;
41+
import java.util.Objects;
42+
import java.util.function.Function;
43+
import javax.annotation.Nullable;
44+
45+
// typedef: security._types.RoleTemplateScript
46+
47+
/**
48+
*
49+
* @see <a href=
50+
* "../doc-files/api-spec.html#security._types.RoleTemplateScript">API
51+
* specification</a>
52+
*/
53+
@JsonpDeserializable
54+
public class RoleTemplateScript implements TaggedUnion<RoleTemplateScript.Kind, Object>, JsonpSerializable {
55+
56+
public enum Kind {
57+
Stored, Inline
58+
59+
}
60+
61+
private final Kind _kind;
62+
private final Object _value;
63+
64+
@Override
65+
public final Kind _kind() {
66+
return _kind;
67+
}
68+
69+
@Override
70+
public final Object _get() {
71+
return _value;
72+
}
73+
74+
private RoleTemplateScript(Kind kind, Object value) {
75+
this._kind = kind;
76+
this._value = value;
77+
}
78+
79+
private RoleTemplateScript(Builder builder) {
80+
81+
this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "<variant kind>");
82+
this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "<variant value>");
83+
84+
}
85+
86+
public static RoleTemplateScript of(Function<Builder, ObjectBuilder<RoleTemplateScript>> fn) {
87+
return fn.apply(new Builder()).build();
88+
}
89+
90+
/**
91+
* Is this variant instance of kind {@code stored}?
92+
*/
93+
public boolean isStored() {
94+
return _kind == Kind.Stored;
95+
}
96+
97+
/**
98+
* Get the {@code stored} variant value.
99+
*
100+
* @throws IllegalStateException
101+
* if the current variant is not of the {@code stored} kind.
102+
*/
103+
public StoredScriptId stored() {
104+
return TaggedUnionUtils.get(this, Kind.Stored);
105+
}
106+
107+
/**
108+
* Is this variant instance of kind {@code inline}?
109+
*/
110+
public boolean isInline() {
111+
return _kind == Kind.Inline;
112+
}
113+
114+
/**
115+
* Get the {@code inline} variant value.
116+
*
117+
* @throws IllegalStateException
118+
* if the current variant is not of the {@code inline} kind.
119+
*/
120+
public RoleTemplateInlineScript inline() {
121+
return TaggedUnionUtils.get(this, Kind.Inline);
122+
}
123+
124+
@Override
125+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
126+
if (_value instanceof JsonpSerializable) {
127+
((JsonpSerializable) _value).serialize(generator, mapper);
128+
}
129+
130+
}
131+
132+
@Override
133+
public String toString() {
134+
return JsonpUtils.toString(this);
135+
}
136+
137+
public static class Builder extends ObjectBuilderBase implements ObjectBuilder<RoleTemplateScript> {
138+
private Kind _kind;
139+
private Object _value;
140+
141+
public ObjectBuilder<RoleTemplateScript> stored(StoredScriptId v) {
142+
this._kind = Kind.Stored;
143+
this._value = v;
144+
return this;
145+
}
146+
147+
public ObjectBuilder<RoleTemplateScript> stored(
148+
Function<StoredScriptId.Builder, ObjectBuilder<StoredScriptId>> fn) {
149+
return this.stored(fn.apply(new StoredScriptId.Builder()).build());
150+
}
151+
152+
public ObjectBuilder<RoleTemplateScript> inline(RoleTemplateInlineScript v) {
153+
this._kind = Kind.Inline;
154+
this._value = v;
155+
return this;
156+
}
157+
158+
public ObjectBuilder<RoleTemplateScript> inline(
159+
Function<RoleTemplateInlineScript.Builder, ObjectBuilder<RoleTemplateInlineScript>> fn) {
160+
return this.inline(fn.apply(new RoleTemplateInlineScript.Builder()).build());
161+
}
162+
163+
public RoleTemplateScript build() {
164+
_checkSingleUse();
165+
return new RoleTemplateScript(this);
166+
}
167+
168+
}
169+
170+
private static JsonpDeserializer<RoleTemplateScript> buildRoleTemplateScriptDeserializer() {
171+
return new UnionDeserializer.Builder<RoleTemplateScript, Kind, Object>(RoleTemplateScript::new, false)
172+
.addMember(Kind.Stored, StoredScriptId._DESERIALIZER)
173+
.addMember(Kind.Inline, RoleTemplateInlineScript._DESERIALIZER).build();
174+
}
175+
176+
public static final JsonpDeserializer<RoleTemplateScript> _DESERIALIZER = JsonpDeserializer
177+
.lazy(RoleTemplateScript::buildRoleTemplateScriptDeserializer);
178+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch.security;
25+
26+
import co.elastic.clients.elasticsearch._types.StoredScriptId;
27+
import co.elastic.clients.util.ObjectBuilder;
28+
import java.util.function.Function;
29+
30+
/**
31+
* Builders for {@link RoleTemplateScript} variants.
32+
*/
33+
public class RoleTemplateScriptBuilders {
34+
private RoleTemplateScriptBuilders() {
35+
}
36+
37+
/**
38+
* Creates a builder for the {@link StoredScriptId stored}
39+
* {@code RoleTemplateScript} variant.
40+
*/
41+
public static StoredScriptId.Builder stored() {
42+
return new StoredScriptId.Builder();
43+
}
44+
45+
/**
46+
* Creates a builder for the {@link RoleTemplateInlineScript inline}
47+
* {@code RoleTemplateScript} variant.
48+
*/
49+
public static RoleTemplateInlineScript.Builder inline() {
50+
return new RoleTemplateInlineScript.Builder();
51+
}
52+
53+
}

‎java-client/src/main/java/co/elastic/clients/elasticsearch/security/UserIndicesPrivileges.java‎

Lines changed: 406 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.