Skip to content

Commit 646369e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2ebdcd3 of spec repo
1 parent 1f858fd commit 646369e

22 files changed

+942
-10
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17075,6 +17075,12 @@ components:
1707517075
required:
1707617076
- id
1707717077
type: object
17078+
DeploymentGateRulesResponse:
17079+
description: Response for a deployment gate rules.
17080+
properties:
17081+
data:
17082+
$ref: '#/components/schemas/ListDeploymentRuleResponseData'
17083+
type: object
1707817084
DeploymentMetadata:
1707917085
description: Metadata object containing the publication creation information.
1708017086
properties:
@@ -30199,6 +30205,37 @@ components:
3019930205
type: string
3020030206
x-enum-varnames:
3020130207
- LIST_CONNECTIONS_RESPONSE
30208+
ListDeploymentRuleDataType:
30209+
description: List deployment rule resource type.
30210+
enum:
30211+
- list_deployment_rules
30212+
example: list_deployment_rules
30213+
type: string
30214+
x-enum-varnames:
30215+
- LIST_DEPLOYMENT_RULES
30216+
ListDeploymentRuleResponseData:
30217+
description: Data for a list of deployment rules.
30218+
properties:
30219+
attributes:
30220+
$ref: '#/components/schemas/ListDeploymentRuleResponseDataAttributes'
30221+
id:
30222+
description: Unique identifier of the deployment rule.
30223+
example: 1111-2222-3333-4444-555566667777
30224+
type: string
30225+
type:
30226+
$ref: '#/components/schemas/ListDeploymentRuleDataType'
30227+
required:
30228+
- type
30229+
- attributes
30230+
- id
30231+
type: object
30232+
ListDeploymentRuleResponseDataAttributes:
30233+
properties:
30234+
rules:
30235+
items:
30236+
$ref: '#/components/schemas/DeploymentRuleResponseDataAttributes'
30237+
type: array
30238+
type: object
3020230239
ListDevicesResponse:
3020330240
description: List devices response.
3020430241
properties:
@@ -66236,6 +66273,50 @@ paths:
6623666273

6623766274
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6623866275
/api/v2/deployment_gates/{gate_id}/rules:
66276+
get:
66277+
description: Endpoint to get rules for a deployment gate.
66278+
operationId: GetDeploymentGateRules
66279+
parameters:
66280+
- description: The ID of the deployment gate.
66281+
in: path
66282+
name: gate_id
66283+
required: true
66284+
schema:
66285+
type: string
66286+
responses:
66287+
'200':
66288+
content:
66289+
application/json:
66290+
schema:
66291+
$ref: '#/components/schemas/DeploymentGateRulesResponse'
66292+
description: OK
66293+
'400':
66294+
$ref: '#/components/responses/HTTPCDGatesBadRequestResponse'
66295+
'401':
66296+
$ref: '#/components/responses/UnauthorizedResponse'
66297+
'403':
66298+
$ref: '#/components/responses/ForbiddenResponse'
66299+
'429':
66300+
$ref: '#/components/responses/TooManyRequestsResponse'
66301+
'500':
66302+
content:
66303+
application/json:
66304+
schema:
66305+
$ref: '#/components/schemas/HTTPCIAppErrors'
66306+
description: Internal Server Error
66307+
security:
66308+
- apiKeyAuth: []
66309+
appKeyAuth: []
66310+
summary: Get rules for a deployment gate
66311+
tags:
66312+
- Deployment Gates
66313+
x-permission:
66314+
operator: OR
66315+
permissions:
66316+
- deployment_gates_read
66317+
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.
66318+
66319+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6623966320
post:
6624066321
description: Endpoint to create a deployment rule. A gate for the rule must
6624166322
already exist.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get rules for a deployment gate 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.DeploymentGatesApi;
6+
import com.datadog.api.client.v2.model.DeploymentGateRulesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getDeploymentGateRules", true);
12+
DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient);
13+
14+
// there is a valid "deployment_gate" in the system
15+
String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID");
16+
17+
try {
18+
DeploymentGateRulesResponse result =
19+
apiInstance.getDeploymentGateRules(DEPLOYMENT_GATE_DATA_ID);
20+
System.out.println(result);
21+
} catch (ApiException e) {
22+
System.err.println("Exception when calling DeploymentGatesApi#getDeploymentGateRules");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ public class ApiClient {
740740
put("v2.deleteDeploymentGate", false);
741741
put("v2.deleteDeploymentRule", false);
742742
put("v2.getDeploymentGate", false);
743+
put("v2.getDeploymentGateRules", false);
743744
put("v2.getDeploymentRule", false);
744745
put("v2.updateDeploymentGate", false);
745746
put("v2.updateDeploymentRule", false);

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

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.datadog.api.client.v2.model.CreateDeploymentGateParams;
88
import com.datadog.api.client.v2.model.CreateDeploymentRuleParams;
99
import com.datadog.api.client.v2.model.DeploymentGateResponse;
10+
import com.datadog.api.client.v2.model.DeploymentGateRulesResponse;
1011
import com.datadog.api.client.v2.model.DeploymentRuleResponse;
1112
import com.datadog.api.client.v2.model.UpdateDeploymentGateParams;
1213
import com.datadog.api.client.v2.model.UpdateDeploymentRuleParams;
@@ -857,6 +858,163 @@ public CompletableFuture<ApiResponse<DeploymentGateResponse>> getDeploymentGateW
857858
new GenericType<DeploymentGateResponse>() {});
858859
}
859860

