Skip to content

Commit 61e053f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f9a13ca of spec repo
1 parent 92603ef commit 61e053f

10 files changed

Lines changed: 952 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71914,6 +71914,55 @@ components:
7191471914
$ref: "#/components/schemas/Trigger"
7191571915
type: array
7191671916
type: object
71917+
SpecAttributes:
71918+
description: Attributes of an API spec.
71919+
properties:
71920+
name:
71921+
description: The name of the spec.
71922+
example: pets-api
71923+
type: string
71924+
status:
71925+
$ref: "#/components/schemas/SpecAttributesStatus"
71926+
version:
71927+
description: The version of the spec.
71928+
example: "2.1.0"
71929+
type: string
71930+
type: object
71931+
SpecAttributesStatus:
71932+
description: The publication status of the spec.
71933+
enum:
71934+
- published
71935+
- draft
71936+
- deprecated
71937+
example: published
71938+
type: string
71939+
x-enum-varnames:
71940+
- PUBLISHED
71941+
- DRAFT
71942+
- DEPRECATED
71943+
SpecData:
71944+
description: A single API spec resource.
71945+
properties:
71946+
attributes:
71947+
$ref: "#/components/schemas/SpecAttributes"
71948+
id:
71949+
description: The unique identifier of the spec.
71950+
example: d5e5d5a0-1234-5678-9abc-def012345678
71951+
type: string
71952+
type:
71953+
$ref: "#/components/schemas/SpecType"
71954+
required:
71955+
- type
71956+
type: object
71957+
SpecType:
71958+
default: spec
71959+
description: Type of the spec resource.
71960+
enum:
71961+
- spec
71962+
example: spec
71963+
type: string
71964+
x-enum-varnames:
71965+
- SPEC
7191771966
SpecVersion:
7191871967
description: The version of the CycloneDX specification a BOM conforms to.
7191971968
enum:
@@ -71932,6 +71981,15 @@ components:
7193271981
- ONE_THREE
7193371982
- ONE_FOUR
7193471983
- ONE_FIVE
71984+
SpecsListResponse:
71985+
description: Response containing a list of specs.
71986+
properties:
71987+
data:
71988+
description: List of specs.
71989+
items:
71990+
$ref: "#/components/schemas/SpecData"
71991+
type: array
71992+
type: object
7193571993
SplitAPIKey:
7193671994
description: The definition of the `SplitAPIKey` object.
7193771995
properties:
@@ -137984,6 +138042,43 @@ paths:
137984138042
cursorPath: meta.page.after
137985138043
limitParam: body.data.attributes.page.limit
137986138044
resultsPath: data
138045+
/api/v2/specs:
138046+
get:
138047+
description: Returns a list of API specs stored in the system.
138048+
operationId: ListSpecs
138049+
responses:
138050+
"200":
138051+
content:
138052+
application/json:
138053+
examples:
138054+
default:
138055+
value:
138056+
data:
138057+
- attributes:
138058+
name: pets-api
138059+
status: published
138060+
version: "2.1.0"
138061+
id: d5e5d5a0-1234-5678-9abc-def012345678
138062+
type: spec
138063+
- attributes:
138064+
name: users-api
138065+
status: draft
138066+
version: "1.0.0"
138067+
id: a1b2c3d4-5678-9abc-def0-123456789abc
138068+
type: spec
138069+
schema:
138070+
$ref: "#/components/schemas/SpecsListResponse"
138071+
description: OK
138072+
"403":
138073+
$ref: "#/components/responses/ForbiddenResponse"
138074+
"429":
138075+
$ref: "#/components/responses/TooManyRequestsResponse"
138076+
security:
138077+
- apiKeyAuth: []
138078+
appKeyAuth: []
138079+
summary: List API specs
138080+
tags:
138081+
- Specs
137987138082
/api/v2/static-analysis-sca/dependencies:
137988138083
post:
137989138084
operationId: CreateSCAResult
@@ -148377,6 +148472,9 @@ tags:
148377148472
description: Find out more at
148378148473
url: https://docs.datadoghq.com/tracing/metrics/metrics_namespace/
148379148474
name: Spans Metrics
148475+
- description: |-
148476+
View API specs stored in the system.
148477+
name: Specs
148380148478
- description: API for static analysis
148381148479
name: Static Analysis
148382148480
- description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information.

