From 156ce76fa7e6d6d9376633b6dadfd705d56d1b34 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Oct 2025 20:33:21 +0000 Subject: [PATCH] Regenerate client from commit 389040e of spec repo --- .generator/schemas/v2/openapi.yaml | 406 ++++++++++++++++++ .../v1/logs-pipelines/CreateLogsPipeline.rb | 4 +- .../v1/logs-pipelines/UpdateLogsPipeline.rb | 4 +- .../CreateSCAResolveVulnerableSymbols.rb | 17 + .../v2/static-analysis/CreateSCAResult.rb | 61 +++ features/scenarios_model_mapping.rb | 6 + features/v1/logs_pipelines.feature | 8 +- features/v2/static_analysis.feature | 24 ++ features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 27 ++ .../v2/api/static_analysis_api.rb | 172 ++++++++ .../resolve_vulnerable_symbols_request.rb | 105 +++++ ...resolve_vulnerable_symbols_request_data.rb | 143 ++++++ ...nerable_symbols_request_data_attributes.rb | 107 +++++ ...ve_vulnerable_symbols_request_data_type.rb | 26 ++ .../resolve_vulnerable_symbols_response.rb | 105 +++++ ...esolve_vulnerable_symbols_response_data.rb | 143 ++++++ ...erable_symbols_response_data_attributes.rb | 107 +++++ ...e_vulnerable_symbols_response_data_type.rb | 26 ++ ...lve_vulnerable_symbols_response_results.rb | 117 +++++ ...ols_response_results_vulnerable_symbols.rb | 117 +++++ ...onse_results_vulnerable_symbols_symbols.rb | 125 ++++++ .../v2/models/sca_request.rb | 105 +++++ .../v2/models/sca_request_data.rb | 143 ++++++ .../v2/models/sca_request_data_attributes.rb | 193 +++++++++ .../sca_request_data_attributes_commit.rb | 165 +++++++ ...uest_data_attributes_dependencies_items.rb | 211 +++++++++ ...utes_dependencies_items_locations_items.rb | 135 ++++++ ...ies_items_locations_items_file_position.rb | 125 ++++++ ...ndencies_items_locations_items_position.rb | 144 +++++++ ...items_reachable_symbol_properties_items.rb | 115 +++++ ...sca_request_data_attributes_files_items.rb | 115 +++++ ...request_data_attributes_relations_items.rb | 117 +++++ .../sca_request_data_attributes_repository.rb | 105 +++++ ...t_data_attributes_vulnerabilities_items.rb | 127 ++++++ ...tes_vulnerabilities_items_affects_items.rb | 105 +++++ .../v2/models/sca_request_data_type.rb | 26 ++ 38 files changed, 3787 insertions(+), 8 deletions(-) create mode 100644 examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb create mode 100644 examples/v2/static-analysis/CreateSCAResult.rb create mode 100644 features/v2/static_analysis.feature create mode 100644 lib/datadog_api_client/v2/api/static_analysis_api.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols.rb create mode 100644 lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_commit.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_file_position.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_position.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_files_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_relations_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_repository.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items_affects_items.rb create mode 100644 lib/datadog_api_client/v2/models/sca_request_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 17509b56882d..09edf2f7e318 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -37849,6 +37849,121 @@ components: type: string x-enum-varnames: - RULESET + ResolveVulnerableSymbolsRequest: + description: The definition of `ResolveVulnerableSymbolsRequest` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestData' + type: object + ResolveVulnerableSymbolsRequestData: + description: The definition of `ResolveVulnerableSymbolsRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataAttributes' + id: + description: The `ResolveVulnerableSymbolsRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataType' + required: + - type + type: object + ResolveVulnerableSymbolsRequestDataAttributes: + description: The definition of `ResolveVulnerableSymbolsRequestDataAttributes` + object. + properties: + purls: + description: The `attributes` `purls`. + items: + type: string + type: array + type: object + ResolveVulnerableSymbolsRequestDataType: + default: resolve-vulnerable-symbols-request + description: Resolve vulnerable symbols request resource type. + enum: + - resolve-vulnerable-symbols-request + example: resolve-vulnerable-symbols-request + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_REQUEST + ResolveVulnerableSymbolsResponse: + description: The definition of `ResolveVulnerableSymbolsResponse` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseData' + type: object + ResolveVulnerableSymbolsResponseData: + description: The definition of `ResolveVulnerableSymbolsResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataAttributes' + id: + description: The `ResolveVulnerableSymbolsResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataType' + required: + - type + type: object + ResolveVulnerableSymbolsResponseDataAttributes: + description: The definition of `ResolveVulnerableSymbolsResponseDataAttributes` + object. + properties: + results: + description: The `attributes` `results`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResults' + type: array + type: object + ResolveVulnerableSymbolsResponseDataType: + default: resolve-vulnerable-symbols-response + description: Resolve vulnerable symbols response resource type. + enum: + - resolve-vulnerable-symbols-response + example: resolve-vulnerable-symbols-response + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_RESPONSE + ResolveVulnerableSymbolsResponseResults: + description: The definition of `ResolveVulnerableSymbolsResponseResults` object. + properties: + purl: + description: The `items` `purl`. + type: string + vulnerable_symbols: + description: The `items` `vulnerable_symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` + object. + properties: + advisory_id: + description: The `items` `advisory_id`. + type: string + symbols: + description: The `items` `symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` + object. + properties: + name: + description: The `items` `name`. + type: string + type: + description: The `items` `type`. + type: string + value: + description: The `items` `value`. + type: string + type: object ResourceFilterAttributes: description: Attributes of a resource filter. example: @@ -40193,6 +40308,243 @@ components: example: report_id type: string type: object + ScaRequest: + description: The definition of `ScaRequest` object. + properties: + data: + $ref: '#/components/schemas/ScaRequestData' + type: object + ScaRequestData: + description: The definition of `ScaRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ScaRequestDataAttributes' + id: + description: The `ScaRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ScaRequestDataType' + required: + - type + type: object + ScaRequestDataAttributes: + description: The definition of `ScaRequestDataAttributes` object. + properties: + commit: + $ref: '#/components/schemas/ScaRequestDataAttributesCommit' + dependencies: + description: The `attributes` `dependencies`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItems' + type: array + env: + description: The `attributes` `env`. + type: string + files: + description: The `attributes` `files`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesFilesItems' + type: array + relations: + description: The `attributes` `relations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesRelationsItems' + type: array + repository: + $ref: '#/components/schemas/ScaRequestDataAttributesRepository' + service: + description: The `attributes` `service`. + type: string + tags: + additionalProperties: + type: string + description: The `attributes` `tags`. + type: object + vulnerabilities: + description: The `attributes` `vulnerabilities`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItems' + type: array + type: object + ScaRequestDataAttributesCommit: + description: The definition of `ScaRequestDataAttributesCommit` object. + properties: + author_date: + description: The `commit` `author_date`. + type: string + author_email: + description: The `commit` `author_email`. + type: string + author_name: + description: The `commit` `author_name`. + type: string + branch: + description: The `commit` `branch`. + type: string + committer_email: + description: The `commit` `committer_email`. + type: string + committer_name: + description: The `commit` `committer_name`. + type: string + sha: + description: The `commit` `sha`. + type: string + type: object + ScaRequestDataAttributesDependenciesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItems` object. + properties: + exclusions: + description: The `items` `exclusions`. + items: + type: string + type: array + group: + description: The `items` `group`. + type: string + is_dev: + description: The `items` `is_dev`. + type: boolean + is_direct: + description: The `items` `is_direct`. + type: boolean + language: + description: The `items` `language`. + type: string + locations: + description: The `items` `locations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems' + type: array + name: + description: The `items` `name`. + type: string + package_manager: + description: The `items` `package_manager`. + type: string + purl: + description: The `items` `purl`. + type: string + reachable_symbol_properties: + description: The `items` `reachable_symbol_properties`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems' + type: array + version: + description: The `items` `version`. + type: string + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsLocationsItems` + object. + properties: + block: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + name: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + namespace: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + version: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: + description: A position in a file + properties: + end: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + file_name: + description: The `file_name`. + type: string + start: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition: + description: A position + properties: + col: + description: The `col`. + format: int32 + maximum: 2147483647 + type: integer + line: + description: The `line`. + format: int32 + maximum: 2147483647 + type: integer + type: object + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` + object. + properties: + name: + description: The `items` `name`. + type: string + value: + description: The `items` `value`. + type: string + type: object + ScaRequestDataAttributesFilesItems: + description: The definition of `ScaRequestDataAttributesFilesItems` object. + properties: + name: + description: The `items` `name`. + type: string + purl: + description: The `items` `purl`. + type: string + type: object + ScaRequestDataAttributesRelationsItems: + description: The definition of `ScaRequestDataAttributesRelationsItems` object. + properties: + depends_on: + description: The `items` `depends_on`. + items: + type: string + type: array + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataAttributesRepository: + description: The definition of `ScaRequestDataAttributesRepository` object. + properties: + url: + description: The `repository` `url`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItems` + object. + properties: + affects: + description: The `items` `affects`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems' + type: array + bom_ref: + description: The `items` `bom_ref`. + type: string + id: + description: The `items` `id`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` + object. + properties: + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataType: + default: scarequests + description: Scarequests resource type. + enum: + - scarequests + example: scarequests + type: string + x-enum-varnames: + - SCAREQUESTS ScalarColumn: description: A single column in a scalar query response. oneOf: @@ -73460,6 +73812,58 @@ paths: cursorPath: meta.page.after limitParam: body.data.attributes.page.limit resultsPath: data + /api/v2/static-analysis-sca/dependencies: + post: + description: Post dependencies for analysis + operationId: CreateSCAResult + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScaRequest' + required: true + responses: + '200': + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Post dependencies for analysis + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols: + post: + description: Post vulnerable symbols + operationId: CreateSCAResolveVulnerableSymbols + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: POST request to resolve vulnerable symbols + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. @@ -76975,6 +77379,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/metrics/metrics_namespace/ name: Spans Metrics +- description: API for static analysis + name: Static Analysis - description: "Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime,\nidentify regional issues, and track your application performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand diff --git a/examples/v1/logs-pipelines/CreateLogsPipeline.rb b/examples/v1/logs-pipelines/CreateLogsPipeline.rb index d6646a9fc3f9..78104004e3d2 100644 --- a/examples/v1/logs-pipelines/CreateLogsPipeline.rb +++ b/examples/v1/logs-pipelines/CreateLogsPipeline.rb @@ -11,8 +11,8 @@ processors: [ DatadogAPIClient::V1::LogsGrokParser.new({ grok: DatadogAPIClient::V1::LogsGrokParserRules.new({ - match_rules: 'rule_name_1 foo\nrule_name_2 bar\n', - support_rules: 'rule_name_1 foo\nrule_name_2 bar\n', + match_rules: 'rule_name_1 foo\nrule_name_2 bar', + support_rules: 'rule_name_1 foo\nrule_name_2 bar', }), is_enabled: false, samples: [], diff --git a/examples/v1/logs-pipelines/UpdateLogsPipeline.rb b/examples/v1/logs-pipelines/UpdateLogsPipeline.rb index 74765e7967e5..48a5147133f4 100644 --- a/examples/v1/logs-pipelines/UpdateLogsPipeline.rb +++ b/examples/v1/logs-pipelines/UpdateLogsPipeline.rb @@ -11,8 +11,8 @@ processors: [ DatadogAPIClient::V1::LogsGrokParser.new({ grok: DatadogAPIClient::V1::LogsGrokParserRules.new({ - match_rules: 'rule_name_1 foo\nrule_name_2 bar\n', - support_rules: 'rule_name_1 foo\nrule_name_2 bar\n', + match_rules: 'rule_name_1 foo\nrule_name_2 bar', + support_rules: 'rule_name_1 foo\nrule_name_2 bar', }), is_enabled: false, samples: [], diff --git a/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb b/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb new file mode 100644 index 000000000000..bc04a0a85010 --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb @@ -0,0 +1,17 @@ +# POST request to resolve vulnerable symbols returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_sca_resolve_vulnerable_symbols".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::ResolveVulnerableSymbolsRequest.new({ + data: DatadogAPIClient::V2::ResolveVulnerableSymbolsRequestData.new({ + attributes: DatadogAPIClient::V2::ResolveVulnerableSymbolsRequestDataAttributes.new({ + purls: [], + }), + type: DatadogAPIClient::V2::ResolveVulnerableSymbolsRequestDataType::RESOLVE_VULNERABLE_SYMBOLS_REQUEST, + }), +}) +p api_instance.create_sca_resolve_vulnerable_symbols(body) diff --git a/examples/v2/static-analysis/CreateSCAResult.rb b/examples/v2/static-analysis/CreateSCAResult.rb new file mode 100644 index 000000000000..1b767022c75d --- /dev/null +++ b/examples/v2/static-analysis/CreateSCAResult.rb @@ -0,0 +1,61 @@ +# Post dependencies for analysis returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_sca_result".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::ScaRequest.new({ + data: DatadogAPIClient::V2::ScaRequestData.new({ + attributes: DatadogAPIClient::V2::ScaRequestDataAttributes.new({ + commit: DatadogAPIClient::V2::ScaRequestDataAttributesCommit.new({}), + dependencies: [ + DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItems.new({ + exclusions: [], + locations: [ + DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItems.new({ + block: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.new({ + _end: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + start: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + }), + name: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.new({ + _end: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + start: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + }), + namespace: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.new({ + _end: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + start: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + }), + version: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.new({ + _end: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + start: DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.new({}), + }), + }), + ], + reachable_symbol_properties: [ + DatadogAPIClient::V2::ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems.new({}), + ], + }), + ], + files: [ + DatadogAPIClient::V2::ScaRequestDataAttributesFilesItems.new({}), + ], + relations: [ + DatadogAPIClient::V2::ScaRequestDataAttributesRelationsItems.new({ + depends_on: [], + }), + ], + repository: DatadogAPIClient::V2::ScaRequestDataAttributesRepository.new({}), + vulnerabilities: [ + DatadogAPIClient::V2::ScaRequestDataAttributesVulnerabilitiesItems.new({ + affects: [ + DatadogAPIClient::V2::ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems.new({}), + ], + }), + ], + }), + type: DatadogAPIClient::V2::ScaRequestDataType::SCAREQUESTS, + }), +}) +p api_instance.create_sca_result(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 5cbf5c8ea60e..b2dfb4e95e3c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2877,6 +2877,12 @@ "v2.ListSpans" => { "body" => "SpansListRequest", }, + "v2.CreateSCAResult" => { + "body" => "ScaRequest", + }, + "v2.CreateSCAResolveVulnerableSymbols" => { + "body" => "ResolveVulnerableSymbolsRequest", + }, "v2.SetOnDemandConcurrencyCap" => { "body" => "OnDemandConcurrencyCapAttributes", }, diff --git a/features/v1/logs_pipelines.feature b/features/v1/logs_pipelines.feature index 66305bbbaf2c..cdb150dd6edf 100644 --- a/features/v1/logs_pipelines.feature +++ b/features/v1/logs_pipelines.feature @@ -24,14 +24,14 @@ Feature: Logs Pipelines @generated @skip @team:DataDog/event-platform-experience Scenario: Create a pipeline returns "Bad Request" response Given new "CreateLogsPipeline" request - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/event-platform-experience Scenario: Create a pipeline returns "OK" response Given new "CreateLogsPipeline" request - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 200 OK @@ -128,7 +128,7 @@ Feature: Logs Pipelines Scenario: Update a pipeline returns "Bad Request" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 400 Bad Request @@ -136,7 +136,7 @@ Feature: Logs Pipelines Scenario: Update a pipeline returns "OK" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 200 OK diff --git a/features/v2/static_analysis.feature b/features/v2/static_analysis.feature new file mode 100644 index 000000000000..85bf4d83ae13 --- /dev/null +++ b/features/v2/static_analysis.feature @@ -0,0 +1,24 @@ +@endpoint(static-analysis) @endpoint(static-analysis-v2) +Feature: Static Analysis + API for static analysis + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "StaticAnalysis" API + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: POST request to resolve vulnerable symbols returns "OK" response + Given operation "CreateSCAResolveVulnerableSymbols" enabled + And new "CreateSCAResolveVulnerableSymbols" request + And body with value {"data": {"attributes": {"purls": []}, "type": "resolve-vulnerable-symbols-request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Post dependencies for analysis returns "OK" response + Given operation "CreateSCAResult" enabled + And new "CreateSCAResult" request + And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}]}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}} + 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 c4c269d3cab9..ad6dcc7086aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3780,6 +3780,18 @@ "type": "safe" } }, + "CreateSCAResult": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateSCAResolveVulnerableSymbols": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index f6cb0bb0f1ad..3c69b3f08e5d 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -286,6 +286,8 @@ def initialize "v2.get_slo_report": false, "v2.get_slo_report_job_status": false, "v2.get_spa_recommendations": false, + "v2.create_sca_resolve_vulnerable_symbols": false, + "v2.create_sca_result": false, "v2.add_member_team": false, "v2.list_member_teams": false, "v2.remove_member_team": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 31aa072fd693..329c98f5d668 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3263,6 +3263,17 @@ def overrides "v2.reorder_ruleset_resource_array" => "ReorderRulesetResourceArray", "v2.reorder_ruleset_resource_data" => "ReorderRulesetResourceData", "v2.reorder_ruleset_resource_data_type" => "ReorderRulesetResourceDataType", + "v2.resolve_vulnerable_symbols_request" => "ResolveVulnerableSymbolsRequest", + "v2.resolve_vulnerable_symbols_request_data" => "ResolveVulnerableSymbolsRequestData", + "v2.resolve_vulnerable_symbols_request_data_attributes" => "ResolveVulnerableSymbolsRequestDataAttributes", + "v2.resolve_vulnerable_symbols_request_data_type" => "ResolveVulnerableSymbolsRequestDataType", + "v2.resolve_vulnerable_symbols_response" => "ResolveVulnerableSymbolsResponse", + "v2.resolve_vulnerable_symbols_response_data" => "ResolveVulnerableSymbolsResponseData", + "v2.resolve_vulnerable_symbols_response_data_attributes" => "ResolveVulnerableSymbolsResponseDataAttributes", + "v2.resolve_vulnerable_symbols_response_data_type" => "ResolveVulnerableSymbolsResponseDataType", + "v2.resolve_vulnerable_symbols_response_results" => "ResolveVulnerableSymbolsResponseResults", + "v2.resolve_vulnerable_symbols_response_results_vulnerable_symbols" => "ResolveVulnerableSymbolsResponseResultsVulnerableSymbols", + "v2.resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols" => "ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols", "v2.resource_filter_attributes" => "ResourceFilterAttributes", "v2.resource_filter_request_type" => "ResourceFilterRequestType", "v2.response_meta_attributes" => "ResponseMetaAttributes", @@ -3478,6 +3489,21 @@ def overrides "v2.scalar_meta" => "ScalarMeta", "v2.scalar_query" => "ScalarQuery", "v2.scalar_response" => "ScalarResponse", + "v2.sca_request" => "ScaRequest", + "v2.sca_request_data" => "ScaRequestData", + "v2.sca_request_data_attributes" => "ScaRequestDataAttributes", + "v2.sca_request_data_attributes_commit" => "ScaRequestDataAttributesCommit", + "v2.sca_request_data_attributes_dependencies_items" => "ScaRequestDataAttributesDependenciesItems", + "v2.sca_request_data_attributes_dependencies_items_locations_items" => "ScaRequestDataAttributesDependenciesItemsLocationsItems", + "v2.sca_request_data_attributes_dependencies_items_locations_items_file_position" => "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + "v2.sca_request_data_attributes_dependencies_items_locations_items_position" => "ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition", + "v2.sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items" => "ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems", + "v2.sca_request_data_attributes_files_items" => "ScaRequestDataAttributesFilesItems", + "v2.sca_request_data_attributes_relations_items" => "ScaRequestDataAttributesRelationsItems", + "v2.sca_request_data_attributes_repository" => "ScaRequestDataAttributesRepository", + "v2.sca_request_data_attributes_vulnerabilities_items" => "ScaRequestDataAttributesVulnerabilitiesItems", + "v2.sca_request_data_attributes_vulnerabilities_items_affects_items" => "ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems", + "v2.sca_request_data_type" => "ScaRequestDataType", "v2.schedule" => "Schedule", "v2.schedule_create_request" => "ScheduleCreateRequest", "v2.schedule_create_request_data" => "ScheduleCreateRequestData", @@ -4246,6 +4272,7 @@ def overrides "v2.spa_api" => "SpaAPI", "v2.spans_api" => "SpansAPI", "v2.spans_metrics_api" => "SpansMetricsAPI", + "v2.static_analysis_api" => "StaticAnalysisAPI", "v2.synthetics_api" => "SyntheticsAPI", "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", diff --git a/lib/datadog_api_client/v2/api/static_analysis_api.rb b/lib/datadog_api_client/v2/api/static_analysis_api.rb new file mode 100644 index 000000000000..f4c20fad3327 --- /dev/null +++ b/lib/datadog_api_client/v2/api/static_analysis_api.rb @@ -0,0 +1,172 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class StaticAnalysisAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # POST request to resolve vulnerable symbols. + # + # @see #create_sca_resolve_vulnerable_symbols_with_http_info + def create_sca_resolve_vulnerable_symbols(body, opts = {}) + data, _status_code, _headers = create_sca_resolve_vulnerable_symbols_with_http_info(body, opts) + data + end + + # POST request to resolve vulnerable symbols. + # + # Post vulnerable symbols + # + # @param body [ResolveVulnerableSymbolsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ResolveVulnerableSymbolsResponse, Integer, Hash)>] ResolveVulnerableSymbolsResponse data, response status code and response headers + def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_resolve_vulnerable_symbols".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_resolve_vulnerable_symbols") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_resolve_vulnerable_symbols")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols ...' + 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 StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols' + + # 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] || 'ResolveVulnerableSymbolsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sca_resolve_vulnerable_symbols, + :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: StaticAnalysisAPI#create_sca_resolve_vulnerable_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Post dependencies for analysis. + # + # @see #create_sca_result_with_http_info + def create_sca_result(body, opts = {}) + create_sca_result_with_http_info(body, opts) + nil + end + + # Post dependencies for analysis. + # + # Post dependencies for analysis + # + # @param body [ScaRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_sca_result_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_result".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_result") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_result")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_result ...' + 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 StaticAnalysisAPI.create_sca_result" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/dependencies' + + # 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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sca_result, + :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: StaticAnalysisAPI#create_sca_result\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/resolve_vulnerable_symbols_request.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request.rb new file mode 100644 index 000000000000..800ccf64514a --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request.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 `ResolveVulnerableSymbolsRequest` object. + class ResolveVulnerableSymbolsRequest + include BaseGenericModel + + # The definition of `ResolveVulnerableSymbolsRequestData` 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' => :'ResolveVulnerableSymbolsRequestData' + } + 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::ResolveVulnerableSymbolsRequest` 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/resolve_vulnerable_symbols_request_data.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data.rb new file mode 100644 index 000000000000..e021e10f5e94 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data.rb @@ -0,0 +1,143 @@ +=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 `ResolveVulnerableSymbolsRequestData` object. + class ResolveVulnerableSymbolsRequestData + include BaseGenericModel + + # The definition of `ResolveVulnerableSymbolsRequestDataAttributes` object. + attr_accessor :attributes + + # The `ResolveVulnerableSymbolsRequestData` `id`. + attr_accessor :id + + # Resolve vulnerable symbols request 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' => :'ResolveVulnerableSymbolsRequestDataAttributes', + :'id' => :'String', + :'type' => :'ResolveVulnerableSymbolsRequestDataType' + } + 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::ResolveVulnerableSymbolsRequestData` 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 @type.nil? + true + 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/resolve_vulnerable_symbols_request_data_attributes.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_attributes.rb new file mode 100644 index 000000000000..c3a24d4b57a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_attributes.rb @@ -0,0 +1,107 @@ +=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 `ResolveVulnerableSymbolsRequestDataAttributes` object. + class ResolveVulnerableSymbolsRequestDataAttributes + include BaseGenericModel + + # The `attributes` `purls`. + attr_accessor :purls + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'purls' => :'purls' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'purls' => :'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::ResolveVulnerableSymbolsRequestDataAttributes` 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?(:'purls') + if (value = attributes[:'purls']).is_a?(Array) + self.purls = value + end + 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 && + purls == o.purls && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [purls, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_type.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_data_type.rb new file mode 100644 index 000000000000..b77529b3a491 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_request_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 + # Resolve vulnerable symbols request resource type. + class ResolveVulnerableSymbolsRequestDataType + include BaseEnumModel + + RESOLVE_VULNERABLE_SYMBOLS_REQUEST = "resolve-vulnerable-symbols-request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response.rb new file mode 100644 index 000000000000..669c6f0a1615 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response.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 `ResolveVulnerableSymbolsResponse` object. + class ResolveVulnerableSymbolsResponse + include BaseGenericModel + + # The definition of `ResolveVulnerableSymbolsResponseData` 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' => :'ResolveVulnerableSymbolsResponseData' + } + 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::ResolveVulnerableSymbolsResponse` 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/resolve_vulnerable_symbols_response_data.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb new file mode 100644 index 000000000000..74360bc94590 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data.rb @@ -0,0 +1,143 @@ +=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 `ResolveVulnerableSymbolsResponseData` object. + class ResolveVulnerableSymbolsResponseData + include BaseGenericModel + + # The definition of `ResolveVulnerableSymbolsResponseDataAttributes` object. + attr_accessor :attributes + + # The `ResolveVulnerableSymbolsResponseData` `id`. + attr_accessor :id + + # Resolve vulnerable symbols response 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' => :'ResolveVulnerableSymbolsResponseDataAttributes', + :'id' => :'String', + :'type' => :'ResolveVulnerableSymbolsResponseDataType' + } + 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::ResolveVulnerableSymbolsResponseData` 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 @type.nil? + true + 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/resolve_vulnerable_symbols_response_data_attributes.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_attributes.rb new file mode 100644 index 000000000000..5cd409d3e44b --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_attributes.rb @@ -0,0 +1,107 @@ +=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 `ResolveVulnerableSymbolsResponseDataAttributes` object. + class ResolveVulnerableSymbolsResponseDataAttributes + include BaseGenericModel + + # The `attributes` `results`. + attr_accessor :results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'results' => :'results' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'results' => :'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::ResolveVulnerableSymbolsResponseDataAttributes` 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?(:'results') + if (value = attributes[:'results']).is_a?(Array) + self.results = value + end + 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 && + results == o.results && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [results, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_data_type.rb new file mode 100644 index 000000000000..5d654cddc6a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_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 + # Resolve vulnerable symbols response resource type. + class ResolveVulnerableSymbolsResponseDataType + include BaseEnumModel + + RESOLVE_VULNERABLE_SYMBOLS_RESPONSE = "resolve-vulnerable-symbols-response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results.rb new file mode 100644 index 000000000000..3a282ff06119 --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results.rb @@ -0,0 +1,117 @@ +=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 `ResolveVulnerableSymbolsResponseResults` object. + class ResolveVulnerableSymbolsResponseResults + include BaseGenericModel + + # The `items` `purl`. + attr_accessor :purl + + # The `items` `vulnerable_symbols`. + attr_accessor :vulnerable_symbols + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'purl' => :'purl', + :'vulnerable_symbols' => :'vulnerable_symbols' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'purl' => :'String', + :'vulnerable_symbols' => :'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::ResolveVulnerableSymbolsResponseResults` 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?(:'purl') + self.purl = attributes[:'purl'] + end + + if attributes.key?(:'vulnerable_symbols') + if (value = attributes[:'vulnerable_symbols']).is_a?(Array) + self.vulnerable_symbols = value + end + 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 && + purl == o.purl && + vulnerable_symbols == o.vulnerable_symbols && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [purl, vulnerable_symbols, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols.rb new file mode 100644 index 000000000000..996ac44da3cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols.rb @@ -0,0 +1,117 @@ +=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 `ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` object. + class ResolveVulnerableSymbolsResponseResultsVulnerableSymbols + include BaseGenericModel + + # The `items` `advisory_id`. + attr_accessor :advisory_id + + # The `items` `symbols`. + attr_accessor :symbols + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'advisory_id' => :'advisory_id', + :'symbols' => :'symbols' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'advisory_id' => :'String', + :'symbols' => :'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::ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` 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?(:'advisory_id') + self.advisory_id = attributes[:'advisory_id'] + end + + if attributes.key?(:'symbols') + if (value = attributes[:'symbols']).is_a?(Array) + self.symbols = value + end + 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 && + advisory_id == o.advisory_id && + symbols == o.symbols && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [advisory_id, symbols, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.rb b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.rb new file mode 100644 index 000000000000..499e5835f73c --- /dev/null +++ b/lib/datadog_api_client/v2/models/resolve_vulnerable_symbols_response_results_vulnerable_symbols_symbols.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 `ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` object. + class ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols + include BaseGenericModel + + # The `items` `name`. + attr_accessor :name + + # The `items` `type`. + attr_accessor :type + + # The `items` `value`. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'String', + :'value' => :'String' + } + 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::ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 && + name == o.name && + type == o.type && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request.rb b/lib/datadog_api_client/v2/models/sca_request.rb new file mode 100644 index 000000000000..8958028eafe3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request.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 `ScaRequest` object. + class ScaRequest + include BaseGenericModel + + # The definition of `ScaRequestData` 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' => :'ScaRequestData' + } + 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::ScaRequest` 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/sca_request_data.rb b/lib/datadog_api_client/v2/models/sca_request_data.rb new file mode 100644 index 000000000000..f746c97debaa --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data.rb @@ -0,0 +1,143 @@ +=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 `ScaRequestData` object. + class ScaRequestData + include BaseGenericModel + + # The definition of `ScaRequestDataAttributes` object. + attr_accessor :attributes + + # The `ScaRequestData` `id`. + attr_accessor :id + + # Scarequests 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' => :'ScaRequestDataAttributes', + :'id' => :'String', + :'type' => :'ScaRequestDataType' + } + 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::ScaRequestData` 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 @type.nil? + true + 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/sca_request_data_attributes.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes.rb new file mode 100644 index 000000000000..4bf0654b7574 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes.rb @@ -0,0 +1,193 @@ +=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 `ScaRequestDataAttributes` object. + class ScaRequestDataAttributes + include BaseGenericModel + + # The definition of `ScaRequestDataAttributesCommit` object. + attr_accessor :commit + + # The `attributes` `dependencies`. + attr_accessor :dependencies + + # The `attributes` `env`. + attr_accessor :env + + # The `attributes` `files`. + attr_accessor :files + + # The `attributes` `relations`. + attr_accessor :relations + + # The definition of `ScaRequestDataAttributesRepository` object. + attr_accessor :repository + + # The `attributes` `service`. + attr_accessor :service + + # The `attributes` `tags`. + attr_accessor :tags + + # The `attributes` `vulnerabilities`. + attr_accessor :vulnerabilities + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commit' => :'commit', + :'dependencies' => :'dependencies', + :'env' => :'env', + :'files' => :'files', + :'relations' => :'relations', + :'repository' => :'repository', + :'service' => :'service', + :'tags' => :'tags', + :'vulnerabilities' => :'vulnerabilities' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commit' => :'ScaRequestDataAttributesCommit', + :'dependencies' => :'Array', + :'env' => :'String', + :'files' => :'Array', + :'relations' => :'Array', + :'repository' => :'ScaRequestDataAttributesRepository', + :'service' => :'String', + :'tags' => :'Hash', + :'vulnerabilities' => :'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::ScaRequestDataAttributes` 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?(:'commit') + self.commit = attributes[:'commit'] + end + + if attributes.key?(:'dependencies') + if (value = attributes[:'dependencies']).is_a?(Array) + self.dependencies = value + end + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'relations') + if (value = attributes[:'relations']).is_a?(Array) + self.relations = value + end + end + + if attributes.key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'tags') + self.tags = attributes[:'tags'] + end + + if attributes.key?(:'vulnerabilities') + if (value = attributes[:'vulnerabilities']).is_a?(Array) + self.vulnerabilities = value + end + 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 && + commit == o.commit && + dependencies == o.dependencies && + env == o.env && + files == o.files && + relations == o.relations && + repository == o.repository && + service == o.service && + tags == o.tags && + vulnerabilities == o.vulnerabilities && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commit, dependencies, env, files, relations, repository, service, tags, vulnerabilities, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_commit.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_commit.rb new file mode 100644 index 000000000000..c99cb38db2cb --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_commit.rb @@ -0,0 +1,165 @@ +=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 `ScaRequestDataAttributesCommit` object. + class ScaRequestDataAttributesCommit + include BaseGenericModel + + # The `commit` `author_date`. + attr_accessor :author_date + + # The `commit` `author_email`. + attr_accessor :author_email + + # The `commit` `author_name`. + attr_accessor :author_name + + # The `commit` `branch`. + attr_accessor :branch + + # The `commit` `committer_email`. + attr_accessor :committer_email + + # The `commit` `committer_name`. + attr_accessor :committer_name + + # The `commit` `sha`. + attr_accessor :sha + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author_date' => :'author_date', + :'author_email' => :'author_email', + :'author_name' => :'author_name', + :'branch' => :'branch', + :'committer_email' => :'committer_email', + :'committer_name' => :'committer_name', + :'sha' => :'sha' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author_date' => :'String', + :'author_email' => :'String', + :'author_name' => :'String', + :'branch' => :'String', + :'committer_email' => :'String', + :'committer_name' => :'String', + :'sha' => :'String' + } + 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::ScaRequestDataAttributesCommit` 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?(:'author_date') + self.author_date = attributes[:'author_date'] + end + + if attributes.key?(:'author_email') + self.author_email = attributes[:'author_email'] + end + + if attributes.key?(:'author_name') + self.author_name = attributes[:'author_name'] + end + + if attributes.key?(:'branch') + self.branch = attributes[:'branch'] + end + + if attributes.key?(:'committer_email') + self.committer_email = attributes[:'committer_email'] + end + + if attributes.key?(:'committer_name') + self.committer_name = attributes[:'committer_name'] + end + + if attributes.key?(:'sha') + self.sha = attributes[:'sha'] + 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 && + author_date == o.author_date && + author_email == o.author_email && + author_name == o.author_name && + branch == o.branch && + committer_email == o.committer_email && + committer_name == o.committer_name && + sha == o.sha && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author_date, author_email, author_name, branch, committer_email, committer_name, sha, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items.rb new file mode 100644 index 000000000000..e55163bda28f --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items.rb @@ -0,0 +1,211 @@ +=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 `ScaRequestDataAttributesDependenciesItems` object. + class ScaRequestDataAttributesDependenciesItems + include BaseGenericModel + + # The `items` `exclusions`. + attr_accessor :exclusions + + # The `items` `group`. + attr_accessor :group + + # The `items` `is_dev`. + attr_accessor :is_dev + + # The `items` `is_direct`. + attr_accessor :is_direct + + # The `items` `language`. + attr_accessor :language + + # The `items` `locations`. + attr_accessor :locations + + # The `items` `name`. + attr_accessor :name + + # The `items` `package_manager`. + attr_accessor :package_manager + + # The `items` `purl`. + attr_accessor :purl + + # The `items` `reachable_symbol_properties`. + attr_accessor :reachable_symbol_properties + + # The `items` `version`. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'exclusions' => :'exclusions', + :'group' => :'group', + :'is_dev' => :'is_dev', + :'is_direct' => :'is_direct', + :'language' => :'language', + :'locations' => :'locations', + :'name' => :'name', + :'package_manager' => :'package_manager', + :'purl' => :'purl', + :'reachable_symbol_properties' => :'reachable_symbol_properties', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'exclusions' => :'Array', + :'group' => :'String', + :'is_dev' => :'Boolean', + :'is_direct' => :'Boolean', + :'language' => :'String', + :'locations' => :'Array', + :'name' => :'String', + :'package_manager' => :'String', + :'purl' => :'String', + :'reachable_symbol_properties' => :'Array', + :'version' => :'String' + } + 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::ScaRequestDataAttributesDependenciesItems` 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?(:'exclusions') + if (value = attributes[:'exclusions']).is_a?(Array) + self.exclusions = value + end + end + + if attributes.key?(:'group') + self.group = attributes[:'group'] + end + + if attributes.key?(:'is_dev') + self.is_dev = attributes[:'is_dev'] + end + + if attributes.key?(:'is_direct') + self.is_direct = attributes[:'is_direct'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'locations') + if (value = attributes[:'locations']).is_a?(Array) + self.locations = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'package_manager') + self.package_manager = attributes[:'package_manager'] + end + + if attributes.key?(:'purl') + self.purl = attributes[:'purl'] + end + + if attributes.key?(:'reachable_symbol_properties') + if (value = attributes[:'reachable_symbol_properties']).is_a?(Array) + self.reachable_symbol_properties = value + end + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 && + exclusions == o.exclusions && + group == o.group && + is_dev == o.is_dev && + is_direct == o.is_direct && + language == o.language && + locations == o.locations && + name == o.name && + package_manager == o.package_manager && + purl == o.purl && + reachable_symbol_properties == o.reachable_symbol_properties && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [exclusions, group, is_dev, is_direct, language, locations, name, package_manager, purl, reachable_symbol_properties, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items.rb new file mode 100644 index 000000000000..f4c4824f19f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items.rb @@ -0,0 +1,135 @@ +=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 `ScaRequestDataAttributesDependenciesItemsLocationsItems` object. + class ScaRequestDataAttributesDependenciesItemsLocationsItems + include BaseGenericModel + + # A position in a file + attr_accessor :block + + # A position in a file + attr_accessor :name + + # A position in a file + attr_accessor :namespace + + # A position in a file + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'block' => :'block', + :'name' => :'name', + :'namespace' => :'namespace', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'block' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition', + :'name' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition', + :'namespace' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition', + :'version' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + } + 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::ScaRequestDataAttributesDependenciesItemsLocationsItems` 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?(:'block') + self.block = attributes[:'block'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'namespace') + self.namespace = attributes[:'namespace'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 && + block == o.block && + name == o.name && + namespace == o.namespace && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [block, name, namespace, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_file_position.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_file_position.rb new file mode 100644 index 000000000000..783c59caa2dc --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_file_position.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 + # A position in a file + class ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition + include BaseGenericModel + + # A position + attr_accessor :_end + + # The `file_name`. + attr_accessor :file_name + + # A position + attr_accessor :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'file_name' => :'file_name', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition', + :'file_name' => :'String', + :'start' => :'ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + } + 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::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition` 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?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'file_name') + self.file_name = attributes[:'file_name'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + 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 && + _end == o._end && + file_name == o.file_name && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, file_name, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_position.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_position.rb new file mode 100644 index 000000000000..c0aaf3f014e3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_locations_items_position.rb @@ -0,0 +1,144 @@ +=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 + # A position + class ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition + include BaseGenericModel + + # The `col`. + attr_reader :col + + # The `line`. + attr_reader :line + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'col' => :'col', + :'line' => :'line' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'col' => :'Integer', + :'line' => :'Integer' + } + 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::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition` 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?(:'col') + self.col = attributes[:'col'] + end + + if attributes.key?(:'line') + self.line = attributes[:'line'] + 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 !@col.nil? && @col > 2147483647 + return false if !@line.nil? && @line > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param col [Object] Object to be assigned + # @!visibility private + def col=(col) + if !col.nil? && col > 2147483647 + fail ArgumentError, 'invalid value for "col", must be smaller than or equal to 2147483647.' + end + @col = col + end + + # Custom attribute writer method with validation + # @param line [Object] Object to be assigned + # @!visibility private + def line=(line) + if !line.nil? && line > 2147483647 + fail ArgumentError, 'invalid value for "line", must be smaller than or equal to 2147483647.' + end + @line = line + 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 && + col == o.col && + line == o.line && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [col, line, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.rb new file mode 100644 index 000000000000..5e30de51544f --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_dependencies_items_reachable_symbol_properties_items.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 `ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` object. + class ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems + include BaseGenericModel + + # The `items` `name`. + attr_accessor :name + + # The `items` `value`. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'value' => :'String' + } + 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::ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 && + name == o.name && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_files_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_files_items.rb new file mode 100644 index 000000000000..f8078ccf5aa4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_files_items.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 `ScaRequestDataAttributesFilesItems` object. + class ScaRequestDataAttributesFilesItems + include BaseGenericModel + + # The `items` `name`. + attr_accessor :name + + # The `items` `purl`. + attr_accessor :purl + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'purl' => :'purl' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'purl' => :'String' + } + 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::ScaRequestDataAttributesFilesItems` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'purl') + self.purl = attributes[:'purl'] + 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 && + name == o.name && + purl == o.purl && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, purl, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_relations_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_relations_items.rb new file mode 100644 index 000000000000..1508bedad9f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_relations_items.rb @@ -0,0 +1,117 @@ +=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 `ScaRequestDataAttributesRelationsItems` object. + class ScaRequestDataAttributesRelationsItems + include BaseGenericModel + + # The `items` `depends_on`. + attr_accessor :depends_on + + # The `items` `ref`. + attr_accessor :ref + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'depends_on' => :'depends_on', + :'ref' => :'ref' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'depends_on' => :'Array', + :'ref' => :'String' + } + 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::ScaRequestDataAttributesRelationsItems` 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?(:'depends_on') + if (value = attributes[:'depends_on']).is_a?(Array) + self.depends_on = value + end + end + + if attributes.key?(:'ref') + self.ref = attributes[:'ref'] + 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 && + depends_on == o.depends_on && + ref == o.ref && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [depends_on, ref, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_repository.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_repository.rb new file mode 100644 index 000000000000..28aa5622f421 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_repository.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 `ScaRequestDataAttributesRepository` object. + class ScaRequestDataAttributesRepository + include BaseGenericModel + + # The `repository` `url`. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'url' => :'String' + } + 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::ScaRequestDataAttributesRepository` 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?(:'url') + self.url = attributes[:'url'] + 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 && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items.rb new file mode 100644 index 000000000000..b6a1d9e74580 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items.rb @@ -0,0 +1,127 @@ +=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 `ScaRequestDataAttributesVulnerabilitiesItems` object. + class ScaRequestDataAttributesVulnerabilitiesItems + include BaseGenericModel + + # The `items` `affects`. + attr_accessor :affects + + # The `items` `bom_ref`. + attr_accessor :bom_ref + + # The `items` `id`. + attr_accessor :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'affects' => :'affects', + :'bom_ref' => :'bom_ref', + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'affects' => :'Array', + :'bom_ref' => :'String', + :'id' => :'String' + } + 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::ScaRequestDataAttributesVulnerabilitiesItems` 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?(:'affects') + if (value = attributes[:'affects']).is_a?(Array) + self.affects = value + end + end + + if attributes.key?(:'bom_ref') + self.bom_ref = attributes[:'bom_ref'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + 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 && + affects == o.affects && + bom_ref == o.bom_ref && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [affects, bom_ref, id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items_affects_items.rb b/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items_affects_items.rb new file mode 100644 index 000000000000..1f5922a8daa7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_data_attributes_vulnerabilities_items_affects_items.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 `ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` object. + class ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems + include BaseGenericModel + + # The `items` `ref`. + attr_accessor :ref + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ref' => :'ref' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ref' => :'String' + } + 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::ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` 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?(:'ref') + self.ref = attributes[:'ref'] + 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 && + ref == o.ref && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ref, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sca_request_data_type.rb b/lib/datadog_api_client/v2/models/sca_request_data_type.rb new file mode 100644 index 000000000000..578cb04ad037 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sca_request_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 + # Scarequests resource type. + class ScaRequestDataType + include BaseEnumModel + + SCAREQUESTS = "scarequests".freeze + end +end