Skip to content

Commit 94194e6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9a73736 of spec repo
1 parent 441c610 commit 94194e6

File tree

8 files changed

+407
-49
lines changed

8 files changed

+407
-49
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41081,6 +41081,16 @@ components:
4108141081
example: report_id
4108241082
type: string
4108341083
type: object
41084+
SbomFormat:
41085+
description: The SBOM standard
41086+
enum:
41087+
- CycloneDX
41088+
- SPDX
41089+
example: CycloneDX
41090+
type: string
41091+
x-enum-varnames:
41092+
- CYCLONEDX
41093+
- SPDX
4108441094
ScalarColumn:
4108541095
description: A single column in a scalar query response.
4108641096
oneOf:
@@ -51419,13 +51429,29 @@ components:
5141951429
- attributes
5142051430
- relationships
5142151431
type: object
51422-
VulnerabilityAttributes:
51423-
description: The JSON:API attributes of the vulnerability.
51432+
VulnerabilityAdvisory:
51433+
description: Advisory that associated with the vulnerability.
5142451434
properties:
51425-
advisory_id:
51435+
id:
5142651436
description: Vulnerability advisory ID.
5142751437
example: TRIVY-CVE-2023-0615
5142851438
type: string
51439+
last_modification_date:
51440+
description: Vulnerability advisory last modification date.
51441+
example: 2024-09-19 21:23:08+00:00
51442+
type: string
51443+
publish_date:
51444+
description: Vulnerability advisory publish date.
51445+
example: 2024-09-19 21:23:08+00:00
51446+
type: string
51447+
required:
51448+
- id
51449+
type: object
51450+
VulnerabilityAttributes:
51451+
description: The JSON:API attributes of the vulnerability.
51452+
properties:
51453+
advisory:
51454+
$ref: '#/components/schemas/VulnerabilityAdvisory'
5142951455
code_location:
5143051456
$ref: '#/components/schemas/CodeLocation'
5143151457
cve_list:
@@ -70913,7 +70939,7 @@ paths:
7091370939
format: int64
7091470940
minimum: 1
7091570941
type: integer
70916-
- description: Filter by name.
70942+
- description: Filter by name. This field supports the usage of wildcards (*).
7091770943
example: datadog-agent
7091870944
in: query
7091970945
name: filter[name]
@@ -71208,7 +71234,7 @@ paths:
7120871234
security:
7120971235
- apiKeyAuth: []
7121071236
appKeyAuth: []
71211-
summary: List assets SBOMs
71237+
summary: List SBOMs
7121271238
tags:
7121371239
- Security Monitoring
7121471240
x-unstable: '**Note**: This endpoint is a private preview.
@@ -71241,6 +71267,13 @@ paths:
7124171267
required: false
7124271268
schema:
7124371269
type: string
71270+
- description: The standard of the SBOM.
71271+
example: CycloneDX
71272+
in: query
71273+
name: ext:format
71274+
required: false
71275+
schema:
71276+
$ref: '#/components/schemas/SbomFormat'
7124471277
responses:
7124571278
'200':
7124671279
content:
@@ -71468,7 +71501,8 @@ paths:
7146871501
consider a request to be the first request when there is no `page[token]`
7146971502
parameter.\n\nThe response of this first request contains the newly created
7147071503
token in the `links` section.\n\nThis token can then be used in the subsequent
71471-
paginated requests.\n\n#### Subsequent requests\n\nAny request containing
71504+
paginated requests.\n\n*Note: The first request may take longer to complete
71505+
than subsequent requests.*\n\n#### Subsequent requests\n\nAny request containing
7147271506
valid `page[token]` and `page[number]` parameters will be considered a subsequent
7147371507
request.\n\nIf the `token` is invalid, a `404` response will be returned.\n\nIf
7147471508
the page `number` is invalid, a `400` response will be returned.\n\n### Filtering\n\nThe
@@ -71488,7 +71522,12 @@ paths:
7148871522
For more details on each of the properties included in this section, check
7148971523
the endpoints response tables.\n\n```JSON\n{\n \"data\": [...],\n \"meta\":
7149071524
{\n \"total\": 1500,\n \"count\": 18732,\n \"token\": \"some_token\"\n
71491-
\ },\n \"links\": {...}\n}\n```"
71525+
\ },\n \"links\": {...}\n}\n```\n### Extensions\n\nThe request in some cases
71526+
can include extensions to update behavior of the endpoint requested. The format
71527+
of the filter parameters follows the [JSON:API format](https://jsonapi.org/extensions/#extensions):
71528+
`ext:$extension_name`, where `extension_name` is the name of the modifier
71529+
that is being applied.\n\nExtensions can only include one value at the moment:
71530+
`ext:modifier=value`."
7149271531
operationId: ListVulnerabilities
7149371532
parameters:
7149471533
- description: Its value must come from the `links` section of the response
@@ -71596,7 +71635,7 @@ paths:
7159671635
- description: Filter by advisory ID.
7159771636
example: TRIVY-CVE-2023-0615
7159871637
in: query
71599-
name: filter[advisory_id]
71638+
name: filter[advisory.id]
7160071639
required: false
7160171640
schema:
7160271641
type: string
@@ -71696,7 +71735,8 @@ paths:
7169671735
required: false
7169771736
schema:
7169871737
type: string
71699-
- description: Filter by asset name.
71738+
- description: Filter by asset name. This field supports the usage of wildcards
71739+
(*).
7170071740
example: datadog-agent
7170171741
in: query
7170271742
name: filter[asset.name]

examples/v2/security-monitoring/ListAssetsSBOMs.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// List assets SBOMs returns "OK" response
1+
// List SBOMs returns "OK" response
22

33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6-
import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListAssetsSBOMsOptionalParameters;
7-
import com.datadog.api.client.v2.model.AssetType;
86
import com.datadog.api.client.v2.model.ListAssetsSBOMsResponse;
97

108
public class Example {
@@ -14,11 +12,7 @@ public static void main(String[] args) {
1412
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
1513

1614
try {
17-
ListAssetsSBOMsResponse result =
18-
apiInstance.listAssetsSBOMs(
19-
new ListAssetsSBOMsOptionalParameters()
20-
.filterPackageName("pandas")
21-
.filterAssetType(AssetType.SERVICE));
15+
ListAssetsSBOMsResponse result = apiInstance.listAssetsSBOMs();
2216
System.out.println(result);
2317
} catch (ApiException e) {
2418
System.err.println("Exception when calling SecurityMonitoringApi#listAssetsSBOMs");
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// List assets SBOMs returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListAssetsSBOMsOptionalParameters;
7+
import com.datadog.api.client.v2.model.AssetType;
8+
import com.datadog.api.client.v2.model.ListAssetsSBOMsResponse;
9+
10+
public class Example {
11+
public static void main(String[] args) {
12+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
13+
defaultClient.setUnstableOperationEnabled("v2.listAssetsSBOMs", true);
14+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
15+
16+
try {
17+
ListAssetsSBOMsResponse result =
18+
apiInstance.listAssetsSBOMs(
19+
new ListAssetsSBOMsOptionalParameters()
20+
.filterPackageName("pandas")
21+
.filterAssetType(AssetType.SERVICE));
22+
System.out.println(result);
23+
} catch (ApiException e) {
24+
System.err.println("Exception when calling SecurityMonitoringApi#listAssetsSBOMs");
25+
System.err.println("Status code: " + e.getCode());
26+
System.err.println("Reason: " + e.getResponseBody());
27+
System.err.println("Response headers: " + e.getResponseHeaders());
28+
e.printStackTrace();
29+
}
30+
}
31+
}

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.datadog.api.client.v2.model.PatchNotificationRuleParameters;
3434
import com.datadog.api.client.v2.model.RunHistoricalJobRequest;
3535
import com.datadog.api.client.v2.model.SBOMComponentLicenseType;
36+
import com.datadog.api.client.v2.model.SbomFormat;
3637
import com.datadog.api.client.v2.model.SecurityFilterCreateRequest;
3738
import com.datadog.api.client.v2.model.SecurityFilterResponse;
3839
import com.datadog.api.client.v2.model.SecurityFilterUpdateRequest;
@@ -4029,6 +4030,7 @@ public ApiResponse<GetRuleVersionHistoryResponse> getRuleVersionHistoryWithHttpI
40294030
/** Manage optional parameters to getSBOM. */
40304031
public static class GetSBOMOptionalParameters {
40314032
private String filterRepoDigest;
4033+
private SbomFormat extFormat;
40324034

40334035
/**
40344036
* Set filterRepoDigest.
@@ -4041,6 +4043,17 @@ public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) {
40414043
this.filterRepoDigest = filterRepoDigest;
40424044
return this;
40434045
}
4046+
4047+
/**
4048+
* Set extFormat.
4049+
*
4050+
* @param extFormat The standard of the SBOM. (optional)
4051+
* @return GetSBOMOptionalParameters
4052+
*/
4053+
public GetSBOMOptionalParameters extFormat(SbomFormat extFormat) {
4054+
this.extFormat = extFormat;
4055+
return this;
4056+
}
40444057
}
40454058

40464059
/**
@@ -4155,6 +4168,7 @@ public ApiResponse<GetSBOMResponse> getSBOMWithHttpInfo(
41554168
400, "Missing the required parameter 'filterAssetName' when calling getSBOM");
41564169
}
41574170
String filterRepoDigest = parameters.filterRepoDigest;
4171+
SbomFormat extFormat = parameters.extFormat;
41584172
// create path and map variables
41594173
String localVarPath =
41604174
"/api/v2/security/sboms/{asset_type}"
@@ -4167,6 +4181,7 @@ public ApiResponse<GetSBOMResponse> getSBOMWithHttpInfo(
41674181
apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName));
41684182
localVarQueryParams.addAll(
41694183
apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest));
4184+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat));
41704185

41714186
Invocation.Builder builder =
41724187
apiClient.createBuilder(
@@ -4229,6 +4244,7 @@ public CompletableFuture<ApiResponse<GetSBOMResponse>> getSBOMWithHttpInfoAsync(
42294244
return result;
42304245
}
42314246
String filterRepoDigest = parameters.filterRepoDigest;
4247+
SbomFormat extFormat = parameters.extFormat;
42324248
// create path and map variables
42334249
String localVarPath =
42344250
"/api/v2/security/sboms/{asset_type}"
@@ -4241,6 +4257,7 @@ public CompletableFuture<ApiResponse<GetSBOMResponse>> getSBOMWithHttpInfoAsync(
42414257
apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName));
42424258
localVarQueryParams.addAll(
42434259
apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest));
4260+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat));
42444261

42454262
Invocation.Builder builder;
42464263
try {
@@ -6198,7 +6215,7 @@ public ListAssetsSBOMsOptionalParameters filterLicenseType(
61986215
}
61996216

62006217
/**
6201-
* List assets SBOMs.
6218+
* List SBOMs.
62026219
*
62036220
* <p>See {@link #listAssetsSBOMsWithHttpInfo}.
62046221
*
@@ -6210,7 +6227,7 @@ public ListAssetsSBOMsResponse listAssetsSBOMs() throws ApiException {
62106227
}
62116228

62126229
/**
6213-
* List assets SBOMs.
6230+
* List SBOMs.
62146231
*
62156232
* <p>See {@link #listAssetsSBOMsWithHttpInfoAsync}.
62166233
*
@@ -6225,7 +6242,7 @@ public CompletableFuture<ListAssetsSBOMsResponse> listAssetsSBOMsAsync() {
62256242
}
62266243

62276244
/**
6228-
* List assets SBOMs.
6245+
* List SBOMs.
62296246
*
62306247
* <p>See {@link #listAssetsSBOMsWithHttpInfo}.
62316248
*
@@ -6239,7 +6256,7 @@ public ListAssetsSBOMsResponse listAssetsSBOMs(ListAssetsSBOMsOptionalParameters
62396256
}
62406257

62416258
/**
6242-
* List assets SBOMs.
6259+
* List SBOMs.
62436260
*
62446261
* <p>See {@link #listAssetsSBOMsWithHttpInfoAsync}.
62456262
*
@@ -6347,7 +6364,7 @@ public ApiResponse<ListAssetsSBOMsResponse> listAssetsSBOMsWithHttpInfo(
63476364
}
63486365

63496366
/**
6350-
* List assets SBOMs.
6367+
* List SBOMs.
63516368
*
63526369
* <p>See {@link #listAssetsSBOMsWithHttpInfo}.
63536370
*
@@ -8650,7 +8667,8 @@ public ListVulnerabilitiesOptionalParameters filterOrigin(String filterOrigin) {
86508667
/**
86518668
* Set filterAssetName.
86528669
*
8653-
* @param filterAssetName Filter by asset name. (optional)
8670+
* @param filterAssetName Filter by asset name. This field supports the usage of wildcards (*).
8671+
* (optional)
86548672
* @return ListVulnerabilitiesOptionalParameters
86558673
*/
86568674
public ListVulnerabilitiesOptionalParameters filterAssetName(String filterAssetName) {
@@ -8938,6 +8956,8 @@ public CompletableFuture<ListVulnerabilitiesResponse> listVulnerabilitiesAsync(
89388956
*
89398957
* <p>This token can then be used in the subsequent paginated requests.
89408958
*
8959+
* <p><em>Note: The first request may take longer to complete than subsequent requests.</em>
8960+
*
89418961
* <h3>Subsequent requests</h3>
89428962
*
89438963
* <p>Any request containing valid <code>page[token]</code> and <code>page[number]</code>
@@ -8989,6 +9009,16 @@ public CompletableFuture<ListVulnerabilitiesResponse> listVulnerabilitiesAsync(
89899009
* "links": {...}
89909010
* }</code>
89919011
*
9012+
* <h3>Extensions</h3>
9013+
*
9014+
* <p>The request in some cases can include extensions to update behavior of the endpoint
9015+
* requested. The format of the filter parameters follows the <a
9016+
* href="https://jsonapi.org/extensions/#extensions">JSON:API format</a>: <code>
9017+
* ext:$extension_name</code>, where <code>extension_name</code> is the name of the modifier that
9018+
* is being applied.
9019+
*
9020+
* <p>Extensions can only include one value at the moment: <code>ext:modifier=value</code>.
9021+
*
89929022
* @param parameters Optional parameters for the request.
89939023
* @return ApiResponse&lt;ListVulnerabilitiesResponse&gt;
89949024
* @throws ApiException if fails to make API call
@@ -9085,7 +9115,7 @@ public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
90859115
localVarQueryParams.addAll(
90869116
apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion));
90879117
localVarQueryParams.addAll(
9088-
apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId));
9118+
apiClient.parameterToPairs("", "filter[advisory.id]", filterAdvisoryId));
90899119
localVarQueryParams.addAll(
90909120
apiClient.parameterToPairs(
90919121
"", "filter[risks.exploitation_probability]", filterRisksExploitationProbability));
@@ -9271,7 +9301,7 @@ public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
92719301
localVarQueryParams.addAll(
92729302
apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion));
92739303
localVarQueryParams.addAll(
9274-
apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId));
9304+
apiClient.parameterToPairs("", "filter[advisory.id]", filterAdvisoryId));
92759305
localVarQueryParams.addAll(
92769306
apiClient.parameterToPairs(
92779307
"", "filter[risks.exploitation_probability]", filterRisksExploitationProbability));
@@ -9418,7 +9448,7 @@ public ListVulnerableAssetsOptionalParameters pageNumber(Long pageNumber) {
94189448
/**
94199449
* Set filterName.
94209450
*
9421-
* @param filterName Filter by name. (optional)
9451+
* @param filterName Filter by name. This field supports the usage of wildcards (*). (optional)
94229452
* @return ListVulnerableAssetsOptionalParameters
94239453
*/
94249454
public ListVulnerableAssetsOptionalParameters filterName(String filterName) {

0 commit comments

Comments
 (0)