From d6b6b5ac536c83fe4a5047004600410080d3918c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 1 Oct 2025 14:18:06 +0000 Subject: [PATCH] Regenerate client from commit ba47c96 of spec repo --- .generator/schemas/v2/openapi.yaml | 255 ++++++++++++++++ ...an-options-returns-Created-response.frozen | 1 + ...-scan-options-returns-Created-response.yml | 42 +++ ...re-scan-options-returns-OK-response.frozen | 1 + ...azure-scan-options-returns-OK-response.yml | 20 ++ .../CreateAzureScanOptions.rb | 16 + .../DeleteAzureScanOptions.rb | 5 + .../ListAzureScanOptions.rb | 5 + .../UpdateAzureScanOptions.rb | 12 + features/scenarios_model_mapping.rb | 10 + features/v2/agentless_scanning.feature | 28 ++ features/v2/undo.json | 31 ++ lib/datadog_api_client/inflector.rb | 9 + .../v2/api/agentless_scanning_api.rb | 280 +++++++++++++++++- .../v2/models/azure_scan_options.rb | 105 +++++++ .../v2/models/azure_scan_options_array.rb | 125 ++++++++ .../v2/models/azure_scan_options_data.rb | 154 ++++++++++ .../azure_scan_options_data_attributes.rb | 115 +++++++ .../v2/models/azure_scan_options_data_type.rb | 26 ++ .../models/azure_scan_options_input_update.rb | 105 +++++++ .../azure_scan_options_input_update_data.rb | 154 ++++++++++ ...an_options_input_update_data_attributes.rb | 115 +++++++ ...ure_scan_options_input_update_data_type.rb | 26 ++ 23 files changed, 1632 insertions(+), 8 deletions(-) create mode 100644 cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.frozen create mode 100644 cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.yml create mode 100644 cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.frozen create mode 100644 cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.yml create mode 100644 examples/v2/agentless-scanning/CreateAzureScanOptions.rb create mode 100644 examples/v2/agentless-scanning/DeleteAzureScanOptions.rb create mode 100644 examples/v2/agentless-scanning/ListAzureScanOptions.rb create mode 100644 examples/v2/agentless-scanning/UpdateAzureScanOptions.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_array.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_data.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_input_update.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_input_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_type.rb 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/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.frozen b/cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.frozen new file mode 100644 index 000000000000..1f060e7c19fa --- /dev/null +++ b/cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-09-30T18:30:00.006Z \ No newline at end of file diff --git a/cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.yml b/cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.yml new file mode 100644 index 000000000000..08edd910b01d --- /dev/null +++ b/cassettes/features/v2/agentless_scanning/Create-azure-scan-options-returns-Created-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Tue, 30 Sep 2025 18:30:00 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"vuln_containers_os":true,"vuln_host_os":true},"id":"12345678-90ab-cdef-1234-567890abcdef","type":"azure_scan_options"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Tue, 30 Sep 2025 18:30:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure/12345678-90ab-cdef-1234-567890abcdef + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.frozen b/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.frozen new file mode 100644 index 000000000000..9a91175487c6 --- /dev/null +++ b/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-09-30T18:30:00.763Z \ No newline at end of file diff --git a/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.yml b/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.yml new file mode 100644 index 000000000000..8496ad3a4f65 --- /dev/null +++ b/cassettes/features/v2/agentless_scanning/List-azure-scan-options-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 30 Sep 2025 18:30:00 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/agentless_scanning/accounts/azure + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/agentless-scanning/CreateAzureScanOptions.rb b/examples/v2/agentless-scanning/CreateAzureScanOptions.rb new file mode 100644 index 000000000000..a81b5bbf82ef --- /dev/null +++ b/examples/v2/agentless-scanning/CreateAzureScanOptions.rb @@ -0,0 +1,16 @@ +# Create azure scan options returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new + +body = DatadogAPIClient::V2::AzureScanOptions.new({ + data: DatadogAPIClient::V2::AzureScanOptionsData.new({ + attributes: DatadogAPIClient::V2::AzureScanOptionsDataAttributes.new({ + vuln_containers_os: true, + vuln_host_os: true, + }), + id: "12345678-90ab-cdef-1234-567890abcdef", + type: DatadogAPIClient::V2::AzureScanOptionsDataType::AZURE_SCAN_OPTIONS, + }), +}) +p api_instance.create_azure_scan_options(body) diff --git a/examples/v2/agentless-scanning/DeleteAzureScanOptions.rb b/examples/v2/agentless-scanning/DeleteAzureScanOptions.rb new file mode 100644 index 000000000000..30e9f065cdab --- /dev/null +++ b/examples/v2/agentless-scanning/DeleteAzureScanOptions.rb @@ -0,0 +1,5 @@ +# Delete azure scan options returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new +api_instance.delete_azure_scan_options("12345678-90ab-cdef-1234-567890abcdef") diff --git a/examples/v2/agentless-scanning/ListAzureScanOptions.rb b/examples/v2/agentless-scanning/ListAzureScanOptions.rb new file mode 100644 index 000000000000..94d47df14dea --- /dev/null +++ b/examples/v2/agentless-scanning/ListAzureScanOptions.rb @@ -0,0 +1,5 @@ +# List azure scan options returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new +p api_instance.list_azure_scan_options() diff --git a/examples/v2/agentless-scanning/UpdateAzureScanOptions.rb b/examples/v2/agentless-scanning/UpdateAzureScanOptions.rb new file mode 100644 index 000000000000..f7734dfefd7a --- /dev/null +++ b/examples/v2/agentless-scanning/UpdateAzureScanOptions.rb @@ -0,0 +1,12 @@ +# Update azure scan options returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AgentlessScanningAPI.new + +body = DatadogAPIClient::V2::AzureScanOptionsInputUpdate.new({ + data: DatadogAPIClient::V2::AzureScanOptionsInputUpdateData.new({ + id: "12345678-90ab-cdef-1234-567890abcdef", + type: DatadogAPIClient::V2::AzureScanOptionsInputUpdateDataType::AZURE_SCAN_OPTIONS, + }), +}) +p api_instance.update_azure_scan_options("12345678-90ab-cdef-1234-567890abcdef", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 8f39e632b351..bb9b639b4075 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -910,6 +910,16 @@ "account_id" => "String", "body" => "AwsScanOptionsUpdateRequest", }, + "v2.CreateAzureScanOptions" => { + "body" => "AzureScanOptions", + }, + "v2.DeleteAzureScanOptions" => { + "subscription_id" => "String", + }, + "v2.UpdateAzureScanOptions" => { + "subscription_id" => "String", + "body" => "AzureScanOptionsInputUpdate", + }, "v2.CreateAwsOnDemandTask" => { "body" => "AwsOnDemandCreateRequest", }, 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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 717bcfd0cacf..9abbf586d9ee 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1245,6 +1245,15 @@ def overrides "v2.azure_integration" => "AzureIntegration", "v2.azure_integration_type" => "AzureIntegrationType", "v2.azure_integration_update" => "AzureIntegrationUpdate", + "v2.azure_scan_options" => "AzureScanOptions", + "v2.azure_scan_options_array" => "AzureScanOptionsArray", + "v2.azure_scan_options_data" => "AzureScanOptionsData", + "v2.azure_scan_options_data_attributes" => "AzureScanOptionsDataAttributes", + "v2.azure_scan_options_data_type" => "AzureScanOptionsDataType", + "v2.azure_scan_options_input_update" => "AzureScanOptionsInputUpdate", + "v2.azure_scan_options_input_update_data" => "AzureScanOptionsInputUpdateData", + "v2.azure_scan_options_input_update_data_attributes" => "AzureScanOptionsInputUpdateDataAttributes", + "v2.azure_scan_options_input_update_data_type" => "AzureScanOptionsInputUpdateDataType", "v2.azure_storage_destination" => "AzureStorageDestination", "v2.azure_storage_destination_type" => "AzureStorageDestinationType", "v2.azure_tenant" => "AzureTenant", diff --git a/lib/datadog_api_client/v2/api/agentless_scanning_api.rb b/lib/datadog_api_client/v2/api/agentless_scanning_api.rb index 225d07a6dff2..e05b643ade01 100644 --- a/lib/datadog_api_client/v2/api/agentless_scanning_api.rb +++ b/lib/datadog_api_client/v2/api/agentless_scanning_api.rb @@ -70,7 +70,7 @@ def create_aws_on_demand_task_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'AwsOnDemandResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_aws_on_demand_task, @@ -137,7 +137,7 @@ def create_aws_scan_options_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'AwsScanOptionsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_aws_scan_options, @@ -157,6 +157,73 @@ def create_aws_scan_options_with_http_info(body, opts = {}) return data, status_code, headers end + # Create azure scan options. + # + # @see #create_azure_scan_options_with_http_info + def create_azure_scan_options(body, opts = {}) + data, _status_code, _headers = create_azure_scan_options_with_http_info(body, opts) + data + end + + # Create azure scan options. + # + # Activate Agentless scan options for an Azure subscription. + # + # @param body [AzureScanOptions] + # @param opts [Hash] the optional parameters + # @return [Array<(AzureScanOptions, Integer, Hash)>] AzureScanOptions data, response status code and response headers + def create_azure_scan_options_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.create_azure_scan_options ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AgentlessScanningAPI.create_azure_scan_options" + end + # resource path + local_var_path = '/api/v2/agentless_scanning/accounts/azure' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AzureScanOptions' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_azure_scan_options, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AgentlessScanningAPI#create_azure_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete AWS Scan Options. # # @see #delete_aws_scan_options_with_http_info @@ -202,7 +269,7 @@ def delete_aws_scan_options_with_http_info(account_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_aws_scan_options, @@ -222,6 +289,71 @@ def delete_aws_scan_options_with_http_info(account_id, opts = {}) return data, status_code, headers end + # Delete azure scan options. + # + # @see #delete_azure_scan_options_with_http_info + def delete_azure_scan_options(subscription_id, opts = {}) + delete_azure_scan_options_with_http_info(subscription_id, opts) + nil + end + + # Delete azure scan options. + # + # Delete Agentless scan options for an Azure subscription. + # + # @param subscription_id [String] The Azure subscription ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_azure_scan_options_with_http_info(subscription_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.delete_azure_scan_options ...' + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AgentlessScanningAPI.delete_azure_scan_options" + end + # resource path + local_var_path = '/api/v2/agentless_scanning/accounts/azure/{subscription_id}'.sub('{subscription_id}', CGI.escape(subscription_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_azure_scan_options, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AgentlessScanningAPI#delete_azure_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get AWS On Demand task by id. # # @see #get_aws_on_demand_task_with_http_info @@ -267,7 +399,7 @@ def get_aws_on_demand_task_with_http_info(task_id, opts = {}) return_type = opts[:debug_return_type] || 'AwsOnDemandResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_aws_on_demand_task, @@ -332,7 +464,7 @@ def get_aws_scan_options_with_http_info(account_id, opts = {}) return_type = opts[:debug_return_type] || 'AwsScanOptionsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_aws_scan_options, @@ -392,7 +524,7 @@ def list_aws_on_demand_tasks_with_http_info(opts = {}) return_type = opts[:debug_return_type] || 'AwsOnDemandListResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_aws_on_demand_tasks, @@ -452,7 +584,7 @@ def list_aws_scan_options_with_http_info(opts = {}) return_type = opts[:debug_return_type] || 'AwsScanOptionsListResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_aws_scan_options, @@ -472,6 +604,66 @@ def list_aws_scan_options_with_http_info(opts = {}) return data, status_code, headers end + # List azure scan options. + # + # @see #list_azure_scan_options_with_http_info + def list_azure_scan_options(opts = {}) + data, _status_code, _headers = list_azure_scan_options_with_http_info(opts) + data + end + + # List azure scan options. + # + # Fetches the scan options configured for Azure accounts. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AzureScanOptionsArray, Integer, Hash)>] AzureScanOptionsArray data, response status code and response headers + def list_azure_scan_options_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.list_azure_scan_options ...' + end + # resource path + local_var_path = '/api/v2/agentless_scanning/accounts/azure' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AzureScanOptionsArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_azure_scan_options, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AgentlessScanningAPI#list_azure_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Patch AWS Scan Options. # # @see #update_aws_scan_options_with_http_info @@ -524,7 +716,7 @@ def update_aws_scan_options_with_http_info(account_id, body, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_aws_scan_options, @@ -543,5 +735,77 @@ def update_aws_scan_options_with_http_info(account_id, body, opts = {}) end return data, status_code, headers end + + # Update azure scan options. + # + # @see #update_azure_scan_options_with_http_info + def update_azure_scan_options(subscription_id, body, opts = {}) + data, _status_code, _headers = update_azure_scan_options_with_http_info(subscription_id, body, opts) + data + end + + # Update azure scan options. + # + # Update the Agentless scan options for an activated subscription. + # + # @param subscription_id [String] The Azure subscription ID. + # @param body [AzureScanOptionsInputUpdate] + # @param opts [Hash] the optional parameters + # @return [Array<(AzureScanOptions, Integer, Hash)>] AzureScanOptions data, response status code and response headers + def update_azure_scan_options_with_http_info(subscription_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AgentlessScanningAPI.update_azure_scan_options ...' + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AgentlessScanningAPI.update_azure_scan_options" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AgentlessScanningAPI.update_azure_scan_options" + end + # resource path + local_var_path = '/api/v2/agentless_scanning/accounts/azure/{subscription_id}'.sub('{subscription_id}', CGI.escape(subscription_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AzureScanOptions' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_azure_scan_options, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AgentlessScanningAPI#update_azure_scan_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options.rb b/lib/datadog_api_client/v2/models/azure_scan_options.rb new file mode 100644 index 000000000000..7a043b3c1cb0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptions` object. + class AzureScanOptions + include BaseGenericModel + + # The definition of `AzureScanOptionsData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AzureScanOptionsData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_array.rb b/lib/datadog_api_client/v2/models/azure_scan_options_array.rb new file mode 100644 index 000000000000..081b64106959 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsArray` object. + class AzureScanOptionsArray + include BaseGenericModel + + # The `AzureScanOptionsArray` `data`. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_data.rb b/lib/datadog_api_client/v2/models/azure_scan_options_data.rb new file mode 100644 index 000000000000..69187bc4349d --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsData` object. + class AzureScanOptionsData + include BaseGenericModel + + # The definition of `AzureScanOptionsDataAttributes` object. + attr_accessor :attributes + + # The `AzureScanOptionsData` `id`. + attr_reader :id + + # The type of the resource. The value should always be `azure_scan_options`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AzureScanOptionsDataAttributes', + :'id' => :'String', + :'type' => :'AzureScanOptionsDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_data_attributes.rb b/lib/datadog_api_client/v2/models/azure_scan_options_data_attributes.rb new file mode 100644 index 000000000000..43db575fb321 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_data_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsDataAttributes` object. + class AzureScanOptionsDataAttributes + include BaseGenericModel + + # The `attributes` `vuln_containers_os`. + attr_accessor :vuln_containers_os + + # The `attributes` `vuln_host_os`. + attr_accessor :vuln_host_os + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'vuln_containers_os' => :'vuln_containers_os', + :'vuln_host_os' => :'vuln_host_os' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'vuln_containers_os' => :'Boolean', + :'vuln_host_os' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'vuln_containers_os') + self.vuln_containers_os = attributes[:'vuln_containers_os'] + end + + if attributes.key?(:'vuln_host_os') + self.vuln_host_os = attributes[:'vuln_host_os'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + vuln_containers_os == o.vuln_containers_os && + vuln_host_os == o.vuln_host_os && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [vuln_containers_os, vuln_host_os, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_data_type.rb b/lib/datadog_api_client/v2/models/azure_scan_options_data_type.rb new file mode 100644 index 000000000000..3d0cbe54a67b --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be `azure_scan_options`. + class AzureScanOptionsDataType + include BaseEnumModel + + AZURE_SCAN_OPTIONS = "azure_scan_options".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_input_update.rb b/lib/datadog_api_client/v2/models/azure_scan_options_input_update.rb new file mode 100644 index 000000000000..39efe5dd7591 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_input_update.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsInputUpdate` object. + class AzureScanOptionsInputUpdate + include BaseGenericModel + + # The definition of `AzureScanOptionsInputUpdateData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AzureScanOptionsInputUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsInputUpdate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data.rb b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data.rb new file mode 100644 index 000000000000..3111e03ca694 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsInputUpdateData` object. + class AzureScanOptionsInputUpdateData + include BaseGenericModel + + # The definition of `AzureScanOptionsInputUpdateDataAttributes` object. + attr_accessor :attributes + + # The `AzureScanOptionsInputUpdateData` `id`. + attr_reader :id + + # Azure scan options resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AzureScanOptionsInputUpdateDataAttributes', + :'id' => :'String', + :'type' => :'AzureScanOptionsInputUpdateDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsInputUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_attributes.rb b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_attributes.rb new file mode 100644 index 000000000000..bd5aaba0ebcd --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `AzureScanOptionsInputUpdateDataAttributes` object. + class AzureScanOptionsInputUpdateDataAttributes + include BaseGenericModel + + # The `attributes` `vuln_containers_os`. + attr_accessor :vuln_containers_os + + # The `attributes` `vuln_host_os`. + attr_accessor :vuln_host_os + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'vuln_containers_os' => :'vuln_containers_os', + :'vuln_host_os' => :'vuln_host_os' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'vuln_containers_os' => :'Boolean', + :'vuln_host_os' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AzureScanOptionsInputUpdateDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'vuln_containers_os') + self.vuln_containers_os = attributes[:'vuln_containers_os'] + end + + if attributes.key?(:'vuln_host_os') + self.vuln_host_os = attributes[:'vuln_host_os'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + vuln_containers_os == o.vuln_containers_os && + vuln_host_os == o.vuln_host_os && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [vuln_containers_os, vuln_host_os, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_type.rb b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_type.rb new file mode 100644 index 000000000000..9e5d7dfd19b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/azure_scan_options_input_update_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Azure scan options resource type. + class AzureScanOptionsInputUpdateDataType + include BaseEnumModel + + AZURE_SCAN_OPTIONS = "azure_scan_options".freeze + end +end