From ebf0afa0d43259f2f077d078b99b74181f1c5b92 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:27:40 +0000 Subject: [PATCH] Add CSM Coverage Analysis API specs (#2628) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 209 ++++++++++ .../GetCSMCloudAccountsCoverageAnalysis.java | 26 ++ ...CSMHostsAndContainersCoverageAnalysis.java | 26 ++ .../GetCSMServerlessCoverageAnalysis.java | 25 ++ .../client/v2/api/CsmCoverageAnalysisApi.java | 393 ++++++++++++++++++ ...oudAccountsCoverageAnalysisAttributes.java | 258 ++++++++++++ .../CsmCloudAccountsCoverageAnalysisData.java | 196 +++++++++ ...CloudAccountsCoverageAnalysisResponse.java | 139 +++++++ .../client/v2/model/CsmCoverageAnalysis.java | 235 +++++++++++ ...dContainersCoverageAnalysisAttributes.java | 263 ++++++++++++ ...ostsAndContainersCoverageAnalysisData.java | 197 +++++++++ ...AndContainersCoverageAnalysisResponse.java | 141 +++++++ ...mServerlessCoverageAnalysisAttributes.java | 196 +++++++++ .../CsmServerlessCoverageAnalysisData.java | 196 +++++++++ ...CsmServerlessCoverageAnalysisResponse.java | 138 ++++++ ...verage_Analysis_returns_OK_response.freeze | 1 + ...Coverage_Analysis_returns_OK_response.json | 28 ++ ...verage_Analysis_returns_OK_response.freeze | 1 + ...Coverage_Analysis_returns_OK_response.json | 28 ++ ...verage_Analysis_returns_OK_response.freeze | 1 + ...Coverage_Analysis_returns_OK_response.json | 28 ++ .../v2/api/csm_coverage_analysis.feature | 31 ++ .../com/datadog/api/client/v2/api/undo.json | 18 + 24 files changed, 2778 insertions(+), 4 deletions(-) create mode 100644 examples/v2/csm-coverage-analysis/GetCSMCloudAccountsCoverageAnalysis.java create mode 100644 examples/v2/csm-coverage-analysis/GetCSMHostsAndContainersCoverageAnalysis.java create mode 100644 examples/v2/csm-coverage-analysis/GetCSMServerlessCoverageAnalysis.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/CsmCoverageAnalysisApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmCoverageAnalysis.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisResponse.java create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/csm_coverage_analysis.feature diff --git a/.apigentools-info b/.apigentools-info index 1b3e780c13e..372071a2d80 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 14:39:41.391682", - "spec_repo_commit": "b4e964b3" + "regenerated": "2025-01-02 15:18:18.050924", + "spec_repo_commit": "bc53c28f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 14:39:41.406329", - "spec_repo_commit": "b4e964b3" + "regenerated": "2025-01-02 15:18:18.073678", + "spec_repo_commit": "bc53c28f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5c7885313ee..941ec65aef2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7340,6 +7340,140 @@ components: meta: $ref: '#/components/schemas/CSMAgentsMetadata' type: object + CsmCloudAccountsCoverageAnalysisAttributes: + description: CSM Cloud Accounts Coverage Analysis attributes. + properties: + aws_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + azure_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + gcp_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + org_id: + description: The ID of your organization. + example: 123456 + format: int64 + type: integer + total_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + type: object + CsmCloudAccountsCoverageAnalysisData: + description: CSM Cloud Accounts Coverage Analysis data. + properties: + attributes: + $ref: '#/components/schemas/CsmCloudAccountsCoverageAnalysisAttributes' + id: + description: The ID of your organization. + example: 66b3c6b5-5c9a-457e-b1c3-f247ca23afa3 + type: string + type: + default: get_cloud_accounts_coverage_analysis_response_public_v0 + description: The type of the resource. The value should always be `get_cloud_accounts_coverage_analysis_response_public_v0`. + example: get_cloud_accounts_coverage_analysis_response_public_v0 + type: string + type: object + CsmCloudAccountsCoverageAnalysisResponse: + description: CSM Cloud Accounts Coverage Analysis response. + properties: + data: + $ref: '#/components/schemas/CsmCloudAccountsCoverageAnalysisData' + type: object + CsmCoverageAnalysis: + description: CSM Coverage Analysis. + properties: + configured_resources_count: + description: The number of fully configured resources. + example: 8 + format: int64 + type: integer + coverage: + description: The coverage percentage. + example: 0.8 + format: double + type: number + partially_configured_resources_count: + description: The number of partially configured resources. + example: 0 + format: int64 + type: integer + total_resources_count: + description: The total number of resources. + example: 10 + format: int64 + type: integer + type: object + CsmHostsAndContainersCoverageAnalysisAttributes: + description: CSM Hosts and Containers Coverage Analysis attributes. + properties: + cspm_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + cws_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + org_id: + description: The ID of your organization. + example: 123456 + format: int64 + type: integer + total_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + vm_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + type: object + CsmHostsAndContainersCoverageAnalysisData: + description: CSM Hosts and Containers Coverage Analysis data. + properties: + attributes: + $ref: '#/components/schemas/CsmHostsAndContainersCoverageAnalysisAttributes' + id: + description: The ID of your organization. + example: 66b3c6b5-5c9a-457e-b1c3-f247ca23afa3 + type: string + type: + default: get_hosts_and_containers_coverage_analysis_response_public_v0 + description: The type of the resource. The value should always be `get_hosts_and_containers_coverage_analysis_response_public_v0`. + example: get_hosts_and_containers_coverage_analysis_response_public_v0 + type: string + type: object + CsmHostsAndContainersCoverageAnalysisResponse: + description: CSM Hosts and Containers Coverage Analysis response. + properties: + data: + $ref: '#/components/schemas/CsmHostsAndContainersCoverageAnalysisData' + type: object + CsmServerlessCoverageAnalysisAttributes: + description: CSM Serverless Resources Coverage Analysis attributes. + properties: + cws_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + org_id: + description: The ID of your organization. + example: 123456 + format: int64 + type: integer + total_coverage: + $ref: '#/components/schemas/CsmCoverageAnalysis' + type: object + CsmServerlessCoverageAnalysisData: + description: CSM Serverless Resources Coverage Analysis data. + properties: + attributes: + $ref: '#/components/schemas/CsmServerlessCoverageAnalysisAttributes' + id: + description: The ID of your organization. + example: 66b3c6b5-5c9a-457e-b1c3-f247ca23afa3 + type: string + type: + default: get_serverless_coverage_analysis_response_public_v0 + description: The type of the resource. The value should always be `get_serverless_coverage_analysis_response_public_v0`. + example: get_serverless_coverage_analysis_response_public_v0 + type: string + type: object + CsmServerlessCoverageAnalysisResponse: + description: CSM Serverless Resources Coverage Analysis response. + properties: + data: + $ref: '#/components/schemas/CsmServerlessCoverageAnalysisData' + type: object CustomConnection: description: The definition of `CustomConnection` object. properties: @@ -33610,6 +33744,72 @@ paths: summary: Get all CSM Agents tags: - CSM Agents + /api/v2/csm/onboarding/coverage_analysis/cloud_accounts: + get: + description: 'Get the CSM Coverage Analysis of your Cloud Accounts. + + This is calculated based on the number of your Cloud Accounts that are + + scanned for security issues.' + operationId: GetCSMCloudAccountsCoverageAnalysis + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CsmCloudAccountsCoverageAnalysisResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get the CSM Cloud Accounts Coverage Analysis + tags: + - CSM Coverage Analysis + /api/v2/csm/onboarding/coverage_analysis/hosts_and_containers: + get: + description: 'Get the CSM Coverage Analysis of your Hosts and Containers. + + This is calculated based on the number of agents running on your Hosts + + and Containers with CSM feature(s) enabled.' + operationId: GetCSMHostsAndContainersCoverageAnalysis + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CsmHostsAndContainersCoverageAnalysisResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get the CSM Hosts and Containers Coverage Analysis + tags: + - CSM Coverage Analysis + /api/v2/csm/onboarding/coverage_analysis/serverless: + get: + description: 'Get the CSM Coverage Analysis of your Serverless Resources. + + This is calculated based on the number of agents running on your Serverless + + Resources with CSM feature(s) enabled.' + operationId: GetCSMServerlessCoverageAnalysis + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CsmServerlessCoverageAnalysisResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get the CSM Serverless Coverage Analysis + tags: + - CSM Coverage Analysis /api/v2/csm/onboarding/serverless/agents: get: description: Get the list of all CSM Serverless Agents running on your hosts @@ -47941,6 +48141,15 @@ tags: Go to https://docs.datadoghq.com/security/cloud_security_management to learn more' name: CSM Agents +- description: 'Datadog Cloud Security Management (CSM) delivers real-time threat + detection + + and continuous configuration audits across your entire cloud infrastructure, + + all in a unified view for seamless collaboration and faster remediation. + + Go to https://docs.datadoghq.com/security/cloud_security_management to learn more.' + name: CSM Coverage Analysis - description: Cloud Security Management Threats (CSM Threats) monitors file, network, and process activity across your environment to detect real-time threats to your infrastructure. See [Cloud Security Management Threats](https://docs.datadoghq.com/security/threats/) diff --git a/examples/v2/csm-coverage-analysis/GetCSMCloudAccountsCoverageAnalysis.java b/examples/v2/csm-coverage-analysis/GetCSMCloudAccountsCoverageAnalysis.java new file mode 100644 index 00000000000..714d4f2edff --- /dev/null +++ b/examples/v2/csm-coverage-analysis/GetCSMCloudAccountsCoverageAnalysis.java @@ -0,0 +1,26 @@ +// Get the CSM Cloud Accounts Coverage Analysis returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CsmCoverageAnalysisApi; +import com.datadog.api.client.v2.model.CsmCloudAccountsCoverageAnalysisResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CsmCoverageAnalysisApi apiInstance = new CsmCoverageAnalysisApi(defaultClient); + + try { + CsmCloudAccountsCoverageAnalysisResponse result = + apiInstance.getCSMCloudAccountsCoverageAnalysis(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CsmCoverageAnalysisApi#getCSMCloudAccountsCoverageAnalysis"); + 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/csm-coverage-analysis/GetCSMHostsAndContainersCoverageAnalysis.java b/examples/v2/csm-coverage-analysis/GetCSMHostsAndContainersCoverageAnalysis.java new file mode 100644 index 00000000000..338e6d58971 --- /dev/null +++ b/examples/v2/csm-coverage-analysis/GetCSMHostsAndContainersCoverageAnalysis.java @@ -0,0 +1,26 @@ +// Get the CSM Hosts and Containers Coverage Analysis returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CsmCoverageAnalysisApi; +import com.datadog.api.client.v2.model.CsmHostsAndContainersCoverageAnalysisResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CsmCoverageAnalysisApi apiInstance = new CsmCoverageAnalysisApi(defaultClient); + + try { + CsmHostsAndContainersCoverageAnalysisResponse result = + apiInstance.getCSMHostsAndContainersCoverageAnalysis(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CsmCoverageAnalysisApi#getCSMHostsAndContainersCoverageAnalysis"); + 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/csm-coverage-analysis/GetCSMServerlessCoverageAnalysis.java b/examples/v2/csm-coverage-analysis/GetCSMServerlessCoverageAnalysis.java new file mode 100644 index 00000000000..951f5142676 --- /dev/null +++ b/examples/v2/csm-coverage-analysis/GetCSMServerlessCoverageAnalysis.java @@ -0,0 +1,25 @@ +// Get the CSM Serverless Coverage Analysis returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CsmCoverageAnalysisApi; +import com.datadog.api.client.v2.model.CsmServerlessCoverageAnalysisResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CsmCoverageAnalysisApi apiInstance = new CsmCoverageAnalysisApi(defaultClient); + + try { + CsmServerlessCoverageAnalysisResponse result = apiInstance.getCSMServerlessCoverageAnalysis(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CsmCoverageAnalysisApi#getCSMServerlessCoverageAnalysis"); + 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/v2/api/CsmCoverageAnalysisApi.java b/src/main/java/com/datadog/api/client/v2/api/CsmCoverageAnalysisApi.java new file mode 100644 index 00000000000..a7ca665c06b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CsmCoverageAnalysisApi.java @@ -0,0 +1,393 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CsmCloudAccountsCoverageAnalysisResponse; +import com.datadog.api.client.v2.model.CsmHostsAndContainersCoverageAnalysisResponse; +import com.datadog.api.client.v2.model.CsmServerlessCoverageAnalysisResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmCoverageAnalysisApi { + private ApiClient apiClient; + + public CsmCoverageAnalysisApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CsmCoverageAnalysisApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the CSM Cloud Accounts Coverage Analysis. + * + *

See {@link #getCSMCloudAccountsCoverageAnalysisWithHttpInfo}. + * + * @return CsmCloudAccountsCoverageAnalysisResponse + * @throws ApiException if fails to make API call + */ + public CsmCloudAccountsCoverageAnalysisResponse getCSMCloudAccountsCoverageAnalysis() + throws ApiException { + return getCSMCloudAccountsCoverageAnalysisWithHttpInfo().getData(); + } + + /** + * Get the CSM Cloud Accounts Coverage Analysis. + * + *

See {@link #getCSMCloudAccountsCoverageAnalysisWithHttpInfoAsync}. + * + * @return CompletableFuture<CsmCloudAccountsCoverageAnalysisResponse> + */ + public CompletableFuture + getCSMCloudAccountsCoverageAnalysisAsync() { + return getCSMCloudAccountsCoverageAnalysisWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the CSM Coverage Analysis of your Cloud Accounts. This is calculated based on the number of + * your Cloud Accounts that are scanned for security issues. + * + * @return ApiResponse<CsmCloudAccountsCoverageAnalysisResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + getCSMCloudAccountsCoverageAnalysisWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/cloud_accounts"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMCloudAccountsCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the CSM Cloud Accounts Coverage Analysis. + * + *

See {@link #getCSMCloudAccountsCoverageAnalysisWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<CsmCloudAccountsCoverageAnalysisResponse>> + */ + public CompletableFuture> + getCSMCloudAccountsCoverageAnalysisWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/cloud_accounts"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMCloudAccountsCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the CSM Hosts and Containers Coverage Analysis. + * + *

See {@link #getCSMHostsAndContainersCoverageAnalysisWithHttpInfo}. + * + * @return CsmHostsAndContainersCoverageAnalysisResponse + * @throws ApiException if fails to make API call + */ + public CsmHostsAndContainersCoverageAnalysisResponse getCSMHostsAndContainersCoverageAnalysis() + throws ApiException { + return getCSMHostsAndContainersCoverageAnalysisWithHttpInfo().getData(); + } + + /** + * Get the CSM Hosts and Containers Coverage Analysis. + * + *

See {@link #getCSMHostsAndContainersCoverageAnalysisWithHttpInfoAsync}. + * + * @return CompletableFuture<CsmHostsAndContainersCoverageAnalysisResponse> + */ + public CompletableFuture + getCSMHostsAndContainersCoverageAnalysisAsync() { + return getCSMHostsAndContainersCoverageAnalysisWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the CSM Coverage Analysis of your Hosts and Containers. This is calculated based on the + * number of agents running on your Hosts and Containers with CSM feature(s) enabled. + * + * @return ApiResponse<CsmHostsAndContainersCoverageAnalysisResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + getCSMHostsAndContainersCoverageAnalysisWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/hosts_and_containers"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMHostsAndContainersCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the CSM Hosts and Containers Coverage Analysis. + * + *

See {@link #getCSMHostsAndContainersCoverageAnalysisWithHttpInfo}. + * + * @return + * CompletableFuture<ApiResponse<CsmHostsAndContainersCoverageAnalysisResponse>> + */ + public CompletableFuture> + getCSMHostsAndContainersCoverageAnalysisWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/hosts_and_containers"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMHostsAndContainersCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the CSM Serverless Coverage Analysis. + * + *

See {@link #getCSMServerlessCoverageAnalysisWithHttpInfo}. + * + * @return CsmServerlessCoverageAnalysisResponse + * @throws ApiException if fails to make API call + */ + public CsmServerlessCoverageAnalysisResponse getCSMServerlessCoverageAnalysis() + throws ApiException { + return getCSMServerlessCoverageAnalysisWithHttpInfo().getData(); + } + + /** + * Get the CSM Serverless Coverage Analysis. + * + *

See {@link #getCSMServerlessCoverageAnalysisWithHttpInfoAsync}. + * + * @return CompletableFuture<CsmServerlessCoverageAnalysisResponse> + */ + public CompletableFuture + getCSMServerlessCoverageAnalysisAsync() { + return getCSMServerlessCoverageAnalysisWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the CSM Coverage Analysis of your Serverless Resources. This is calculated based on the + * number of agents running on your Serverless Resources with CSM feature(s) enabled. + * + * @return ApiResponse<CsmServerlessCoverageAnalysisResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + getCSMServerlessCoverageAnalysisWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/serverless"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMServerlessCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the CSM Serverless Coverage Analysis. + * + *

See {@link #getCSMServerlessCoverageAnalysisWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<CsmServerlessCoverageAnalysisResponse>> + */ + public CompletableFuture> + getCSMServerlessCoverageAnalysisWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/csm/onboarding/coverage_analysis/serverless"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CsmCoverageAnalysisApi.getCSMServerlessCoverageAnalysis", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisAttributes.java new file mode 100644 index 00000000000..8b079af1c61 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisAttributes.java @@ -0,0 +1,258 @@ +/* + * 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; + +/** CSM Cloud Accounts Coverage Analysis attributes. */ +@JsonPropertyOrder({ + CsmCloudAccountsCoverageAnalysisAttributes.JSON_PROPERTY_AWS_COVERAGE, + CsmCloudAccountsCoverageAnalysisAttributes.JSON_PROPERTY_AZURE_COVERAGE, + CsmCloudAccountsCoverageAnalysisAttributes.JSON_PROPERTY_GCP_COVERAGE, + CsmCloudAccountsCoverageAnalysisAttributes.JSON_PROPERTY_ORG_ID, + CsmCloudAccountsCoverageAnalysisAttributes.JSON_PROPERTY_TOTAL_COVERAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmCloudAccountsCoverageAnalysisAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AWS_COVERAGE = "aws_coverage"; + private CsmCoverageAnalysis awsCoverage; + + public static final String JSON_PROPERTY_AZURE_COVERAGE = "azure_coverage"; + private CsmCoverageAnalysis azureCoverage; + + public static final String JSON_PROPERTY_GCP_COVERAGE = "gcp_coverage"; + private CsmCoverageAnalysis gcpCoverage; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_TOTAL_COVERAGE = "total_coverage"; + private CsmCoverageAnalysis totalCoverage; + + public CsmCloudAccountsCoverageAnalysisAttributes awsCoverage(CsmCoverageAnalysis awsCoverage) { + this.awsCoverage = awsCoverage; + this.unparsed |= awsCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return awsCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getAwsCoverage() { + return awsCoverage; + } + + public void setAwsCoverage(CsmCoverageAnalysis awsCoverage) { + this.awsCoverage = awsCoverage; + } + + public CsmCloudAccountsCoverageAnalysisAttributes azureCoverage( + CsmCoverageAnalysis azureCoverage) { + this.azureCoverage = azureCoverage; + this.unparsed |= azureCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return azureCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZURE_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getAzureCoverage() { + return azureCoverage; + } + + public void setAzureCoverage(CsmCoverageAnalysis azureCoverage) { + this.azureCoverage = azureCoverage; + } + + public CsmCloudAccountsCoverageAnalysisAttributes gcpCoverage(CsmCoverageAnalysis gcpCoverage) { + this.gcpCoverage = gcpCoverage; + this.unparsed |= gcpCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return gcpCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCP_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getGcpCoverage() { + return gcpCoverage; + } + + public void setGcpCoverage(CsmCoverageAnalysis gcpCoverage) { + this.gcpCoverage = gcpCoverage; + } + + public CsmCloudAccountsCoverageAnalysisAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of your organization. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public CsmCloudAccountsCoverageAnalysisAttributes totalCoverage( + CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + this.unparsed |= totalCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return totalCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getTotalCoverage() { + return totalCoverage; + } + + public void setTotalCoverage(CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + } + + /** + * 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 CsmCloudAccountsCoverageAnalysisAttributes + */ + @JsonAnySetter + public CsmCloudAccountsCoverageAnalysisAttributes 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 CsmCloudAccountsCoverageAnalysisAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmCloudAccountsCoverageAnalysisAttributes csmCloudAccountsCoverageAnalysisAttributes = + (CsmCloudAccountsCoverageAnalysisAttributes) o; + return Objects.equals(this.awsCoverage, csmCloudAccountsCoverageAnalysisAttributes.awsCoverage) + && Objects.equals( + this.azureCoverage, csmCloudAccountsCoverageAnalysisAttributes.azureCoverage) + && Objects.equals(this.gcpCoverage, csmCloudAccountsCoverageAnalysisAttributes.gcpCoverage) + && Objects.equals(this.orgId, csmCloudAccountsCoverageAnalysisAttributes.orgId) + && Objects.equals( + this.totalCoverage, csmCloudAccountsCoverageAnalysisAttributes.totalCoverage) + && Objects.equals( + this.additionalProperties, + csmCloudAccountsCoverageAnalysisAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + awsCoverage, azureCoverage, gcpCoverage, orgId, totalCoverage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmCloudAccountsCoverageAnalysisAttributes {\n"); + sb.append(" awsCoverage: ").append(toIndentedString(awsCoverage)).append("\n"); + sb.append(" azureCoverage: ").append(toIndentedString(azureCoverage)).append("\n"); + sb.append(" gcpCoverage: ").append(toIndentedString(gcpCoverage)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" totalCoverage: ").append(toIndentedString(totalCoverage)).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/CsmCloudAccountsCoverageAnalysisData.java b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisData.java new file mode 100644 index 00000000000..f317fadec57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisData.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** CSM Cloud Accounts Coverage Analysis data. */ +@JsonPropertyOrder({ + CsmCloudAccountsCoverageAnalysisData.JSON_PROPERTY_ATTRIBUTES, + CsmCloudAccountsCoverageAnalysisData.JSON_PROPERTY_ID, + CsmCloudAccountsCoverageAnalysisData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmCloudAccountsCoverageAnalysisData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CsmCloudAccountsCoverageAnalysisAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "get_cloud_accounts_coverage_analysis_response_public_v0"; + + public CsmCloudAccountsCoverageAnalysisData attributes( + CsmCloudAccountsCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * CSM Cloud Accounts Coverage Analysis attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCloudAccountsCoverageAnalysisAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CsmCloudAccountsCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + } + + public CsmCloudAccountsCoverageAnalysisData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of your organization. + * + * @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 CsmCloudAccountsCoverageAnalysisData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. The value should always be + * get_cloud_accounts_coverage_analysis_response_public_v0. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 CsmCloudAccountsCoverageAnalysisData + */ + @JsonAnySetter + public CsmCloudAccountsCoverageAnalysisData 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 CsmCloudAccountsCoverageAnalysisData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmCloudAccountsCoverageAnalysisData csmCloudAccountsCoverageAnalysisData = + (CsmCloudAccountsCoverageAnalysisData) o; + return Objects.equals(this.attributes, csmCloudAccountsCoverageAnalysisData.attributes) + && Objects.equals(this.id, csmCloudAccountsCoverageAnalysisData.id) + && Objects.equals(this.type, csmCloudAccountsCoverageAnalysisData.type) + && Objects.equals( + this.additionalProperties, csmCloudAccountsCoverageAnalysisData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmCloudAccountsCoverageAnalysisData {\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/CsmCloudAccountsCoverageAnalysisResponse.java b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisResponse.java new file mode 100644 index 00000000000..d6419647348 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmCloudAccountsCoverageAnalysisResponse.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; + +/** CSM Cloud Accounts Coverage Analysis response. */ +@JsonPropertyOrder({CsmCloudAccountsCoverageAnalysisResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmCloudAccountsCoverageAnalysisResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CsmCloudAccountsCoverageAnalysisData data; + + public CsmCloudAccountsCoverageAnalysisResponse data(CsmCloudAccountsCoverageAnalysisData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * CSM Cloud Accounts Coverage Analysis data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCloudAccountsCoverageAnalysisData getData() { + return data; + } + + public void setData(CsmCloudAccountsCoverageAnalysisData 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 CsmCloudAccountsCoverageAnalysisResponse + */ + @JsonAnySetter + public CsmCloudAccountsCoverageAnalysisResponse 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 CsmCloudAccountsCoverageAnalysisResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmCloudAccountsCoverageAnalysisResponse csmCloudAccountsCoverageAnalysisResponse = + (CsmCloudAccountsCoverageAnalysisResponse) o; + return Objects.equals(this.data, csmCloudAccountsCoverageAnalysisResponse.data) + && Objects.equals( + this.additionalProperties, + csmCloudAccountsCoverageAnalysisResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmCloudAccountsCoverageAnalysisResponse {\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/CsmCoverageAnalysis.java b/src/main/java/com/datadog/api/client/v2/model/CsmCoverageAnalysis.java new file mode 100644 index 00000000000..d2ef97749c1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmCoverageAnalysis.java @@ -0,0 +1,235 @@ +/* + * 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; + +/** CSM Coverage Analysis. */ +@JsonPropertyOrder({ + CsmCoverageAnalysis.JSON_PROPERTY_CONFIGURED_RESOURCES_COUNT, + CsmCoverageAnalysis.JSON_PROPERTY_COVERAGE, + CsmCoverageAnalysis.JSON_PROPERTY_PARTIALLY_CONFIGURED_RESOURCES_COUNT, + CsmCoverageAnalysis.JSON_PROPERTY_TOTAL_RESOURCES_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmCoverageAnalysis { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFIGURED_RESOURCES_COUNT = + "configured_resources_count"; + private Long configuredResourcesCount; + + public static final String JSON_PROPERTY_COVERAGE = "coverage"; + private Double coverage; + + public static final String JSON_PROPERTY_PARTIALLY_CONFIGURED_RESOURCES_COUNT = + "partially_configured_resources_count"; + private Long partiallyConfiguredResourcesCount; + + public static final String JSON_PROPERTY_TOTAL_RESOURCES_COUNT = "total_resources_count"; + private Long totalResourcesCount; + + public CsmCoverageAnalysis configuredResourcesCount(Long configuredResourcesCount) { + this.configuredResourcesCount = configuredResourcesCount; + return this; + } + + /** + * The number of fully configured resources. + * + * @return configuredResourcesCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIGURED_RESOURCES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getConfiguredResourcesCount() { + return configuredResourcesCount; + } + + public void setConfiguredResourcesCount(Long configuredResourcesCount) { + this.configuredResourcesCount = configuredResourcesCount; + } + + public CsmCoverageAnalysis coverage(Double coverage) { + this.coverage = coverage; + return this; + } + + /** + * The coverage percentage. + * + * @return coverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCoverage() { + return coverage; + } + + public void setCoverage(Double coverage) { + this.coverage = coverage; + } + + public CsmCoverageAnalysis partiallyConfiguredResourcesCount( + Long partiallyConfiguredResourcesCount) { + this.partiallyConfiguredResourcesCount = partiallyConfiguredResourcesCount; + return this; + } + + /** + * The number of partially configured resources. + * + * @return partiallyConfiguredResourcesCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARTIALLY_CONFIGURED_RESOURCES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPartiallyConfiguredResourcesCount() { + return partiallyConfiguredResourcesCount; + } + + public void setPartiallyConfiguredResourcesCount(Long partiallyConfiguredResourcesCount) { + this.partiallyConfiguredResourcesCount = partiallyConfiguredResourcesCount; + } + + public CsmCoverageAnalysis totalResourcesCount(Long totalResourcesCount) { + this.totalResourcesCount = totalResourcesCount; + return this; + } + + /** + * The total number of resources. + * + * @return totalResourcesCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_RESOURCES_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalResourcesCount() { + return totalResourcesCount; + } + + public void setTotalResourcesCount(Long totalResourcesCount) { + this.totalResourcesCount = totalResourcesCount; + } + + /** + * 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 CsmCoverageAnalysis + */ + @JsonAnySetter + public CsmCoverageAnalysis 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 CsmCoverageAnalysis object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmCoverageAnalysis csmCoverageAnalysis = (CsmCoverageAnalysis) o; + return Objects.equals( + this.configuredResourcesCount, csmCoverageAnalysis.configuredResourcesCount) + && Objects.equals(this.coverage, csmCoverageAnalysis.coverage) + && Objects.equals( + this.partiallyConfiguredResourcesCount, + csmCoverageAnalysis.partiallyConfiguredResourcesCount) + && Objects.equals(this.totalResourcesCount, csmCoverageAnalysis.totalResourcesCount) + && Objects.equals(this.additionalProperties, csmCoverageAnalysis.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + configuredResourcesCount, + coverage, + partiallyConfiguredResourcesCount, + totalResourcesCount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmCoverageAnalysis {\n"); + sb.append(" configuredResourcesCount: ") + .append(toIndentedString(configuredResourcesCount)) + .append("\n"); + sb.append(" coverage: ").append(toIndentedString(coverage)).append("\n"); + sb.append(" partiallyConfiguredResourcesCount: ") + .append(toIndentedString(partiallyConfiguredResourcesCount)) + .append("\n"); + sb.append(" totalResourcesCount: ") + .append(toIndentedString(totalResourcesCount)) + .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/CsmHostsAndContainersCoverageAnalysisAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisAttributes.java new file mode 100644 index 00000000000..13466a34bc9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisAttributes.java @@ -0,0 +1,263 @@ +/* + * 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; + +/** CSM Hosts and Containers Coverage Analysis attributes. */ +@JsonPropertyOrder({ + CsmHostsAndContainersCoverageAnalysisAttributes.JSON_PROPERTY_CSPM_COVERAGE, + CsmHostsAndContainersCoverageAnalysisAttributes.JSON_PROPERTY_CWS_COVERAGE, + CsmHostsAndContainersCoverageAnalysisAttributes.JSON_PROPERTY_ORG_ID, + CsmHostsAndContainersCoverageAnalysisAttributes.JSON_PROPERTY_TOTAL_COVERAGE, + CsmHostsAndContainersCoverageAnalysisAttributes.JSON_PROPERTY_VM_COVERAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmHostsAndContainersCoverageAnalysisAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CSPM_COVERAGE = "cspm_coverage"; + private CsmCoverageAnalysis cspmCoverage; + + public static final String JSON_PROPERTY_CWS_COVERAGE = "cws_coverage"; + private CsmCoverageAnalysis cwsCoverage; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_TOTAL_COVERAGE = "total_coverage"; + private CsmCoverageAnalysis totalCoverage; + + public static final String JSON_PROPERTY_VM_COVERAGE = "vm_coverage"; + private CsmCoverageAnalysis vmCoverage; + + public CsmHostsAndContainersCoverageAnalysisAttributes cspmCoverage( + CsmCoverageAnalysis cspmCoverage) { + this.cspmCoverage = cspmCoverage; + this.unparsed |= cspmCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return cspmCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CSPM_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getCspmCoverage() { + return cspmCoverage; + } + + public void setCspmCoverage(CsmCoverageAnalysis cspmCoverage) { + this.cspmCoverage = cspmCoverage; + } + + public CsmHostsAndContainersCoverageAnalysisAttributes cwsCoverage( + CsmCoverageAnalysis cwsCoverage) { + this.cwsCoverage = cwsCoverage; + this.unparsed |= cwsCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return cwsCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CWS_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getCwsCoverage() { + return cwsCoverage; + } + + public void setCwsCoverage(CsmCoverageAnalysis cwsCoverage) { + this.cwsCoverage = cwsCoverage; + } + + public CsmHostsAndContainersCoverageAnalysisAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of your organization. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public CsmHostsAndContainersCoverageAnalysisAttributes totalCoverage( + CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + this.unparsed |= totalCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return totalCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getTotalCoverage() { + return totalCoverage; + } + + public void setTotalCoverage(CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + } + + public CsmHostsAndContainersCoverageAnalysisAttributes vmCoverage( + CsmCoverageAnalysis vmCoverage) { + this.vmCoverage = vmCoverage; + this.unparsed |= vmCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return vmCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VM_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getVmCoverage() { + return vmCoverage; + } + + public void setVmCoverage(CsmCoverageAnalysis vmCoverage) { + this.vmCoverage = vmCoverage; + } + + /** + * 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 CsmHostsAndContainersCoverageAnalysisAttributes + */ + @JsonAnySetter + public CsmHostsAndContainersCoverageAnalysisAttributes 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 CsmHostsAndContainersCoverageAnalysisAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmHostsAndContainersCoverageAnalysisAttributes + csmHostsAndContainersCoverageAnalysisAttributes = + (CsmHostsAndContainersCoverageAnalysisAttributes) o; + return Objects.equals( + this.cspmCoverage, csmHostsAndContainersCoverageAnalysisAttributes.cspmCoverage) + && Objects.equals( + this.cwsCoverage, csmHostsAndContainersCoverageAnalysisAttributes.cwsCoverage) + && Objects.equals(this.orgId, csmHostsAndContainersCoverageAnalysisAttributes.orgId) + && Objects.equals( + this.totalCoverage, csmHostsAndContainersCoverageAnalysisAttributes.totalCoverage) + && Objects.equals( + this.vmCoverage, csmHostsAndContainersCoverageAnalysisAttributes.vmCoverage) + && Objects.equals( + this.additionalProperties, + csmHostsAndContainersCoverageAnalysisAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cspmCoverage, cwsCoverage, orgId, totalCoverage, vmCoverage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmHostsAndContainersCoverageAnalysisAttributes {\n"); + sb.append(" cspmCoverage: ").append(toIndentedString(cspmCoverage)).append("\n"); + sb.append(" cwsCoverage: ").append(toIndentedString(cwsCoverage)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" totalCoverage: ").append(toIndentedString(totalCoverage)).append("\n"); + sb.append(" vmCoverage: ").append(toIndentedString(vmCoverage)).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/CsmHostsAndContainersCoverageAnalysisData.java b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisData.java new file mode 100644 index 00000000000..f2f8cd76aec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisData.java @@ -0,0 +1,197 @@ +/* + * 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; + +/** CSM Hosts and Containers Coverage Analysis data. */ +@JsonPropertyOrder({ + CsmHostsAndContainersCoverageAnalysisData.JSON_PROPERTY_ATTRIBUTES, + CsmHostsAndContainersCoverageAnalysisData.JSON_PROPERTY_ID, + CsmHostsAndContainersCoverageAnalysisData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmHostsAndContainersCoverageAnalysisData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CsmHostsAndContainersCoverageAnalysisAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "get_hosts_and_containers_coverage_analysis_response_public_v0"; + + public CsmHostsAndContainersCoverageAnalysisData attributes( + CsmHostsAndContainersCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * CSM Hosts and Containers Coverage Analysis attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmHostsAndContainersCoverageAnalysisAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CsmHostsAndContainersCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + } + + public CsmHostsAndContainersCoverageAnalysisData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of your organization. + * + * @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 CsmHostsAndContainersCoverageAnalysisData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. The value should always be + * get_hosts_and_containers_coverage_analysis_response_public_v0. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 CsmHostsAndContainersCoverageAnalysisData + */ + @JsonAnySetter + public CsmHostsAndContainersCoverageAnalysisData 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 CsmHostsAndContainersCoverageAnalysisData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmHostsAndContainersCoverageAnalysisData csmHostsAndContainersCoverageAnalysisData = + (CsmHostsAndContainersCoverageAnalysisData) o; + return Objects.equals(this.attributes, csmHostsAndContainersCoverageAnalysisData.attributes) + && Objects.equals(this.id, csmHostsAndContainersCoverageAnalysisData.id) + && Objects.equals(this.type, csmHostsAndContainersCoverageAnalysisData.type) + && Objects.equals( + this.additionalProperties, + csmHostsAndContainersCoverageAnalysisData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmHostsAndContainersCoverageAnalysisData {\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/CsmHostsAndContainersCoverageAnalysisResponse.java b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisResponse.java new file mode 100644 index 00000000000..2a80514f979 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmHostsAndContainersCoverageAnalysisResponse.java @@ -0,0 +1,141 @@ +/* + * 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; + +/** CSM Hosts and Containers Coverage Analysis response. */ +@JsonPropertyOrder({CsmHostsAndContainersCoverageAnalysisResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmHostsAndContainersCoverageAnalysisResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CsmHostsAndContainersCoverageAnalysisData data; + + public CsmHostsAndContainersCoverageAnalysisResponse data( + CsmHostsAndContainersCoverageAnalysisData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * CSM Hosts and Containers Coverage Analysis data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmHostsAndContainersCoverageAnalysisData getData() { + return data; + } + + public void setData(CsmHostsAndContainersCoverageAnalysisData 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 CsmHostsAndContainersCoverageAnalysisResponse + */ + @JsonAnySetter + public CsmHostsAndContainersCoverageAnalysisResponse 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 CsmHostsAndContainersCoverageAnalysisResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmHostsAndContainersCoverageAnalysisResponse csmHostsAndContainersCoverageAnalysisResponse = + (CsmHostsAndContainersCoverageAnalysisResponse) o; + return Objects.equals(this.data, csmHostsAndContainersCoverageAnalysisResponse.data) + && Objects.equals( + this.additionalProperties, + csmHostsAndContainersCoverageAnalysisResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmHostsAndContainersCoverageAnalysisResponse {\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/CsmServerlessCoverageAnalysisAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisAttributes.java new file mode 100644 index 00000000000..d77f00e6ead --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisAttributes.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** CSM Serverless Resources Coverage Analysis attributes. */ +@JsonPropertyOrder({ + CsmServerlessCoverageAnalysisAttributes.JSON_PROPERTY_CWS_COVERAGE, + CsmServerlessCoverageAnalysisAttributes.JSON_PROPERTY_ORG_ID, + CsmServerlessCoverageAnalysisAttributes.JSON_PROPERTY_TOTAL_COVERAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmServerlessCoverageAnalysisAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CWS_COVERAGE = "cws_coverage"; + private CsmCoverageAnalysis cwsCoverage; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_TOTAL_COVERAGE = "total_coverage"; + private CsmCoverageAnalysis totalCoverage; + + public CsmServerlessCoverageAnalysisAttributes cwsCoverage(CsmCoverageAnalysis cwsCoverage) { + this.cwsCoverage = cwsCoverage; + this.unparsed |= cwsCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return cwsCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CWS_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getCwsCoverage() { + return cwsCoverage; + } + + public void setCwsCoverage(CsmCoverageAnalysis cwsCoverage) { + this.cwsCoverage = cwsCoverage; + } + + public CsmServerlessCoverageAnalysisAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of your organization. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public CsmServerlessCoverageAnalysisAttributes totalCoverage(CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + this.unparsed |= totalCoverage.unparsed; + return this; + } + + /** + * CSM Coverage Analysis. + * + * @return totalCoverage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COVERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmCoverageAnalysis getTotalCoverage() { + return totalCoverage; + } + + public void setTotalCoverage(CsmCoverageAnalysis totalCoverage) { + this.totalCoverage = totalCoverage; + } + + /** + * 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 CsmServerlessCoverageAnalysisAttributes + */ + @JsonAnySetter + public CsmServerlessCoverageAnalysisAttributes 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 CsmServerlessCoverageAnalysisAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmServerlessCoverageAnalysisAttributes csmServerlessCoverageAnalysisAttributes = + (CsmServerlessCoverageAnalysisAttributes) o; + return Objects.equals(this.cwsCoverage, csmServerlessCoverageAnalysisAttributes.cwsCoverage) + && Objects.equals(this.orgId, csmServerlessCoverageAnalysisAttributes.orgId) + && Objects.equals(this.totalCoverage, csmServerlessCoverageAnalysisAttributes.totalCoverage) + && Objects.equals( + this.additionalProperties, + csmServerlessCoverageAnalysisAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cwsCoverage, orgId, totalCoverage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmServerlessCoverageAnalysisAttributes {\n"); + sb.append(" cwsCoverage: ").append(toIndentedString(cwsCoverage)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" totalCoverage: ").append(toIndentedString(totalCoverage)).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/CsmServerlessCoverageAnalysisData.java b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisData.java new file mode 100644 index 00000000000..1d0aa34da00 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisData.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** CSM Serverless Resources Coverage Analysis data. */ +@JsonPropertyOrder({ + CsmServerlessCoverageAnalysisData.JSON_PROPERTY_ATTRIBUTES, + CsmServerlessCoverageAnalysisData.JSON_PROPERTY_ID, + CsmServerlessCoverageAnalysisData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmServerlessCoverageAnalysisData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CsmServerlessCoverageAnalysisAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "get_serverless_coverage_analysis_response_public_v0"; + + public CsmServerlessCoverageAnalysisData attributes( + CsmServerlessCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * CSM Serverless Resources Coverage Analysis attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmServerlessCoverageAnalysisAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CsmServerlessCoverageAnalysisAttributes attributes) { + this.attributes = attributes; + } + + public CsmServerlessCoverageAnalysisData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of your organization. + * + * @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 CsmServerlessCoverageAnalysisData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. The value should always be + * get_serverless_coverage_analysis_response_public_v0. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 CsmServerlessCoverageAnalysisData + */ + @JsonAnySetter + public CsmServerlessCoverageAnalysisData 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 CsmServerlessCoverageAnalysisData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmServerlessCoverageAnalysisData csmServerlessCoverageAnalysisData = + (CsmServerlessCoverageAnalysisData) o; + return Objects.equals(this.attributes, csmServerlessCoverageAnalysisData.attributes) + && Objects.equals(this.id, csmServerlessCoverageAnalysisData.id) + && Objects.equals(this.type, csmServerlessCoverageAnalysisData.type) + && Objects.equals( + this.additionalProperties, csmServerlessCoverageAnalysisData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmServerlessCoverageAnalysisData {\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/CsmServerlessCoverageAnalysisResponse.java b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisResponse.java new file mode 100644 index 00000000000..5d3081e9e5e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CsmServerlessCoverageAnalysisResponse.java @@ -0,0 +1,138 @@ +/* + * 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; + +/** CSM Serverless Resources Coverage Analysis response. */ +@JsonPropertyOrder({CsmServerlessCoverageAnalysisResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CsmServerlessCoverageAnalysisResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CsmServerlessCoverageAnalysisData data; + + public CsmServerlessCoverageAnalysisResponse data(CsmServerlessCoverageAnalysisData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * CSM Serverless Resources Coverage Analysis data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CsmServerlessCoverageAnalysisData getData() { + return data; + } + + public void setData(CsmServerlessCoverageAnalysisData 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 CsmServerlessCoverageAnalysisResponse + */ + @JsonAnySetter + public CsmServerlessCoverageAnalysisResponse 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 CsmServerlessCoverageAnalysisResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CsmServerlessCoverageAnalysisResponse csmServerlessCoverageAnalysisResponse = + (CsmServerlessCoverageAnalysisResponse) o; + return Objects.equals(this.data, csmServerlessCoverageAnalysisResponse.data) + && Objects.equals( + this.additionalProperties, csmServerlessCoverageAnalysisResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CsmServerlessCoverageAnalysisResponse {\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/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.freeze new file mode 100644 index 00000000000..c37dee1e4c1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-19T17:17:10.296Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.json new file mode 100644 index 00000000000..5f9a903a045 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Cloud_Accounts_Coverage_Analysis_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/csm/onboarding/coverage_analysis/cloud_accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"type\":\"get_cloud_accounts_coverage_analysis_response_public_v0\",\"attributes\":{\"aws_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":4,\"total_resources_count\":10,\"coverage\":0.4},\"azure_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":2,\"total_resources_count\":6,\"coverage\":0.3333333333333333},\"gcp_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":2,\"total_resources_count\":4,\"coverage\":0.5},\"org_id\":321813,\"total_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":8,\"total_resources_count\":20,\"coverage\":0.4}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f1570efe-40b4-7ceb-fbcd-ace56479e8bc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.freeze new file mode 100644 index 00000000000..1d9635bb446 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-19T17:17:10.704Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.json new file mode 100644 index 00000000000..bf0f57a9092 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Hosts_and_Containers_Coverage_Analysis_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/csm/onboarding/coverage_analysis/hosts_and_containers", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"type\":\"get_hosts_and_containers_coverage_analysis_response_public_v0\",\"attributes\":{\"cspm_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":9,\"coverage\":0},\"cws_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":9,\"coverage\":0},\"org_id\":321813,\"total_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":9,\"coverage\":0},\"vm_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":0}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ac8b1135-61fd-9c48-abee-7e0b772938dc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.freeze new file mode 100644 index 00000000000..468d6c35fca --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-19T17:17:11.235Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.json new file mode 100644 index 00000000000..e72712bd389 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_CSM_Serverless_Coverage_Analysis_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/csm/onboarding/coverage_analysis/serverless", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"type\":\"get_serverless_coverage_analysis_response_public_v0\",\"attributes\":{\"cws_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":0},\"org_id\":0,\"total_coverage\":{\"partially_configured_resources_count\":0,\"configured_resources_count\":0,\"total_resources_count\":0}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "226ecbee-b2e4-8835-4e36-711fa9438384" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/csm_coverage_analysis.feature b/src/test/resources/com/datadog/api/client/v2/api/csm_coverage_analysis.feature new file mode 100644 index 00000000000..8c3689dbfa7 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/csm_coverage_analysis.feature @@ -0,0 +1,31 @@ +@endpoint(csm-coverage-analysis) @endpoint(csm-coverage-analysis-v2) +Feature: CSM Coverage Analysis + Datadog Cloud Security Management (CSM) delivers real-time threat + detection and continuous configuration audits across your entire cloud + infrastructure, all in a unified view for seamless collaboration and + faster remediation. Go to + https://docs.datadoghq.com/security/cloud_security_management to learn + more. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CSMCoverageAnalysis" API + + @team:DataDog/k9-cloud-security-platform + Scenario: Get the CSM Cloud Accounts Coverage Analysis returns "OK" response + Given new "GetCSMCloudAccountsCoverageAnalysis" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/k9-cloud-security-platform + Scenario: Get the CSM Hosts and Containers Coverage Analysis returns "OK" response + Given new "GetCSMHostsAndContainersCoverageAnalysis" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/k9-cloud-security-platform + Scenario: Get the CSM Serverless Coverage Analysis returns "OK" response + Given new "GetCSMServerlessCoverageAnalysis" request + When the request is sent + Then the response status is 200 OK 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 b54d9e43a45..daae080a0ce 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 @@ -535,6 +535,24 @@ "type": "safe" } }, + "GetCSMCloudAccountsCoverageAnalysis": { + "tag": "CSM Coverage Analysis", + "undo": { + "type": "safe" + } + }, + "GetCSMHostsAndContainersCoverageAnalysis": { + "tag": "CSM Coverage Analysis", + "undo": { + "type": "safe" + } + }, + "GetCSMServerlessCoverageAnalysis": { + "tag": "CSM Coverage Analysis", + "undo": { + "type": "safe" + } + }, "ListAllCSMServerlessAgents": { "tag": "CSM Agents", "undo": {