From 2348d8504ab6b6bdca312b90faa30148c75e91c2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 11 May 2026 12:13:50 +0000 Subject: [PATCH] Regenerate client from commit e2d2f14 of spec repo --- .generator/schemas/v2/openapi.yaml | 32 ++++ .../v2/on-call/SetOnCallTeamRoutingRules.rb | 31 +++- features/v2/on-call.feature | 2 +- lib/datadog_api_client/inflector.rb | 2 + .../v2/models/routing_rule_action.rb | 3 +- .../routing_rule_escalation_policy_action.rb | 174 ++++++++++++++++++ ...ting_rule_escalation_policy_action_type.rb | 26 +++ 7 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb create mode 100644 lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ad1ff827d8dc..c37e63639177 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -59535,6 +59535,7 @@ components: - $ref: "#/components/schemas/SendSlackMessageAction" - $ref: "#/components/schemas/SendTeamsMessageAction" - $ref: "#/components/schemas/TriggerWorkflowAutomationAction" + - $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction" RoutingRuleAttributes: description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency. properties: @@ -59552,6 +59553,37 @@ components: urgency: $ref: "#/components/schemas/Urgency" type: object + RoutingRuleEscalationPolicyAction: + description: "Routes the page to an escalation policy, optionally restricted to business hours." + properties: + ack_timeout_minutes: + description: "The number of minutes before an unacknowledged page is re-escalated." + example: 10 + format: int64 + type: integer + policy_id: + description: "The ID of the escalation policy to route to." + example: "00000000-0000-0000-0000-000000000000" + type: string + support_hours: + $ref: "#/components/schemas/TimeRestrictions" + type: + $ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType" + urgency: + $ref: "#/components/schemas/Urgency" + required: + - type + - policy_id + type: object + RoutingRuleEscalationPolicyActionType: + default: escalation_policy + description: "Indicates that the action routes to an escalation policy." + enum: + - escalation_policy + example: escalation_policy + type: string + x-enum-varnames: + - ESCALATION_POLICY RoutingRuleRelationships: description: Specifies relationships for a routing rule, linking to associated policy resources. properties: diff --git a/examples/v2/on-call/SetOnCallTeamRoutingRules.rb b/examples/v2/on-call/SetOnCallTeamRoutingRules.rb index f293be78238d..31cc9c20e8d0 100644 --- a/examples/v2/on-call/SetOnCallTeamRoutingRules.rb +++ b/examples/v2/on-call/SetOnCallTeamRoutingRules.rb @@ -41,9 +41,36 @@ }), }), DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ - policy_id: ESCALATION_POLICY_DATA_ID, + actions: [ + DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({ + ack_timeout_minutes: 10, + policy_id: ESCALATION_POLICY_DATA_ID, + support_hours: DatadogAPIClient::V2::TimeRestrictions.new({ + time_zone: "Europe/Paris", + restrictions: [ + DatadogAPIClient::V2::TimeRestriction.new({ + end_day: DatadogAPIClient::V2::Weekday::FRIDAY, + end_time: "17:00:00", + start_day: DatadogAPIClient::V2::Weekday::MONDAY, + start_time: "09:00:00", + }), + ], + }), + type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY, + urgency: DatadogAPIClient::V2::Urgency::LOW, + }), + ], + query: "tags.service:test", + }), + DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({ + actions: [ + DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({ + policy_id: ESCALATION_POLICY_DATA_ID, + type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY, + urgency: DatadogAPIClient::V2::Urgency::LOW, + }), + ], query: "", - urgency: DatadogAPIClient::V2::Urgency::LOW, }), ], }), diff --git a/features/v2/on-call.feature b/features/v2/on-call.feature index 0f4b2a0e3402..421f4c051e74 100644 --- a/features/v2/on-call.feature +++ b/features/v2/on-call.feature @@ -401,7 +401,7 @@ Feature: On-Call And there is a valid "schedule" in the system And there is a valid "escalation_policy" in the system And request contains "team_id" parameter from "dd_team.data.id" - And body with value {"data": {"attributes": {"rules": [{"actions": [{"channel": "channel", "type": "send_slack_message", "workspace": "workspace"}], "query": "tags.service:test", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "", "urgency": "low"}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}} + And body with value {"data": {"attributes": {"rules": [{"actions": [{"channel": "channel", "type": "send_slack_message", "workspace": "workspace"}], "query": "tags.service:test", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"actions": [{"ack_timeout_minutes": 10, "policy_id": "{{ escalation_policy.data.id }}", "support_hours": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "friday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}]}, "type": "escalation_policy", "urgency": "low"}], "query": "tags.service:test"}, {"actions": [{"policy_id": "{{ escalation_policy.data.id }}", "type": "escalation_policy", "urgency": "low"}], "query": ""}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}} And request contains "include" parameter with value "rules" When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ef9502e0145f..85a6a3027a3d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4820,6 +4820,8 @@ def overrides "v2.routing_rule" => "RoutingRule", "v2.routing_rule_action" => "RoutingRuleAction", "v2.routing_rule_attributes" => "RoutingRuleAttributes", + "v2.routing_rule_escalation_policy_action" => "RoutingRuleEscalationPolicyAction", + "v2.routing_rule_escalation_policy_action_type" => "RoutingRuleEscalationPolicyActionType", "v2.routing_rule_relationships" => "RoutingRuleRelationships", "v2.routing_rule_relationships_policy" => "RoutingRuleRelationshipsPolicy", "v2.routing_rule_relationships_policy_data" => "RoutingRuleRelationshipsPolicyData", diff --git a/lib/datadog_api_client/v2/models/routing_rule_action.rb b/lib/datadog_api_client/v2/models/routing_rule_action.rb index cd4d3b04d05d..3ae2b1f7a81f 100644 --- a/lib/datadog_api_client/v2/models/routing_rule_action.rb +++ b/lib/datadog_api_client/v2/models/routing_rule_action.rb @@ -28,7 +28,8 @@ def openapi_one_of [ :'SendSlackMessageAction', :'SendTeamsMessageAction', - :'TriggerWorkflowAutomationAction' + :'TriggerWorkflowAutomationAction', + :'RoutingRuleEscalationPolicyAction' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb new file mode 100644 index 000000000000..52c33510f364 --- /dev/null +++ b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action.rb @@ -0,0 +1,174 @@ +=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 + # Routes the page to an escalation policy, optionally restricted to business hours. + class RoutingRuleEscalationPolicyAction + include BaseGenericModel + + # The number of minutes before an unacknowledged page is re-escalated. + attr_accessor :ack_timeout_minutes + + # The ID of the escalation policy to route to. + attr_reader :policy_id + + # Holds time zone information and a list of time restrictions for a routing rule. + attr_accessor :support_hours + + # Indicates that the action routes to an escalation policy. + attr_reader :type + + # Specifies the level of urgency for a routing rule (low, high, or dynamic). + attr_accessor :urgency + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ack_timeout_minutes' => :'ack_timeout_minutes', + :'policy_id' => :'policy_id', + :'support_hours' => :'support_hours', + :'type' => :'type', + :'urgency' => :'urgency' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ack_timeout_minutes' => :'Integer', + :'policy_id' => :'String', + :'support_hours' => :'TimeRestrictions', + :'type' => :'RoutingRuleEscalationPolicyActionType', + :'urgency' => :'Urgency' + } + 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::RoutingRuleEscalationPolicyAction` 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?(:'ack_timeout_minutes') + self.ack_timeout_minutes = attributes[:'ack_timeout_minutes'] + end + + if attributes.key?(:'policy_id') + self.policy_id = attributes[:'policy_id'] + end + + if attributes.key?(:'support_hours') + self.support_hours = attributes[:'support_hours'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'urgency') + self.urgency = attributes[:'urgency'] + 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 @policy_id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param policy_id [Object] Object to be assigned + # @!visibility private + def policy_id=(policy_id) + if policy_id.nil? + fail ArgumentError, 'invalid value for "policy_id", policy_id cannot be nil.' + end + @policy_id = policy_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 && + ack_timeout_minutes == o.ack_timeout_minutes && + policy_id == o.policy_id && + support_hours == o.support_hours && + type == o.type && + urgency == o.urgency && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ack_timeout_minutes, policy_id, support_hours, type, urgency, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_type.rb new file mode 100644 index 000000000000..1b34864976c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/routing_rule_escalation_policy_action_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 + # Indicates that the action routes to an escalation policy. + class RoutingRuleEscalationPolicyActionType + include BaseEnumModel + + ESCALATION_POLICY = "escalation_policy".freeze + end +end