Skip to content

Commit 1fae3ca

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove support for namespace_filters.include/exclude_all in v2 AWS Integrations API (#2578)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4830f1f commit 1fae3ca

File tree

34 files changed

+64
-511
lines changed

34 files changed

+64
-511
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-11-25 11:57:20.882330",
8-
"spec_repo_commit": "80b43a3b"
7+
"regenerated": "2024-11-25 17:55:59.723742",
8+
"spec_repo_commit": "3cfd102e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-25 11:57:20.901354",
13-
"spec_repo_commit": "80b43a3b"
12+
"regenerated": "2024-11-25 17:55:59.742591",
13+
"spec_repo_commit": "3cfd102e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,19 +1320,8 @@ components:
13201320
AWSNamespaceFilters:
13211321
description: AWS Metrics namespace filters
13221322
oneOf:
1323-
- $ref: '#/components/schemas/AWSNamespaceFiltersExcludeAll'
13241323
- $ref: '#/components/schemas/AWSNamespaceFiltersExcludeOnly'
1325-
- $ref: '#/components/schemas/AWSNamespaceFiltersIncludeAll'
13261324
- $ref: '#/components/schemas/AWSNamespaceFiltersIncludeOnly'
1327-
AWSNamespaceFiltersExcludeAll:
1328-
description: Exclude all namespaces
1329-
properties:
1330-
exclude_all:
1331-
description: Exclude all namespaces
1332-
example: false
1333-
type: boolean
1334-
required:
1335-
- exclude_all
13361325
AWSNamespaceFiltersExcludeOnly:
13371326
description: Exclude only these namespaces
13381327
properties:
@@ -1346,15 +1335,6 @@ components:
13461335
type: array
13471336
required:
13481337
- exclude_only
1349-
AWSNamespaceFiltersIncludeAll:
1350-
description: Include all namespaces
1351-
properties:
1352-
include_all:
1353-
description: Include all namespaces
1354-
example: false
1355-
type: boolean
1356-
required:
1357-
- include_all
13581338
AWSNamespaceFiltersIncludeOnly:
13591339
description: Include only these namespaces
13601340
properties:

src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFilters.java

Lines changed: 5 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -78,51 +78,6 @@ public AWSNamespaceFilters deserialize(JsonParser jp, DeserializationContext ctx
7878
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
7979
int match = 0;
8080
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
81-
// deserialize AWSNamespaceFiltersExcludeAll
82-
try {
83-
boolean attemptParsing = true;
84-
// ensure that we respect type coercion as set on the client ObjectMapper
85-
if (AWSNamespaceFiltersExcludeAll.class.equals(Integer.class)
86-
|| AWSNamespaceFiltersExcludeAll.class.equals(Long.class)
87-
|| AWSNamespaceFiltersExcludeAll.class.equals(Float.class)
88-
|| AWSNamespaceFiltersExcludeAll.class.equals(Double.class)
89-
|| AWSNamespaceFiltersExcludeAll.class.equals(Boolean.class)
90-
|| AWSNamespaceFiltersExcludeAll.class.equals(String.class)) {
91-
attemptParsing = typeCoercion;
92-
if (!attemptParsing) {
93-
attemptParsing |=
94-
((AWSNamespaceFiltersExcludeAll.class.equals(Integer.class)
95-
|| AWSNamespaceFiltersExcludeAll.class.equals(Long.class))
96-
&& token == JsonToken.VALUE_NUMBER_INT);
97-
attemptParsing |=
98-
((AWSNamespaceFiltersExcludeAll.class.equals(Float.class)
99-
|| AWSNamespaceFiltersExcludeAll.class.equals(Double.class))
100-
&& (token == JsonToken.VALUE_NUMBER_FLOAT
101-
|| token == JsonToken.VALUE_NUMBER_INT));
102-
attemptParsing |=
103-
(AWSNamespaceFiltersExcludeAll.class.equals(Boolean.class)
104-
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
105-
attemptParsing |=
106-
(AWSNamespaceFiltersExcludeAll.class.equals(String.class)
107-
&& token == JsonToken.VALUE_STRING);
108-
}
109-
}
110-
if (attemptParsing) {
111-
tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersExcludeAll.class);
112-
// TODO: there is no validation against JSON schema constraints
113-
// (min, max, enum, pattern...), this does not perform a strict JSON
114-
// validation, which means the 'match' count may be higher than it should be.
115-
if (!((AWSNamespaceFiltersExcludeAll) tmp).unparsed) {
116-
deserialized = tmp;
117-
match++;
118-
}
119-
log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersExcludeAll'");
120-
}
121-
} catch (Exception e) {
122-
// deserialization failed, continue
123-
log.log(Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersExcludeAll'", e);
124-
}
125-
12681
// deserialize AWSNamespaceFiltersExcludeOnly
12782
try {
12883
boolean attemptParsing = true;
@@ -169,51 +124,6 @@ public AWSNamespaceFilters deserialize(JsonParser jp, DeserializationContext ctx
169124
Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersExcludeOnly'", e);
170125
}
171126

172-
// deserialize AWSNamespaceFiltersIncludeAll
173-
try {
174-
boolean attemptParsing = true;
175-
// ensure that we respect type coercion as set on the client ObjectMapper
176-
if (AWSNamespaceFiltersIncludeAll.class.equals(Integer.class)
177-
|| AWSNamespaceFiltersIncludeAll.class.equals(Long.class)
178-
|| AWSNamespaceFiltersIncludeAll.class.equals(Float.class)
179-
|| AWSNamespaceFiltersIncludeAll.class.equals(Double.class)
180-
|| AWSNamespaceFiltersIncludeAll.class.equals(Boolean.class)
181-
|| AWSNamespaceFiltersIncludeAll.class.equals(String.class)) {
182-
attemptParsing = typeCoercion;
183-
if (!attemptParsing) {
184-
attemptParsing |=
185-
((AWSNamespaceFiltersIncludeAll.class.equals(Integer.class)
186-
|| AWSNamespaceFiltersIncludeAll.class.equals(Long.class))
187-
&& token == JsonToken.VALUE_NUMBER_INT);
188-
attemptParsing |=
189-
((AWSNamespaceFiltersIncludeAll.class.equals(Float.class)
190-
|| AWSNamespaceFiltersIncludeAll.class.equals(Double.class))
191-
&& (token == JsonToken.VALUE_NUMBER_FLOAT
192-
|| token == JsonToken.VALUE_NUMBER_INT));
193-
attemptParsing |=
194-
(AWSNamespaceFiltersIncludeAll.class.equals(Boolean.class)
195-
&& (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
196-
attemptParsing |=
197-
(AWSNamespaceFiltersIncludeAll.class.equals(String.class)
198-
&& token == JsonToken.VALUE_STRING);
199-
}
200-
}
201-
if (attemptParsing) {
202-
tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersIncludeAll.class);
203-
// TODO: there is no validation against JSON schema constraints
204-
// (min, max, enum, pattern...), this does not perform a strict JSON
205-
// validation, which means the 'match' count may be higher than it should be.
206-
if (!((AWSNamespaceFiltersIncludeAll) tmp).unparsed) {
207-
deserialized = tmp;
208-
match++;
209-
}
210-
log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersIncludeAll'");
211-
}
212-
} catch (Exception e) {
213-
// deserialization failed, continue
214-
log.log(Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersIncludeAll'", e);
215-
}
216-
217127
// deserialize AWSNamespaceFiltersIncludeOnly
218128
try {
219129
boolean attemptParsing = true;
@@ -289,33 +199,19 @@ public AWSNamespaceFilters() {
289199
super("oneOf", Boolean.FALSE);
290200
}
291201

292-
public AWSNamespaceFilters(AWSNamespaceFiltersExcludeAll o) {
293-
super("oneOf", Boolean.FALSE);
294-
setActualInstance(o);
295-
}
296-
297202
public AWSNamespaceFilters(AWSNamespaceFiltersExcludeOnly o) {
298203
super("oneOf", Boolean.FALSE);
299204
setActualInstance(o);
300205
}
301206

302-
public AWSNamespaceFilters(AWSNamespaceFiltersIncludeAll o) {
303-
super("oneOf", Boolean.FALSE);
304-
setActualInstance(o);
305-
}
306-
307207
public AWSNamespaceFilters(AWSNamespaceFiltersIncludeOnly o) {
308208
super("oneOf", Boolean.FALSE);
309209
setActualInstance(o);
310210
}
311211

312212
static {
313-
schemas.put(
314-
"AWSNamespaceFiltersExcludeAll", new GenericType<AWSNamespaceFiltersExcludeAll>() {});
315213
schemas.put(
316214
"AWSNamespaceFiltersExcludeOnly", new GenericType<AWSNamespaceFiltersExcludeOnly>() {});
317-
schemas.put(
318-
"AWSNamespaceFiltersIncludeAll", new GenericType<AWSNamespaceFiltersIncludeAll>() {});
319215
schemas.put(
320216
"AWSNamespaceFiltersIncludeOnly", new GenericType<AWSNamespaceFiltersIncludeOnly>() {});
321217
JSON.registerDescendants(AWSNamespaceFilters.class, Collections.unmodifiableMap(schemas));
@@ -328,27 +224,18 @@ public Map<String, GenericType> getSchemas() {
328224

329225
/**
330226
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
331-
* against the oneOf child schemas: AWSNamespaceFiltersExcludeAll, AWSNamespaceFiltersExcludeOnly,
332-
* AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly
227+
* against the oneOf child schemas: AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeOnly
333228
*
334229
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
335230
* composed schema (allOf, anyOf, oneOf).
336231
*/
337232
@Override
338233
public void setActualInstance(Object instance) {
339-
if (JSON.isInstanceOf(AWSNamespaceFiltersExcludeAll.class, instance, new HashSet<Class<?>>())) {
340-
super.setActualInstance(instance);
341-
return;
342-
}
343234
if (JSON.isInstanceOf(
344235
AWSNamespaceFiltersExcludeOnly.class, instance, new HashSet<Class<?>>())) {
345236
super.setActualInstance(instance);
346237
return;
347238
}
348-
if (JSON.isInstanceOf(AWSNamespaceFiltersIncludeAll.class, instance, new HashSet<Class<?>>())) {
349-
super.setActualInstance(instance);
350-
return;
351-
}
352239
if (JSON.isInstanceOf(
353240
AWSNamespaceFiltersIncludeOnly.class, instance, new HashSet<Class<?>>())) {
354241
super.setActualInstance(instance);
@@ -360,35 +247,21 @@ public void setActualInstance(Object instance) {
360247
return;
361248
}
362249
throw new RuntimeException(
363-
"Invalid instance type. Must be AWSNamespaceFiltersExcludeAll,"
364-
+ " AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeAll,"
250+
"Invalid instance type. Must be AWSNamespaceFiltersExcludeOnly,"
365251
+ " AWSNamespaceFiltersIncludeOnly");
366252
}
367253

368254
/**
369-
* Get the actual instance, which can be the following: AWSNamespaceFiltersExcludeAll,
370-
* AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly
255+
* Get the actual instance, which can be the following: AWSNamespaceFiltersExcludeOnly,
256+
* AWSNamespaceFiltersIncludeOnly
371257
*
372-
* @return The actual instance (AWSNamespaceFiltersExcludeAll, AWSNamespaceFiltersExcludeOnly,
373-
* AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly)
258+
* @return The actual instance (AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeOnly)
374259
*/
375260
@Override
376261
public Object getActualInstance() {
377262
return super.getActualInstance();
378263
}
379264

380-
/**
381-
* Get the actual instance of `AWSNamespaceFiltersExcludeAll`. If the actual instance is not
382-
* `AWSNamespaceFiltersExcludeAll`, the ClassCastException will be thrown.
383-
*
384-
* @return The actual instance of `AWSNamespaceFiltersExcludeAll`
385-
* @throws ClassCastException if the instance is not `AWSNamespaceFiltersExcludeAll`
386-
*/
387-
public AWSNamespaceFiltersExcludeAll getAWSNamespaceFiltersExcludeAll()
388-
throws ClassCastException {
389-
return (AWSNamespaceFiltersExcludeAll) super.getActualInstance();
390-
}
391-
392265
/**
393266
* Get the actual instance of `AWSNamespaceFiltersExcludeOnly`. If the actual instance is not
394267
* `AWSNamespaceFiltersExcludeOnly`, the ClassCastException will be thrown.
@@ -401,18 +274,6 @@ public AWSNamespaceFiltersExcludeOnly getAWSNamespaceFiltersExcludeOnly()
401274
return (AWSNamespaceFiltersExcludeOnly) super.getActualInstance();
402275
}
403276

404-
/**
405-
* Get the actual instance of `AWSNamespaceFiltersIncludeAll`. If the actual instance is not
406-
* `AWSNamespaceFiltersIncludeAll`, the ClassCastException will be thrown.
407-
*
408-
* @return The actual instance of `AWSNamespaceFiltersIncludeAll`
409-
* @throws ClassCastException if the instance is not `AWSNamespaceFiltersIncludeAll`
410-
*/
411-
public AWSNamespaceFiltersIncludeAll getAWSNamespaceFiltersIncludeAll()
412-
throws ClassCastException {
413-
return (AWSNamespaceFiltersIncludeAll) super.getActualInstance();
414-
}
415-
416277
/**
417278
* Get the actual instance of `AWSNamespaceFiltersIncludeOnly`. If the actual instance is not
418279
* `AWSNamespaceFiltersIncludeOnly`, the ClassCastException will be thrown.

0 commit comments

Comments
 (0)