From 6eca1a36c03c026a6067732911ccd918eb217202 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 11 Jun 2026 12:12:54 +0000 Subject: [PATCH] Regenerate client from commit 881c84e of spec repo --- .generator/schemas/v2/openapi.yaml | 388 +++++++++ .../GetAsmServiceByName.rb | 8 + features/scenarios_model_mapping.rb | 3 + features/v2/application_security.feature | 8 + features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 5 + .../v2/api/application_security_api.rb | 74 ++ ...application_security_service_attributes.rb | 800 ++++++++++++++++++ .../application_security_service_resource.rb | 165 ++++ .../application_security_service_type.rb | 26 + .../application_security_services_metadata.rb | 123 +++ .../application_security_services_response.rb | 146 ++++ 13 files changed, 1753 insertions(+) create mode 100644 examples/v2/application-security/GetAsmServiceByName.rb create mode 100644 lib/datadog_api_client/v2/models/application_security_service_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/application_security_service_resource.rb create mode 100644 lib/datadog_api_client/v2/models/application_security_service_type.rb create mode 100644 lib/datadog_api_client/v2/models/application_security_services_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/application_security_services_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fd5ed0088f50..2907d758e322 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -215,6 +215,16 @@ components: required: true schema: type: string + ApplicationSecurityServiceNameParam: + description: |- + The name of the service to retrieve Application Security details for. + Returns all matching services across environments. + example: web-store + in: path + name: service_filter + required: true + schema: + type: string ApplicationSecurityWafCustomRuleIDParam: description: The ID of the custom rule. example: 3b5-v82-ns6 @@ -8254,6 +8264,303 @@ components: required: - data type: object + ApplicationSecurityServiceAttributes: + description: Application Security details describing a service in a given environment. + properties: + agent_versions: + description: The Datadog Agent versions reporting for the service. + example: + - 7.50.0 + items: + description: A Datadog Agent version reporting for the service. + example: 7.50.0 + type: string + type: array + app_type: + description: The application type of the service, such as `web` or `serverless`. + example: web + type: string + asm_threat_compatible: + description: Whether the service is compatible with Application Security Management (Threats). + example: true + type: boolean + backend_waf_event_count: + description: The number of backend WAF events detected for the service. + example: 10 + format: int64 + type: integer + business_logic: + description: The enabled business logic detection rules for the service. + example: + - users.login.success + items: + description: A business logic detection rule enabled for the service. + example: users.login.success + type: string + type: array + color: + deprecated: true + description: "Deprecated: a display color associated with the service in the UI." + example: "" + type: string + env: + description: The environment the service runs in. + example: prod + type: string + event_count: + description: The number of Application Security events detected for the service. + example: 42 + format: int64 + type: integer + event_trend: + deprecated: true + description: "Deprecated: the trend of Application Security events over time." + example: + - 0 + items: + description: A point in the Application Security events trend. + example: 0 + format: int64 + type: integer + type: array + has_appsec_enabled: + description: Whether Application Security Management (Threats) is enabled for the service. + example: true + type: boolean + hits: + deprecated: true + description: "Deprecated: the number of hits for the service." + example: 0 + format: int64 + type: integer + iast_product_activation: + description: Whether Interactive Application Security Testing (IAST) is enabled for the service. + example: false + type: boolean + iast_product_compatibility: + description: The Interactive Application Security Testing (IAST) compatibility status of the service. + example: compatible + type: string + iast_product_compatibility_reasons: + description: The reasons explaining the Interactive Application Security Testing (IAST) compatibility status. + example: + - service_not_compatible + items: + description: A reason explaining the Interactive Application Security Testing (IAST) compatibility status. + example: service_not_compatible + type: string + type: array + languages: + description: The programming languages detected for the service. + example: + - go + items: + description: A programming language detected for the service. + example: go + type: string + type: array + last_ingested_spans: + description: The Unix timestamp, in seconds, of the last ingested span for the service. + example: 1610000000 + format: int64 + type: integer + rc_capabilities: + description: The Remote Configuration capabilities reported by the service. + example: + - ASM_DD_RULES + items: + description: A Remote Configuration capability reported by the service. + example: ASM_DD_RULES + type: string + type: array + recommended_business_logic: + description: The recommended business logic detection rules for the service. + example: + - users.login.success + items: + description: A recommended business logic detection rule for the service. + example: users.login.success + type: string + type: array + risk_product_activation: + description: Whether Software Composition Analysis (SCA) is enabled for the service. + example: false + type: boolean + risk_product_compatibility: + description: The Software Composition Analysis (SCA) compatibility status of the service. + example: compatible + type: string + risk_product_compatibility_reasons: + description: The reasons explaining the Software Composition Analysis (SCA) compatibility status. + example: + - service_not_compatible + items: + description: A reason explaining the Software Composition Analysis (SCA) compatibility status. + example: service_not_compatible + type: string + type: array + rules_version: + description: The WAF rules versions applied to the service. + example: + - 1.13.0 + items: + description: A WAF rules version applied to the service. + example: 1.13.0 + type: string + type: array + service: + description: The name of the service. + example: web-store + type: string + signal_count: + deprecated: true + description: "Deprecated: the number of security signals for the service." + example: 0 + format: int64 + type: integer + signal_trend: + deprecated: true + description: "Deprecated: the trend of security signals over time." + example: + - 0 + items: + description: A point in the security signals trend. + example: 0 + format: int64 + type: integer + type: array + source: + description: The data sources that contributed information about the service. + example: + - services-activity + items: + description: A data source that contributed information about the service. + example: services-activity + type: string + type: array + teams: + description: The teams that own the service. + example: + - security-team + items: + description: A team that owns the service. + example: security-team + type: string + type: array + tracer_versions: + description: The Datadog tracing library versions reporting for the service. + example: + - 1.60.0 + items: + description: A Datadog tracing library version reporting for the service. + example: 1.60.0 + type: string + type: array + vm-activation: + description: The Vulnerability Management activation status of the service. + example: enabled + type: string + vuln_critical_count: + deprecated: true + description: "Deprecated: the number of critical-severity vulnerabilities for the service." + example: 0 + format: int64 + type: integer + vuln_high_count: + deprecated: true + description: "Deprecated: the number of high-severity vulnerabilities for the service." + example: 0 + format: int64 + type: integer + without_filter_services: + description: The total number of services available without applying the service filter. + example: 0 + format: int64 + type: integer + required: + - service + - env + - app_type + - has_appsec_enabled + - asm_threat_compatible + - languages + - teams + - event_count + - backend_waf_event_count + - risk_product_activation + - risk_product_compatibility + - risk_product_compatibility_reasons + - iast_product_activation + - iast_product_compatibility + - iast_product_compatibility_reasons + - vm-activation + - agent_versions + - tracer_versions + - rules_version + - rc_capabilities + - source + - last_ingested_spans + - business_logic + - recommended_business_logic + - without_filter_services + - color + - event_trend + - signal_trend + - signal_count + - hits + - vuln_high_count + - vuln_critical_count + type: object + ApplicationSecurityServiceResource: + description: A JSON:API resource describing a service and its Application Security details. + properties: + attributes: + $ref: "#/components/schemas/ApplicationSecurityServiceAttributes" + id: + description: The unique identifier of the service, formatted as `_`. + example: web-store_prod + type: string + type: + $ref: "#/components/schemas/ApplicationSecurityServiceType" + required: + - id + - type + - attributes + type: object + ApplicationSecurityServiceType: + default: service_env + description: The type of the resource. The value should always be `service_env`. + enum: + - service_env + example: service_env + type: string + x-enum-varnames: + - SERVICE_ENV + ApplicationSecurityServicesMetadata: + description: Metadata returned alongside the list of services. + properties: + num_services_with_appsec: + description: The number of services with Application Security Management (Threats) enabled. + example: 1 + format: int64 + type: integer + required: + - num_services_with_appsec + type: object + ApplicationSecurityServicesResponse: + description: Response object containing the list of services matching the requested name. + properties: + data: + description: The list of services matching the requested name. + items: + $ref: "#/components/schemas/ApplicationSecurityServiceResource" + type: array + meta: + $ref: "#/components/schemas/ApplicationSecurityServicesMetadata" + required: + - data + - meta + type: object ApplicationSecurityWafCustomRuleAction: description: The definition of `ApplicationSecurityWafCustomRuleAction` object. properties: @@ -161459,6 +161766,87 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and it's subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/asm/services/{service_filter}: + get: + description: |- + Retrieve Application Security details for services matching the given name. + Returns Application Security activation, compatibility, and product enablement + information for each matching `(service, environment)` pair, along with a count + of services that have Application Security Management (Threats) enabled. + operationId: GetAsmServiceByName + parameters: + - $ref: "#/components/parameters/ApplicationSecurityServiceNameParam" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + agent_versions: + - 7.50.0 + app_type: web + asm_threat_compatible: true + backend_waf_event_count: 10 + business_logic: [] + color: "" + env: prod + event_count: 42 + event_trend: [] + has_appsec_enabled: true + hits: 0 + iast_product_activation: false + iast_product_compatibility: compatible + iast_product_compatibility_reasons: [] + languages: + - go + last_ingested_spans: 1610000000 + rc_capabilities: + - ASM_DD_RULES + recommended_business_logic: [] + risk_product_activation: false + risk_product_compatibility: compatible + risk_product_compatibility_reasons: [] + rules_version: + - 1.13.0 + service: web-store + signal_count: 0 + signal_trend: [] + source: + - services-activity + teams: + - security-team + tracer_versions: + - 1.60.0 + vm-activation: enabled + vuln_critical_count: 0 + vuln_high_count: 0 + without_filter_services: 0 + id: web-store_prod + type: service_env + meta: + num_services_with_appsec: 1 + schema: + $ref: "#/components/schemas/ApplicationSecurityServicesResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Application Security details for a service + tags: + - "Application Security" + "x-permission": + operator: OR + permissions: + - apm_service_catalog_read + - appsec_protect_read + - apm_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/cloud_workload/policy/download: get: description: |- diff --git a/examples/v2/application-security/GetAsmServiceByName.rb b/examples/v2/application-security/GetAsmServiceByName.rb new file mode 100644 index 000000000000..64fd840916b1 --- /dev/null +++ b/examples/v2/application-security/GetAsmServiceByName.rb @@ -0,0 +1,8 @@ +# Get Application Security details for a service returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_asm_service_by_name".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new +p api_instance.get_asm_service_by_name("service_filter") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 4302b7a08ef5..f64bfee110b8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4601,6 +4601,9 @@ "policy_id" => "String", "body" => "ApplicationSecurityPolicyUpdateRequest", }, + "v2.GetAsmServiceByName" => { + "service_filter" => "String", + }, "v2.ListCSMThreatsAgentRules" => { "policy_id" => "String", }, diff --git a/features/v2/application_security.feature b/features/v2/application_security.feature index 4dbda1c46942..710a60641417 100644 --- a/features/v2/application_security.feature +++ b/features/v2/application_security.feature @@ -148,6 +148,14 @@ Feature: Application Security When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/asm-backend + Scenario: Get Application Security details for a service returns "OK" response + Given operation "GetAsmServiceByName" enabled + And new "GetAsmServiceByName" request + And request contains "service_filter" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Get a WAF Policy returns "OK" response Given there is a valid "policy" in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index 2de79b4feb4e..09f7d92f5830 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6700,6 +6700,12 @@ "type": "safe" } }, + "GetAsmServiceByName": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, "DownloadCloudWorkloadPolicyFile": { "tag": "CSM Threats", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index e72b5758ecad..656146194c26 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -594,6 +594,7 @@ def initialize "v2.update_connection": false, "v2.get_pruned_trace_by_id": false, "v2.get_trace_by_id": false, + "v2.get_asm_service_by_name": false, "v2.create_report_schedule": false, "v2.patch_report_schedule": false, "v2.delete_sourcemaps": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 0f0830cc8eb9..0ebce093d504 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1383,6 +1383,11 @@ def overrides "v2.application_security_policy_update_attributes" => "ApplicationSecurityPolicyUpdateAttributes", "v2.application_security_policy_update_data" => "ApplicationSecurityPolicyUpdateData", "v2.application_security_policy_update_request" => "ApplicationSecurityPolicyUpdateRequest", + "v2.application_security_service_attributes" => "ApplicationSecurityServiceAttributes", + "v2.application_security_service_resource" => "ApplicationSecurityServiceResource", + "v2.application_security_services_metadata" => "ApplicationSecurityServicesMetadata", + "v2.application_security_services_response" => "ApplicationSecurityServicesResponse", + "v2.application_security_service_type" => "ApplicationSecurityServiceType", "v2.application_security_waf_custom_rule_action" => "ApplicationSecurityWafCustomRuleAction", "v2.application_security_waf_custom_rule_action_action" => "ApplicationSecurityWafCustomRuleActionAction", "v2.application_security_waf_custom_rule_action_parameters" => "ApplicationSecurityWafCustomRuleActionParameters", diff --git a/lib/datadog_api_client/v2/api/application_security_api.rb b/lib/datadog_api_client/v2/api/application_security_api.rb index 43572bca6b7c..16bb8f8e5317 100644 --- a/lib/datadog_api_client/v2/api/application_security_api.rb +++ b/lib/datadog_api_client/v2/api/application_security_api.rb @@ -617,6 +617,80 @@ def get_application_security_waf_policy_with_http_info(policy_id, opts = {}) return data, status_code, headers end + # Get Application Security details for a service. + # + # @see #get_asm_service_by_name_with_http_info + def get_asm_service_by_name(service_filter, opts = {}) + data, _status_code, _headers = get_asm_service_by_name_with_http_info(service_filter, opts) + data + end + + # Get Application Security details for a service. + # + # Retrieve Application Security details for services matching the given name. + # Returns Application Security activation, compatibility, and product enablement + # information for each matching `(service, environment)` pair, along with a count + # of services that have Application Security Management (Threats) enabled. + # + # @param service_filter [String] The name of the service to retrieve Application Security details for. Returns all matching services across environments. + # @param opts [Hash] the optional parameters + # @return [Array<(ApplicationSecurityServicesResponse, Integer, Hash)>] ApplicationSecurityServicesResponse data, response status code and response headers + def get_asm_service_by_name_with_http_info(service_filter, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_asm_service_by_name".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_asm_service_by_name") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_asm_service_by_name")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.get_asm_service_by_name ...' + end + # verify the required parameter 'service_filter' is set + if @api_client.config.client_side_validation && service_filter.nil? + fail ArgumentError, "Missing the required parameter 'service_filter' when calling ApplicationSecurityAPI.get_asm_service_by_name" + end + # resource path + local_var_path = '/api/v2/security/asm/services/{service_filter}'.sub('{service_filter}', CGI.escape(service_filter.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ApplicationSecurityServicesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_asm_service_by_name, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#get_asm_service_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List all WAF custom rules. # # @see #list_application_security_waf_custom_rules_with_http_info diff --git a/lib/datadog_api_client/v2/models/application_security_service_attributes.rb b/lib/datadog_api_client/v2/models/application_security_service_attributes.rb new file mode 100644 index 000000000000..acb0579ffe9e --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_service_attributes.rb @@ -0,0 +1,800 @@ +=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 + # Application Security details describing a service in a given environment. + class ApplicationSecurityServiceAttributes + include BaseGenericModel + + # The Datadog Agent versions reporting for the service. + attr_reader :agent_versions + + # The application type of the service, such as `web` or `serverless`. + attr_reader :app_type + + # Whether the service is compatible with Application Security Management (Threats). + attr_reader :asm_threat_compatible + + # The number of backend WAF events detected for the service. + attr_reader :backend_waf_event_count + + # The enabled business logic detection rules for the service. + attr_reader :business_logic + + # Deprecated: a display color associated with the service in the UI. + attr_reader :color + + # The environment the service runs in. + attr_reader :env + + # The number of Application Security events detected for the service. + attr_reader :event_count + + # Deprecated: the trend of Application Security events over time. + attr_reader :event_trend + + # Whether Application Security Management (Threats) is enabled for the service. + attr_reader :has_appsec_enabled + + # Deprecated: the number of hits for the service. + attr_reader :hits + + # Whether Interactive Application Security Testing (IAST) is enabled for the service. + attr_reader :iast_product_activation + + # The Interactive Application Security Testing (IAST) compatibility status of the service. + attr_reader :iast_product_compatibility + + # The reasons explaining the Interactive Application Security Testing (IAST) compatibility status. + attr_reader :iast_product_compatibility_reasons + + # The programming languages detected for the service. + attr_reader :languages + + # The Unix timestamp, in seconds, of the last ingested span for the service. + attr_reader :last_ingested_spans + + # The Remote Configuration capabilities reported by the service. + attr_reader :rc_capabilities + + # The recommended business logic detection rules for the service. + attr_reader :recommended_business_logic + + # Whether Software Composition Analysis (SCA) is enabled for the service. + attr_reader :risk_product_activation + + # The Software Composition Analysis (SCA) compatibility status of the service. + attr_reader :risk_product_compatibility + + # The reasons explaining the Software Composition Analysis (SCA) compatibility status. + attr_reader :risk_product_compatibility_reasons + + # The WAF rules versions applied to the service. + attr_reader :rules_version + + # The name of the service. + attr_reader :service + + # Deprecated: the number of security signals for the service. + attr_reader :signal_count + + # Deprecated: the trend of security signals over time. + attr_reader :signal_trend + + # The data sources that contributed information about the service. + attr_reader :source + + # The teams that own the service. + attr_reader :teams + + # The Datadog tracing library versions reporting for the service. + attr_reader :tracer_versions + + # The Vulnerability Management activation status of the service. + attr_reader :vm_activation + + # Deprecated: the number of critical-severity vulnerabilities for the service. + attr_reader :vuln_critical_count + + # Deprecated: the number of high-severity vulnerabilities for the service. + attr_reader :vuln_high_count + + # The total number of services available without applying the service filter. + attr_reader :without_filter_services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agent_versions' => :'agent_versions', + :'app_type' => :'app_type', + :'asm_threat_compatible' => :'asm_threat_compatible', + :'backend_waf_event_count' => :'backend_waf_event_count', + :'business_logic' => :'business_logic', + :'color' => :'color', + :'env' => :'env', + :'event_count' => :'event_count', + :'event_trend' => :'event_trend', + :'has_appsec_enabled' => :'has_appsec_enabled', + :'hits' => :'hits', + :'iast_product_activation' => :'iast_product_activation', + :'iast_product_compatibility' => :'iast_product_compatibility', + :'iast_product_compatibility_reasons' => :'iast_product_compatibility_reasons', + :'languages' => :'languages', + :'last_ingested_spans' => :'last_ingested_spans', + :'rc_capabilities' => :'rc_capabilities', + :'recommended_business_logic' => :'recommended_business_logic', + :'risk_product_activation' => :'risk_product_activation', + :'risk_product_compatibility' => :'risk_product_compatibility', + :'risk_product_compatibility_reasons' => :'risk_product_compatibility_reasons', + :'rules_version' => :'rules_version', + :'service' => :'service', + :'signal_count' => :'signal_count', + :'signal_trend' => :'signal_trend', + :'source' => :'source', + :'teams' => :'teams', + :'tracer_versions' => :'tracer_versions', + :'vm_activation' => :'vm-activation', + :'vuln_critical_count' => :'vuln_critical_count', + :'vuln_high_count' => :'vuln_high_count', + :'without_filter_services' => :'without_filter_services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agent_versions' => :'Array', + :'app_type' => :'String', + :'asm_threat_compatible' => :'Boolean', + :'backend_waf_event_count' => :'Integer', + :'business_logic' => :'Array', + :'color' => :'String', + :'env' => :'String', + :'event_count' => :'Integer', + :'event_trend' => :'Array', + :'has_appsec_enabled' => :'Boolean', + :'hits' => :'Integer', + :'iast_product_activation' => :'Boolean', + :'iast_product_compatibility' => :'String', + :'iast_product_compatibility_reasons' => :'Array', + :'languages' => :'Array', + :'last_ingested_spans' => :'Integer', + :'rc_capabilities' => :'Array', + :'recommended_business_logic' => :'Array', + :'risk_product_activation' => :'Boolean', + :'risk_product_compatibility' => :'String', + :'risk_product_compatibility_reasons' => :'Array', + :'rules_version' => :'Array', + :'service' => :'String', + :'signal_count' => :'Integer', + :'signal_trend' => :'Array', + :'source' => :'Array', + :'teams' => :'Array', + :'tracer_versions' => :'Array', + :'vm_activation' => :'String', + :'vuln_critical_count' => :'Integer', + :'vuln_high_count' => :'Integer', + :'without_filter_services' => :'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::ApplicationSecurityServiceAttributes` 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?(:'agent_versions') + if (value = attributes[:'agent_versions']).is_a?(Array) + self.agent_versions = value + end + end + + if attributes.key?(:'app_type') + self.app_type = attributes[:'app_type'] + end + + if attributes.key?(:'asm_threat_compatible') + self.asm_threat_compatible = attributes[:'asm_threat_compatible'] + end + + if attributes.key?(:'backend_waf_event_count') + self.backend_waf_event_count = attributes[:'backend_waf_event_count'] + end + + if attributes.key?(:'business_logic') + if (value = attributes[:'business_logic']).is_a?(Array) + self.business_logic = value + end + end + + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'event_count') + self.event_count = attributes[:'event_count'] + end + + if attributes.key?(:'event_trend') + if (value = attributes[:'event_trend']).is_a?(Array) + self.event_trend = value + end + end + + if attributes.key?(:'has_appsec_enabled') + self.has_appsec_enabled = attributes[:'has_appsec_enabled'] + end + + if attributes.key?(:'hits') + self.hits = attributes[:'hits'] + end + + if attributes.key?(:'iast_product_activation') + self.iast_product_activation = attributes[:'iast_product_activation'] + end + + if attributes.key?(:'iast_product_compatibility') + self.iast_product_compatibility = attributes[:'iast_product_compatibility'] + end + + if attributes.key?(:'iast_product_compatibility_reasons') + if (value = attributes[:'iast_product_compatibility_reasons']).is_a?(Array) + self.iast_product_compatibility_reasons = value + end + end + + if attributes.key?(:'languages') + if (value = attributes[:'languages']).is_a?(Array) + self.languages = value + end + end + + if attributes.key?(:'last_ingested_spans') + self.last_ingested_spans = attributes[:'last_ingested_spans'] + end + + if attributes.key?(:'rc_capabilities') + if (value = attributes[:'rc_capabilities']).is_a?(Array) + self.rc_capabilities = value + end + end + + if attributes.key?(:'recommended_business_logic') + if (value = attributes[:'recommended_business_logic']).is_a?(Array) + self.recommended_business_logic = value + end + end + + if attributes.key?(:'risk_product_activation') + self.risk_product_activation = attributes[:'risk_product_activation'] + end + + if attributes.key?(:'risk_product_compatibility') + self.risk_product_compatibility = attributes[:'risk_product_compatibility'] + end + + if attributes.key?(:'risk_product_compatibility_reasons') + if (value = attributes[:'risk_product_compatibility_reasons']).is_a?(Array) + self.risk_product_compatibility_reasons = value + end + end + + if attributes.key?(:'rules_version') + if (value = attributes[:'rules_version']).is_a?(Array) + self.rules_version = value + end + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'signal_count') + self.signal_count = attributes[:'signal_count'] + end + + if attributes.key?(:'signal_trend') + if (value = attributes[:'signal_trend']).is_a?(Array) + self.signal_trend = value + end + end + + if attributes.key?(:'source') + if (value = attributes[:'source']).is_a?(Array) + self.source = value + end + end + + if attributes.key?(:'teams') + if (value = attributes[:'teams']).is_a?(Array) + self.teams = value + end + end + + if attributes.key?(:'tracer_versions') + if (value = attributes[:'tracer_versions']).is_a?(Array) + self.tracer_versions = value + end + end + + if attributes.key?(:'vm_activation') + self.vm_activation = attributes[:'vm_activation'] + end + + if attributes.key?(:'vuln_critical_count') + self.vuln_critical_count = attributes[:'vuln_critical_count'] + end + + if attributes.key?(:'vuln_high_count') + self.vuln_high_count = attributes[:'vuln_high_count'] + end + + if attributes.key?(:'without_filter_services') + self.without_filter_services = attributes[:'without_filter_services'] + 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 @agent_versions.nil? + return false if @app_type.nil? + return false if @asm_threat_compatible.nil? + return false if @backend_waf_event_count.nil? + return false if @business_logic.nil? + return false if @color.nil? + return false if @env.nil? + return false if @event_count.nil? + return false if @event_trend.nil? + return false if @has_appsec_enabled.nil? + return false if @hits.nil? + return false if @iast_product_activation.nil? + return false if @iast_product_compatibility.nil? + return false if @iast_product_compatibility_reasons.nil? + return false if @languages.nil? + return false if @last_ingested_spans.nil? + return false if @rc_capabilities.nil? + return false if @recommended_business_logic.nil? + return false if @risk_product_activation.nil? + return false if @risk_product_compatibility.nil? + return false if @risk_product_compatibility_reasons.nil? + return false if @rules_version.nil? + return false if @service.nil? + return false if @signal_count.nil? + return false if @signal_trend.nil? + return false if @source.nil? + return false if @teams.nil? + return false if @tracer_versions.nil? + return false if @vm_activation.nil? + return false if @vuln_critical_count.nil? + return false if @vuln_high_count.nil? + return false if @without_filter_services.nil? + true + end + + # Custom attribute writer method with validation + # @param agent_versions [Object] Object to be assigned + # @!visibility private + def agent_versions=(agent_versions) + if agent_versions.nil? + fail ArgumentError, 'invalid value for "agent_versions", agent_versions cannot be nil.' + end + @agent_versions = agent_versions + end + + # Custom attribute writer method with validation + # @param app_type [Object] Object to be assigned + # @!visibility private + def app_type=(app_type) + if app_type.nil? + fail ArgumentError, 'invalid value for "app_type", app_type cannot be nil.' + end + @app_type = app_type + end + + # Custom attribute writer method with validation + # @param asm_threat_compatible [Object] Object to be assigned + # @!visibility private + def asm_threat_compatible=(asm_threat_compatible) + if asm_threat_compatible.nil? + fail ArgumentError, 'invalid value for "asm_threat_compatible", asm_threat_compatible cannot be nil.' + end + @asm_threat_compatible = asm_threat_compatible + end + + # Custom attribute writer method with validation + # @param backend_waf_event_count [Object] Object to be assigned + # @!visibility private + def backend_waf_event_count=(backend_waf_event_count) + if backend_waf_event_count.nil? + fail ArgumentError, 'invalid value for "backend_waf_event_count", backend_waf_event_count cannot be nil.' + end + @backend_waf_event_count = backend_waf_event_count + end + + # Custom attribute writer method with validation + # @param business_logic [Object] Object to be assigned + # @!visibility private + def business_logic=(business_logic) + if business_logic.nil? + fail ArgumentError, 'invalid value for "business_logic", business_logic cannot be nil.' + end + @business_logic = business_logic + end + + # Custom attribute writer method with validation + # @param color [Object] Object to be assigned + # @!visibility private + def color=(color) + if color.nil? + fail ArgumentError, 'invalid value for "color", color cannot be nil.' + end + @color = color + end + + # Custom attribute writer method with validation + # @param env [Object] Object to be assigned + # @!visibility private + def env=(env) + if env.nil? + fail ArgumentError, 'invalid value for "env", env cannot be nil.' + end + @env = env + end + + # Custom attribute writer method with validation + # @param event_count [Object] Object to be assigned + # @!visibility private + def event_count=(event_count) + if event_count.nil? + fail ArgumentError, 'invalid value for "event_count", event_count cannot be nil.' + end + @event_count = event_count + end + + # Custom attribute writer method with validation + # @param event_trend [Object] Object to be assigned + # @!visibility private + def event_trend=(event_trend) + if event_trend.nil? + fail ArgumentError, 'invalid value for "event_trend", event_trend cannot be nil.' + end + @event_trend = event_trend + end + + # Custom attribute writer method with validation + # @param has_appsec_enabled [Object] Object to be assigned + # @!visibility private + def has_appsec_enabled=(has_appsec_enabled) + if has_appsec_enabled.nil? + fail ArgumentError, 'invalid value for "has_appsec_enabled", has_appsec_enabled cannot be nil.' + end + @has_appsec_enabled = has_appsec_enabled + end + + # Custom attribute writer method with validation + # @param hits [Object] Object to be assigned + # @!visibility private + def hits=(hits) + if hits.nil? + fail ArgumentError, 'invalid value for "hits", hits cannot be nil.' + end + @hits = hits + end + + # Custom attribute writer method with validation + # @param iast_product_activation [Object] Object to be assigned + # @!visibility private + def iast_product_activation=(iast_product_activation) + if iast_product_activation.nil? + fail ArgumentError, 'invalid value for "iast_product_activation", iast_product_activation cannot be nil.' + end + @iast_product_activation = iast_product_activation + end + + # Custom attribute writer method with validation + # @param iast_product_compatibility [Object] Object to be assigned + # @!visibility private + def iast_product_compatibility=(iast_product_compatibility) + if iast_product_compatibility.nil? + fail ArgumentError, 'invalid value for "iast_product_compatibility", iast_product_compatibility cannot be nil.' + end + @iast_product_compatibility = iast_product_compatibility + end + + # Custom attribute writer method with validation + # @param iast_product_compatibility_reasons [Object] Object to be assigned + # @!visibility private + def iast_product_compatibility_reasons=(iast_product_compatibility_reasons) + if iast_product_compatibility_reasons.nil? + fail ArgumentError, 'invalid value for "iast_product_compatibility_reasons", iast_product_compatibility_reasons cannot be nil.' + end + @iast_product_compatibility_reasons = iast_product_compatibility_reasons + end + + # Custom attribute writer method with validation + # @param languages [Object] Object to be assigned + # @!visibility private + def languages=(languages) + if languages.nil? + fail ArgumentError, 'invalid value for "languages", languages cannot be nil.' + end + @languages = languages + end + + # Custom attribute writer method with validation + # @param last_ingested_spans [Object] Object to be assigned + # @!visibility private + def last_ingested_spans=(last_ingested_spans) + if last_ingested_spans.nil? + fail ArgumentError, 'invalid value for "last_ingested_spans", last_ingested_spans cannot be nil.' + end + @last_ingested_spans = last_ingested_spans + end + + # Custom attribute writer method with validation + # @param rc_capabilities [Object] Object to be assigned + # @!visibility private + def rc_capabilities=(rc_capabilities) + if rc_capabilities.nil? + fail ArgumentError, 'invalid value for "rc_capabilities", rc_capabilities cannot be nil.' + end + @rc_capabilities = rc_capabilities + end + + # Custom attribute writer method with validation + # @param recommended_business_logic [Object] Object to be assigned + # @!visibility private + def recommended_business_logic=(recommended_business_logic) + if recommended_business_logic.nil? + fail ArgumentError, 'invalid value for "recommended_business_logic", recommended_business_logic cannot be nil.' + end + @recommended_business_logic = recommended_business_logic + end + + # Custom attribute writer method with validation + # @param risk_product_activation [Object] Object to be assigned + # @!visibility private + def risk_product_activation=(risk_product_activation) + if risk_product_activation.nil? + fail ArgumentError, 'invalid value for "risk_product_activation", risk_product_activation cannot be nil.' + end + @risk_product_activation = risk_product_activation + end + + # Custom attribute writer method with validation + # @param risk_product_compatibility [Object] Object to be assigned + # @!visibility private + def risk_product_compatibility=(risk_product_compatibility) + if risk_product_compatibility.nil? + fail ArgumentError, 'invalid value for "risk_product_compatibility", risk_product_compatibility cannot be nil.' + end + @risk_product_compatibility = risk_product_compatibility + end + + # Custom attribute writer method with validation + # @param risk_product_compatibility_reasons [Object] Object to be assigned + # @!visibility private + def risk_product_compatibility_reasons=(risk_product_compatibility_reasons) + if risk_product_compatibility_reasons.nil? + fail ArgumentError, 'invalid value for "risk_product_compatibility_reasons", risk_product_compatibility_reasons cannot be nil.' + end + @risk_product_compatibility_reasons = risk_product_compatibility_reasons + end + + # Custom attribute writer method with validation + # @param rules_version [Object] Object to be assigned + # @!visibility private + def rules_version=(rules_version) + if rules_version.nil? + fail ArgumentError, 'invalid value for "rules_version", rules_version cannot be nil.' + end + @rules_version = rules_version + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param signal_count [Object] Object to be assigned + # @!visibility private + def signal_count=(signal_count) + if signal_count.nil? + fail ArgumentError, 'invalid value for "signal_count", signal_count cannot be nil.' + end + @signal_count = signal_count + end + + # Custom attribute writer method with validation + # @param signal_trend [Object] Object to be assigned + # @!visibility private + def signal_trend=(signal_trend) + if signal_trend.nil? + fail ArgumentError, 'invalid value for "signal_trend", signal_trend cannot be nil.' + end + @signal_trend = signal_trend + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param teams [Object] Object to be assigned + # @!visibility private + def teams=(teams) + if teams.nil? + fail ArgumentError, 'invalid value for "teams", teams cannot be nil.' + end + @teams = teams + end + + # Custom attribute writer method with validation + # @param tracer_versions [Object] Object to be assigned + # @!visibility private + def tracer_versions=(tracer_versions) + if tracer_versions.nil? + fail ArgumentError, 'invalid value for "tracer_versions", tracer_versions cannot be nil.' + end + @tracer_versions = tracer_versions + end + + # Custom attribute writer method with validation + # @param vm_activation [Object] Object to be assigned + # @!visibility private + def vm_activation=(vm_activation) + if vm_activation.nil? + fail ArgumentError, 'invalid value for "vm_activation", vm_activation cannot be nil.' + end + @vm_activation = vm_activation + end + + # Custom attribute writer method with validation + # @param vuln_critical_count [Object] Object to be assigned + # @!visibility private + def vuln_critical_count=(vuln_critical_count) + if vuln_critical_count.nil? + fail ArgumentError, 'invalid value for "vuln_critical_count", vuln_critical_count cannot be nil.' + end + @vuln_critical_count = vuln_critical_count + end + + # Custom attribute writer method with validation + # @param vuln_high_count [Object] Object to be assigned + # @!visibility private + def vuln_high_count=(vuln_high_count) + if vuln_high_count.nil? + fail ArgumentError, 'invalid value for "vuln_high_count", vuln_high_count cannot be nil.' + end + @vuln_high_count = vuln_high_count + end + + # Custom attribute writer method with validation + # @param without_filter_services [Object] Object to be assigned + # @!visibility private + def without_filter_services=(without_filter_services) + if without_filter_services.nil? + fail ArgumentError, 'invalid value for "without_filter_services", without_filter_services cannot be nil.' + end + @without_filter_services = without_filter_services + 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 && + agent_versions == o.agent_versions && + app_type == o.app_type && + asm_threat_compatible == o.asm_threat_compatible && + backend_waf_event_count == o.backend_waf_event_count && + business_logic == o.business_logic && + color == o.color && + env == o.env && + event_count == o.event_count && + event_trend == o.event_trend && + has_appsec_enabled == o.has_appsec_enabled && + hits == o.hits && + iast_product_activation == o.iast_product_activation && + iast_product_compatibility == o.iast_product_compatibility && + iast_product_compatibility_reasons == o.iast_product_compatibility_reasons && + languages == o.languages && + last_ingested_spans == o.last_ingested_spans && + rc_capabilities == o.rc_capabilities && + recommended_business_logic == o.recommended_business_logic && + risk_product_activation == o.risk_product_activation && + risk_product_compatibility == o.risk_product_compatibility && + risk_product_compatibility_reasons == o.risk_product_compatibility_reasons && + rules_version == o.rules_version && + service == o.service && + signal_count == o.signal_count && + signal_trend == o.signal_trend && + source == o.source && + teams == o.teams && + tracer_versions == o.tracer_versions && + vm_activation == o.vm_activation && + vuln_critical_count == o.vuln_critical_count && + vuln_high_count == o.vuln_high_count && + without_filter_services == o.without_filter_services && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agent_versions, app_type, asm_threat_compatible, backend_waf_event_count, business_logic, color, env, event_count, event_trend, has_appsec_enabled, hits, iast_product_activation, iast_product_compatibility, iast_product_compatibility_reasons, languages, last_ingested_spans, rc_capabilities, recommended_business_logic, risk_product_activation, risk_product_compatibility, risk_product_compatibility_reasons, rules_version, service, signal_count, signal_trend, source, teams, tracer_versions, vm_activation, vuln_critical_count, vuln_high_count, without_filter_services, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_service_resource.rb b/lib/datadog_api_client/v2/models/application_security_service_resource.rb new file mode 100644 index 000000000000..f31f6c92b562 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_service_resource.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 + # A JSON:API resource describing a service and its Application Security details. + class ApplicationSecurityServiceResource + include BaseGenericModel + + # Application Security details describing a service in a given environment. + attr_reader :attributes + + # The unique identifier of the service, formatted as `_`. + attr_reader :id + + # The type of the resource. The value should always be `service_env`. + 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' => :'ApplicationSecurityServiceAttributes', + :'id' => :'String', + :'type' => :'ApplicationSecurityServiceType' + } + 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::ApplicationSecurityServiceResource` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_service_type.rb b/lib/datadog_api_client/v2/models/application_security_service_type.rb new file mode 100644 index 000000000000..65ce6cd63ec8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_service_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be `service_env`. + class ApplicationSecurityServiceType + include BaseEnumModel + + SERVICE_ENV = "service_env".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_services_metadata.rb b/lib/datadog_api_client/v2/models/application_security_services_metadata.rb new file mode 100644 index 000000000000..8ec373d04742 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_services_metadata.rb @@ -0,0 +1,123 @@ +=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 + # Metadata returned alongside the list of services. + class ApplicationSecurityServicesMetadata + include BaseGenericModel + + # The number of services with Application Security Management (Threats) enabled. + attr_reader :num_services_with_appsec + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'num_services_with_appsec' => :'num_services_with_appsec' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'num_services_with_appsec' => :'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::ApplicationSecurityServicesMetadata` 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?(:'num_services_with_appsec') + self.num_services_with_appsec = attributes[:'num_services_with_appsec'] + 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 @num_services_with_appsec.nil? + true + end + + # Custom attribute writer method with validation + # @param num_services_with_appsec [Object] Object to be assigned + # @!visibility private + def num_services_with_appsec=(num_services_with_appsec) + if num_services_with_appsec.nil? + fail ArgumentError, 'invalid value for "num_services_with_appsec", num_services_with_appsec cannot be nil.' + end + @num_services_with_appsec = num_services_with_appsec + 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 && + num_services_with_appsec == o.num_services_with_appsec && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [num_services_with_appsec, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_services_response.rb b/lib/datadog_api_client/v2/models/application_security_services_response.rb new file mode 100644 index 000000000000..fcb82e617e65 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_services_response.rb @@ -0,0 +1,146 @@ +=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 + # Response object containing the list of services matching the requested name. + class ApplicationSecurityServicesResponse + include BaseGenericModel + + # The list of services matching the requested name. + attr_reader :data + + # Metadata returned alongside the list of services. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ApplicationSecurityServicesMetadata' + } + 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::ApplicationSecurityServicesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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 && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end