861+
/**
862+
* Get rules for a deployment gate.
863+
*
864+
* <p>See {@link #getDeploymentGateRulesWithHttpInfo}.
865+
*
866+
* @param gateId The ID of the deployment gate. (required)
867+
* @return DeploymentGateRulesResponse
868+
* @throws ApiException if fails to make API call
869+
*/
870+
public DeploymentGateRulesResponse getDeploymentGateRules(String gateId) throws ApiException {
871+
return getDeploymentGateRulesWithHttpInfo(gateId).getData();
872+
}
873+
874+
/**
875+
* Get rules for a deployment gate.
876+
*
877+
* <p>See {@link #getDeploymentGateRulesWithHttpInfoAsync}.
878+
*
879+
* @param gateId The ID of the deployment gate. (required)
880+
* @return CompletableFuture&lt;DeploymentGateRulesResponse&gt;
881+
*/
882+
public CompletableFuture<DeploymentGateRulesResponse> getDeploymentGateRulesAsync(String gateId) {
883+
return getDeploymentGateRulesWithHttpInfoAsync(gateId)
884+
.thenApply(
885+
response -> {
886+
return response.getData();
887+
});
888+
}
889+
890+
/**
891+
* Endpoint to get rules for a deployment gate.
892+
*
893+
* @param gateId The ID of the deployment gate. (required)
894+
* @return ApiResponse&lt;DeploymentGateRulesResponse&gt;
895+
* @throws ApiException if fails to make API call
896+
* @http.response.details
897+
* <table border="1">
898+
* <caption>Response details</caption>
899+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
900+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
901+
* <tr><td> 400 </td><td> Bad request. </td><td> - </td></tr>
902+
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
903+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
904+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
905+
* <tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
906+
* </table>
907+
*/
908+
public ApiResponse<DeploymentGateRulesResponse> getDeploymentGateRulesWithHttpInfo(String gateId)
909+
throws ApiException {
910+
// Check if unstable operation is enabled
911+
String operationId = "getDeploymentGateRules";
912+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
913+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
914+
} else {
915+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
916+
}
917+
Object localVarPostBody = null;
918+
919+
// verify the required parameter 'gateId' is set
920+
if (gateId == null) {
921+
throw new ApiException(
922+
400, "Missing the required parameter 'gateId' when calling getDeploymentGateRules");
923+
}
924+
// create path and map variables
925+
String localVarPath =
926+
"/api/v2/deployment_gates/{gate_id}/rules"
927+
.replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString()));
928+
929+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
930+
931+
Invocation.Builder builder =
932+
apiClient.createBuilder(
933+
"v2.DeploymentGatesApi.getDeploymentGateRules",
934+
localVarPath,
935+
new ArrayList<Pair>(),
936+
localVarHeaderParams,
937+
new HashMap<String, String>(),
938+
new String[] {"application/json"},
939+
new String[] {"apiKeyAuth", "appKeyAuth"});
940+
return apiClient.invokeAPI(
941+
"GET",
942+
builder,
943+
localVarHeaderParams,
944+
new String[] {},
945+
localVarPostBody,
946+
new HashMap<String, Object>(),
947+
false,
948+
new GenericType<DeploymentGateRulesResponse>() {});
949+
}
950+
951+
/**
952+
* Get rules for a deployment gate.
953+
*
954+
* <p>See {@link #getDeploymentGateRulesWithHttpInfo}.
955+
*
956+
* @param gateId The ID of the deployment gate. (required)
957+
* @return CompletableFuture&lt;ApiResponse&lt;DeploymentGateRulesResponse&gt;&gt;
958+
*/
959+
public CompletableFuture<ApiResponse<DeploymentGateRulesResponse>>
960+
getDeploymentGateRulesWithHttpInfoAsync(String gateId) {
961+
// Check if unstable operation is enabled
962+
String operationId = "getDeploymentGateRules";
963+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
964+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
965+
} else {
966+
CompletableFuture<ApiResponse<DeploymentGateRulesResponse>> result =
967+
new CompletableFuture<>();
968+
result.completeExceptionally(
969+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
970+
return result;
971+
}
972+
Object localVarPostBody = null;
973+
974+
// verify the required parameter 'gateId' is set
975+
if (gateId == null) {
976+
CompletableFuture<ApiResponse<DeploymentGateRulesResponse>> result =
977+
new CompletableFuture<>();
978+
result.completeExceptionally(
979+
new ApiException(
980+
400, "Missing the required parameter 'gateId' when calling getDeploymentGateRules"));
981+
return result;
982+
}
983+
// create path and map variables
984+
String localVarPath =
985+
"/api/v2/deployment_gates/{gate_id}/rules"
986+
.replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString()));
987+
988+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
989+
990+
Invocation.Builder builder;
991+
try {
992+
builder =
993+
apiClient.createBuilder(
994+
"v2.DeploymentGatesApi.getDeploymentGateRules",
995+
localVarPath,
996+
new ArrayList<Pair>(),
997+
localVarHeaderParams,
998+
new HashMap<String, String>(),
999+
new String[] {"application/json"},
1000+
new String[] {"apiKeyAuth", "appKeyAuth"});
1001+
} catch (ApiException ex) {
1002+
CompletableFuture<ApiResponse<DeploymentGateRulesResponse>> result =
1003+
new CompletableFuture<>();
1004+
result.completeExceptionally(ex);
1005+
return result;
1006+
}
1007+
return apiClient.invokeAPIAsync(
1008+
"GET",
1009+
builder,
1010+
localVarHeaderParams,
1011+
new String[] {},
1012+
localVarPostBody,
1013+
new HashMap<String, Object>(),
1014+
false,
1015+
new GenericType<DeploymentGateRulesResponse>() {});
1016+
}
1017+
8601018
/**
8611019
* Get deployment rule.
8621020
*

0 commit comments

Comments
 (0)