diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d22c0abd585..b59bff36be1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65766,6 +65766,240 @@ components: required: - data type: object + TestOptimizationDeleteServiceSettingsRequest: + description: Request object for deleting Test Optimization service settings. + properties: + data: + $ref: "#/components/schemas/TestOptimizationDeleteServiceSettingsRequestData" + required: + - data + type: object + TestOptimizationDeleteServiceSettingsRequestAttributes: + description: Attributes for deleting Test Optimization service settings. + properties: + env: + description: The environment name. If omitted, defaults to `none`. + example: prod + type: string + repository_id: + description: The repository identifier. + example: github.com/datadog/shopist + minLength: 1 + type: string + service_name: + description: The service name. + example: shopist + minLength: 1 + type: string + required: + - repository_id + - service_name + type: object + TestOptimizationDeleteServiceSettingsRequestData: + description: Data object for delete service settings request. + properties: + attributes: + $ref: "#/components/schemas/TestOptimizationDeleteServiceSettingsRequestAttributes" + type: + $ref: "#/components/schemas/TestOptimizationDeleteServiceSettingsRequestDataType" + required: + - type + - attributes + type: object + TestOptimizationDeleteServiceSettingsRequestDataType: + description: JSON:API type for delete service settings request. The value must always be `test_optimization_delete_service_settings_request`. + enum: + - test_optimization_delete_service_settings_request + example: test_optimization_delete_service_settings_request + type: string + x-enum-varnames: + - TEST_OPTIMIZATION_DELETE_SERVICE_SETTINGS_REQUEST + TestOptimizationGetServiceSettingsRequest: + description: Request object for getting Test Optimization service settings. + properties: + data: + $ref: "#/components/schemas/TestOptimizationGetServiceSettingsRequestData" + required: + - data + type: object + TestOptimizationGetServiceSettingsRequestAttributes: + description: Attributes for requesting Test Optimization service settings. + properties: + env: + description: The environment name. If omitted, defaults to `none`. + example: prod + type: string + repository_id: + description: The repository identifier. + example: github.com/datadog/shopist + minLength: 1 + type: string + service_name: + description: The service name. + example: shopist + minLength: 1 + type: string + required: + - repository_id + - service_name + type: object + TestOptimizationGetServiceSettingsRequestData: + description: Data object for get service settings request. + properties: + attributes: + $ref: "#/components/schemas/TestOptimizationGetServiceSettingsRequestAttributes" + type: + $ref: "#/components/schemas/TestOptimizationGetServiceSettingsRequestDataType" + required: + - type + - attributes + type: object + TestOptimizationGetServiceSettingsRequestDataType: + description: JSON:API type for get service settings request. The value must always be `test_optimization_get_service_settings_request`. + enum: + - test_optimization_get_service_settings_request + example: test_optimization_get_service_settings_request + type: string + x-enum-varnames: + - TEST_OPTIMIZATION_GET_SERVICE_SETTINGS_REQUEST + TestOptimizationServiceSettingsAttributes: + description: Attributes for Test Optimization service settings. + properties: + auto_test_retries_enabled: + description: Whether Auto Test Retries are enabled for this service. + example: false + type: boolean + code_coverage_enabled: + description: Whether Code Coverage is enabled for this service. + example: false + type: boolean + early_flake_detection_enabled: + description: Whether Early Flake Detection is enabled for this service. + example: false + type: boolean + env: + description: The environment name. + example: prod + type: string + failed_test_replay_enabled: + description: Whether Failed Test Replay is enabled for this service. + example: false + type: boolean + pr_comments_enabled: + description: Whether PR Comments are enabled for this service. + example: true + type: boolean + repository_id: + description: The repository identifier. + example: github.com/datadog/shopist + type: string + service_name: + description: The service name. + example: shopist + type: string + test_impact_analysis_enabled: + description: Whether Test Impact Analysis is enabled for this service. + example: false + type: boolean + type: object + TestOptimizationServiceSettingsData: + description: Data object for Test Optimization service settings response. + properties: + attributes: + $ref: "#/components/schemas/TestOptimizationServiceSettingsAttributes" + id: + description: Unique identifier for the service settings. + example: github.com/datadog/shopist::shopist::prod + type: string + type: + $ref: "#/components/schemas/TestOptimizationServiceSettingsType" + type: object + TestOptimizationServiceSettingsResponse: + description: Response object containing Test Optimization service settings. + properties: + data: + $ref: "#/components/schemas/TestOptimizationServiceSettingsData" + type: object + TestOptimizationServiceSettingsType: + description: JSON:API type for service settings response. The value must always be `test_optimization_service_settings`. + enum: + - test_optimization_service_settings + example: test_optimization_service_settings + type: string + x-enum-varnames: + - TEST_OPTIMIZATION_SERVICE_SETTINGS + TestOptimizationUpdateServiceSettingsRequest: + description: Request object for updating Test Optimization service settings. + properties: + data: + $ref: "#/components/schemas/TestOptimizationUpdateServiceSettingsRequestData" + required: + - data + type: object + TestOptimizationUpdateServiceSettingsRequestAttributes: + description: Attributes for updating Test Optimization service settings. All non-required fields are optional; only provided fields will be updated. + properties: + auto_test_retries_enabled: + description: Whether Auto Test Retries are enabled for this service. + example: false + type: boolean + code_coverage_enabled: + description: Whether Code Coverage is enabled for this service. + example: false + type: boolean + early_flake_detection_enabled: + description: Whether Early Flake Detection is enabled for this service. + example: false + type: boolean + env: + description: The environment name. If omitted, defaults to `none`. + example: prod + type: string + failed_test_replay_enabled: + description: Whether Failed Test Replay is enabled for this service. + example: false + type: boolean + pr_comments_enabled: + description: Whether PR Comments are enabled for this service. + example: true + type: boolean + repository_id: + description: The repository identifier. + example: github.com/datadog/shopist + minLength: 1 + type: string + service_name: + description: The service name. + example: shopist + minLength: 1 + type: string + test_impact_analysis_enabled: + description: Whether Test Impact Analysis is enabled for this service. + example: false + type: boolean + required: + - repository_id + - service_name + type: object + TestOptimizationUpdateServiceSettingsRequestData: + description: Data object for update service settings request. + properties: + attributes: + $ref: "#/components/schemas/TestOptimizationUpdateServiceSettingsRequestAttributes" + type: + $ref: "#/components/schemas/TestOptimizationUpdateServiceSettingsRequestDataType" + required: + - type + - attributes + type: object + TestOptimizationUpdateServiceSettingsRequestDataType: + description: JSON:API type for update service settings request. The value must always be `test_optimization_update_service_settings_request`. + enum: + - test_optimization_update_service_settings_request + example: test_optimization_update_service_settings_request + type: string + x-enum-varnames: + - TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST ThreatHuntingJobDataType: description: Type of payload. enum: @@ -69561,6 +69795,7 @@ components: teams_manage: Manage Teams. Create, delete, rename, and edit metadata of all Teams. To control Team membership across all Teams, use the User Access Manage permission. teams_read: Read Teams data. A User with this permission can view Team names, metadata, and which Users are on each Team. test_optimization_read: View Test Optimization. + test_optimization_settings_write: Update service settings in Test Optimization. test_optimization_write: Update flaky tests from Flaky Tests Management of Test Optimization. timeseries_query: Query Timeseries data. usage_read: View your organization's usage and usage attribution. @@ -75808,6 +76043,124 @@ paths: operator: OR permissions: - ci_visibility_read + /api/v2/ci/test-optimization/settings/service: + delete: + description: |- + Delete Test Optimization settings for a specific service identified by repository, service name, and environment. + operationId: DeleteTestOptimizationServiceSettings + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TestOptimizationDeleteServiceSettingsRequest" + required: true + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - test_optimization_settings_write + summary: Delete Test Optimization service settings + tags: ["Test Optimization"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - test_optimization_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: |- + Partially update Test Optimization settings for a specific service identified by repository, service name, and environment. + Only provided fields are updated; null or omitted fields are left unchanged. + operationId: UpdateTestOptimizationServiceSettings + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TestOptimizationUpdateServiceSettingsRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TestOptimizationServiceSettingsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - test_optimization_settings_write + summary: Update Test Optimization service settings + tags: ["Test Optimization"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - test_optimization_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Retrieve Test Optimization settings for a specific service identified by repository, service name, and environment. + operationId: GetTestOptimizationServiceSettings + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TestOptimizationGetServiceSettingsRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TestOptimizationServiceSettingsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - test_optimization_read + summary: Get Test Optimization service settings + tags: ["Test Optimization"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - test_optimization_read + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ci/tests/analytics/aggregate: post: description: |- diff --git a/examples/v2/test-optimization/DeleteTestOptimizationServiceSettings.java b/examples/v2/test-optimization/DeleteTestOptimizationServiceSettings.java new file mode 100644 index 00000000000..890b1b8ab25 --- /dev/null +++ b/examples/v2/test-optimization/DeleteTestOptimizationServiceSettings.java @@ -0,0 +1,41 @@ +// Delete Test Optimization service settings returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TestOptimizationApi; +import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequest; +import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequestAttributes; +import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequestData; +import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteTestOptimizationServiceSettings", true); + TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); + + TestOptimizationDeleteServiceSettingsRequest body = + new TestOptimizationDeleteServiceSettingsRequest() + .data( + new TestOptimizationDeleteServiceSettingsRequestData() + .attributes( + new TestOptimizationDeleteServiceSettingsRequestAttributes() + .env("prod") + .repositoryId("github.com/datadog/shopist") + .serviceName("shopist")) + .type( + TestOptimizationDeleteServiceSettingsRequestDataType + .TEST_OPTIMIZATION_DELETE_SERVICE_SETTINGS_REQUEST)); + + try { + apiInstance.deleteTestOptimizationServiceSettings(body); + } catch (ApiException e) { + System.err.println( + "Exception when calling TestOptimizationApi#deleteTestOptimizationServiceSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/test-optimization/GetTestOptimizationServiceSettings.java b/examples/v2/test-optimization/GetTestOptimizationServiceSettings.java new file mode 100644 index 00000000000..eb9f0a5b99d --- /dev/null +++ b/examples/v2/test-optimization/GetTestOptimizationServiceSettings.java @@ -0,0 +1,44 @@ +// Get Test Optimization service settings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TestOptimizationApi; +import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequest; +import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequestAttributes; +import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequestData; +import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequestDataType; +import com.datadog.api.client.v2.model.TestOptimizationServiceSettingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getTestOptimizationServiceSettings", true); + TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); + + TestOptimizationGetServiceSettingsRequest body = + new TestOptimizationGetServiceSettingsRequest() + .data( + new TestOptimizationGetServiceSettingsRequestData() + .attributes( + new TestOptimizationGetServiceSettingsRequestAttributes() + .env("prod") + .repositoryId("github.com/datadog/shopist") + .serviceName("shopist")) + .type( + TestOptimizationGetServiceSettingsRequestDataType + .TEST_OPTIMIZATION_GET_SERVICE_SETTINGS_REQUEST)); + + try { + TestOptimizationServiceSettingsResponse result = + apiInstance.getTestOptimizationServiceSettings(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling TestOptimizationApi#getTestOptimizationServiceSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/test-optimization/UpdateTestOptimizationServiceSettings.java b/examples/v2/test-optimization/UpdateTestOptimizationServiceSettings.java new file mode 100644 index 00000000000..364ab399964 --- /dev/null +++ b/examples/v2/test-optimization/UpdateTestOptimizationServiceSettings.java @@ -0,0 +1,50 @@ +// Update Test Optimization service settings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TestOptimizationApi; +import com.datadog.api.client.v2.model.TestOptimizationServiceSettingsResponse; +import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequest; +import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequestAttributes; +import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequestData; +import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateTestOptimizationServiceSettings", true); + TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); + + TestOptimizationUpdateServiceSettingsRequest body = + new TestOptimizationUpdateServiceSettingsRequest() + .data( + new TestOptimizationUpdateServiceSettingsRequestData() + .attributes( + new TestOptimizationUpdateServiceSettingsRequestAttributes() + .autoTestRetriesEnabled(false) + .codeCoverageEnabled(false) + .earlyFlakeDetectionEnabled(false) + .env("prod") + .failedTestReplayEnabled(false) + .prCommentsEnabled(true) + .repositoryId("github.com/datadog/shopist") + .serviceName("shopist") + .testImpactAnalysisEnabled(false)) + .type( + TestOptimizationUpdateServiceSettingsRequestDataType + .TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST)); + + try { + TestOptimizationServiceSettingsResponse result = + apiInstance.updateTestOptimizationServiceSettings(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling TestOptimizationApi#updateTestOptimizationServiceSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 154be7692e9..8310bd14035 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -782,6 +782,11 @@ public class ApiClient { put("v2.getChangeRequest", false); put("v2.updateChangeRequest", false); put("v2.updateChangeRequestDecision", false); + put("v2.deleteTestOptimizationServiceSettings", false); + put("v2.getTestOptimizationServiceSettings", false); + put("v2.searchFlakyTests", false); + put("v2.updateFlakyTests", false); + put("v2.updateTestOptimizationServiceSettings", false); put("v2.createAWSCloudAuthPersonaMapping", false); put("v2.deleteAWSCloudAuthPersonaMapping", false); put("v2.getAWSCloudAuthPersonaMapping", false); @@ -984,8 +989,6 @@ public class ApiClient { put("v2.getIncidentTeam", false); put("v2.listIncidentTeams", false); put("v2.updateIncidentTeam", false); - put("v2.searchFlakyTests", false); - put("v2.updateFlakyTests", false); } }; protected static final java.util.logging.Logger logger = diff --git a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java index 02e6e7a08f4..d45173ef6aa 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java @@ -11,6 +11,10 @@ import com.datadog.api.client.v2.model.FlakyTestsSearchRequestAttributes; import com.datadog.api.client.v2.model.FlakyTestsSearchRequestData; import com.datadog.api.client.v2.model.FlakyTestsSearchResponse; +import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequest; +import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequest; +import com.datadog.api.client.v2.model.TestOptimizationServiceSettingsResponse; +import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequest; import com.datadog.api.client.v2.model.UpdateFlakyTestsRequest; import com.datadog.api.client.v2.model.UpdateFlakyTestsResponse; import jakarta.ws.rs.client.Invocation; @@ -52,6 +56,322 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Delete Test Optimization service settings. + * + *

