From 296cc87e3a120f8b28f85f768f8578eeba136fa3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 1 Oct 2025 14:20:12 +0000 Subject: [PATCH] Regenerate client from commit ba47c96 of spec repo --- .generator/schemas/v2/openapi.yaml | 255 +++++++++ .../frozen.json | 1 + .../recording.har | 109 ++++ .../frozen.json | 1 + .../recording.har | 57 ++ .../CreateAzureScanOptions.ts | 30 ++ .../DeleteAzureScanOptions.ts | 21 + .../ListAzureScanOptions.ts | 17 + .../UpdateAzureScanOptions.ts | 27 + features/support/scenarios_model_mapping.ts | 28 + features/v2/agentless_scanning.feature | 28 + features/v2/undo.json | 31 ++ .../apis/AgentlessScanningApi.ts | 497 ++++++++++++++++++ packages/datadog-api-client-v2/index.ts | 12 + .../models/AzureScanOptions.ts | 53 ++ .../models/AzureScanOptionsArray.ts | 54 ++ .../models/AzureScanOptionsData.ts | 72 +++ .../models/AzureScanOptionsDataAttributes.ts | 60 +++ .../models/AzureScanOptionsDataType.ts | 16 + .../models/AzureScanOptionsInputUpdate.ts | 53 ++ .../models/AzureScanOptionsInputUpdateData.ts | 72 +++ ...ureScanOptionsInputUpdateDataAttributes.ts | 60 +++ .../AzureScanOptionsInputUpdateDataType.ts | 16 + .../models/ObjectSerializer.ts | 17 + 24 files changed, 1587 insertions(+) create mode 100644 cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/frozen.json create mode 100644 cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/recording.har create mode 100644 cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/frozen.json create mode 100644 cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/recording.har create mode 100644 examples/v2/agentless-scanning/CreateAzureScanOptions.ts create mode 100644 examples/v2/agentless-scanning/DeleteAzureScanOptions.ts create mode 100644 examples/v2/agentless-scanning/ListAzureScanOptions.ts create mode 100644 examples/v2/agentless-scanning/UpdateAzureScanOptions.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptions.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsArray.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsData.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsDataType.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdate.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateData.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataType.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d4dfe8ead6bc..d3505929ef55 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/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/frozen.json b/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/frozen.json new file mode 100644 index 000000000000..1af95128625d --- /dev/null +++ b/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/frozen.json @@ -0,0 +1 @@ +"2025-09-30T18:30:00.006Z" diff --git a/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/recording.har b/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/recording.har new file mode 100644 index 000000000000..84543c04a2e2 --- /dev/null +++ b/cassettes/v2/Agentless-Scanning_730042230/Create-azure-scan-options-returns-Created-response_1871665817/recording.har @@ -0,0 +1,109 @@ +{ + "log": { + "_recordingName": "Agentless Scanning/Create azure scan options returns \"Created\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e519a321b24bb3b9474c63f68735e218", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 143, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 590, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"vuln_containers_os\":true,\"vuln_host_os\":true},\"id\":\"12345678-90ab-cdef-1234-567890abcdef\",\"type\":\"azure_scan_options\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure" + }, + "response": { + "bodySize": 143, + "content": { + "mimeType": "application/vnd.api+json", + "size": 143, + "text": "{\"data\":{\"id\":\"12345678-90ab-cdef-1234-567890abcdef\",\"type\":\"azure_scan_options\",\"attributes\":{\"vuln_containers_os\":true,\"vuln_host_os\":true}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-09-30T18:30:00.009Z", + "time": 364 + }, + { + "_id": "f983fb1e25ddf746b6fddda952d7e03c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 563, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure/12345678-90ab-cdef-1234-567890abcdef" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "application/vnd.api+json", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 523, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-09-30T18:30:00.385Z", + "time": 362 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/frozen.json b/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/frozen.json new file mode 100644 index 000000000000..6f9a0b24733a --- /dev/null +++ b/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/frozen.json @@ -0,0 +1 @@ +"2025-09-30T18:30:00.763Z" diff --git a/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/recording.har b/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/recording.har new file mode 100644 index 000000000000..cae1b66a4a0d --- /dev/null +++ b/cassettes/v2/Agentless-Scanning_730042230/List-azure-scan-options-returns-OK-response_3188596895/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Agentless Scanning/List azure scan options returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "ec337ccf4495cbb4bdcb7c7e14d1e55e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 534, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure" + }, + "response": { + "bodySize": 11, + "content": { + "mimeType": "application/vnd.api+json", + "size": 11, + "text": "{\"data\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-09-30T18:30:00.766Z", + "time": 103 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/agentless-scanning/CreateAzureScanOptions.ts b/examples/v2/agentless-scanning/CreateAzureScanOptions.ts new file mode 100644 index 000000000000..15adbc5dfe68 --- /dev/null +++ b/examples/v2/agentless-scanning/CreateAzureScanOptions.ts @@ -0,0 +1,30 @@ +/** + * Create azure scan options returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.AgentlessScanningApi(configuration); + +const params: v2.AgentlessScanningApiCreateAzureScanOptionsRequest = { + body: { + data: { + attributes: { + vulnContainersOs: true, + vulnHostOs: true, + }, + id: "12345678-90ab-cdef-1234-567890abcdef", + type: "azure_scan_options", + }, + }, +}; + +apiInstance + .createAzureScanOptions(params) + .then((data: v2.AzureScanOptions) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/agentless-scanning/DeleteAzureScanOptions.ts b/examples/v2/agentless-scanning/DeleteAzureScanOptions.ts new file mode 100644 index 000000000000..f1ea850a3532 --- /dev/null +++ b/examples/v2/agentless-scanning/DeleteAzureScanOptions.ts @@ -0,0 +1,21 @@ +/** + * Delete azure scan options returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.AgentlessScanningApi(configuration); + +const params: v2.AgentlessScanningApiDeleteAzureScanOptionsRequest = { + subscriptionId: "12345678-90ab-cdef-1234-567890abcdef", +}; + +apiInstance + .deleteAzureScanOptions(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/agentless-scanning/ListAzureScanOptions.ts b/examples/v2/agentless-scanning/ListAzureScanOptions.ts new file mode 100644 index 000000000000..d2f6ae2ece70 --- /dev/null +++ b/examples/v2/agentless-scanning/ListAzureScanOptions.ts @@ -0,0 +1,17 @@ +/** + * List azure scan options returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.AgentlessScanningApi(configuration); + +apiInstance + .listAzureScanOptions() + .then((data: v2.AzureScanOptionsArray) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/agentless-scanning/UpdateAzureScanOptions.ts b/examples/v2/agentless-scanning/UpdateAzureScanOptions.ts new file mode 100644 index 000000000000..40f1a5916a12 --- /dev/null +++ b/examples/v2/agentless-scanning/UpdateAzureScanOptions.ts @@ -0,0 +1,27 @@ +/** + * Update azure scan options returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.AgentlessScanningApi(configuration); + +const params: v2.AgentlessScanningApiUpdateAzureScanOptionsRequest = { + body: { + data: { + id: "12345678-90ab-cdef-1234-567890abcdef", + type: "azure_scan_options", + }, + }, + subscriptionId: "12345678-90ab-cdef-1234-567890abcdef", +}; + +apiInstance + .updateAzureScanOptions(params) + .then((data: v2.AzureScanOptions) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 923349010113..727886196a45 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -2534,6 +2534,34 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "{}", }, + "v2.ListAzureScanOptions": { + "operationResponseType": "AzureScanOptionsArray", + }, + "v2.CreateAzureScanOptions": { + "body": { + "type": "AzureScanOptions", + "format": "", + }, + "operationResponseType": "AzureScanOptions", + }, + "v2.DeleteAzureScanOptions": { + "subscriptionId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.UpdateAzureScanOptions": { + "subscriptionId": { + "type": "string", + "format": "", + }, + "body": { + "type": "AzureScanOptionsInputUpdate", + "format": "", + }, + "operationResponseType": "AzureScanOptions", + }, "v2.ListAwsOnDemandTasks": { "operationResponseType": "AwsOnDemandListResponse", }, diff --git a/features/v2/agentless_scanning.feature b/features/v2/agentless_scanning.feature index f5f66c57cca0..280cc3413621 100644 --- a/features/v2/agentless_scanning.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 92c07fe002e0..6fcf52fcedc9 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/packages/datadog-api-client-v2/apis/AgentlessScanningApi.ts b/packages/datadog-api-client-v2/apis/AgentlessScanningApi.ts index fce460b20829..97933a94e39d 100644 --- a/packages/datadog-api-client-v2/apis/AgentlessScanningApi.ts +++ b/packages/datadog-api-client-v2/apis/AgentlessScanningApi.ts @@ -24,6 +24,9 @@ import { AwsScanOptionsCreateRequest } from "../models/AwsScanOptionsCreateReque import { AwsScanOptionsListResponse } from "../models/AwsScanOptionsListResponse"; import { AwsScanOptionsResponse } from "../models/AwsScanOptionsResponse"; import { AwsScanOptionsUpdateRequest } from "../models/AwsScanOptionsUpdateRequest"; +import { AzureScanOptions } from "../models/AzureScanOptions"; +import { AzureScanOptionsArray } from "../models/AzureScanOptionsArray"; +import { AzureScanOptionsInputUpdate } from "../models/AzureScanOptionsInputUpdate"; export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { public async createAwsOnDemandTask( @@ -62,6 +65,7 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -103,6 +107,49 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async createAzureScanOptions( + body: AzureScanOptions, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createAzureScanOptions"); + } + + // Path Params + const localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + // Make Request Context + const requestContext = _config + .getServer("v2.AgentlessScanningApi.createAzureScanOptions") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "AzureScanOptions", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -137,6 +184,42 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteAzureScanOptions( + subscriptionId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("subscriptionId", "deleteAzureScanOptions"); + } + + // Path Params + const localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}".replace( + "{subscription_id}", + encodeURIComponent(String(subscriptionId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.AgentlessScanningApi.deleteAzureScanOptions") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -171,6 +254,7 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -205,6 +289,7 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -229,6 +314,7 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -253,6 +339,32 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async listAzureScanOptions( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/agentless_scanning/accounts/azure"; + + // Make Request Context + const requestContext = _config + .getServer("v2.AgentlessScanningApi.listAzureScanOptions") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -304,6 +416,59 @@ export class AgentlessScanningApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async updateAzureScanOptions( + subscriptionId: string, + body: AzureScanOptionsInputUpdate, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'subscriptionId' is not null or undefined + if (subscriptionId === null || subscriptionId === undefined) { + throw new RequiredError("subscriptionId", "updateAzureScanOptions"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateAzureScanOptions"); + } + + // Path Params + const localVarPath = + "/api/v2/agentless_scanning/accounts/azure/{subscription_id}".replace( + "{subscription_id}", + encodeURIComponent(String(subscriptionId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.AgentlessScanningApi.updateAzureScanOptions") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "AzureScanOptionsInputUpdate", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -436,6 +601,64 @@ export class AgentlessScanningApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createAzureScanOptions + * @throws ApiException if the response code was not in [200, 299] + */ + public async createAzureScanOptions( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: AzureScanOptions = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptions" + ) as AzureScanOptions; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: AzureScanOptions = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptions", + "" + ) as AzureScanOptions; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -488,6 +711,55 @@ export class AgentlessScanningApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteAzureScanOptions + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteAzureScanOptions( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -730,6 +1002,64 @@ export class AgentlessScanningApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listAzureScanOptions + * @throws ApiException if the response code was not in [200, 299] + */ + public async listAzureScanOptions( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: AzureScanOptionsArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptionsArray" + ) as AzureScanOptionsArray; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: AzureScanOptionsArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptionsArray", + "" + ) as AzureScanOptionsArray; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -781,6 +1111,64 @@ export class AgentlessScanningApiResponseProcessor { 'Unknown API Status Code!\nBody: "' + body + '"' ); } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateAzureScanOptions + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateAzureScanOptions( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: AzureScanOptions = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptions" + ) as AzureScanOptions; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: AzureScanOptions = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AzureScanOptions", + "" + ) as AzureScanOptions; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } } export interface AgentlessScanningApiCreateAwsOnDemandTaskRequest { @@ -799,6 +1187,13 @@ export interface AgentlessScanningApiCreateAwsScanOptionsRequest { body: AwsScanOptionsCreateRequest; } +export interface AgentlessScanningApiCreateAzureScanOptionsRequest { + /** + * @type AzureScanOptions + */ + body: AzureScanOptions; +} + export interface AgentlessScanningApiDeleteAwsScanOptionsRequest { /** * The ID of an AWS account. @@ -807,6 +1202,14 @@ export interface AgentlessScanningApiDeleteAwsScanOptionsRequest { accountId: string; } +export interface AgentlessScanningApiDeleteAzureScanOptionsRequest { + /** + * The Azure subscription ID. + * @type string + */ + subscriptionId: string; +} + export interface AgentlessScanningApiGetAwsOnDemandTaskRequest { /** * The UUID of the task. @@ -836,6 +1239,18 @@ export interface AgentlessScanningApiUpdateAwsScanOptionsRequest { body: AwsScanOptionsUpdateRequest; } +export interface AgentlessScanningApiUpdateAzureScanOptionsRequest { + /** + * The Azure subscription ID. + * @type string + */ + subscriptionId: string; + /** + * @type AzureScanOptionsInputUpdate + */ + body: AzureScanOptionsInputUpdate; +} + export class AgentlessScanningApi { private requestFactory: AgentlessScanningApiRequestFactory; private responseProcessor: AgentlessScanningApiResponseProcessor; @@ -895,6 +1310,27 @@ export class AgentlessScanningApi { }); } + /** + * Activate Agentless scan options for an Azure subscription. + * @param param The request object + */ + public createAzureScanOptions( + param: AgentlessScanningApiCreateAzureScanOptionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createAzureScanOptions( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createAzureScanOptions(responseContext); + }); + }); + } + /** * Delete Agentless scan options for an AWS account. * @param param The request object @@ -916,6 +1352,27 @@ export class AgentlessScanningApi { }); } + /** + * Delete Agentless scan options for an Azure subscription. + * @param param The request object + */ + public deleteAzureScanOptions( + param: AgentlessScanningApiDeleteAzureScanOptionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteAzureScanOptions( + param.subscriptionId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteAzureScanOptions(responseContext); + }); + }); + } + /** * Fetch the data of a specific on demand task. * @param param The request object @@ -994,6 +1451,24 @@ export class AgentlessScanningApi { }); } + /** + * Fetches the scan options configured for Azure accounts. + * @param param The request object + */ + public listAzureScanOptions( + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listAzureScanOptions(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listAzureScanOptions(responseContext); + }); + }); + } + /** * Update the Agentless scan options for an activated account. * @param param The request object @@ -1015,4 +1490,26 @@ export class AgentlessScanningApi { }); }); } + + /** + * Update the Agentless scan options for an activated subscription. + * @param param The request object + */ + public updateAzureScanOptions( + param: AgentlessScanningApiUpdateAzureScanOptionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateAzureScanOptions( + param.subscriptionId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateAzureScanOptions(responseContext); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index c068002129fa..0bd4f6335a36 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -54,10 +54,13 @@ export { export { AgentlessScanningApiCreateAwsOnDemandTaskRequest, AgentlessScanningApiCreateAwsScanOptionsRequest, + AgentlessScanningApiCreateAzureScanOptionsRequest, AgentlessScanningApiDeleteAwsScanOptionsRequest, + AgentlessScanningApiDeleteAzureScanOptionsRequest, AgentlessScanningApiGetAwsOnDemandTaskRequest, AgentlessScanningApiGetAwsScanOptionsRequest, AgentlessScanningApiUpdateAwsScanOptionsRequest, + AgentlessScanningApiUpdateAzureScanOptionsRequest, AgentlessScanningApi, } from "./apis/AgentlessScanningApi"; @@ -1141,6 +1144,15 @@ export { AzureCredentialsUpdate } from "./models/AzureCredentialsUpdate"; export { AzureIntegration } from "./models/AzureIntegration"; export { AzureIntegrationType } from "./models/AzureIntegrationType"; export { AzureIntegrationUpdate } from "./models/AzureIntegrationUpdate"; +export { AzureScanOptions } from "./models/AzureScanOptions"; +export { AzureScanOptionsArray } from "./models/AzureScanOptionsArray"; +export { AzureScanOptionsData } from "./models/AzureScanOptionsData"; +export { AzureScanOptionsDataAttributes } from "./models/AzureScanOptionsDataAttributes"; +export { AzureScanOptionsDataType } from "./models/AzureScanOptionsDataType"; +export { AzureScanOptionsInputUpdate } from "./models/AzureScanOptionsInputUpdate"; +export { AzureScanOptionsInputUpdateData } from "./models/AzureScanOptionsInputUpdateData"; +export { AzureScanOptionsInputUpdateDataAttributes } from "./models/AzureScanOptionsInputUpdateDataAttributes"; +export { AzureScanOptionsInputUpdateDataType } from "./models/AzureScanOptionsInputUpdateDataType"; export { AzureStorageDestination } from "./models/AzureStorageDestination"; export { AzureStorageDestinationType } from "./models/AzureStorageDestinationType"; export { AzureTenant } from "./models/AzureTenant"; diff --git a/packages/datadog-api-client-v2/models/AzureScanOptions.ts b/packages/datadog-api-client-v2/models/AzureScanOptions.ts new file mode 100644 index 000000000000..cb2b9ed4faae --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptions.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AzureScanOptionsData } from "./AzureScanOptionsData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptions` object. + */ +export class AzureScanOptions { + /** + * The definition of `AzureScanOptionsData` object. + */ + "data"?: AzureScanOptionsData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "AzureScanOptionsData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsArray.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsArray.ts new file mode 100644 index 000000000000..0daa118c3b17 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsArray.ts @@ -0,0 +1,54 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AzureScanOptionsData } from "./AzureScanOptionsData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsArray` object. + */ +export class AzureScanOptionsArray { + /** + * The `AzureScanOptionsArray` `data`. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsArray.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsData.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsData.ts new file mode 100644 index 000000000000..1b7e64a6e80d --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsData.ts @@ -0,0 +1,72 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AzureScanOptionsDataAttributes } from "./AzureScanOptionsDataAttributes"; +import { AzureScanOptionsDataType } from "./AzureScanOptionsDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsData` object. + */ +export class AzureScanOptionsData { + /** + * The definition of `AzureScanOptionsDataAttributes` object. + */ + "attributes"?: AzureScanOptionsDataAttributes; + /** + * The `AzureScanOptionsData` `id`. + */ + "id": string; + /** + * The type of the resource. The value should always be `azure_scan_options`. + */ + "type": AzureScanOptionsDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "AzureScanOptionsDataAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "AzureScanOptionsDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsDataAttributes.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsDataAttributes.ts new file mode 100644 index 000000000000..5b87ee0bfd19 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsDataAttributes.ts @@ -0,0 +1,60 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsDataAttributes` object. + */ +export class AzureScanOptionsDataAttributes { + /** + * The `attributes` `vuln_containers_os`. + */ + "vulnContainersOs"?: boolean; + /** + * The `attributes` `vuln_host_os`. + */ + "vulnHostOs"?: boolean; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + vulnContainersOs: { + baseName: "vuln_containers_os", + type: "boolean", + }, + vulnHostOs: { + baseName: "vuln_host_os", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsDataType.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsDataType.ts new file mode 100644 index 000000000000..9c03c491e54f --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsDataType.ts @@ -0,0 +1,16 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the resource. The value should always be `azure_scan_options`. + */ + +export type AzureScanOptionsDataType = + | typeof AZURE_SCAN_OPTIONS + | UnparsedObject; +export const AZURE_SCAN_OPTIONS = "azure_scan_options"; diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdate.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdate.ts new file mode 100644 index 000000000000..a6ee96090441 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdate.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AzureScanOptionsInputUpdateData } from "./AzureScanOptionsInputUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsInputUpdate` object. + */ +export class AzureScanOptionsInputUpdate { + /** + * The definition of `AzureScanOptionsInputUpdateData` object. + */ + "data"?: AzureScanOptionsInputUpdateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "AzureScanOptionsInputUpdateData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsInputUpdate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateData.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateData.ts new file mode 100644 index 000000000000..6df3d1402520 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateData.ts @@ -0,0 +1,72 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AzureScanOptionsInputUpdateDataAttributes } from "./AzureScanOptionsInputUpdateDataAttributes"; +import { AzureScanOptionsInputUpdateDataType } from "./AzureScanOptionsInputUpdateDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsInputUpdateData` object. + */ +export class AzureScanOptionsInputUpdateData { + /** + * The definition of `AzureScanOptionsInputUpdateDataAttributes` object. + */ + "attributes"?: AzureScanOptionsInputUpdateDataAttributes; + /** + * The `AzureScanOptionsInputUpdateData` `id`. + */ + "id": string; + /** + * Azure scan options resource type. + */ + "type": AzureScanOptionsInputUpdateDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "AzureScanOptionsInputUpdateDataAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "AzureScanOptionsInputUpdateDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsInputUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataAttributes.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataAttributes.ts new file mode 100644 index 000000000000..93ea05e7e067 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataAttributes.ts @@ -0,0 +1,60 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `AzureScanOptionsInputUpdateDataAttributes` object. + */ +export class AzureScanOptionsInputUpdateDataAttributes { + /** + * The `attributes` `vuln_containers_os`. + */ + "vulnContainersOs"?: boolean; + /** + * The `attributes` `vuln_host_os`. + */ + "vulnHostOs"?: boolean; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + vulnContainersOs: { + baseName: "vuln_containers_os", + type: "boolean", + }, + vulnHostOs: { + baseName: "vuln_host_os", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AzureScanOptionsInputUpdateDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataType.ts b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataType.ts new file mode 100644 index 000000000000..e3459f6120ec --- /dev/null +++ b/packages/datadog-api-client-v2/models/AzureScanOptionsInputUpdateDataType.ts @@ -0,0 +1,16 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Azure scan options resource type. + */ + +export type AzureScanOptionsInputUpdateDataType = + | typeof AZURE_SCAN_OPTIONS + | UnparsedObject; +export const AZURE_SCAN_OPTIONS = "azure_scan_options"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 1ae4682f71a3..4cdedde02d70 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -215,6 +215,13 @@ import { AwsScanOptionsUpdateData } from "./AwsScanOptionsUpdateData"; import { AwsScanOptionsUpdateRequest } from "./AwsScanOptionsUpdateRequest"; import { AzureIntegration } from "./AzureIntegration"; import { AzureIntegrationUpdate } from "./AzureIntegrationUpdate"; +import { AzureScanOptions } from "./AzureScanOptions"; +import { AzureScanOptionsArray } from "./AzureScanOptionsArray"; +import { AzureScanOptionsData } from "./AzureScanOptionsData"; +import { AzureScanOptionsDataAttributes } from "./AzureScanOptionsDataAttributes"; +import { AzureScanOptionsInputUpdate } from "./AzureScanOptionsInputUpdate"; +import { AzureScanOptionsInputUpdateData } from "./AzureScanOptionsInputUpdateData"; +import { AzureScanOptionsInputUpdateDataAttributes } from "./AzureScanOptionsInputUpdateDataAttributes"; import { AzureStorageDestination } from "./AzureStorageDestination"; import { AzureTenant } from "./AzureTenant"; import { AzureTenantUpdate } from "./AzureTenantUpdate"; @@ -2542,6 +2549,8 @@ const enumsMap: { [key: string]: any[] } = { AwsOnDemandType: ["aws_resource"], AwsScanOptionsType: ["aws_scan_options"], AzureIntegrationType: ["Azure"], + AzureScanOptionsDataType: ["azure_scan_options"], + AzureScanOptionsInputUpdateDataType: ["azure_scan_options"], AzureStorageDestinationType: ["azure_storage"], AzureTenantType: ["AzureTenant"], AzureUCConfigPairType: ["azure_uc_configs"], @@ -4162,6 +4171,14 @@ const typeMap: { [index: string]: any } = { AwsScanOptionsUpdateRequest: AwsScanOptionsUpdateRequest, AzureIntegration: AzureIntegration, AzureIntegrationUpdate: AzureIntegrationUpdate, + AzureScanOptions: AzureScanOptions, + AzureScanOptionsArray: AzureScanOptionsArray, + AzureScanOptionsData: AzureScanOptionsData, + AzureScanOptionsDataAttributes: AzureScanOptionsDataAttributes, + AzureScanOptionsInputUpdate: AzureScanOptionsInputUpdate, + AzureScanOptionsInputUpdateData: AzureScanOptionsInputUpdateData, + AzureScanOptionsInputUpdateDataAttributes: + AzureScanOptionsInputUpdateDataAttributes, AzureStorageDestination: AzureStorageDestination, AzureTenant: AzureTenant, AzureTenantUpdate: AzureTenantUpdate,