examples/v2/specs/ListSpecs.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List API specs 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.SpecsApi;
6+
import com.datadog.api.client.v2.model.SpecsListResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
SpecsApi apiInstance = new SpecsApi(defaultClient);
12+
13+
try {
14+
SpecsListResponse result = apiInstance.listSpecs();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling SpecsApi#listSpecs");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
package com.datadog.api.client.v2.api;
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.ApiResponse;
6+
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.SpecsListResponse;
8+
import jakarta.ws.rs.client.Invocation;
9+
import jakarta.ws.rs.core.GenericType;
10+
import java.util.ArrayList;
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
import java.util.concurrent.CompletableFuture;
14+
15+
@jakarta.annotation.Generated(
16+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
17+
public class SpecsApi {
18+
private ApiClient apiClient;
19+
20+
public SpecsApi() {
21+
this(ApiClient.getDefaultApiClient());
22+
}
23+
24+
public SpecsApi(ApiClient apiClient) {
25+
this.apiClient = apiClient;
26+
}
27+
28+
/**
29+
* Get the API client.
30+
*
31+
* @return API client
32+
*/
33+
public ApiClient getApiClient() {
34+
return apiClient;
35+
}
36+
37+
/**
38+
* Set the API client.
39+
*
40+
* @param apiClient an instance of API client
41+
*/
42+
public void setApiClient(ApiClient apiClient) {
43+
this.apiClient = apiClient;
44+
}
45+
46+
/**
47+
* List API specs.
48+
*
49+
* <p>See {@link #listSpecsWithHttpInfo}.
50+
*
51+
* @return SpecsListResponse
52+
* @throws ApiException if fails to make API call
53+
*/
54+
public SpecsListResponse listSpecs() throws ApiException {
55+
return listSpecsWithHttpInfo().getData();
56+
}
57+
58+
/**
59+
* List API specs.
60+
*
61+
* <p>See {@link #listSpecsWithHttpInfoAsync}.
62+
*
63+
* @return CompletableFuture&lt;SpecsListResponse&gt;
64+
*/
65+
public CompletableFuture<SpecsListResponse> listSpecsAsync() {
66+
return listSpecsWithHttpInfoAsync()
67+
.thenApply(
68+
response -> {
69+
return response.getData();
70+
});
71+
}
72+
73+
/**
74+
* Returns a list of API specs stored in the system.
75+
*
76+
* @return ApiResponse&lt;SpecsListResponse&gt;
77+
* @throws ApiException if fails to make API call
78+
* @http.response.details
79+
* <table border="1">
80+
* <caption>Response details</caption>
81+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
82+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
83+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
84+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
85+
* </table>
86+
*/
87+
public ApiResponse<SpecsListResponse> listSpecsWithHttpInfo() throws ApiException {
88+
Object localVarPostBody = null;
89+
// create path and map variables
90+
String localVarPath = "/api/v2/specs";
91+
92+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
93+
94+
Invocation.Builder builder =
95+
apiClient.createBuilder(
96+
"v2.SpecsApi.listSpecs",
97+
localVarPath,
98+
new ArrayList<Pair>(),
99+
localVarHeaderParams,
100+
new HashMap<String, String>(),
101+
new String[] {"application/json"},
102+
new String[] {"apiKeyAuth", "appKeyAuth"});
103+
return apiClient.invokeAPI(
104+
"GET",
105+
builder,
106+
localVarHeaderParams,
107+
new String[] {},
108+
localVarPostBody,
109+
new HashMap<String, Object>(),
110+
false,
111+
new GenericType<SpecsListResponse>() {});
112+
}
113+
114+
/**
115+
* List API specs.
116+
*
117+
* <p>See {@link #listSpecsWithHttpInfo}.
118+
*
119+
* @return CompletableFuture&lt;ApiResponse&lt;SpecsListResponse&gt;&gt;
120+
*/
121+
public CompletableFuture<ApiResponse<SpecsListResponse>> listSpecsWithHttpInfoAsync() {
122+
Object localVarPostBody = null;
123+
// create path and map variables
124+
String localVarPath = "/api/v2/specs";
125+
126+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
127+
128+
Invocation.Builder builder;
129+
try {
130+
builder =
131+
apiClient.createBuilder(
132+
"v2.SpecsApi.listSpecs",
133+
localVarPath,
134+
new ArrayList<Pair>(),
135+
localVarHeaderParams,
136+
new HashMap<String, String>(),
137+
new String[] {"application/json"},
138+
new String[] {"apiKeyAuth", "appKeyAuth"});
139+
} catch (ApiException ex) {
140+
CompletableFuture<ApiResponse<SpecsListResponse>> result = new CompletableFuture<>();
141+
result.completeExceptionally(ex);
142+
return result;
143+
}
144+
return apiClient.invokeAPIAsync(
145+
"GET",
146+
builder,
147+
localVarHeaderParams,
148+
new String[] {},
149+
localVarPostBody,
150+
new HashMap<String, Object>(),
151+
false,
152+
new GenericType<SpecsListResponse>() {});
153+
}
154+
}

0 commit comments

Comments
 (0)