Skip to content

Commit 5424003

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c193713 of spec repo
1 parent e40cee5 commit 5424003

13 files changed

Lines changed: 466 additions & 42 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65461,6 +65461,7 @@ components:
6546165461
- $ref: "#/components/schemas/SendSlackMessageAction"
6546265462
- $ref: "#/components/schemas/SendTeamsMessageAction"
6546365463
- $ref: "#/components/schemas/TriggerWorkflowAutomationAction"
65464+
- $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction"
6546465465
RoutingRuleAttributes:
6546565466
description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
6546665467
properties:
@@ -65478,6 +65479,52 @@ components:
6547865479
urgency:
6547965480
$ref: "#/components/schemas/Urgency"
6548065481
type: object
65482+
RoutingRuleEscalationPolicyAction:
65483+
description: "Triggers an escalation policy."
65484+
properties:
65485+
ack_timeout_minutes:
65486+
description: "The number of minutes before an acknowledged page is re-triggered."
65487+
example: 30
65488+
format: int64
65489+
type: integer
65490+
policy_id:
65491+
description: "The ID of the escalation policy to route to."
65492+
example: "00000000-0000-0000-0000-000000000000"
65493+
type: string
65494+
support_hours:
65495+
$ref: "#/components/schemas/RoutingRuleEscalationPolicyActionSupportHours"
65496+
type:
65497+
$ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType"
65498+
urgency:
65499+
$ref: "#/components/schemas/Urgency"
65500+
required:
65501+
- type
65502+
- policy_id
65503+
type: object
65504+
RoutingRuleEscalationPolicyActionSupportHours:
65505+
description: "Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule."
65506+
properties:
65507+
restrictions:
65508+
description: "The list of support hours time windows."
65509+
items:
65510+
$ref: "#/components/schemas/TimeRestriction"
65511+
type: array
65512+
time_zone:
65513+
description: "The time zone in which the support hours are expressed."
65514+
example: ""
65515+
type: string
65516+
required:
65517+
- time_zone
65518+
type: object
65519+
RoutingRuleEscalationPolicyActionType:
65520+
default: escalation_policy
65521+
description: "Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule."
65522+
enum:
65523+
- escalation_policy
65524+
example: escalation_policy
65525+
type: string
65526+
x-enum-varnames:
65527+
- ESCALATION_POLICY
6548165528
RoutingRuleRelationships:
6548265529
description: Specifies relationships for a routing rule, linking to associated policy resources.
6548365530
properties:
@@ -85180,7 +85227,7 @@ components:
8518085227
type: string
8518185228
type: object
8518285229
TimeRestrictions:
85183-
description: Holds time zone information and a list of time restrictions for a routing rule.
85230+
description: Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
8518485231
properties:
8518585232
restrictions:
8518685233
description: Defines the list of time-based restrictions.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-11-27T14:11:49.966Z
1+
2026-05-15T14:39:18.459Z

cassettes/features/v2/on-call/Set-On-Call-team-routing-rules-returns-OK-response.yml

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/v2/on-call/SetOnCallTeamRoutingRules.rb

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
rules: [
1616
DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({
1717
actions: [
18-
DatadogAPIClient::V2::SendSlackMessageAction.new({
19-
channel: "channel",
20-
type: DatadogAPIClient::V2::SendSlackMessageActionType::SEND_SLACK_MESSAGE,
21-
workspace: "workspace",
18+
DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({
19+
type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY,
20+
policy_id: ESCALATION_POLICY_DATA_ID,
21+
urgency: DatadogAPIClient::V2::Urgency::LOW,
2222
}),
2323
],
24-
query: "tags.service:test",
24+
query: "tags.service:time_restrictions",
2525
time_restriction: DatadogAPIClient::V2::TimeRestrictions.new({
2626
time_zone: "Europe/Paris",
2727
restrictions: [
@@ -40,11 +40,49 @@
4040
],
4141
}),
4242
}),
43+
DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({
44+
actions: [
45+
DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({
46+
type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY,
47+
policy_id: ESCALATION_POLICY_DATA_ID,
48+
urgency: DatadogAPIClient::V2::Urgency::LOW,
49+
ack_timeout_minutes: 30,
50+
support_hours: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionSupportHours.new({
51+
time_zone: "Europe/Paris",
52+
restrictions: [
53+
DatadogAPIClient::V2::TimeRestriction.new({
54+
end_day: DatadogAPIClient::V2::Weekday::WEDNESDAY,
55+
end_time: "17:00:00",
56+
start_day: DatadogAPIClient::V2::Weekday::WEDNESDAY,
57+
start_time: "09:00:00",
58+
}),
59+
DatadogAPIClient::V2::TimeRestriction.new({
60+
end_day: DatadogAPIClient::V2::Weekday::THURSDAY,
61+
end_time: "17:00:00",
62+
start_day: DatadogAPIClient::V2::Weekday::THURSDAY,
63+
start_time: "09:00:00",
64+
}),
65+
],
66+
}),
67+
}),
68+
],
69+
query: "tags.service:support_hours_and_acknowledgment_timeout",
70+
}),
4371
DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({
4472
policy_id: ESCALATION_POLICY_DATA_ID,
45-
query: "",
73+
query: "tags.service:legacy_policy_definition",
4674
urgency: DatadogAPIClient::V2::Urgency::LOW,
4775
}),
76+
DatadogAPIClient::V2::TeamRoutingRulesRequestRule.new({
77+
actions: [
78+
DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction.new({
79+
type: DatadogAPIClient::V2::RoutingRuleEscalationPolicyActionType::ESCALATION_POLICY,
80+
policy_id: ESCALATION_POLICY_DATA_ID,
81+
urgency: DatadogAPIClient::V2::Urgency::LOW,
82+
}),
83+
],
84+
query: "",
85+
}),
4886
],
4987
}),
5088
id: DD_TEAM_DATA_ID,

