diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2c64bbd7a3f..8477f098853 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -39409,6 +39409,95 @@ components: type: string x-enum-varnames: - RULESET + ResolveVulnerableSymbolsRequest: + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestData' + type: object + ResolveVulnerableSymbolsRequestData: + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataType' + required: + - type + type: object + ResolveVulnerableSymbolsRequestDataAttributes: + properties: + purls: + items: + type: string + type: array + type: object + ResolveVulnerableSymbolsRequestDataType: + default: resolve-vulnerable-symbols-request + enum: + - resolve-vulnerable-symbols-request + example: resolve-vulnerable-symbols-request + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_REQUEST + ResolveVulnerableSymbolsResponse: + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseData' + type: object + ResolveVulnerableSymbolsResponseData: + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataType' + required: + - type + type: object + ResolveVulnerableSymbolsResponseDataAttributes: + properties: + results: + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResults' + type: array + type: object + ResolveVulnerableSymbolsResponseDataType: + default: resolve-vulnerable-symbols-response + enum: + - resolve-vulnerable-symbols-response + example: resolve-vulnerable-symbols-response + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_RESPONSE + ResolveVulnerableSymbolsResponseResults: + properties: + purl: + type: string + vulnerable_symbols: + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols: + properties: + advisory_id: + type: string + symbols: + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols: + properties: + name: + type: string + type: + type: string + value: + type: string + type: object ResourceFilterAttributes: description: Attributes of a resource filter. example: @@ -41843,6 +41932,184 @@ components: example: report_id type: string type: object + ScaRequest: + properties: + data: + $ref: '#/components/schemas/ScaRequestData' + type: object + ScaRequestData: + properties: + attributes: + $ref: '#/components/schemas/ScaRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ScaRequestDataType' + required: + - type + type: object + ScaRequestDataAttributes: + properties: + commit: + $ref: '#/components/schemas/ScaRequestDataAttributesCommit' + dependencies: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItems' + type: array + env: + type: string + files: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesFilesItems' + type: array + relations: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesRelationsItems' + type: array + repository: + $ref: '#/components/schemas/ScaRequestDataAttributesRepository' + service: + type: string + tags: + additionalProperties: + type: string + type: object + vulnerabilities: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItems' + type: array + type: object + ScaRequestDataAttributesCommit: + properties: + author_date: + type: string + author_email: + type: string + author_name: + type: string + branch: + type: string + committer_email: + type: string + committer_name: + type: string + sha: + type: string + type: object + ScaRequestDataAttributesDependenciesItems: + properties: + exclusions: + items: + type: string + type: array + group: + type: string + is_dev: + type: boolean + is_direct: + type: boolean + language: + type: string + locations: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems' + type: array + name: + type: string + package_manager: + type: string + purl: + type: string + reachable_symbol_properties: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems' + type: array + version: + type: string + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItems: + properties: + block: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + name: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + namespace: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + version: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: + properties: + end: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + file_name: + type: string + start: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition: + properties: + col: + format: int32 + maximum: 2147483647 + type: integer + line: + format: int32 + maximum: 2147483647 + type: integer + type: object + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems: + properties: + name: + type: string + value: + type: string + type: object + ScaRequestDataAttributesFilesItems: + properties: + name: + type: string + purl: + type: string + type: object + ScaRequestDataAttributesRelationsItems: + properties: + depends_on: + items: + type: string + type: array + ref: + type: string + type: object + ScaRequestDataAttributesRepository: + properties: + url: + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItems: + properties: + affects: + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems' + type: array + bom_ref: + type: string + id: + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems: + properties: + ref: + type: string + type: object + ScaRequestDataType: + default: scarequests + enum: + - scarequests + example: scarequests + type: string + x-enum-varnames: + - SCAREQUESTS ScalarColumn: description: A single column in a scalar query response. oneOf: @@ -76995,6 +77262,56 @@ paths: cursorPath: meta.page.after limitParam: body.data.attributes.page.limit resultsPath: data + /api/v2/static-analysis-sca/dependencies: + post: + 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: + 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. @@ -80526,6 +80843,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/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb b/examples/v2/static-analysis/CreateSCAResolveVulnerableSymbols.rb new file mode 100644 index 00000000000..bc04a0a8501 --- /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 00000000000..1b767022c75 --- /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 c3d2f43620e..16aca0402c2 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2988,6 +2988,12 @@ "v2.ListSpans" => { "body" => "SpansListRequest", }, + "v2.CreateSCAResult" => { + "body" => "ScaRequest", + }, + "v2.CreateSCAResolveVulnerableSymbols" => { + "body" => "ResolveVulnerableSymbolsRequest", + }, "v2.SetOnDemandConcurrencyCap" => { "body" => "OnDemandConcurrencyCapAttributes", }, diff --git a/features/v2/static_analysis.feature b/features/v2/static_analysis.feature new file mode 100644 index 00000000000..85bf4d83ae1 --- /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 bb35cea36c2..5f2144f5fb2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3993,6 +3993,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 7978919a496..8519edb2cd0 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -291,6 +291,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 5436fa6f85c..61016133e9d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3356,6 +3356,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", @@ -3577,6 +3588,21 @@ def overrides "v2.scanned_asset_metadata_attributes" => "ScannedAssetMetadataAttributes", "v2.scanned_asset_metadata_last_success" => "ScannedAssetMetadataLastSuccess", "v2.scanned_assets_metadata" => "ScannedAssetsMetadata", + "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", @@ -4380,6 +4406,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 00000000000..617f9f38517 --- /dev/null +++ b/lib/datadog_api_client/v2/api/static_analysis_api.rb @@ -0,0 +1,166 @@ +=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. + # @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. + # @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 00000000000..a0d7c513cb3 --- /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 + # + class ResolveVulnerableSymbolsRequest + include BaseGenericModel + + # + 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 00000000000..be2cf066e0a --- /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 + # + class ResolveVulnerableSymbolsRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + 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 00000000000..15f4f0a9dc2 --- /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 + # + class ResolveVulnerableSymbolsRequestDataAttributes + include BaseGenericModel + + # + 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 00000000000..bc12f15ab43 --- /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 + # + 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 00000000000..32d87854e5c --- /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 + # + class ResolveVulnerableSymbolsResponse + include BaseGenericModel + + # + 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 00000000000..f6a0a23a07b --- /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 + # + class ResolveVulnerableSymbolsResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + 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 00000000000..0e1ed2a54cc --- /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 + # + class ResolveVulnerableSymbolsResponseDataAttributes + include BaseGenericModel + + # + 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 00000000000..cb4a1322906 --- /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 + # + 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 00000000000..313e1ff0141 --- /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 + # + class ResolveVulnerableSymbolsResponseResults + include BaseGenericModel + + # + attr_accessor :purl + + # + 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 00000000000..7e6a1c75552 --- /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 + # + class ResolveVulnerableSymbolsResponseResultsVulnerableSymbols + include BaseGenericModel + + # + attr_accessor :advisory_id + + # + 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 00000000000..0b5c82a8e93 --- /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 + # + class ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols + include BaseGenericModel + + # + attr_accessor :name + + # + attr_accessor :type + + # + 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 00000000000..b6e40af088e --- /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 + # + class ScaRequest + include BaseGenericModel + + # + 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 00000000000..7855d30a488 --- /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 + # + class ScaRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + 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 00000000000..5280db32d33 --- /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 + # + class ScaRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :commit + + # + attr_accessor :dependencies + + # + attr_accessor :env + + # + attr_accessor :files + + # + attr_accessor :relations + + # + attr_accessor :repository + + # + attr_accessor :service + + # + attr_accessor :tags + + # + 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 00000000000..b14e6d9f6b1 --- /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 + # + class ScaRequestDataAttributesCommit + include BaseGenericModel + + # + attr_accessor :author_date + + # + attr_accessor :author_email + + # + attr_accessor :author_name + + # + attr_accessor :branch + + # + attr_accessor :committer_email + + # + attr_accessor :committer_name + + # + 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 00000000000..c82bc0f10a9 --- /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 + # + class ScaRequestDataAttributesDependenciesItems + include BaseGenericModel + + # + attr_accessor :exclusions + + # + attr_accessor :group + + # + attr_accessor :is_dev + + # + attr_accessor :is_direct + + # + attr_accessor :language + + # + attr_accessor :locations + + # + attr_accessor :name + + # + attr_accessor :package_manager + + # + attr_accessor :purl + + # + attr_accessor :reachable_symbol_properties + + # + 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 00000000000..091938f7fec --- /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 + # + class ScaRequestDataAttributesDependenciesItemsLocationsItems + include BaseGenericModel + + # + attr_accessor :block + + # + attr_accessor :name + + # + attr_accessor :namespace + + # + 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 00000000000..e931ede408a --- /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 + # + class ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition + include BaseGenericModel + + # + attr_accessor :_end + + # + attr_accessor :file_name + + # + 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 00000000000..ffd644e4cbc --- /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 + # + class ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition + include BaseGenericModel + + # + attr_reader :col + + # + 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 00000000000..daf1ae5810a --- /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 + # + class ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems + include BaseGenericModel + + # + attr_accessor :name + + # + 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 00000000000..d6779304c7f --- /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 + # + class ScaRequestDataAttributesFilesItems + include BaseGenericModel + + # + attr_accessor :name + + # + 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 00000000000..94e72e51793 --- /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 + # + class ScaRequestDataAttributesRelationsItems + include BaseGenericModel + + # + attr_accessor :depends_on + + # + 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 00000000000..5a0f778d6ce --- /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 + # + class ScaRequestDataAttributesRepository + include BaseGenericModel + + # + 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 00000000000..7ee66286791 --- /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 + # + class ScaRequestDataAttributesVulnerabilitiesItems + include BaseGenericModel + + # + attr_accessor :affects + + # + attr_accessor :bom_ref + + # + 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 00000000000..886d98da6b4 --- /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 + # + class ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems + include BaseGenericModel + + # + 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 00000000000..65550de1424 --- /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 + # + class ScaRequestDataType + include BaseEnumModel + + SCAREQUESTS = "scarequests".freeze + end +end