From fc87a387d091711975805197b408867688be4503 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:39:39 +0000 Subject: [PATCH 1/3] Regenerate client from commit 4095999 of spec repo (#3464) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 153 +++++++++++++++- .../TriggerDeploymentGatesEvaluation.rb | 14 ++ features/v2/deployment_gates.feature | 6 +- lib/datadog_api_client/inflector.rb | 8 + .../v2/api/deployment_gates_api.rb | 4 + ...ployment_gates_evaluation_configuration.rb | 141 +++++++++++++++ ...ent_gates_evaluation_request_attributes.rb | 16 +- ...eployment_gates_evaluation_request_data.rb | 2 + .../deployment_gates_evaluation_rule.rb | 47 +++++ .../v2/models/deployment_gates_fdd_rule.rb | 164 ++++++++++++++++++ .../deployment_gates_fdd_rule_options.rb | 135 ++++++++++++++ .../models/deployment_gates_fdd_rule_type.rb | 26 +++ .../models/deployment_gates_monitor_rule.rb | 164 ++++++++++++++++++ .../deployment_gates_monitor_rule_options.rb | 144 +++++++++++++++ .../deployment_gates_monitor_rule_type.rb | 26 +++ 15 files changed, 1045 insertions(+), 5 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_configuration.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_rule.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_fdd_rule.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_options.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_type.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_monitor_rule.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_options.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6c45f5bcfb23..95e9aad6aed9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29999,6 +29999,25 @@ components: data: $ref: "#/components/schemas/ListDeploymentRuleResponseData" type: object + DeploymentGatesEvaluationConfiguration: + description: |- + Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated + directly from this configuration instead of using the preconfigured gate rules. + At least one rule is required. + properties: + dry_run: + description: Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns `pass`. The real result is visible in the Datadog UI. + example: false + type: boolean + rules: + description: The list of rules to evaluate. At least one rule is required. + items: + $ref: "#/components/schemas/DeploymentGatesEvaluationRule" + minItems: 1 + type: array + required: + - rules + type: object DeploymentGatesEvaluationRequest: description: Request body for triggering a deployment gate evaluation. properties: @@ -30008,8 +30027,13 @@ components: - data type: object DeploymentGatesEvaluationRequestAttributes: - description: Attributes for a deployment gate evaluation request. + description: |- + Attributes for a deployment gate evaluation request. + When `configuration` is provided, rules are evaluated inline from that configuration. + When omitted, rules are resolved from the preconfigured gate for the given service and environment. properties: + configuration: + $ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration" env: description: The environment of the deployment. example: "staging" @@ -30179,6 +30203,60 @@ components: type: string x-enum-varnames: - DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE + DeploymentGatesEvaluationRule: + description: A rule to evaluate as part of a deployment gate evaluation. + discriminator: + mapping: + faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule" + monitor: "#/components/schemas/DeploymentGatesMonitorRule" + propertyName: type + oneOf: + - $ref: "#/components/schemas/DeploymentGatesMonitorRule" + - $ref: "#/components/schemas/DeploymentGatesFDDRule" + DeploymentGatesFDDRule: + description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation. + properties: + dry_run: + description: Rule-level dry run. When enabled, the rule is evaluated normally but it always returns `pass`. The real result is visible in the Datadog UI. + example: false + type: boolean + name: + description: Human-readable name for this rule. + example: "apm faulty deployment" + type: string + options: + $ref: "#/components/schemas/DeploymentGatesFDDRuleOptions" + type: + $ref: "#/components/schemas/DeploymentGatesFDDRuleType" + required: + - type + - name + type: object + DeploymentGatesFDDRuleOptions: + description: Options for a `faulty_deployment_detection` rule. + properties: + duration: + description: Evaluation window in seconds. Maximum 7200 (2 hours). + example: 900 + format: int64 + maximum: 7200 + type: integer + excluded_resources: + description: APM resource names to exclude from analysis. + example: + - "GET /healthcheck" + items: + type: string + type: array + type: object + DeploymentGatesFDDRuleType: + description: The type identifier for a faulty deployment detection rule. + enum: + - faulty_deployment_detection + example: faulty_deployment_detection + type: string + x-enum-varnames: + - FAULTY_DEPLOYMENT_DETECTION DeploymentGatesListResponse: description: Response containing a paginated list of deployment gates. properties: @@ -30213,6 +30291,49 @@ components: minimum: 1 type: integer type: object + DeploymentGatesMonitorRule: + description: A monitor rule to evaluate as part of a deployment gate evaluation. + properties: + dry_run: + description: Rule-level dry run. When enabled, the rule is evaluated normally but always returns `pass`. The real result is visible in the Datadog UI. + example: false + type: boolean + name: + description: Human-readable name for this rule. + example: "error rate monitors" + type: string + options: + $ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions" + type: + $ref: "#/components/schemas/DeploymentGatesMonitorRuleType" + required: + - type + - name + type: object + DeploymentGatesMonitorRuleOptions: + description: Options for a `monitor` rule. + properties: + duration: + description: Evaluation window in seconds. Maximum 7200 (2 hours). + example: 300 + format: int64 + maximum: 7200 + type: integer + query: + description: Monitor search query. + example: "service:transaction-backend env:production" + type: string + required: + - query + type: object + DeploymentGatesMonitorRuleType: + description: The type identifier for a monitor rule. + enum: + - monitor + example: monitor + type: string + x-enum-varnames: + - MONITOR DeploymentGatesRuleResponse: description: The result of a single rule evaluation. properties: @@ -127285,12 +127406,17 @@ paths: Triggers an asynchronous deployment gate evaluation for the given service and environment. Returns an evaluation ID that can be used to poll for the result via the `GET /api/v2/deployments/gates/evaluation/{id}` endpoint. + + When the `configuration` attribute is provided, rules are evaluated inline from that configuration + and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the + gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform. operationId: TriggerDeploymentGatesEvaluation requestBody: content: application/json: examples: default: + summary: Evaluate a preconfigured gate value: data: attributes: @@ -127300,6 +127426,31 @@ paths: service: transaction-backend version: v1.2.3 type: deployment_gates_evaluation_request + with-configuration: + summary: Evaluate with inline rule configuration + value: + data: + attributes: + configuration: + dry_run: false + rules: + - dry_run: false + name: error rate monitors + options: + duration: 300 + query: "service:transaction-backend env:production" + type: monitor + - dry_run: false + name: apm faulty deployment + options: + duration: 900 + excluded_resources: + - "GET /healthcheck" + type: faulty_deployment_detection + env: production + service: transaction-backend + version: 1.2.3 + type: deployment_gates_evaluation_request schema: $ref: "#/components/schemas/DeploymentGatesEvaluationRequest" required: true diff --git a/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb index 4bbeea630832..73061e58cfca 100644 --- a/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb @@ -9,6 +9,20 @@ body = DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({ data: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({ attributes: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({ + configuration: DatadogAPIClient::V2::DeploymentGatesEvaluationConfiguration.new({ + dry_run: false, + rules: [ + DatadogAPIClient::V2::DeploymentGatesMonitorRule.new({ + dry_run: false, + name: "error rate monitors", + options: DatadogAPIClient::V2::DeploymentGatesMonitorRuleOptions.new({ + duration: 300, + query: "service:transaction-backend env:production", + }), + type: DatadogAPIClient::V2::DeploymentGatesMonitorRuleType::MONITOR, + }), + ], + }), env: "staging", identifier: "pre-deploy", primary_tag: "region:us-east-1", diff --git a/features/v2/deployment_gates.feature b/features/v2/deployment_gates.feature index df9494d2aed8..de5ceaeaa3d0 100644 --- a/features/v2/deployment_gates.feature +++ b/features/v2/deployment_gates.feature @@ -286,7 +286,7 @@ Feature: Deployment Gates Scenario: Trigger a deployment gate evaluation returns "Accepted" response Given operation "TriggerDeploymentGatesEvaluation" enabled And new "TriggerDeploymentGatesEvaluation" request - And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} When the request is sent Then the response status is 202 Accepted @@ -294,7 +294,7 @@ Feature: Deployment Gates Scenario: Trigger a deployment gate evaluation returns "Bad request." response Given operation "TriggerDeploymentGatesEvaluation" enabled And new "TriggerDeploymentGatesEvaluation" request - And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} When the request is sent Then the response status is 400 Bad request. @@ -302,7 +302,7 @@ Feature: Deployment Gates Scenario: Trigger a deployment gate evaluation returns "Deployment gate not found." response Given operation "TriggerDeploymentGatesEvaluation" enabled And new "TriggerDeploymentGatesEvaluation" request - And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} When the request is sent Then the response status is 404 Deployment gate not found. diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 56f2bfe21dff..7eb6c8c9119a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2784,6 +2784,7 @@ def overrides "v2.deployment_gate_response_data_attributes_created_by" => "DeploymentGateResponseDataAttributesCreatedBy", "v2.deployment_gate_response_data_attributes_updated_by" => "DeploymentGateResponseDataAttributesUpdatedBy", "v2.deployment_gate_rules_response" => "DeploymentGateRulesResponse", + "v2.deployment_gates_evaluation_configuration" => "DeploymentGatesEvaluationConfiguration", "v2.deployment_gates_evaluation_request" => "DeploymentGatesEvaluationRequest", "v2.deployment_gates_evaluation_request_attributes" => "DeploymentGatesEvaluationRequestAttributes", "v2.deployment_gates_evaluation_request_data" => "DeploymentGatesEvaluationRequestData", @@ -2797,9 +2798,16 @@ def overrides "v2.deployment_gates_evaluation_result_response_attributes_gate_status" => "DeploymentGatesEvaluationResultResponseAttributesGateStatus", "v2.deployment_gates_evaluation_result_response_data" => "DeploymentGatesEvaluationResultResponseData", "v2.deployment_gates_evaluation_result_response_data_type" => "DeploymentGatesEvaluationResultResponseDataType", + "v2.deployment_gates_evaluation_rule" => "DeploymentGatesEvaluationRule", + "v2.deployment_gates_fdd_rule" => "DeploymentGatesFDDRule", + "v2.deployment_gates_fdd_rule_options" => "DeploymentGatesFDDRuleOptions", + "v2.deployment_gates_fdd_rule_type" => "DeploymentGatesFDDRuleType", "v2.deployment_gates_list_response" => "DeploymentGatesListResponse", "v2.deployment_gates_list_response_meta" => "DeploymentGatesListResponseMeta", "v2.deployment_gates_list_response_meta_page" => "DeploymentGatesListResponseMetaPage", + "v2.deployment_gates_monitor_rule" => "DeploymentGatesMonitorRule", + "v2.deployment_gates_monitor_rule_options" => "DeploymentGatesMonitorRuleOptions", + "v2.deployment_gates_monitor_rule_type" => "DeploymentGatesMonitorRuleType", "v2.deployment_gates_rule_response" => "DeploymentGatesRuleResponse", "v2.deployment_metadata" => "DeploymentMetadata", "v2.deployment_relationship" => "DeploymentRelationship", diff --git a/lib/datadog_api_client/v2/api/deployment_gates_api.rb b/lib/datadog_api_client/v2/api/deployment_gates_api.rb index ac38e2e41c71..c80a2a1abd4d 100644 --- a/lib/datadog_api_client/v2/api/deployment_gates_api.rb +++ b/lib/datadog_api_client/v2/api/deployment_gates_api.rb @@ -705,6 +705,10 @@ def trigger_deployment_gates_evaluation(body, opts = {}) # Returns an evaluation ID that can be used to poll for the result via the # `GET /api/v2/deployments/gates/evaluation/{id}` endpoint. # + # When the `configuration` attribute is provided, rules are evaluated inline from that configuration + # and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the + # gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform. + # # @param body [DeploymentGatesEvaluationRequest] # @param opts [Hash] the optional parameters # @return [Array<(DeploymentGatesEvaluationResponse, Integer, Hash)>] DeploymentGatesEvaluationResponse data, response status code and response headers diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_configuration.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_configuration.rb new file mode 100644 index 000000000000..77bb35f42938 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_configuration.rb @@ -0,0 +1,141 @@ +=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 + # Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated + # directly from this configuration instead of using the preconfigured gate rules. + # At least one rule is required. + class DeploymentGatesEvaluationConfiguration + include BaseGenericModel + + # Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns `pass`. The real result is visible in the Datadog UI. + attr_accessor :dry_run + + # The list of rules to evaluate. At least one rule is required. + attr_reader :rules + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'rules' => :'rules' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'Boolean', + :'rules' => :'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::DeploymentGatesEvaluationConfiguration` 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?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @rules.nil? + return false if @rules.length < 1 + true + end + + # Custom attribute writer method with validation + # @param rules [Object] Object to be assigned + # @!visibility private + def rules=(rules) + if rules.nil? + fail ArgumentError, 'invalid value for "rules", rules cannot be nil.' + end + if rules.length < 1 + fail ArgumentError, 'invalid value for "rules", number of items must be greater than or equal to 1.' + end + @rules = rules + 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 && + dry_run == o.dry_run && + rules == o.rules && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, rules, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb index b333e8677916..d6e1384193ed 100644 --- a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb @@ -18,9 +18,16 @@ module DatadogAPIClient::V2 # Attributes for a deployment gate evaluation request. + # When `configuration` is provided, rules are evaluated inline from that configuration. + # When omitted, rules are resolved from the preconfigured gate for the given service and environment. class DeploymentGatesEvaluationRequestAttributes include BaseGenericModel + # Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated + # directly from this configuration instead of using the preconfigured gate rules. + # At least one rule is required. + attr_accessor :configuration + # The environment of the deployment. attr_reader :env @@ -42,6 +49,7 @@ class DeploymentGatesEvaluationRequestAttributes # @!visibility private def self.attribute_map { + :'configuration' => :'configuration', :'env' => :'env', :'identifier' => :'identifier', :'primary_tag' => :'primary_tag', @@ -54,6 +62,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'configuration' => :'DeploymentGatesEvaluationConfiguration', :'env' => :'String', :'identifier' => :'String', :'primary_tag' => :'String', @@ -80,6 +89,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'configuration') + self.configuration = attributes[:'configuration'] + end + if attributes.key?(:'env') self.env = attributes[:'env'] end @@ -156,6 +169,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + configuration == o.configuration && env == o.env && identifier == o.identifier && primary_tag == o.primary_tag && @@ -168,7 +182,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [env, identifier, primary_tag, service, version, additional_properties].hash + [configuration, env, identifier, primary_tag, service, version, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb index 233fc3df9525..8c4977f0f2d9 100644 --- a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb @@ -22,6 +22,8 @@ class DeploymentGatesEvaluationRequestData include BaseGenericModel # Attributes for a deployment gate evaluation request. + # When `configuration` is provided, rules are evaluated inline from that configuration. + # When omitted, rules are resolved from the preconfigured gate for the given service and environment. attr_reader :attributes # JSON:API type for a deployment gate evaluation request. diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_rule.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_rule.rb new file mode 100644 index 000000000000..5abee6237ac2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_rule.rb @@ -0,0 +1,47 @@ +=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 rule to evaluate as part of a deployment gate evaluation. + module DeploymentGatesEvaluationRule + class << self + include BaseOneOfModel + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DeploymentGatesMonitorRule', + :'DeploymentGatesFDDRule' + ] + end + # Discriminator's property name (OpenAPI v3) + def openapi_discriminator_name + :'type' + end + + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + discriminator_value = data[openapi_discriminator_name] + return nil unless discriminator_value + + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule.rb b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule.rb new file mode 100644 index 000000000000..63c504ab5aa0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule.rb @@ -0,0 +1,164 @@ +=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 faulty deployment detection rule to evaluate as part of a deployment gate evaluation. + class DeploymentGatesFDDRule + include BaseGenericModel + + # Rule-level dry run. When enabled, the rule is evaluated normally but it always returns `pass`. The real result is visible in the Datadog UI. + attr_accessor :dry_run + + # Human-readable name for this rule. + attr_reader :name + + # Options for a `faulty_deployment_detection` rule. + attr_accessor :options + + # The type identifier for a faulty deployment detection rule. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'name' => :'name', + :'options' => :'options', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'Boolean', + :'name' => :'String', + :'options' => :'DeploymentGatesFDDRuleOptions', + :'type' => :'DeploymentGatesFDDRuleType' + } + 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::DeploymentGatesFDDRule` 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?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + 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 @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + dry_run == o.dry_run && + name == o.name && + options == o.options && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, name, options, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_options.rb b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_options.rb new file mode 100644 index 000000000000..7feaeeefbb8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_options.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 + # Options for a `faulty_deployment_detection` rule. + class DeploymentGatesFDDRuleOptions + include BaseGenericModel + + # Evaluation window in seconds. Maximum 7200 (2 hours). + attr_reader :duration + + # APM resource names to exclude from analysis. + attr_accessor :excluded_resources + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'duration' => :'duration', + :'excluded_resources' => :'excluded_resources' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'duration' => :'Integer', + :'excluded_resources' => :'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::DeploymentGatesFDDRuleOptions` 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?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'excluded_resources') + if (value = attributes[:'excluded_resources']).is_a?(Array) + self.excluded_resources = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@duration.nil? && @duration > 7200 + true + end + + # Custom attribute writer method with validation + # @param duration [Object] Object to be assigned + # @!visibility private + def duration=(duration) + if !duration.nil? && duration > 7200 + fail ArgumentError, 'invalid value for "duration", must be smaller than or equal to 7200.' + end + @duration = duration + 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 && + duration == o.duration && + excluded_resources == o.excluded_resources && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [duration, excluded_resources, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_type.rb b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_type.rb new file mode 100644 index 000000000000..b72101727373 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_fdd_rule_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 identifier for a faulty deployment detection rule. + class DeploymentGatesFDDRuleType + include BaseEnumModel + + FAULTY_DEPLOYMENT_DETECTION = "faulty_deployment_detection".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule.rb b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule.rb new file mode 100644 index 000000000000..dd6b3cd306ab --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule.rb @@ -0,0 +1,164 @@ +=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 monitor rule to evaluate as part of a deployment gate evaluation. + class DeploymentGatesMonitorRule + include BaseGenericModel + + # Rule-level dry run. When enabled, the rule is evaluated normally but always returns `pass`. The real result is visible in the Datadog UI. + attr_accessor :dry_run + + # Human-readable name for this rule. + attr_reader :name + + # Options for a `monitor` rule. + attr_accessor :options + + # The type identifier for a monitor rule. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'name' => :'name', + :'options' => :'options', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'Boolean', + :'name' => :'String', + :'options' => :'DeploymentGatesMonitorRuleOptions', + :'type' => :'DeploymentGatesMonitorRuleType' + } + 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::DeploymentGatesMonitorRule` 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?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + 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 @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + dry_run == o.dry_run && + name == o.name && + options == o.options && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, name, options, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_options.rb b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_options.rb new file mode 100644 index 000000000000..bdd0980e41c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_options.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 + # Options for a `monitor` rule. + class DeploymentGatesMonitorRuleOptions + include BaseGenericModel + + # Evaluation window in seconds. Maximum 7200 (2 hours). + attr_reader :duration + + # Monitor search query. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'duration' => :'duration', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'duration' => :'Integer', + :'query' => :'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::DeploymentGatesMonitorRuleOptions` 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?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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 !@duration.nil? && @duration > 7200 + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param duration [Object] Object to be assigned + # @!visibility private + def duration=(duration) + if !duration.nil? && duration > 7200 + fail ArgumentError, 'invalid value for "duration", must be smaller than or equal to 7200.' + end + @duration = duration + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + 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 && + duration == o.duration && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [duration, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_type.rb b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_type.rb new file mode 100644 index 000000000000..67572b95befb --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_monitor_rule_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 identifier for a monitor rule. + class DeploymentGatesMonitorRuleType + include BaseEnumModel + + MONITOR = "monitor".freeze + end +end From 44fc62a971c2012bd11cd2ef7f20e69184c8335d Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 13:42:34 +0000 Subject: [PATCH 2/3] Regenerate client from commit e913a88 of spec repo (#3487) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 6 ------ .../AttachServiceNowTicket.rb | 3 --- .../CreateServiceNowTickets.rb | 3 --- features/v2/security_monitoring.feature | 18 ++++++------------ lib/datadog_api_client/configuration.rb | 2 -- .../v2/api/security_monitoring_api.rb | 12 ------------ 6 files changed, 6 insertions(+), 38 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 95e9aad6aed9..d6bc1bc09f74 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -166470,9 +166470,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - 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/). post: description: >- Create ServiceNow tickets for security findings. @@ -166543,9 +166540,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - 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/sboms: get: description: |- diff --git a/examples/v2/security-monitoring/AttachServiceNowTicket.rb b/examples/v2/security-monitoring/AttachServiceNowTicket.rb index fa0191d7b75f..92981be61fd4 100644 --- a/examples/v2/security-monitoring/AttachServiceNowTicket.rb +++ b/examples/v2/security-monitoring/AttachServiceNowTicket.rb @@ -1,9 +1,6 @@ # Attach security findings to a ServiceNow ticket returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.attach_service_now_ticket".to_sym] = true -end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new body = DatadogAPIClient::V2::AttachServiceNowTicketRequest.new({ diff --git a/examples/v2/security-monitoring/CreateServiceNowTickets.rb b/examples/v2/security-monitoring/CreateServiceNowTickets.rb index e87c00b1bbc6..65f672481970 100644 --- a/examples/v2/security-monitoring/CreateServiceNowTickets.rb +++ b/examples/v2/security-monitoring/CreateServiceNowTickets.rb @@ -1,9 +1,6 @@ # Create ServiceNow tickets for security findings returns "Created" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_service_now_tickets".to_sym] = true -end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new body = DatadogAPIClient::V2::CreateServiceNowTicketRequestArray.new({ diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index ce99ef89adaf..40957727ee74 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -113,24 +113,21 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a ServiceNow ticket returns "Bad Request" response - Given operation "AttachServiceNowTicket" enabled - And new "AttachServiceNowTicket" request + Given new "AttachServiceNowTicket" request And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a ServiceNow ticket returns "Not Found" response - Given operation "AttachServiceNowTicket" enabled - And new "AttachServiceNowTicket" request + Given new "AttachServiceNowTicket" request And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a ServiceNow ticket returns "OK" response - Given operation "AttachServiceNowTicket" enabled - And new "AttachServiceNowTicket" request + Given new "AttachServiceNowTicket" request And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} When the request is sent Then the response status is 200 OK @@ -532,24 +529,21 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-investigation Scenario: Create ServiceNow tickets for security findings returns "Bad Request" response - Given operation "CreateServiceNowTickets" enabled - And new "CreateServiceNowTickets" request + Given new "CreateServiceNowTickets" request And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-investigation Scenario: Create ServiceNow tickets for security findings returns "Created" response - Given operation "CreateServiceNowTickets" enabled - And new "CreateServiceNowTickets" request + Given new "CreateServiceNowTickets" request And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} When the request is sent Then the response status is 201 Created @generated @skip @team:DataDog/k9-investigation Scenario: Create ServiceNow tickets for security findings returns "Not Found" response - Given operation "CreateServiceNowTickets" enabled - And new "CreateServiceNowTickets" request + Given new "CreateServiceNowTickets" request And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} When the request is sent Then the response status is 404 Not Found diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index d0c3fbbdb28b..260c407d8944 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -337,7 +337,6 @@ def initialize "v2.get_aws_cloud_auth_persona_mapping": false, "v2.list_aws_cloud_auth_persona_mappings": false, "v2.activate_content_pack": false, - "v2.attach_service_now_ticket": false, "v2.batch_get_security_monitoring_dataset_dependencies": false, "v2.bulk_create_sample_log_generation_subscriptions": false, "v2.bulk_export_security_monitoring_terraform_resources": false, @@ -347,7 +346,6 @@ def initialize "v2.create_sample_log_generation_subscription": false, "v2.create_security_monitoring_dataset": false, "v2.create_security_monitoring_integration_config": false, - "v2.create_service_now_tickets": false, "v2.create_static_analysis_ast": false, "v2.create_static_analysis_server_analysis": false, "v2.deactivate_content_pack": false, diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index fa5c3c9858ec..5186e858878d 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -254,12 +254,6 @@ def attach_service_now_ticket(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers def attach_service_now_ticket_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.attach_service_now_ticket".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.attach_service_now_ticket") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.attach_service_now_ticket")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_service_now_ticket ...' @@ -2054,12 +2048,6 @@ def create_service_now_tickets(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers def create_service_now_tickets_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_service_now_tickets".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_service_now_tickets") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_service_now_tickets")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_service_now_tickets ...' From 776010bfdba02f24f4b4d44b16e2e5b4e4aa6d0b Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 14:40:19 +0000 Subject: [PATCH 3/3] Regenerate client from commit 72bdfd8 of spec repo (#3491) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d6bc1bc09f74..92c1c1fc720d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18048,7 +18048,8 @@ components: description: "The value of the set action" oneOf: - type: string - - format: int64 + - format: int32 + maximum: 2147483647 type: integer - type: boolean CloudWorkloadSecurityAgentRuleActions: