From 4c19d1719e9d38efabdb07824a651e9cefe682d6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 1 Oct 2025 14:19:48 +0000 Subject: [PATCH] Regenerate client from commit ba47c96 of spec repo --- .generator/schemas/v2/openapi.yaml | 255 ++++++++ .../CreateAzureScanOptions.java | 38 ++ .../DeleteAzureScanOptions.java | 22 + .../ListAzureScanOptions.java | 24 + .../UpdateAzureScanOptions.java | 35 ++ .../client/v2/api/AgentlessScanningApi.java | 573 +++++++++++++++++- .../api/client/v2/model/AzureScanOptions.java | 136 +++++ .../v2/model/AzureScanOptionsArray.java | 154 +++++ .../client/v2/model/AzureScanOptionsData.java | 206 +++++++ .../model/AzureScanOptionsDataAttributes.java | 166 +++++ .../v2/model/AzureScanOptionsDataType.java | 57 ++ .../v2/model/AzureScanOptionsInputUpdate.java | 137 +++++ .../AzureScanOptionsInputUpdateData.java | 211 +++++++ ...eScanOptionsInputUpdateDataAttributes.java | 168 +++++ .../AzureScanOptionsInputUpdateDataType.java | 59 ++ ...an_options_returns_Created_response.freeze | 1 + ...scan_options_returns_Created_response.json | 57 ++ ...re_scan_options_returns_OK_response.freeze | 1 + ...zure_scan_options_returns_OK_response.json | 28 + .../client/v2/api/agentless_scanning.feature | 28 + .../com/datadog/api/client/v2/api/undo.json | 31 + 21 files changed, 2371 insertions(+), 16 deletions(-) create mode 100644 examples/v2/agentless-scanning/CreateAzureScanOptions.java create mode 100644 examples/v2/agentless-scanning/DeleteAzureScanOptions.java create mode 100644 examples/v2/agentless-scanning/ListAzureScanOptions.java create mode 100644 examples/v2/agentless-scanning/UpdateAzureScanOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataType.java create mode 100644 src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d4dfe8ead6b..d3505929ef5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5879,6 +5879,115 @@ components: required: - type type: object + AzureScanOptions: + description: The definition of `AzureScanOptions` object. + example: + data: + attributes: + vuln_containers_os: true + vuln_host_os: true + id: 12345678-90ab-cdef-1234-567890abcdef + type: azure_scan_options + properties: + data: + $ref: '#/components/schemas/AzureScanOptionsData' + type: object + AzureScanOptionsArray: + description: The definition of `AzureScanOptionsArray` object. + example: + data: + - attributes: + vuln_containers_os: true + vuln_host_os: true + id: 12345678-90ab-cdef-1234-567890abcdef + type: azure_scan_options + properties: + data: + description: The `AzureScanOptionsArray` `data`. + items: + $ref: '#/components/schemas/AzureScanOptionsData' + type: array + required: + - data + type: object + AzureScanOptionsData: + description: The definition of `AzureScanOptionsData` object. + properties: + attributes: + $ref: '#/components/schemas/AzureScanOptionsDataAttributes' + id: + description: The `AzureScanOptionsData` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/AzureScanOptionsDataType' + required: + - type + - id + type: object + AzureScanOptionsDataAttributes: + description: The definition of `AzureScanOptionsDataAttributes` object. + properties: + vuln_containers_os: + description: The `attributes` `vuln_containers_os`. + type: boolean + vuln_host_os: + description: The `attributes` `vuln_host_os`. + type: boolean + type: object + AzureScanOptionsDataType: + default: azure_scan_options + description: The type of the resource. The value should always be `azure_scan_options`. + enum: + - azure_scan_options + example: azure_scan_options + type: string + x-enum-varnames: + - AZURE_SCAN_OPTIONS + AzureScanOptionsInputUpdate: + description: The definition of `AzureScanOptionsInputUpdate` object. + example: + data: + id: 12345678-90ab-cdef-1234-567890abcdef + type: azure_scan_options + properties: + data: + $ref: '#/components/schemas/AzureScanOptionsInputUpdateData' + type: object + AzureScanOptionsInputUpdateData: + description: The definition of `AzureScanOptionsInputUpdateData` object. + properties: + attributes: + $ref: '#/components/schemas/AzureScanOptionsInputUpdateDataAttributes' + id: + description: The `AzureScanOptionsInputUpdateData` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/AzureScanOptionsInputUpdateDataType' + required: + - type + - id + type: object + AzureScanOptionsInputUpdateDataAttributes: + description: The definition of `AzureScanOptionsInputUpdateDataAttributes` object. + properties: + vuln_containers_os: + description: The `attributes` `vuln_containers_os`. + type: boolean + vuln_host_os: + description: The `attributes` `vuln_host_os`. + type: boolean + type: object + AzureScanOptionsInputUpdateDataType: + default: azure_scan_options + description: Azure scan options resource type. + enum: + - azure_scan_options + example: azure_scan_options + type: string + x-enum-varnames: + - AZURE_SCAN_OPTIONS AzureStorageDestination: description: The `azure_storage` destination forwards logs to an Azure Blob Storage container. @@ -51570,6 +51679,11 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read summary: List AWS Scan Options tags: - Agentless Scanning @@ -51598,6 +51712,11 @@ paths: $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management summary: Post AWS Scan Options tags: - Agentless Scanning @@ -51619,6 +51738,11 @@ paths: $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management summary: Delete AWS Scan Options tags: - Agentless Scanning @@ -51642,6 +51766,11 @@ paths: $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read summary: Get AWS scan options tags: - Agentless Scanning @@ -51668,10 +51797,121 @@ paths: $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management summary: Patch AWS Scan Options tags: - Agentless Scanning x-codegen-request-body-name: body + /api/v2/agentless_scanning/accounts/azure: + get: + description: Fetches the scan options configured for Azure accounts. + operationId: ListAzureScanOptions + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureScanOptionsArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read + summary: List azure scan options + tags: + - Agentless Scanning + post: + description: Activate Agentless scan options for an Azure subscription. + operationId: CreateAzureScanOptions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AzureScanOptions' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureScanOptions' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Create azure scan options + tags: + - Agentless Scanning + /api/v2/agentless_scanning/accounts/azure/{subscription_id}: + delete: + description: Delete Agentless scan options for an Azure subscription. + operationId: DeleteAzureScanOptions + parameters: + - description: The Azure subscription ID. + in: path + name: subscription_id + required: true + schema: + example: 12345678-90ab-cdef-1234-567890abcdef + type: string + responses: + '204': + description: No Content + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Delete azure scan options + tags: + - Agentless Scanning + patch: + description: Update the Agentless scan options for an activated subscription. + operationId: UpdateAzureScanOptions + parameters: + - description: The Azure subscription ID. + in: path + name: subscription_id + required: true + schema: + example: 12345678-90ab-cdef-1234-567890abcdef + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AzureScanOptionsInputUpdate' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AzureScanOptions' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Update azure scan options + tags: + - Agentless Scanning /api/v2/agentless_scanning/ondemand/aws: get: description: Fetches the most recent 1000 AWS on demand tasks. @@ -51687,6 +51927,11 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read summary: Get AWS On Demand tasks tags: - Agentless Scanning @@ -51719,6 +51964,11 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management summary: Post an AWS on demand task tags: - Agentless Scanning @@ -51748,6 +51998,11 @@ paths: $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read summary: Get AWS On Demand task by id tags: - Agentless Scanning diff --git a/examples/v2/agentless-scanning/CreateAzureScanOptions.java b/examples/v2/agentless-scanning/CreateAzureScanOptions.java new file mode 100644 index 00000000000..84c2bacd347 --- /dev/null +++ b/examples/v2/agentless-scanning/CreateAzureScanOptions.java @@ -0,0 +1,38 @@ +// Create azure scan options returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentlessScanningApi; +import com.datadog.api.client.v2.model.AzureScanOptions; +import com.datadog.api.client.v2.model.AzureScanOptionsData; +import com.datadog.api.client.v2.model.AzureScanOptionsDataAttributes; +import com.datadog.api.client.v2.model.AzureScanOptionsDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient); + + AzureScanOptions body = + new AzureScanOptions() + .data( + new AzureScanOptionsData() + .attributes( + new AzureScanOptionsDataAttributes() + .vulnContainersOs(true) + .vulnHostOs(true)) + .id("12345678-90ab-cdef-1234-567890abcdef") + .type(AzureScanOptionsDataType.AZURE_SCAN_OPTIONS)); + + try { + AzureScanOptions result = apiInstance.createAzureScanOptions(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentlessScanningApi#createAzureScanOptions"); + 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/agentless-scanning/DeleteAzureScanOptions.java b/examples/v2/agentless-scanning/DeleteAzureScanOptions.java new file mode 100644 index 00000000000..f51162d9aa7 --- /dev/null +++ b/examples/v2/agentless-scanning/DeleteAzureScanOptions.java @@ -0,0 +1,22 @@ +// Delete azure scan options returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentlessScanningApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient); + + try { + apiInstance.deleteAzureScanOptions("12345678-90ab-cdef-1234-567890abcdef"); + } catch (ApiException e) { + System.err.println("Exception when calling AgentlessScanningApi#deleteAzureScanOptions"); + 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/agentless-scanning/ListAzureScanOptions.java b/examples/v2/agentless-scanning/ListAzureScanOptions.java new file mode 100644 index 00000000000..fa52fc70ce6 --- /dev/null +++ b/examples/v2/agentless-scanning/ListAzureScanOptions.java @@ -0,0 +1,24 @@ +// List azure scan options returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentlessScanningApi; +import com.datadog.api.client.v2.model.AzureScanOptionsArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient); + + try { + AzureScanOptionsArray result = apiInstance.listAzureScanOptions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentlessScanningApi#listAzureScanOptions"); + 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/agentless-scanning/UpdateAzureScanOptions.java b/examples/v2/agentless-scanning/UpdateAzureScanOptions.java new file mode 100644 index 00000000000..1f9e8b56ec4 --- /dev/null +++ b/examples/v2/agentless-scanning/UpdateAzureScanOptions.java @@ -0,0 +1,35 @@ +// Update azure scan options returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentlessScanningApi; +import com.datadog.api.client.v2.model.AzureScanOptions; +import com.datadog.api.client.v2.model.AzureScanOptionsInputUpdate; +import com.datadog.api.client.v2.model.AzureScanOptionsInputUpdateData; +import com.datadog.api.client.v2.model.AzureScanOptionsInputUpdateDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AgentlessScanningApi apiInstance = new AgentlessScanningApi(defaultClient); + + AzureScanOptionsInputUpdate body = + new AzureScanOptionsInputUpdate() + .data( + new AzureScanOptionsInputUpdateData() + .id("12345678-90ab-cdef-1234-567890abcdef") + .type(AzureScanOptionsInputUpdateDataType.AZURE_SCAN_OPTIONS)); + + try { + AzureScanOptions result = + apiInstance.updateAzureScanOptions("12345678-90ab-cdef-1234-567890abcdef", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentlessScanningApi#updateAzureScanOptions"); + 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/AgentlessScanningApi.java b/src/main/java/com/datadog/api/client/v2/api/AgentlessScanningApi.java index d23dda6b44a..e4b253bd642 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AgentlessScanningApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AgentlessScanningApi.java @@ -11,6 +11,9 @@ import com.datadog.api.client.v2.model.AwsScanOptionsListResponse; import com.datadog.api.client.v2.model.AwsScanOptionsResponse; import com.datadog.api.client.v2.model.AwsScanOptionsUpdateRequest; +import com.datadog.api.client.v2.model.AzureScanOptions; +import com.datadog.api.client.v2.model.AzureScanOptionsArray; +import com.datadog.api.client.v2.model.AzureScanOptionsInputUpdate; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -119,7 +122,7 @@ public ApiResponse createAwsOnDemandTaskWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "POST", builder, @@ -166,7 +169,7 @@ public CompletableFuture> createAwsOnDemandTask localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -253,7 +256,7 @@ public ApiResponse createAwsScanOptionsWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "POST", builder, @@ -300,7 +303,7 @@ public ApiResponse createAwsScanOptionsWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -317,6 +320,135 @@ public ApiResponse createAwsScanOptionsWithHttpInfo( new GenericType() {}); } + /** + * Create azure scan options. + * + *

See {@link #createAzureScanOptionsWithHttpInfo}. + * + * @param body (required) + * @return AzureScanOptions + * @throws ApiException if fails to make API call + */ + public AzureScanOptions createAzureScanOptions(AzureScanOptions body) throws ApiException { + return createAzureScanOptionsWithHttpInfo(body).getData(); + } + + /** + * Create azure scan options. + * + *

See {@link #createAzureScanOptionsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<AzureScanOptions> + */ + public CompletableFuture createAzureScanOptionsAsync(AzureScanOptions body) { + return createAzureScanOptionsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Activate Agentless scan options for an Azure subscription. + * + * @param body (required) + * @return ApiResponse<AzureScanOptions> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
429 Too many requests -
+ */ + public ApiResponse createAzureScanOptionsWithHttpInfo(AzureScanOptions body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createAzureScanOptions"); + } + // create path and map variables + String localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.createAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create azure scan options. + * + *

See {@link #createAzureScanOptionsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<AzureScanOptions>> + */ + public CompletableFuture> createAzureScanOptionsWithHttpInfoAsync( + AzureScanOptions body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createAzureScanOptions")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.createAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete AWS Scan Options. * @@ -385,7 +517,7 @@ public ApiResponse deleteAwsScanOptionsWithHttpInfo(String accountId) thro localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "DELETE", builder, @@ -434,7 +566,146 @@ public CompletableFuture> deleteAwsScanOptionsWithHttpInfoAsyn localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete azure scan options. + * + *

See {@link #deleteAzureScanOptionsWithHttpInfo}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAzureScanOptions(String subscriptionId) throws ApiException { + deleteAzureScanOptionsWithHttpInfo(subscriptionId); + } + + /** + * Delete azure scan options. + * + *

See {@link #deleteAzureScanOptionsWithHttpInfoAsync}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteAzureScanOptionsAsync(String subscriptionId) { + return deleteAzureScanOptionsWithHttpInfoAsync(subscriptionId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete Agentless scan options for an Azure subscription. + * + * @param subscriptionId The Azure subscription ID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
429 Too many requests -
+ */ + public ApiResponse deleteAzureScanOptionsWithHttpInfo(String subscriptionId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'subscriptionId' when calling deleteAzureScanOptions"); + } + // create path and map variables + String localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}" + .replaceAll( + "\\{" + "subscription_id" + "\\}", + apiClient.escapeString(subscriptionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.deleteAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete azure scan options. + * + *

See {@link #deleteAzureScanOptionsWithHttpInfo}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteAzureScanOptionsWithHttpInfoAsync( + String subscriptionId) { + Object localVarPostBody = null; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'subscriptionId' when calling" + + " deleteAzureScanOptions")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}" + .replaceAll( + "\\{" + "subscription_id" + "\\}", + apiClient.escapeString(subscriptionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.deleteAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -521,7 +792,7 @@ public ApiResponse getAwsOnDemandTaskWithHttpInfo(String ta localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -570,7 +841,7 @@ public CompletableFuture> getAwsOnDemandTaskWit localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -657,7 +928,7 @@ public ApiResponse getAwsScanOptionsWithHttpInfo(String localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -706,7 +977,7 @@ public CompletableFuture> getAwsScanOptionsW localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -780,7 +1051,7 @@ public ApiResponse listAwsOnDemandTasksWithHttpInfo() localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -817,7 +1088,7 @@ public ApiResponse listAwsOnDemandTasksWithHttpInfo() localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -891,7 +1162,7 @@ public ApiResponse listAwsScanOptionsWithHttpInfo() localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -928,7 +1199,7 @@ public ApiResponse listAwsScanOptionsWithHttpInfo() localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -945,6 +1216,115 @@ public ApiResponse listAwsScanOptionsWithHttpInfo() new GenericType() {}); } + /** + * List azure scan options. + * + *

See {@link #listAzureScanOptionsWithHttpInfo}. + * + * @return AzureScanOptionsArray + * @throws ApiException if fails to make API call + */ + public AzureScanOptionsArray listAzureScanOptions() throws ApiException { + return listAzureScanOptionsWithHttpInfo().getData(); + } + + /** + * List azure scan options. + * + *

See {@link #listAzureScanOptionsWithHttpInfoAsync}. + * + * @return CompletableFuture<AzureScanOptionsArray> + */ + public CompletableFuture listAzureScanOptionsAsync() { + return listAzureScanOptionsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Fetches the scan options configured for Azure accounts. + * + * @return ApiResponse<AzureScanOptionsArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse listAzureScanOptionsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.listAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List azure scan options. + * + *

See {@link #listAzureScanOptionsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<AzureScanOptionsArray>> + */ + public CompletableFuture> + listAzureScanOptionsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.listAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Patch AWS Scan Options. * @@ -1025,7 +1405,7 @@ public ApiResponse updateAwsScanOptionsWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "PATCH", builder, @@ -1084,7 +1464,7 @@ public CompletableFuture> updateAwsScanOptionsWithHttpInfoAsyn localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -1100,4 +1480,165 @@ public CompletableFuture> updateAwsScanOptionsWithHttpInfoAsyn false, null); } + + /** + * Update azure scan options. + * + *

See {@link #updateAzureScanOptionsWithHttpInfo}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @param body (required) + * @return AzureScanOptions + * @throws ApiException if fails to make API call + */ + public AzureScanOptions updateAzureScanOptions( + String subscriptionId, AzureScanOptionsInputUpdate body) throws ApiException { + return updateAzureScanOptionsWithHttpInfo(subscriptionId, body).getData(); + } + + /** + * Update azure scan options. + * + *

See {@link #updateAzureScanOptionsWithHttpInfoAsync}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @param body (required) + * @return CompletableFuture<AzureScanOptions> + */ + public CompletableFuture updateAzureScanOptionsAsync( + String subscriptionId, AzureScanOptionsInputUpdate body) { + return updateAzureScanOptionsWithHttpInfoAsync(subscriptionId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the Agentless scan options for an activated subscription. + * + * @param subscriptionId The Azure subscription ID. (required) + * @param body (required) + * @return ApiResponse<AzureScanOptions> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse updateAzureScanOptionsWithHttpInfo( + String subscriptionId, AzureScanOptionsInputUpdate body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'subscriptionId' when calling updateAzureScanOptions"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAzureScanOptions"); + } + // create path and map variables + String localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}" + .replaceAll( + "\\{" + "subscription_id" + "\\}", + apiClient.escapeString(subscriptionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.updateAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update azure scan options. + * + *

See {@link #updateAzureScanOptionsWithHttpInfo}. + * + * @param subscriptionId The Azure subscription ID. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<AzureScanOptions>> + */ + public CompletableFuture> updateAzureScanOptionsWithHttpInfoAsync( + String subscriptionId, AzureScanOptionsInputUpdate body) { + Object localVarPostBody = body; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'subscriptionId' when calling" + + " updateAzureScanOptions")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAzureScanOptions")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}" + .replaceAll( + "\\{" + "subscription_id" + "\\}", + apiClient.escapeString(subscriptionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentlessScanningApi.updateAzureScanOptions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/AzureScanOptions.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptions.java new file mode 100644 index 00000000000..a9085996ca1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptions.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** The definition of AzureScanOptions object. */ +@JsonPropertyOrder({AzureScanOptions.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AzureScanOptionsData data; + + public AzureScanOptions data(AzureScanOptionsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of AzureScanOptionsData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AzureScanOptionsData getData() { + return data; + } + + public void setData(AzureScanOptionsData 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 AzureScanOptions + */ + @JsonAnySetter + public AzureScanOptions 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 AzureScanOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptions azureScanOptions = (AzureScanOptions) o; + return Objects.equals(this.data, azureScanOptions.data) + && Objects.equals(this.additionalProperties, azureScanOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptions {\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/AzureScanOptionsArray.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsArray.java new file mode 100644 index 00000000000..fe7b58ba9b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of AzureScanOptionsArray object. */ +@JsonPropertyOrder({AzureScanOptionsArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public AzureScanOptionsArray() {} + + @JsonCreator + public AzureScanOptionsArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public AzureScanOptionsArray data(List data) { + this.data = data; + for (AzureScanOptionsData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AzureScanOptionsArray addDataItem(AzureScanOptionsData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The AzureScanOptionsArray data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List 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 AzureScanOptionsArray + */ + @JsonAnySetter + public AzureScanOptionsArray 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 AzureScanOptionsArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsArray azureScanOptionsArray = (AzureScanOptionsArray) o; + return Objects.equals(this.data, azureScanOptionsArray.data) + && Objects.equals(this.additionalProperties, azureScanOptionsArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsArray {\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/AzureScanOptionsData.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsData.java new file mode 100644 index 00000000000..ef0bbceb1c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsData.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of AzureScanOptionsData object. */ +@JsonPropertyOrder({ + AzureScanOptionsData.JSON_PROPERTY_ATTRIBUTES, + AzureScanOptionsData.JSON_PROPERTY_ID, + AzureScanOptionsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AzureScanOptionsDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AzureScanOptionsDataType type = AzureScanOptionsDataType.AZURE_SCAN_OPTIONS; + + public AzureScanOptionsData() {} + + @JsonCreator + public AzureScanOptionsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AzureScanOptionsDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AzureScanOptionsData attributes(AzureScanOptionsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of AzureScanOptionsDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AzureScanOptionsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AzureScanOptionsDataAttributes attributes) { + this.attributes = attributes; + } + + public AzureScanOptionsData id(String id) { + this.id = id; + return this; + } + + /** + * The AzureScanOptionsData id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AzureScanOptionsData type(AzureScanOptionsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be azure_scan_options. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AzureScanOptionsDataType getType() { + return type; + } + + public void setType(AzureScanOptionsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AzureScanOptionsData + */ + @JsonAnySetter + public AzureScanOptionsData 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 AzureScanOptionsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsData azureScanOptionsData = (AzureScanOptionsData) o; + return Objects.equals(this.attributes, azureScanOptionsData.attributes) + && Objects.equals(this.id, azureScanOptionsData.id) + && Objects.equals(this.type, azureScanOptionsData.type) + && Objects.equals(this.additionalProperties, azureScanOptionsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsData {\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/AzureScanOptionsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataAttributes.java new file mode 100644 index 00000000000..cab6731d875 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataAttributes.java @@ -0,0 +1,166 @@ +/* + * 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; + +/** The definition of AzureScanOptionsDataAttributes object. */ +@JsonPropertyOrder({ + AzureScanOptionsDataAttributes.JSON_PROPERTY_VULN_CONTAINERS_OS, + AzureScanOptionsDataAttributes.JSON_PROPERTY_VULN_HOST_OS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VULN_CONTAINERS_OS = "vuln_containers_os"; + private Boolean vulnContainersOs; + + public static final String JSON_PROPERTY_VULN_HOST_OS = "vuln_host_os"; + private Boolean vulnHostOs; + + public AzureScanOptionsDataAttributes vulnContainersOs(Boolean vulnContainersOs) { + this.vulnContainersOs = vulnContainersOs; + return this; + } + + /** + * The attributes vuln_containers_os. + * + * @return vulnContainersOs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VULN_CONTAINERS_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVulnContainersOs() { + return vulnContainersOs; + } + + public void setVulnContainersOs(Boolean vulnContainersOs) { + this.vulnContainersOs = vulnContainersOs; + } + + public AzureScanOptionsDataAttributes vulnHostOs(Boolean vulnHostOs) { + this.vulnHostOs = vulnHostOs; + return this; + } + + /** + * The attributes vuln_host_os. + * + * @return vulnHostOs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VULN_HOST_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVulnHostOs() { + return vulnHostOs; + } + + public void setVulnHostOs(Boolean vulnHostOs) { + this.vulnHostOs = vulnHostOs; + } + + /** + * 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 AzureScanOptionsDataAttributes + */ + @JsonAnySetter + public AzureScanOptionsDataAttributes 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 AzureScanOptionsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsDataAttributes azureScanOptionsDataAttributes = + (AzureScanOptionsDataAttributes) o; + return Objects.equals(this.vulnContainersOs, azureScanOptionsDataAttributes.vulnContainersOs) + && Objects.equals(this.vulnHostOs, azureScanOptionsDataAttributes.vulnHostOs) + && Objects.equals( + this.additionalProperties, azureScanOptionsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(vulnContainersOs, vulnHostOs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsDataAttributes {\n"); + sb.append(" vulnContainersOs: ").append(toIndentedString(vulnContainersOs)).append("\n"); + sb.append(" vulnHostOs: ").append(toIndentedString(vulnHostOs)).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/AzureScanOptionsDataType.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataType.java new file mode 100644 index 00000000000..99008f8e4b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the resource. The value should always be azure_scan_options. */ +@JsonSerialize(using = AzureScanOptionsDataType.AzureScanOptionsDataTypeSerializer.class) +public class AzureScanOptionsDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("azure_scan_options")); + + public static final AzureScanOptionsDataType AZURE_SCAN_OPTIONS = + new AzureScanOptionsDataType("azure_scan_options"); + + AzureScanOptionsDataType(String value) { + super(value, allowedValues); + } + + public static class AzureScanOptionsDataTypeSerializer + extends StdSerializer { + public AzureScanOptionsDataTypeSerializer(Class t) { + super(t); + } + + public AzureScanOptionsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AzureScanOptionsDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AzureScanOptionsDataType fromValue(String value) { + return new AzureScanOptionsDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdate.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdate.java new file mode 100644 index 00000000000..0df8a6ba96e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdate.java @@ -0,0 +1,137 @@ +/* + * 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; + +/** The definition of AzureScanOptionsInputUpdate object. */ +@JsonPropertyOrder({AzureScanOptionsInputUpdate.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsInputUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AzureScanOptionsInputUpdateData data; + + public AzureScanOptionsInputUpdate data(AzureScanOptionsInputUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of AzureScanOptionsInputUpdateData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AzureScanOptionsInputUpdateData getData() { + return data; + } + + public void setData(AzureScanOptionsInputUpdateData 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 AzureScanOptionsInputUpdate + */ + @JsonAnySetter + public AzureScanOptionsInputUpdate 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 AzureScanOptionsInputUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsInputUpdate azureScanOptionsInputUpdate = (AzureScanOptionsInputUpdate) o; + return Objects.equals(this.data, azureScanOptionsInputUpdate.data) + && Objects.equals( + this.additionalProperties, azureScanOptionsInputUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsInputUpdate {\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/AzureScanOptionsInputUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateData.java new file mode 100644 index 00000000000..e0c155dcdac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateData.java @@ -0,0 +1,211 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of AzureScanOptionsInputUpdateData object. */ +@JsonPropertyOrder({ + AzureScanOptionsInputUpdateData.JSON_PROPERTY_ATTRIBUTES, + AzureScanOptionsInputUpdateData.JSON_PROPERTY_ID, + AzureScanOptionsInputUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsInputUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AzureScanOptionsInputUpdateDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AzureScanOptionsInputUpdateDataType type = + AzureScanOptionsInputUpdateDataType.AZURE_SCAN_OPTIONS; + + public AzureScanOptionsInputUpdateData() {} + + @JsonCreator + public AzureScanOptionsInputUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AzureScanOptionsInputUpdateDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AzureScanOptionsInputUpdateData attributes( + AzureScanOptionsInputUpdateDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of AzureScanOptionsInputUpdateDataAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AzureScanOptionsInputUpdateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AzureScanOptionsInputUpdateDataAttributes attributes) { + this.attributes = attributes; + } + + public AzureScanOptionsInputUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The AzureScanOptionsInputUpdateData id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AzureScanOptionsInputUpdateData type(AzureScanOptionsInputUpdateDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Azure scan options resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AzureScanOptionsInputUpdateDataType getType() { + return type; + } + + public void setType(AzureScanOptionsInputUpdateDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AzureScanOptionsInputUpdateData + */ + @JsonAnySetter + public AzureScanOptionsInputUpdateData 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 AzureScanOptionsInputUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsInputUpdateData azureScanOptionsInputUpdateData = + (AzureScanOptionsInputUpdateData) o; + return Objects.equals(this.attributes, azureScanOptionsInputUpdateData.attributes) + && Objects.equals(this.id, azureScanOptionsInputUpdateData.id) + && Objects.equals(this.type, azureScanOptionsInputUpdateData.type) + && Objects.equals( + this.additionalProperties, azureScanOptionsInputUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsInputUpdateData {\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/AzureScanOptionsInputUpdateDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataAttributes.java new file mode 100644 index 00000000000..49d5aa90a4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataAttributes.java @@ -0,0 +1,168 @@ +/* + * 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; + +/** The definition of AzureScanOptionsInputUpdateDataAttributes object. */ +@JsonPropertyOrder({ + AzureScanOptionsInputUpdateDataAttributes.JSON_PROPERTY_VULN_CONTAINERS_OS, + AzureScanOptionsInputUpdateDataAttributes.JSON_PROPERTY_VULN_HOST_OS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AzureScanOptionsInputUpdateDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VULN_CONTAINERS_OS = "vuln_containers_os"; + private Boolean vulnContainersOs; + + public static final String JSON_PROPERTY_VULN_HOST_OS = "vuln_host_os"; + private Boolean vulnHostOs; + + public AzureScanOptionsInputUpdateDataAttributes vulnContainersOs(Boolean vulnContainersOs) { + this.vulnContainersOs = vulnContainersOs; + return this; + } + + /** + * The attributes vuln_containers_os. + * + * @return vulnContainersOs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VULN_CONTAINERS_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVulnContainersOs() { + return vulnContainersOs; + } + + public void setVulnContainersOs(Boolean vulnContainersOs) { + this.vulnContainersOs = vulnContainersOs; + } + + public AzureScanOptionsInputUpdateDataAttributes vulnHostOs(Boolean vulnHostOs) { + this.vulnHostOs = vulnHostOs; + return this; + } + + /** + * The attributes vuln_host_os. + * + * @return vulnHostOs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VULN_HOST_OS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVulnHostOs() { + return vulnHostOs; + } + + public void setVulnHostOs(Boolean vulnHostOs) { + this.vulnHostOs = vulnHostOs; + } + + /** + * 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 AzureScanOptionsInputUpdateDataAttributes + */ + @JsonAnySetter + public AzureScanOptionsInputUpdateDataAttributes 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 AzureScanOptionsInputUpdateDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureScanOptionsInputUpdateDataAttributes azureScanOptionsInputUpdateDataAttributes = + (AzureScanOptionsInputUpdateDataAttributes) o; + return Objects.equals( + this.vulnContainersOs, azureScanOptionsInputUpdateDataAttributes.vulnContainersOs) + && Objects.equals(this.vulnHostOs, azureScanOptionsInputUpdateDataAttributes.vulnHostOs) + && Objects.equals( + this.additionalProperties, + azureScanOptionsInputUpdateDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(vulnContainersOs, vulnHostOs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureScanOptionsInputUpdateDataAttributes {\n"); + sb.append(" vulnContainersOs: ").append(toIndentedString(vulnContainersOs)).append("\n"); + sb.append(" vulnHostOs: ").append(toIndentedString(vulnHostOs)).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/AzureScanOptionsInputUpdateDataType.java b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataType.java new file mode 100644 index 00000000000..68df865ec96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AzureScanOptionsInputUpdateDataType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Azure scan options resource type. */ +@JsonSerialize( + using = AzureScanOptionsInputUpdateDataType.AzureScanOptionsInputUpdateDataTypeSerializer.class) +public class AzureScanOptionsInputUpdateDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("azure_scan_options")); + + public static final AzureScanOptionsInputUpdateDataType AZURE_SCAN_OPTIONS = + new AzureScanOptionsInputUpdateDataType("azure_scan_options"); + + AzureScanOptionsInputUpdateDataType(String value) { + super(value, allowedValues); + } + + public static class AzureScanOptionsInputUpdateDataTypeSerializer + extends StdSerializer { + public AzureScanOptionsInputUpdateDataTypeSerializer( + Class t) { + super(t); + } + + public AzureScanOptionsInputUpdateDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AzureScanOptionsInputUpdateDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AzureScanOptionsInputUpdateDataType fromValue(String value) { + return new AzureScanOptionsInputUpdateDataType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.freeze new file mode 100644 index 00000000000..1f060e7c19f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-09-30T18:30:00.006Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.json new file mode 100644 index 00000000000..48dcc627451 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_azure_scan_options_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"vuln_containers_os\":true,\"vuln_host_os\":true},\"id\":\"12345678-90ab-cdef-1234-567890abcdef\",\"type\":\"azure_scan_options\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/agentless_scanning/accounts/azure", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"12345678-90ab-cdef-1234-567890abcdef\",\"type\":\"azure_scan_options\",\"attributes\":{\"vuln_containers_os\":true,\"vuln_host_os\":true}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e519a321-b24b-b3b9-474c-63f68735e218" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/agentless_scanning/accounts/azure/12345678-90ab-cdef-1234-567890abcdef", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f983fb1e-25dd-f746-b6fd-dda952d7e03c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.freeze new file mode 100644 index 00000000000..9a91175487c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-30T18:30:00.763Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.json new file mode 100644 index 00000000000..134e8ee1519 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_azure_scan_options_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/agentless_scanning/accounts/azure", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ec337ccf-4495-cbb4-bdcb-7c7e14d1e55e" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/agentless_scanning.feature b/src/test/resources/com/datadog/api/client/v2/api/agentless_scanning.feature index f5f66c57cca..280cc341362 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/agentless_scanning.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/agentless_scanning.feature @@ -12,6 +12,13 @@ Feature: Agentless Scanning And a valid "appKeyAuth" key in the system And an instance of "AgentlessScanning" API + @skip-validation @team:DataDog/k9-agentless + Scenario: Create azure scan options returns "Created" response + Given new "CreateAzureScanOptions" request + And body with value {"data": {"attributes": {"vuln_containers_os": true, "vuln_host_os": true}, "id": "12345678-90ab-cdef-1234-567890abcdef", "type": "azure_scan_options"}} + When the request is sent + Then the response status is 201 Created + @team:DataDog/k9-agentless Scenario: Delete AWS Scan Options returns "Bad Request" response Given new "DeleteAwsScanOptions" request @@ -33,6 +40,13 @@ Feature: Agentless Scanning When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-agentless + Scenario: Delete azure scan options returns "No Content" response + Given new "DeleteAzureScanOptions" request + And request contains "subscription_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/k9-agentless Scenario: Get AWS On Demand task by id returns "Bad Request" response Given new "GetAwsOnDemandTask" request @@ -92,6 +106,12 @@ Feature: Agentless Scanning When the request is sent Then the response status is 200 OK + @team:DataDog/k9-agentless + Scenario: List azure scan options returns "OK" response + Given new "ListAzureScanOptions" request + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-agentless Scenario: Patch AWS Scan Options returns "Bad Request" response Given new "UpdateAwsScanOptions" request @@ -159,3 +179,11 @@ Feature: Agentless Scanning And body with value {"data": {"attributes": {"arn": "invalid-arn"}, "type": "aws_resource"}} When the request is sent Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-agentless + Scenario: Update azure scan options returns "OK" response + Given new "UpdateAzureScanOptions" request + And request contains "subscription_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "12345678-90ab-cdef-1234-567890abcdef", "type": "azure_scan_options"}} + 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 92c07fe002e..6fcf52fcedc 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 @@ -152,6 +152,37 @@ "type": "idempotent" } }, + "ListAzureScanOptions": { + "tag": "Agentless Scanning", + "undo": { + "type": "safe" + } + }, + "CreateAzureScanOptions": { + "tag": "Agentless Scanning", + "undo": { + "operationId": "DeleteAzureScanOptions", + "parameters": [ + { + "name": "subscription_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAzureScanOptions": { + "tag": "Agentless Scanning", + "undo": { + "type": "idempotent" + } + }, + "UpdateAzureScanOptions": { + "tag": "Agentless Scanning", + "undo": { + "type": "idempotent" + } + }, "ListAwsOnDemandTasks": { "tag": "Agentless Scanning", "undo": {