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
2 changes: 1 addition & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71267,7 +71267,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/BudgetValidationRequest'
$ref: '#/components/schemas/BudgetWithEntries'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
Expand Down
4 changes: 2 additions & 2 deletions examples/v2/cloud-cost-management/GetBudget.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.BudgetValidationRequest;
import com.datadog.api.client.v2.model.BudgetWithEntries;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);

try {
BudgetValidationRequest result = apiInstance.getBudget("budget_id");
BudgetWithEntries result = apiInstance.getBudget("budget_id");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#getBudget");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1712,10 +1712,10 @@ public CompletableFuture<ApiResponse<Void>> deleteTagPipelinesRulesetWithHttpInf
* <p>See {@link #getBudgetWithHttpInfo}.
*
* @param budgetId Budget id. (required)
* @return BudgetValidationRequest
* @return BudgetWithEntries
* @throws ApiException if fails to make API call
*/
public BudgetValidationRequest getBudget(String budgetId) throws ApiException {
public BudgetWithEntries getBudget(String budgetId) throws ApiException {
return getBudgetWithHttpInfo(budgetId).getData();
}

Expand All @@ -1725,9 +1725,9 @@ public BudgetValidationRequest getBudget(String budgetId) throws ApiException {
* <p>See {@link #getBudgetWithHttpInfoAsync}.
*
* @param budgetId Budget id. (required)
* @return CompletableFuture&lt;BudgetValidationRequest&gt;
* @return CompletableFuture&lt;BudgetWithEntries&gt;
*/
public CompletableFuture<BudgetValidationRequest> getBudgetAsync(String budgetId) {
public CompletableFuture<BudgetWithEntries> getBudgetAsync(String budgetId) {
return getBudgetWithHttpInfoAsync(budgetId)
.thenApply(
response -> {
Expand All @@ -1739,7 +1739,7 @@ public CompletableFuture<BudgetValidationRequest> getBudgetAsync(String budgetId
* Get a budget
*
* @param budgetId Budget id. (required)
* @return ApiResponse&lt;BudgetValidationRequest&gt;
* @return ApiResponse&lt;BudgetWithEntries&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
Expand All @@ -1749,8 +1749,7 @@ public CompletableFuture<BudgetValidationRequest> getBudgetAsync(String budgetId
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<BudgetValidationRequest> getBudgetWithHttpInfo(String budgetId)
throws ApiException {
public ApiResponse<BudgetWithEntries> getBudgetWithHttpInfo(String budgetId) throws ApiException {
Object localVarPostBody = null;

// verify the required parameter 'budgetId' is set
Expand Down Expand Up @@ -1782,7 +1781,7 @@ public ApiResponse<BudgetValidationRequest> getBudgetWithHttpInfo(String budgetI
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<BudgetValidationRequest>() {});
new GenericType<BudgetWithEntries>() {});
}

/**
Expand All @@ -1791,15 +1790,15 @@ public ApiResponse<BudgetValidationRequest> getBudgetWithHttpInfo(String budgetI
* <p>See {@link #getBudgetWithHttpInfo}.
*
* @param budgetId Budget id. (required)
* @return CompletableFuture&lt;ApiResponse&lt;BudgetValidationRequest&gt;&gt;
* @return CompletableFuture&lt;ApiResponse&lt;BudgetWithEntries&gt;&gt;
*/
public CompletableFuture<ApiResponse<BudgetValidationRequest>> getBudgetWithHttpInfoAsync(
public CompletableFuture<ApiResponse<BudgetWithEntries>> getBudgetWithHttpInfoAsync(
String budgetId) {
Object localVarPostBody = null;

// verify the required parameter 'budgetId' is set
if (budgetId == null) {
CompletableFuture<ApiResponse<BudgetValidationRequest>> result = new CompletableFuture<>();
CompletableFuture<ApiResponse<BudgetWithEntries>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'budgetId' when calling getBudget"));
Expand All @@ -1824,7 +1823,7 @@ public CompletableFuture<ApiResponse<BudgetValidationRequest>> getBudgetWithHttp
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<BudgetValidationRequest>> result = new CompletableFuture<>();
CompletableFuture<ApiResponse<BudgetWithEntries>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
Expand All @@ -1836,7 +1835,7 @@ public CompletableFuture<ApiResponse<BudgetValidationRequest>> getBudgetWithHttp
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<BudgetValidationRequest>() {});
new GenericType<BudgetWithEntries>() {});
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/com/datadog/api/Undo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public static class Parameter {
public List<Parameter> parameters;

public Map<String, Object> getRequestParameters(
Object responseData, Object requestData, Method requestBuilder, ObjectMapper mapper, Map<String, Object> pathParameters) {
Object responseData,
Object requestData,
Method requestBuilder,
ObjectMapper mapper,
Map<String, Object> pathParameters) {
Map<String, Object> requestParams = new HashMap<String, Object>();
for (int i = 0; i < parameters.size(); i++) {
Undo.UndoMethod.Parameter p = parameters.get(i);
Expand Down
16 changes: 12 additions & 4 deletions src/test/java/com/datadog/api/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void newRequest(String name) {
}
}
parametersArray = new ArrayList<>();
pathParameters = new HashMap<>(); // Clear path parameters for new request
pathParameters = new HashMap<>(); // Clear path parameters for new request
}

public void addRequestParameter(String parameterName, String value)
Expand Down Expand Up @@ -458,7 +458,9 @@ public void given(String apiVersion, Given step) throws Exception {

Undo undoSettings = UndoAction.UndoAction().getUndo(apiVersion, step.getOperationName());
if (undoSettings != null) {
undo.add(getRequestUndo(apiVersion, undoSettings, responseData, givenParametersArray.get(0), pathParameters));
undo.add(
getRequestUndo(
apiVersion, undoSettings, responseData, givenParametersArray.get(0), pathParameters));
}

if (step.source != null) {
Expand All @@ -471,7 +473,11 @@ public void given(String apiVersion, Given step) throws Exception {
}

public Callable<?> getRequestUndo(
String apiVersion, Undo undoSettings, Object responseData, Object requestData, Map<String, Object> pathParameters)
String apiVersion,
Undo undoSettings,
Object responseData,
Object requestData,
Map<String, Object> pathParameters)
throws Exception {
// find API service based on undo tag value
Class<?> undoAPIClass =
Expand Down Expand Up @@ -579,7 +585,9 @@ public void sendRequest() throws Exception {
} catch (Exception e) {
throw new Exception(e.getCause());
}
undo.add(getRequestUndo(apiVersion, undoSettings, responseData, parametersArray.get(0), pathParameters));
undo.add(
getRequestUndo(
apiVersion, undoSettings, responseData, parametersArray.get(0), pathParameters));
}
}

Expand Down
Loading