Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71059,6 +71059,14 @@ paths:
/api/v2/apm/services:
get:
operationId: GetServiceList
parameters:
- description: Filter services by environment. Can be set to `*` to return all
services across all environments.
in: query
name: filter[env]
required: true
schema:
type: string
responses:
'200':
content:
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/apm/GetServiceList.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void main(String[] args) {
ApmApi apiInstance = new ApmApi(defaultClient);

try {
ServiceList result = apiInstance.getServiceList();
ServiceList result = apiInstance.getServiceList("filter[env]");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApmApi#getServiceList");
Expand Down
47 changes: 39 additions & 8 deletions src/main/java/com/datadog/api/client/v2/api/ApmApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -48,29 +49,35 @@ public void setApiClient(ApiClient apiClient) {
*
* <p>See {@link #getServiceListWithHttpInfo}.
*
* @param filterEnv Filter services by environment. Can be set to <code>*</code> to return all
* services across all environments. (required)
* @return ServiceList
* @throws ApiException if fails to make API call
*/
public ServiceList getServiceList() throws ApiException {
return getServiceListWithHttpInfo().getData();
public ServiceList getServiceList(String filterEnv) throws ApiException {
return getServiceListWithHttpInfo(filterEnv).getData();
}

/**
* Get service list.
*
* <p>See {@link #getServiceListWithHttpInfoAsync}.
*
* @param filterEnv Filter services by environment. Can be set to <code>*</code> to return all
* services across all environments. (required)
* @return CompletableFuture&lt;ServiceList&gt;
*/
public CompletableFuture<ServiceList> getServiceListAsync() {
return getServiceListWithHttpInfoAsync()
public CompletableFuture<ServiceList> getServiceListAsync(String filterEnv) {
return getServiceListWithHttpInfoAsync(filterEnv)
.thenApply(
response -> {
return response.getData();
});
}

/**
* @param filterEnv Filter services by environment. Can be set to <code>*</code> to return all
* services across all environments. (required)
* @return ApiResponse&lt;ServiceList&gt;
* @throws ApiException if fails to make API call
* @http.response.details
Expand All @@ -81,18 +88,27 @@ public CompletableFuture<ServiceList> getServiceListAsync() {
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<ServiceList> getServiceListWithHttpInfo() throws ApiException {
public ApiResponse<ServiceList> getServiceListWithHttpInfo(String filterEnv) throws ApiException {
Object localVarPostBody = null;

// verify the required parameter 'filterEnv' is set
if (filterEnv == null) {
throw new ApiException(
400, "Missing the required parameter 'filterEnv' when calling getServiceList");
}
// create path and map variables
String localVarPath = "/api/v2/apm/services";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[env]", filterEnv));

Invocation.Builder builder =
apiClient.createBuilder(
"v2.ApmApi.getServiceList",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand All @@ -113,22 +129,37 @@ public ApiResponse<ServiceList> getServiceListWithHttpInfo() throws ApiException
*
* <p>See {@link #getServiceListWithHttpInfo}.
*
* @param filterEnv Filter services by environment. Can be set to <code>*</code> to return all
* services across all environments. (required)
* @return CompletableFuture&lt;ApiResponse&lt;ServiceList&gt;&gt;
*/
public CompletableFuture<ApiResponse<ServiceList>> getServiceListWithHttpInfoAsync() {
public CompletableFuture<ApiResponse<ServiceList>> getServiceListWithHttpInfoAsync(
String filterEnv) {
Object localVarPostBody = null;

// verify the required parameter 'filterEnv' is set
if (filterEnv == null) {
CompletableFuture<ApiResponse<ServiceList>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'filterEnv' when calling getServiceList"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/apm/services";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[env]", filterEnv));

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.ApmApi.getServiceList",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Feature: APM
And a valid "appKeyAuth" key in the system
And an instance of "APM" API
And new "GetServiceList" request
And request contains "filter[env]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
Loading