Skip to content

Commit 63f8a68

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1943b0b of spec repo
1 parent 1920b15 commit 63f8a68

File tree

7 files changed

+413
-0
lines changed

7 files changed

+413
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16644,6 +16644,14 @@ components:
1664416644
required:
1664516645
- id
1664616646
type: object
16647+
DeploymentGateRulesResponse:
16648+
description: Response for a deployment gate rules.
16649+
properties:
16650+
data:
16651+
items:
16652+
$ref: '#/components/schemas/DeploymentRuleResponseData'
16653+
type: array
16654+
type: object
1664716655
DeploymentMetadata:
1664816656
description: Metadata object containing the publication creation information.
1664916657
properties:
@@ -64391,6 +64399,50 @@ paths:
6439164399

6439264400
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6439364401
/api/v2/deployment_gates/{gate_id}/rules:
64402+
get:
64403+
description: Endpoint to get rules for a deployment gate.
64404+
operationId: GetDeploymentGateRules
64405+
parameters:
64406+
- description: The ID of the deployment gate.
64407+
in: path
64408+
name: gate_id
64409+
required: true
64410+
schema:
64411+
type: string
64412+
responses:
64413+
'200':
64414+
content:
64415+
application/json:
64416+
schema:
64417+
$ref: '#/components/schemas/DeploymentGateRulesResponse'
64418+
description: OK
64419+
'400':
64420+
$ref: '#/components/responses/HTTPCDGatesBadRequestResponse'
64421+
'401':
64422+
$ref: '#/components/responses/UnauthorizedResponse'
64423+
'403':
64424+
$ref: '#/components/responses/ForbiddenResponse'
64425+
'429':
64426+
$ref: '#/components/responses/TooManyRequestsResponse'
64427+
'500':
64428+
content:
64429+
application/json:
64430+
schema:
64431+
$ref: '#/components/schemas/HTTPCIAppErrors'
64432+
description: Internal Server Error
64433+
security:
64434+
- apiKeyAuth: []
64435+
appKeyAuth: []
64436+
summary: Get rules for a deployment gate
64437+
tags:
64438+
- Deployment Gates
64439+
x-permission:
64440+
operator: OR
64441+
permissions:
64442+
- deployment_gates_read
64443+
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.
64444+
64445+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6439464446
post:
6439564447
description: Endpoint to create a deployment rule. A gate for the rule must
6439664448
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
@@ -738,6 +738,7 @@ public class ApiClient {
738738
put("v2.deleteDeploymentGate", false);
739739
put("v2.deleteDeploymentRule", false);
740740
put("v2.getDeploymentGate", false);
741+
put("v2.getDeploymentGateRules", false);
741742
put("v2.getDeploymentRule", false);
742743
put("v2.updateDeploymentGate", false);
743744
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)