features/v2/on-call.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Feature: On-Call
401401
And there is a valid "schedule" in the system
402402
And there is a valid "escalation_policy" in the system
403403
And request contains "team_id" parameter from "dd_team.data.id"
404-
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"}}
404+
And body with value {"data": {"attributes": {"rules": [{"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": "tags.service:time_restrictions", "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": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low", "ack_timeout_minutes": 30, "support_hours": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "wednesday", "end_time": "17:00:00", "start_day": "wednesday", "start_time": "09:00:00"}, {"end_day": "thursday", "end_time": "17:00:00", "start_day": "thursday", "start_time": "09:00:00"}]}}], "query": "tags.service:support_hours_and_acknowledgment_timeout"}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "tags.service:legacy_policy_definition", "urgency": "low"}, {"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": ""}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}}
405405
And request contains "include" parameter with value "rules"
406406
When the request is sent
407407
Then the response status is 200 OK

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5157,6 +5157,9 @@ def overrides
51575157
"v2.routing_rule" => "RoutingRule",
51585158
"v2.routing_rule_action" => "RoutingRuleAction",
51595159
"v2.routing_rule_attributes" => "RoutingRuleAttributes",
5160+
"v2.routing_rule_escalation_policy_action" => "RoutingRuleEscalationPolicyAction",
5161+
"v2.routing_rule_escalation_policy_action_support_hours" => "RoutingRuleEscalationPolicyActionSupportHours",
5162+
"v2.routing_rule_escalation_policy_action_type" => "RoutingRuleEscalationPolicyActionType",
51605163
"v2.routing_rule_relationships" => "RoutingRuleRelationships",
51615164
"v2.routing_rule_relationships_policy" => "RoutingRuleRelationshipsPolicy",
51625165
"v2.routing_rule_relationships_policy_data" => "RoutingRuleRelationshipsPolicyData",

lib/datadog_api_client/v2/models/routing_rule_action.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def openapi_one_of
2828
[
2929
:'SendSlackMessageAction',
3030
:'SendTeamsMessageAction',
31-
:'TriggerWorkflowAutomationAction'
31+
:'TriggerWorkflowAutomationAction',
32+
:'RoutingRuleEscalationPolicyAction'
3233
]
3334
end
3435
# Builds the object

lib/datadog_api_client/v2/models/routing_rule_attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class RoutingRuleAttributes
2727
# Defines the query or condition that triggers this routing rule.
2828
attr_accessor :query
2929

30-
# Holds time zone information and a list of time restrictions for a routing rule.
30+
# Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
3131
attr_accessor :time_restriction
3232

3333
# Specifies the level of urgency for a routing rule (low, high, or dynamic).
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Triggers an escalation policy.
21+
class RoutingRuleEscalationPolicyAction
22+
include BaseGenericModel
23+
24+
# The number of minutes before an acknowledged page is re-triggered.
25+
attr_accessor :ack_timeout_minutes
26+
27+
# The ID of the escalation policy to route to.
28+
attr_reader :policy_id
29+
30+
# Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule.
31+
attr_accessor :support_hours
32+
33+
# Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule.
34+
attr_reader :type
35+
36+
# Specifies the level of urgency for a routing rule (low, high, or dynamic).
37+
attr_accessor :urgency
38+
39+
attr_accessor :additional_properties
40+
41+
# Attribute mapping from ruby-style variable name to JSON key.
42+
# @!visibility private
43+
def self.attribute_map
44+
{
45+
:'ack_timeout_minutes' => :'ack_timeout_minutes',
46+
:'policy_id' => :'policy_id',
47+
:'support_hours' => :'support_hours',
48+
:'type' => :'type',
49+
:'urgency' => :'urgency'
50+
}
51+
end
52+
53+
# Attribute type mapping.
54+
# @!visibility private
55+
def self.openapi_types
56+
{
57+
:'ack_timeout_minutes' => :'Integer',
58+
:'policy_id' => :'String',
59+
:'support_hours' => :'RoutingRuleEscalationPolicyActionSupportHours',
60+
:'type' => :'RoutingRuleEscalationPolicyActionType',
61+
:'urgency' => :'Urgency'
62+
}
63+
end
64+
65+
# Initializes the object
66+
# @param attributes [Hash] Model attributes in the form of hash
67+
# @!visibility private
68+
def initialize(attributes = {})
69+
if (!attributes.is_a?(Hash))
70+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RoutingRuleEscalationPolicyAction` initialize method"
71+
end
72+
73+
self.additional_properties = {}
74+
# check to see if the attribute exists and convert string to symbol for hash key
75+
attributes = attributes.each_with_object({}) { |(k, v), h|
76+
if (!self.class.attribute_map.key?(k.to_sym))
77+
self.additional_properties[k.to_sym] = v
78+
else
79+
h[k.to_sym] = v
80+
end
81+
}
82+
83+
if attributes.key?(:'ack_timeout_minutes')
84+
self.ack_timeout_minutes = attributes[:'ack_timeout_minutes']
85+
end
86+
87+
if attributes.key?(:'policy_id')
88+
self.policy_id = attributes[:'policy_id']
89+
end
90+
91+
if attributes.key?(:'support_hours')
92+
self.support_hours = attributes[:'support_hours']
93+
end
94+
95+
if attributes.key?(:'type')
96+
self.type = attributes[:'type']
97+
end
98+
99+
if attributes.key?(:'urgency')
100+
self.urgency = attributes[:'urgency']
101+
end
102+
end
103+
104+
# Check to see if the all the properties in the model are valid
105+
# @return true if the model is valid
106+
# @!visibility private
107+
def valid?
108+
return false if @policy_id.nil?
109+
return false if @type.nil?
110+
true
111+
end
112+
113+
# Custom attribute writer method with validation
114+
# @param policy_id [Object] Object to be assigned
115+
# @!visibility private
116+
def policy_id=(policy_id)
117+
if policy_id.nil?
118+
fail ArgumentError, 'invalid value for "policy_id", policy_id cannot be nil.'
119+
end
120+
@policy_id = policy_id
121+
end
122+
123+
# Custom attribute writer method with validation
124+
# @param type [Object] Object to be assigned
125+
# @!visibility private
126+
def type=(type)
127+
if type.nil?
128+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
129+
end
130+
@type = type
131+
end
132+
133+
# Returns the object in the form of hash, with additionalProperties support.
134+
# @return [Hash] Returns the object in the form of hash
135+
# @!visibility private
136+
def to_hash
137+
hash = {}
138+
self.class.attribute_map.each_pair do |attr, param|
139+
value = self.send(attr)
140+
if value.nil?
141+
is_nullable = self.class.openapi_nullable.include?(attr)
142+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
143+
end
144+
145+
hash[param] = _to_hash(value)
146+
end
147+
self.additional_properties.each_pair do |attr, value|
148+
hash[attr] = value
149+
end
150+
hash
151+
end
152+
153+
# Checks equality by comparing each attribute.
154+
# @param o [Object] Object to be compared
155+
# @!visibility private
156+
def ==(o)
157+
return true if self.equal?(o)
158+
self.class == o.class &&
159+
ack_timeout_minutes == o.ack_timeout_minutes &&
160+
policy_id == o.policy_id &&
161+
support_hours == o.support_hours &&
162+
type == o.type &&
163+
urgency == o.urgency &&
164+
additional_properties == o.additional_properties
165+
end
166+
167+
# Calculates hash code according to all attributes.
168+
# @return [Integer] Hash code
169+
# @!visibility private
170+
def hash
171+
[ack_timeout_minutes, policy_id, support_hours, type, urgency, additional_properties].hash
172+
end
173+
end
174+
end

0 commit comments

Comments
 (0)