See {@link #deleteTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void deleteTestOptimizationServiceSettings( + TestOptimizationDeleteServiceSettingsRequest body) throws ApiException { + deleteTestOptimizationServiceSettingsWithHttpInfo(body); + } + + /** + * Delete Test Optimization service settings. + * + *

See {@link #deleteTestOptimizationServiceSettingsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture deleteTestOptimizationServiceSettingsAsync( + TestOptimizationDeleteServiceSettingsRequest body) { + return deleteTestOptimizationServiceSettingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete Test Optimization settings for a specific service identified by repository, service + * name, and environment. + * + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteTestOptimizationServiceSettingsWithHttpInfo( + TestOptimizationDeleteServiceSettingsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " deleteTestOptimizationServiceSettings"); + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.deleteTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete Test Optimization service settings. + * + *

See {@link #deleteTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> + deleteTestOptimizationServiceSettingsWithHttpInfoAsync( + TestOptimizationDeleteServiceSettingsRequest body) { + // Check if unstable operation is enabled + String operationId = "deleteTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " deleteTestOptimizationServiceSettings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.deleteTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get Test Optimization service settings. + * + *

See {@link #getTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @return TestOptimizationServiceSettingsResponse + * @throws ApiException if fails to make API call + */ + public TestOptimizationServiceSettingsResponse getTestOptimizationServiceSettings( + TestOptimizationGetServiceSettingsRequest body) throws ApiException { + return getTestOptimizationServiceSettingsWithHttpInfo(body).getData(); + } + + /** + * Get Test Optimization service settings. + * + *

See {@link #getTestOptimizationServiceSettingsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<TestOptimizationServiceSettingsResponse> + */ + public CompletableFuture + getTestOptimizationServiceSettingsAsync(TestOptimizationGetServiceSettingsRequest body) { + return getTestOptimizationServiceSettingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve Test Optimization settings for a specific service identified by repository, service + * name, and environment. + * + * @param body (required) + * @return ApiResponse<TestOptimizationServiceSettingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + getTestOptimizationServiceSettingsWithHttpInfo(TestOptimizationGetServiceSettingsRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling getTestOptimizationServiceSettings"); + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.getTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Test Optimization service settings. + * + *

See {@link #getTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TestOptimizationServiceSettingsResponse>> + */ + public CompletableFuture> + getTestOptimizationServiceSettingsWithHttpInfoAsync( + TestOptimizationGetServiceSettingsRequest body) { + // Check if unstable operation is enabled + String operationId = "getTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " getTestOptimizationServiceSettings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.getTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to searchFlakyTests. */ public static class SearchFlakyTestsOptionalParameters { private FlakyTestsSearchRequest body; @@ -459,4 +779,167 @@ public CompletableFuture> updateFlakyTests false, new GenericType() {}); } + + /** + * Update Test Optimization service settings. + * + *

See {@link #updateTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @return TestOptimizationServiceSettingsResponse + * @throws ApiException if fails to make API call + */ + public TestOptimizationServiceSettingsResponse updateTestOptimizationServiceSettings( + TestOptimizationUpdateServiceSettingsRequest body) throws ApiException { + return updateTestOptimizationServiceSettingsWithHttpInfo(body).getData(); + } + + /** + * Update Test Optimization service settings. + * + *

See {@link #updateTestOptimizationServiceSettingsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<TestOptimizationServiceSettingsResponse> + */ + public CompletableFuture + updateTestOptimizationServiceSettingsAsync( + TestOptimizationUpdateServiceSettingsRequest body) { + return updateTestOptimizationServiceSettingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially update Test Optimization settings for a specific service identified by repository, + * service name, and environment. Only provided fields are updated; null or omitted fields are + * left unchanged. + * + * @param body (required) + * @return ApiResponse<TestOptimizationServiceSettingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + updateTestOptimizationServiceSettingsWithHttpInfo( + TestOptimizationUpdateServiceSettingsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateTestOptimizationServiceSettings"); + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.updateTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update Test Optimization service settings. + * + *

See {@link #updateTestOptimizationServiceSettingsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TestOptimizationServiceSettingsResponse>> + */ + public CompletableFuture> + updateTestOptimizationServiceSettingsWithHttpInfoAsync( + TestOptimizationUpdateServiceSettingsRequest body) { + // Check if unstable operation is enabled + String operationId = "updateTestOptimizationServiceSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateTestOptimizationServiceSettings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/ci/test-optimization/settings/service"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TestOptimizationApi.updateTestOptimizationServiceSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequest.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequest.java new file mode 100644 index 00000000000..7ad7b7294d4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequest.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object for deleting Test Optimization service settings. */ +@JsonPropertyOrder({TestOptimizationDeleteServiceSettingsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationDeleteServiceSettingsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TestOptimizationDeleteServiceSettingsRequestData data; + + public TestOptimizationDeleteServiceSettingsRequest() {} + + @JsonCreator + public TestOptimizationDeleteServiceSettingsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TestOptimizationDeleteServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TestOptimizationDeleteServiceSettingsRequest data( + TestOptimizationDeleteServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for delete service settings request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationDeleteServiceSettingsRequestData getData() { + return data; + } + + public void setData(TestOptimizationDeleteServiceSettingsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationDeleteServiceSettingsRequest + */ + @JsonAnySetter + public TestOptimizationDeleteServiceSettingsRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationDeleteServiceSettingsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationDeleteServiceSettingsRequest testOptimizationDeleteServiceSettingsRequest = + (TestOptimizationDeleteServiceSettingsRequest) o; + return Objects.equals(this.data, testOptimizationDeleteServiceSettingsRequest.data) + && Objects.equals( + this.additionalProperties, + testOptimizationDeleteServiceSettingsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationDeleteServiceSettingsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestAttributes.java new file mode 100644 index 00000000000..804b620afa2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestAttributes.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for deleting Test Optimization service settings. */ +@JsonPropertyOrder({ + TestOptimizationDeleteServiceSettingsRequestAttributes.JSON_PROPERTY_ENV, + TestOptimizationDeleteServiceSettingsRequestAttributes.JSON_PROPERTY_REPOSITORY_ID, + TestOptimizationDeleteServiceSettingsRequestAttributes.JSON_PROPERTY_SERVICE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationDeleteServiceSettingsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; + private String repositoryId; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public TestOptimizationDeleteServiceSettingsRequestAttributes() {} + + @JsonCreator + public TestOptimizationDeleteServiceSettingsRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_REPOSITORY_ID) String repositoryId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_NAME) String serviceName) { + this.repositoryId = repositoryId; + this.serviceName = serviceName; + } + + public TestOptimizationDeleteServiceSettingsRequestAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment name. If omitted, defaults to none. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public TestOptimizationDeleteServiceSettingsRequestAttributes repositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * The repository identifier. + * + * @return repositoryId + */ + @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRepositoryId() { + return repositoryId; + } + + public void setRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + } + + public TestOptimizationDeleteServiceSettingsRequestAttributes serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The service name. + * + * @return serviceName + */ + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationDeleteServiceSettingsRequestAttributes + */ + @JsonAnySetter + public TestOptimizationDeleteServiceSettingsRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TestOptimizationDeleteServiceSettingsRequestAttributes object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationDeleteServiceSettingsRequestAttributes + testOptimizationDeleteServiceSettingsRequestAttributes = + (TestOptimizationDeleteServiceSettingsRequestAttributes) o; + return Objects.equals(this.env, testOptimizationDeleteServiceSettingsRequestAttributes.env) + && Objects.equals( + this.repositoryId, testOptimizationDeleteServiceSettingsRequestAttributes.repositoryId) + && Objects.equals( + this.serviceName, testOptimizationDeleteServiceSettingsRequestAttributes.serviceName) + && Objects.equals( + this.additionalProperties, + testOptimizationDeleteServiceSettingsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(env, repositoryId, serviceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationDeleteServiceSettingsRequestAttributes {\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestData.java new file mode 100644 index 00000000000..27572f0f7ce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestData.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for delete service settings request. */ +@JsonPropertyOrder({ + TestOptimizationDeleteServiceSettingsRequestData.JSON_PROPERTY_ATTRIBUTES, + TestOptimizationDeleteServiceSettingsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationDeleteServiceSettingsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TestOptimizationDeleteServiceSettingsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TestOptimizationDeleteServiceSettingsRequestDataType type; + + public TestOptimizationDeleteServiceSettingsRequestData() {} + + @JsonCreator + public TestOptimizationDeleteServiceSettingsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TestOptimizationDeleteServiceSettingsRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TestOptimizationDeleteServiceSettingsRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TestOptimizationDeleteServiceSettingsRequestData attributes( + TestOptimizationDeleteServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for deleting Test Optimization service settings. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationDeleteServiceSettingsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TestOptimizationDeleteServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + } + + public TestOptimizationDeleteServiceSettingsRequestData type( + TestOptimizationDeleteServiceSettingsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for delete service settings request. The value must always be + * test_optimization_delete_service_settings_request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationDeleteServiceSettingsRequestDataType getType() { + return type; + } + + public void setType(TestOptimizationDeleteServiceSettingsRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationDeleteServiceSettingsRequestData + */ + @JsonAnySetter + public TestOptimizationDeleteServiceSettingsRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationDeleteServiceSettingsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationDeleteServiceSettingsRequestData + testOptimizationDeleteServiceSettingsRequestData = + (TestOptimizationDeleteServiceSettingsRequestData) o; + return Objects.equals( + this.attributes, testOptimizationDeleteServiceSettingsRequestData.attributes) + && Objects.equals(this.type, testOptimizationDeleteServiceSettingsRequestData.type) + && Objects.equals( + this.additionalProperties, + testOptimizationDeleteServiceSettingsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationDeleteServiceSettingsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestDataType.java new file mode 100644 index 00000000000..ade8d46f49c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationDeleteServiceSettingsRequestDataType.java @@ -0,0 +1,68 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * JSON:API type for delete service settings request. The value must always be + * test_optimization_delete_service_settings_request. + */ +@JsonSerialize( + using = + TestOptimizationDeleteServiceSettingsRequestDataType + .TestOptimizationDeleteServiceSettingsRequestDataTypeSerializer.class) +public class TestOptimizationDeleteServiceSettingsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("test_optimization_delete_service_settings_request")); + + public static final TestOptimizationDeleteServiceSettingsRequestDataType + TEST_OPTIMIZATION_DELETE_SERVICE_SETTINGS_REQUEST = + new TestOptimizationDeleteServiceSettingsRequestDataType( + "test_optimization_delete_service_settings_request"); + + TestOptimizationDeleteServiceSettingsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class TestOptimizationDeleteServiceSettingsRequestDataTypeSerializer + extends StdSerializer { + public TestOptimizationDeleteServiceSettingsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public TestOptimizationDeleteServiceSettingsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TestOptimizationDeleteServiceSettingsRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TestOptimizationDeleteServiceSettingsRequestDataType fromValue(String value) { + return new TestOptimizationDeleteServiceSettingsRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequest.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequest.java new file mode 100644 index 00000000000..11c2a60cb1f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequest.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object for getting Test Optimization service settings. */ +@JsonPropertyOrder({TestOptimizationGetServiceSettingsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationGetServiceSettingsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TestOptimizationGetServiceSettingsRequestData data; + + public TestOptimizationGetServiceSettingsRequest() {} + + @JsonCreator + public TestOptimizationGetServiceSettingsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TestOptimizationGetServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TestOptimizationGetServiceSettingsRequest data( + TestOptimizationGetServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for get service settings request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationGetServiceSettingsRequestData getData() { + return data; + } + + public void setData(TestOptimizationGetServiceSettingsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationGetServiceSettingsRequest + */ + @JsonAnySetter + public TestOptimizationGetServiceSettingsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationGetServiceSettingsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationGetServiceSettingsRequest testOptimizationGetServiceSettingsRequest = + (TestOptimizationGetServiceSettingsRequest) o; + return Objects.equals(this.data, testOptimizationGetServiceSettingsRequest.data) + && Objects.equals( + this.additionalProperties, + testOptimizationGetServiceSettingsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationGetServiceSettingsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestAttributes.java new file mode 100644 index 00000000000..8eab6487240 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestAttributes.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for requesting Test Optimization service settings. */ +@JsonPropertyOrder({ + TestOptimizationGetServiceSettingsRequestAttributes.JSON_PROPERTY_ENV, + TestOptimizationGetServiceSettingsRequestAttributes.JSON_PROPERTY_REPOSITORY_ID, + TestOptimizationGetServiceSettingsRequestAttributes.JSON_PROPERTY_SERVICE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationGetServiceSettingsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; + private String repositoryId; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public TestOptimizationGetServiceSettingsRequestAttributes() {} + + @JsonCreator + public TestOptimizationGetServiceSettingsRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_REPOSITORY_ID) String repositoryId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_NAME) String serviceName) { + this.repositoryId = repositoryId; + this.serviceName = serviceName; + } + + public TestOptimizationGetServiceSettingsRequestAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment name. If omitted, defaults to none. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public TestOptimizationGetServiceSettingsRequestAttributes repositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * The repository identifier. + * + * @return repositoryId + */ + @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRepositoryId() { + return repositoryId; + } + + public void setRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + } + + public TestOptimizationGetServiceSettingsRequestAttributes serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The service name. + * + * @return serviceName + */ + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationGetServiceSettingsRequestAttributes + */ + @JsonAnySetter + public TestOptimizationGetServiceSettingsRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TestOptimizationGetServiceSettingsRequestAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationGetServiceSettingsRequestAttributes + testOptimizationGetServiceSettingsRequestAttributes = + (TestOptimizationGetServiceSettingsRequestAttributes) o; + return Objects.equals(this.env, testOptimizationGetServiceSettingsRequestAttributes.env) + && Objects.equals( + this.repositoryId, testOptimizationGetServiceSettingsRequestAttributes.repositoryId) + && Objects.equals( + this.serviceName, testOptimizationGetServiceSettingsRequestAttributes.serviceName) + && Objects.equals( + this.additionalProperties, + testOptimizationGetServiceSettingsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(env, repositoryId, serviceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationGetServiceSettingsRequestAttributes {\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestData.java new file mode 100644 index 00000000000..714404f7943 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestData.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for get service settings request. */ +@JsonPropertyOrder({ + TestOptimizationGetServiceSettingsRequestData.JSON_PROPERTY_ATTRIBUTES, + TestOptimizationGetServiceSettingsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationGetServiceSettingsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TestOptimizationGetServiceSettingsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TestOptimizationGetServiceSettingsRequestDataType type; + + public TestOptimizationGetServiceSettingsRequestData() {} + + @JsonCreator + public TestOptimizationGetServiceSettingsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TestOptimizationGetServiceSettingsRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TestOptimizationGetServiceSettingsRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TestOptimizationGetServiceSettingsRequestData attributes( + TestOptimizationGetServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for requesting Test Optimization service settings. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationGetServiceSettingsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TestOptimizationGetServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + } + + public TestOptimizationGetServiceSettingsRequestData type( + TestOptimizationGetServiceSettingsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for get service settings request. The value must always be + * test_optimization_get_service_settings_request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationGetServiceSettingsRequestDataType getType() { + return type; + } + + public void setType(TestOptimizationGetServiceSettingsRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationGetServiceSettingsRequestData + */ + @JsonAnySetter + public TestOptimizationGetServiceSettingsRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationGetServiceSettingsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationGetServiceSettingsRequestData testOptimizationGetServiceSettingsRequestData = + (TestOptimizationGetServiceSettingsRequestData) o; + return Objects.equals(this.attributes, testOptimizationGetServiceSettingsRequestData.attributes) + && Objects.equals(this.type, testOptimizationGetServiceSettingsRequestData.type) + && Objects.equals( + this.additionalProperties, + testOptimizationGetServiceSettingsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationGetServiceSettingsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestDataType.java new file mode 100644 index 00000000000..fcf9c17001c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetServiceSettingsRequestDataType.java @@ -0,0 +1,68 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * JSON:API type for get service settings request. The value must always be + * test_optimization_get_service_settings_request. + */ +@JsonSerialize( + using = + TestOptimizationGetServiceSettingsRequestDataType + .TestOptimizationGetServiceSettingsRequestDataTypeSerializer.class) +public class TestOptimizationGetServiceSettingsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("test_optimization_get_service_settings_request")); + + public static final TestOptimizationGetServiceSettingsRequestDataType + TEST_OPTIMIZATION_GET_SERVICE_SETTINGS_REQUEST = + new TestOptimizationGetServiceSettingsRequestDataType( + "test_optimization_get_service_settings_request"); + + TestOptimizationGetServiceSettingsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class TestOptimizationGetServiceSettingsRequestDataTypeSerializer + extends StdSerializer { + public TestOptimizationGetServiceSettingsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public TestOptimizationGetServiceSettingsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TestOptimizationGetServiceSettingsRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TestOptimizationGetServiceSettingsRequestDataType fromValue(String value) { + return new TestOptimizationGetServiceSettingsRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsAttributes.java new file mode 100644 index 00000000000..500d5abca72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsAttributes.java @@ -0,0 +1,394 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for Test Optimization service settings. */ +@JsonPropertyOrder({ + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_CODE_COVERAGE_ENABLED, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_ENV, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_PR_COMMENTS_ENABLED, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_REPOSITORY_ID, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_SERVICE_NAME, + TestOptimizationServiceSettingsAttributes.JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationServiceSettingsAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED = "auto_test_retries_enabled"; + private Boolean autoTestRetriesEnabled; + + public static final String JSON_PROPERTY_CODE_COVERAGE_ENABLED = "code_coverage_enabled"; + private Boolean codeCoverageEnabled; + + public static final String JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED = + "early_flake_detection_enabled"; + private Boolean earlyFlakeDetectionEnabled; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED = + "failed_test_replay_enabled"; + private Boolean failedTestReplayEnabled; + + public static final String JSON_PROPERTY_PR_COMMENTS_ENABLED = "pr_comments_enabled"; + private Boolean prCommentsEnabled; + + public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; + private String repositoryId; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public static final String JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED = + "test_impact_analysis_enabled"; + private Boolean testImpactAnalysisEnabled; + + public TestOptimizationServiceSettingsAttributes autoTestRetriesEnabled( + Boolean autoTestRetriesEnabled) { + this.autoTestRetriesEnabled = autoTestRetriesEnabled; + return this; + } + + /** + * Whether Auto Test Retries are enabled for this service. + * + * @return autoTestRetriesEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoTestRetriesEnabled() { + return autoTestRetriesEnabled; + } + + public void setAutoTestRetriesEnabled(Boolean autoTestRetriesEnabled) { + this.autoTestRetriesEnabled = autoTestRetriesEnabled; + } + + public TestOptimizationServiceSettingsAttributes codeCoverageEnabled( + Boolean codeCoverageEnabled) { + this.codeCoverageEnabled = codeCoverageEnabled; + return this; + } + + /** + * Whether Code Coverage is enabled for this service. + * + * @return codeCoverageEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE_COVERAGE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCodeCoverageEnabled() { + return codeCoverageEnabled; + } + + public void setCodeCoverageEnabled(Boolean codeCoverageEnabled) { + this.codeCoverageEnabled = codeCoverageEnabled; + } + + public TestOptimizationServiceSettingsAttributes earlyFlakeDetectionEnabled( + Boolean earlyFlakeDetectionEnabled) { + this.earlyFlakeDetectionEnabled = earlyFlakeDetectionEnabled; + return this; + } + + /** + * Whether Early Flake Detection is enabled for this service. + * + * @return earlyFlakeDetectionEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEarlyFlakeDetectionEnabled() { + return earlyFlakeDetectionEnabled; + } + + public void setEarlyFlakeDetectionEnabled(Boolean earlyFlakeDetectionEnabled) { + this.earlyFlakeDetectionEnabled = earlyFlakeDetectionEnabled; + } + + public TestOptimizationServiceSettingsAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment name. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public TestOptimizationServiceSettingsAttributes failedTestReplayEnabled( + Boolean failedTestReplayEnabled) { + this.failedTestReplayEnabled = failedTestReplayEnabled; + return this; + } + + /** + * Whether Failed Test Replay is enabled for this service. + * + * @return failedTestReplayEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFailedTestReplayEnabled() { + return failedTestReplayEnabled; + } + + public void setFailedTestReplayEnabled(Boolean failedTestReplayEnabled) { + this.failedTestReplayEnabled = failedTestReplayEnabled; + } + + public TestOptimizationServiceSettingsAttributes prCommentsEnabled(Boolean prCommentsEnabled) { + this.prCommentsEnabled = prCommentsEnabled; + return this; + } + + /** + * Whether PR Comments are enabled for this service. + * + * @return prCommentsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PR_COMMENTS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrCommentsEnabled() { + return prCommentsEnabled; + } + + public void setPrCommentsEnabled(Boolean prCommentsEnabled) { + this.prCommentsEnabled = prCommentsEnabled; + } + + public TestOptimizationServiceSettingsAttributes repositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * The repository identifier. + * + * @return repositoryId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryId() { + return repositoryId; + } + + public void setRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + } + + public TestOptimizationServiceSettingsAttributes serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The service name. + * + * @return serviceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public TestOptimizationServiceSettingsAttributes testImpactAnalysisEnabled( + Boolean testImpactAnalysisEnabled) { + this.testImpactAnalysisEnabled = testImpactAnalysisEnabled; + return this; + } + + /** + * Whether Test Impact Analysis is enabled for this service. + * + * @return testImpactAnalysisEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestImpactAnalysisEnabled() { + return testImpactAnalysisEnabled; + } + + public void setTestImpactAnalysisEnabled(Boolean testImpactAnalysisEnabled) { + this.testImpactAnalysisEnabled = testImpactAnalysisEnabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationServiceSettingsAttributes + */ + @JsonAnySetter + public TestOptimizationServiceSettingsAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationServiceSettingsAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationServiceSettingsAttributes testOptimizationServiceSettingsAttributes = + (TestOptimizationServiceSettingsAttributes) o; + return Objects.equals( + this.autoTestRetriesEnabled, + testOptimizationServiceSettingsAttributes.autoTestRetriesEnabled) + && Objects.equals( + this.codeCoverageEnabled, testOptimizationServiceSettingsAttributes.codeCoverageEnabled) + && Objects.equals( + this.earlyFlakeDetectionEnabled, + testOptimizationServiceSettingsAttributes.earlyFlakeDetectionEnabled) + && Objects.equals(this.env, testOptimizationServiceSettingsAttributes.env) + && Objects.equals( + this.failedTestReplayEnabled, + testOptimizationServiceSettingsAttributes.failedTestReplayEnabled) + && Objects.equals( + this.prCommentsEnabled, testOptimizationServiceSettingsAttributes.prCommentsEnabled) + && Objects.equals(this.repositoryId, testOptimizationServiceSettingsAttributes.repositoryId) + && Objects.equals(this.serviceName, testOptimizationServiceSettingsAttributes.serviceName) + && Objects.equals( + this.testImpactAnalysisEnabled, + testOptimizationServiceSettingsAttributes.testImpactAnalysisEnabled) + && Objects.equals( + this.additionalProperties, + testOptimizationServiceSettingsAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autoTestRetriesEnabled, + codeCoverageEnabled, + earlyFlakeDetectionEnabled, + env, + failedTestReplayEnabled, + prCommentsEnabled, + repositoryId, + serviceName, + testImpactAnalysisEnabled, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationServiceSettingsAttributes {\n"); + sb.append(" autoTestRetriesEnabled: ") + .append(toIndentedString(autoTestRetriesEnabled)) + .append("\n"); + sb.append(" codeCoverageEnabled: ") + .append(toIndentedString(codeCoverageEnabled)) + .append("\n"); + sb.append(" earlyFlakeDetectionEnabled: ") + .append(toIndentedString(earlyFlakeDetectionEnabled)) + .append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" failedTestReplayEnabled: ") + .append(toIndentedString(failedTestReplayEnabled)) + .append("\n"); + sb.append(" prCommentsEnabled: ").append(toIndentedString(prCommentsEnabled)).append("\n"); + sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" testImpactAnalysisEnabled: ") + .append(toIndentedString(testImpactAnalysisEnabled)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsData.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsData.java new file mode 100644 index 00000000000..d4b9b2e4a38 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsData.java @@ -0,0 +1,200 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for Test Optimization service settings response. */ +@JsonPropertyOrder({ + TestOptimizationServiceSettingsData.JSON_PROPERTY_ATTRIBUTES, + TestOptimizationServiceSettingsData.JSON_PROPERTY_ID, + TestOptimizationServiceSettingsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationServiceSettingsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TestOptimizationServiceSettingsAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TestOptimizationServiceSettingsType type; + + public TestOptimizationServiceSettingsData attributes( + TestOptimizationServiceSettingsAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for Test Optimization service settings. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TestOptimizationServiceSettingsAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TestOptimizationServiceSettingsAttributes attributes) { + this.attributes = attributes; + } + + public TestOptimizationServiceSettingsData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the service settings. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TestOptimizationServiceSettingsData type(TestOptimizationServiceSettingsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for service settings response. The value must always be + * test_optimization_service_settings. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TestOptimizationServiceSettingsType getType() { + return type; + } + + public void setType(TestOptimizationServiceSettingsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationServiceSettingsData + */ + @JsonAnySetter + public TestOptimizationServiceSettingsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationServiceSettingsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationServiceSettingsData testOptimizationServiceSettingsData = + (TestOptimizationServiceSettingsData) o; + return Objects.equals(this.attributes, testOptimizationServiceSettingsData.attributes) + && Objects.equals(this.id, testOptimizationServiceSettingsData.id) + && Objects.equals(this.type, testOptimizationServiceSettingsData.type) + && Objects.equals( + this.additionalProperties, testOptimizationServiceSettingsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationServiceSettingsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsResponse.java new file mode 100644 index 00000000000..e7132cc26db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsResponse.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response object containing Test Optimization service settings. */ +@JsonPropertyOrder({TestOptimizationServiceSettingsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationServiceSettingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TestOptimizationServiceSettingsData data; + + public TestOptimizationServiceSettingsResponse data(TestOptimizationServiceSettingsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for Test Optimization service settings response. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TestOptimizationServiceSettingsData getData() { + return data; + } + + public void setData(TestOptimizationServiceSettingsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationServiceSettingsResponse + */ + @JsonAnySetter + public TestOptimizationServiceSettingsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationServiceSettingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationServiceSettingsResponse testOptimizationServiceSettingsResponse = + (TestOptimizationServiceSettingsResponse) o; + return Objects.equals(this.data, testOptimizationServiceSettingsResponse.data) + && Objects.equals( + this.additionalProperties, + testOptimizationServiceSettingsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationServiceSettingsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsType.java new file mode 100644 index 00000000000..e40b390a304 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationServiceSettingsType.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * JSON:API type for service settings response. The value must always be + * test_optimization_service_settings. + */ +@JsonSerialize( + using = TestOptimizationServiceSettingsType.TestOptimizationServiceSettingsTypeSerializer.class) +public class TestOptimizationServiceSettingsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("test_optimization_service_settings")); + + public static final TestOptimizationServiceSettingsType TEST_OPTIMIZATION_SERVICE_SETTINGS = + new TestOptimizationServiceSettingsType("test_optimization_service_settings"); + + TestOptimizationServiceSettingsType(String value) { + super(value, allowedValues); + } + + public static class TestOptimizationServiceSettingsTypeSerializer + extends StdSerializer { + public TestOptimizationServiceSettingsTypeSerializer( + Class t) { + super(t); + } + + public TestOptimizationServiceSettingsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TestOptimizationServiceSettingsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TestOptimizationServiceSettingsType fromValue(String value) { + return new TestOptimizationServiceSettingsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequest.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequest.java new file mode 100644 index 00000000000..53cbc434ffc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequest.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object for updating Test Optimization service settings. */ +@JsonPropertyOrder({TestOptimizationUpdateServiceSettingsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationUpdateServiceSettingsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TestOptimizationUpdateServiceSettingsRequestData data; + + public TestOptimizationUpdateServiceSettingsRequest() {} + + @JsonCreator + public TestOptimizationUpdateServiceSettingsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TestOptimizationUpdateServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TestOptimizationUpdateServiceSettingsRequest data( + TestOptimizationUpdateServiceSettingsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for update service settings request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationUpdateServiceSettingsRequestData getData() { + return data; + } + + public void setData(TestOptimizationUpdateServiceSettingsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationUpdateServiceSettingsRequest + */ + @JsonAnySetter + public TestOptimizationUpdateServiceSettingsRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationUpdateServiceSettingsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationUpdateServiceSettingsRequest testOptimizationUpdateServiceSettingsRequest = + (TestOptimizationUpdateServiceSettingsRequest) o; + return Objects.equals(this.data, testOptimizationUpdateServiceSettingsRequest.data) + && Objects.equals( + this.additionalProperties, + testOptimizationUpdateServiceSettingsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationUpdateServiceSettingsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestAttributes.java new file mode 100644 index 00000000000..8540222d129 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestAttributes.java @@ -0,0 +1,417 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes for updating Test Optimization service settings. All non-required fields are optional; + * only provided fields will be updated. + */ +@JsonPropertyOrder({ + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_CODE_COVERAGE_ENABLED, + TestOptimizationUpdateServiceSettingsRequestAttributes + .JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_ENV, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_PR_COMMENTS_ENABLED, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_REPOSITORY_ID, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_SERVICE_NAME, + TestOptimizationUpdateServiceSettingsRequestAttributes.JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationUpdateServiceSettingsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED = "auto_test_retries_enabled"; + private Boolean autoTestRetriesEnabled; + + public static final String JSON_PROPERTY_CODE_COVERAGE_ENABLED = "code_coverage_enabled"; + private Boolean codeCoverageEnabled; + + public static final String JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED = + "early_flake_detection_enabled"; + private Boolean earlyFlakeDetectionEnabled; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED = + "failed_test_replay_enabled"; + private Boolean failedTestReplayEnabled; + + public static final String JSON_PROPERTY_PR_COMMENTS_ENABLED = "pr_comments_enabled"; + private Boolean prCommentsEnabled; + + public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; + private String repositoryId; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public static final String JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED = + "test_impact_analysis_enabled"; + private Boolean testImpactAnalysisEnabled; + + public TestOptimizationUpdateServiceSettingsRequestAttributes() {} + + @JsonCreator + public TestOptimizationUpdateServiceSettingsRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_REPOSITORY_ID) String repositoryId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE_NAME) String serviceName) { + this.repositoryId = repositoryId; + this.serviceName = serviceName; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes autoTestRetriesEnabled( + Boolean autoTestRetriesEnabled) { + this.autoTestRetriesEnabled = autoTestRetriesEnabled; + return this; + } + + /** + * Whether Auto Test Retries are enabled for this service. + * + * @return autoTestRetriesEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_TEST_RETRIES_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoTestRetriesEnabled() { + return autoTestRetriesEnabled; + } + + public void setAutoTestRetriesEnabled(Boolean autoTestRetriesEnabled) { + this.autoTestRetriesEnabled = autoTestRetriesEnabled; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes codeCoverageEnabled( + Boolean codeCoverageEnabled) { + this.codeCoverageEnabled = codeCoverageEnabled; + return this; + } + + /** + * Whether Code Coverage is enabled for this service. + * + * @return codeCoverageEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE_COVERAGE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCodeCoverageEnabled() { + return codeCoverageEnabled; + } + + public void setCodeCoverageEnabled(Boolean codeCoverageEnabled) { + this.codeCoverageEnabled = codeCoverageEnabled; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes earlyFlakeDetectionEnabled( + Boolean earlyFlakeDetectionEnabled) { + this.earlyFlakeDetectionEnabled = earlyFlakeDetectionEnabled; + return this; + } + + /** + * Whether Early Flake Detection is enabled for this service. + * + * @return earlyFlakeDetectionEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EARLY_FLAKE_DETECTION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEarlyFlakeDetectionEnabled() { + return earlyFlakeDetectionEnabled; + } + + public void setEarlyFlakeDetectionEnabled(Boolean earlyFlakeDetectionEnabled) { + this.earlyFlakeDetectionEnabled = earlyFlakeDetectionEnabled; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment name. If omitted, defaults to none. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes failedTestReplayEnabled( + Boolean failedTestReplayEnabled) { + this.failedTestReplayEnabled = failedTestReplayEnabled; + return this; + } + + /** + * Whether Failed Test Replay is enabled for this service. + * + * @return failedTestReplayEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILED_TEST_REPLAY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFailedTestReplayEnabled() { + return failedTestReplayEnabled; + } + + public void setFailedTestReplayEnabled(Boolean failedTestReplayEnabled) { + this.failedTestReplayEnabled = failedTestReplayEnabled; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes prCommentsEnabled( + Boolean prCommentsEnabled) { + this.prCommentsEnabled = prCommentsEnabled; + return this; + } + + /** + * Whether PR Comments are enabled for this service. + * + * @return prCommentsEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PR_COMMENTS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrCommentsEnabled() { + return prCommentsEnabled; + } + + public void setPrCommentsEnabled(Boolean prCommentsEnabled) { + this.prCommentsEnabled = prCommentsEnabled; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes repositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * The repository identifier. + * + * @return repositoryId + */ + @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRepositoryId() { + return repositoryId; + } + + public void setRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The service name. + * + * @return serviceName + */ + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public TestOptimizationUpdateServiceSettingsRequestAttributes testImpactAnalysisEnabled( + Boolean testImpactAnalysisEnabled) { + this.testImpactAnalysisEnabled = testImpactAnalysisEnabled; + return this; + } + + /** + * Whether Test Impact Analysis is enabled for this service. + * + * @return testImpactAnalysisEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_IMPACT_ANALYSIS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestImpactAnalysisEnabled() { + return testImpactAnalysisEnabled; + } + + public void setTestImpactAnalysisEnabled(Boolean testImpactAnalysisEnabled) { + this.testImpactAnalysisEnabled = testImpactAnalysisEnabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationUpdateServiceSettingsRequestAttributes + */ + @JsonAnySetter + public TestOptimizationUpdateServiceSettingsRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this TestOptimizationUpdateServiceSettingsRequestAttributes object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationUpdateServiceSettingsRequestAttributes + testOptimizationUpdateServiceSettingsRequestAttributes = + (TestOptimizationUpdateServiceSettingsRequestAttributes) o; + return Objects.equals( + this.autoTestRetriesEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.autoTestRetriesEnabled) + && Objects.equals( + this.codeCoverageEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.codeCoverageEnabled) + && Objects.equals( + this.earlyFlakeDetectionEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.earlyFlakeDetectionEnabled) + && Objects.equals(this.env, testOptimizationUpdateServiceSettingsRequestAttributes.env) + && Objects.equals( + this.failedTestReplayEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.failedTestReplayEnabled) + && Objects.equals( + this.prCommentsEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.prCommentsEnabled) + && Objects.equals( + this.repositoryId, testOptimizationUpdateServiceSettingsRequestAttributes.repositoryId) + && Objects.equals( + this.serviceName, testOptimizationUpdateServiceSettingsRequestAttributes.serviceName) + && Objects.equals( + this.testImpactAnalysisEnabled, + testOptimizationUpdateServiceSettingsRequestAttributes.testImpactAnalysisEnabled) + && Objects.equals( + this.additionalProperties, + testOptimizationUpdateServiceSettingsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autoTestRetriesEnabled, + codeCoverageEnabled, + earlyFlakeDetectionEnabled, + env, + failedTestReplayEnabled, + prCommentsEnabled, + repositoryId, + serviceName, + testImpactAnalysisEnabled, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationUpdateServiceSettingsRequestAttributes {\n"); + sb.append(" autoTestRetriesEnabled: ") + .append(toIndentedString(autoTestRetriesEnabled)) + .append("\n"); + sb.append(" codeCoverageEnabled: ") + .append(toIndentedString(codeCoverageEnabled)) + .append("\n"); + sb.append(" earlyFlakeDetectionEnabled: ") + .append(toIndentedString(earlyFlakeDetectionEnabled)) + .append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" failedTestReplayEnabled: ") + .append(toIndentedString(failedTestReplayEnabled)) + .append("\n"); + sb.append(" prCommentsEnabled: ").append(toIndentedString(prCommentsEnabled)).append("\n"); + sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" testImpactAnalysisEnabled: ") + .append(toIndentedString(testImpactAnalysisEnabled)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestData.java new file mode 100644 index 00000000000..7ed77c11f94 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestData.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for update service settings request. */ +@JsonPropertyOrder({ + TestOptimizationUpdateServiceSettingsRequestData.JSON_PROPERTY_ATTRIBUTES, + TestOptimizationUpdateServiceSettingsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TestOptimizationUpdateServiceSettingsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TestOptimizationUpdateServiceSettingsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TestOptimizationUpdateServiceSettingsRequestDataType type; + + public TestOptimizationUpdateServiceSettingsRequestData() {} + + @JsonCreator + public TestOptimizationUpdateServiceSettingsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TestOptimizationUpdateServiceSettingsRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TestOptimizationUpdateServiceSettingsRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TestOptimizationUpdateServiceSettingsRequestData attributes( + TestOptimizationUpdateServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating Test Optimization service settings. All non-required fields are + * optional; only provided fields will be updated. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationUpdateServiceSettingsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TestOptimizationUpdateServiceSettingsRequestAttributes attributes) { + this.attributes = attributes; + } + + public TestOptimizationUpdateServiceSettingsRequestData type( + TestOptimizationUpdateServiceSettingsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for update service settings request. The value must always be + * test_optimization_update_service_settings_request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TestOptimizationUpdateServiceSettingsRequestDataType getType() { + return type; + } + + public void setType(TestOptimizationUpdateServiceSettingsRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TestOptimizationUpdateServiceSettingsRequestData + */ + @JsonAnySetter + public TestOptimizationUpdateServiceSettingsRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TestOptimizationUpdateServiceSettingsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestOptimizationUpdateServiceSettingsRequestData + testOptimizationUpdateServiceSettingsRequestData = + (TestOptimizationUpdateServiceSettingsRequestData) o; + return Objects.equals( + this.attributes, testOptimizationUpdateServiceSettingsRequestData.attributes) + && Objects.equals(this.type, testOptimizationUpdateServiceSettingsRequestData.type) + && Objects.equals( + this.additionalProperties, + testOptimizationUpdateServiceSettingsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestOptimizationUpdateServiceSettingsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestDataType.java new file mode 100644 index 00000000000..1b5450c0fd7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateServiceSettingsRequestDataType.java @@ -0,0 +1,68 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * JSON:API type for update service settings request. The value must always be + * test_optimization_update_service_settings_request. + */ +@JsonSerialize( + using = + TestOptimizationUpdateServiceSettingsRequestDataType + .TestOptimizationUpdateServiceSettingsRequestDataTypeSerializer.class) +public class TestOptimizationUpdateServiceSettingsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("test_optimization_update_service_settings_request")); + + public static final TestOptimizationUpdateServiceSettingsRequestDataType + TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST = + new TestOptimizationUpdateServiceSettingsRequestDataType( + "test_optimization_update_service_settings_request"); + + TestOptimizationUpdateServiceSettingsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class TestOptimizationUpdateServiceSettingsRequestDataTypeSerializer + extends StdSerializer { + public TestOptimizationUpdateServiceSettingsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public TestOptimizationUpdateServiceSettingsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TestOptimizationUpdateServiceSettingsRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TestOptimizationUpdateServiceSettingsRequestDataType fromValue(String value) { + return new TestOptimizationUpdateServiceSettingsRequestDataType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature index bbf7d87075e..427db05baf4 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature @@ -9,6 +9,78 @@ Feature: Test Optimization And a valid "appKeyAuth" key in the system And an instance of "TestOptimization" API + @generated @skip @team:DataDog/ci-app-backend + Scenario: Delete Test Optimization service settings returns "Bad Request" response + Given operation "DeleteTestOptimizationServiceSettings" enabled + And new "DeleteTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Delete Test Optimization service settings returns "No Content" response + Given operation "DeleteTestOptimizationServiceSettings" enabled + And new "DeleteTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Delete Test Optimization service settings returns "Not Found" response + Given operation "DeleteTestOptimizationServiceSettings" enabled + And new "DeleteTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_delete_service_settings_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings returns "Bad Request" response + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings returns "Not Found" response + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings returns "OK" response + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings with empty env returns bad request + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "", "repository_id": "github.com/datadog/shopist", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings with empty repository_id returns bad request + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "", "service_name": "shopist"}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ci-app-backend + Scenario: Get Test Optimization service settings with empty service_name returns bad request + Given operation "GetTestOptimizationServiceSettings" enabled + And new "GetTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "github.com/datadog/shopist", "service_name": ""}, "type": "test_optimization_get_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ci-app-backend Scenario: Search flaky tests returns "Bad Request" response Given operation "SearchFlakyTests" enabled @@ -61,6 +133,38 @@ Feature: Test Optimization When the request with pagination is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend + Scenario: Update Test Optimization service settings returns "Bad Request" response + Given operation "UpdateTestOptimizationServiceSettings" enabled + And new "UpdateTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Update Test Optimization service settings returns "Not Found" response + Given operation "UpdateTestOptimizationServiceSettings" enabled + And new "UpdateTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Update Test Optimization service settings returns "OK" response + Given operation "UpdateTestOptimizationServiceSettings" enabled + And new "UpdateTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/ci-app-backend + Scenario: Update Test Optimization service settings with empty repository_id returns bad request + Given operation "UpdateTestOptimizationServiceSettings" enabled + And new "UpdateTestOptimizationServiceSettings" request + And body with value {"data": {"attributes": {"env": "prod", "repository_id": "", "service_name": "shopist"}, "type": "test_optimization_update_service_settings_request"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ci-app-backend Scenario: Update flaky test states returns "Bad Request" response Given operation "UpdateFlakyTests" enabled diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a04c9b283b9..df39366284d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1036,6 +1036,24 @@ "type": "safe" } }, + "DeleteTestOptimizationServiceSettings": { + "tag": "Test Optimization", + "undo": { + "type": "unsafe" + } + }, + "UpdateTestOptimizationServiceSettings": { + "tag": "Test Optimization", + "undo": { + "type": "unsafe" + } + }, + "GetTestOptimizationServiceSettings": { + "tag": "Test Optimization", + "undo": { + "type": "safe" + } + }, "AggregateCIAppTestEvents": { "tag": "CI Visibility Tests", "undo": {