Skip to content

Commit 3310c36

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add workflow automation to oncall team rules (#3283)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 80f2b84 commit 3310c36

5 files changed

Lines changed: 197 additions & 1 deletion

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59666,6 +59666,7 @@ components:
5966659666
oneOf:
5966759667
- $ref: "#/components/schemas/SendSlackMessageAction"
5966859668
- $ref: "#/components/schemas/SendTeamsMessageAction"
59669+
- $ref: "#/components/schemas/TriggerWorkflowAutomationAction"
5966959670
RoutingRuleAttributes:
5967059671
description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
5967159672
properties:
@@ -79462,6 +79463,28 @@ components:
7946279463
type: string
7946379464
x-enum-varnames:
7946479465
- MONITOR_ALERT_TRIGGER
79466+
TriggerWorkflowAutomationAction:
79467+
description: "Triggers a Workflow Automation."
79468+
properties:
79469+
handle:
79470+
description: "The handle of the Workflow Automation to trigger."
79471+
example: my-workflow-handle
79472+
type: string
79473+
type:
79474+
$ref: "#/components/schemas/TriggerWorkflowAutomationActionType"
79475+
required:
79476+
- type
79477+
- handle
79478+
type: object
79479+
TriggerWorkflowAutomationActionType:
79480+
default: workflow
79481+
description: "Indicates that the action triggers a Workflow Automation."
79482+
enum:
79483+
- workflow
79484+
example: workflow
79485+
type: string
79486+
x-enum-varnames:
79487+
- TRIGGER_WORKFLOW_AUTOMATION
7946579488
UCConfigPair:
7946679489
description: The definition of `UCConfigPair` object.
7946779490
example:

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6083,6 +6083,8 @@ def overrides
60836083
"v2.trigger_rate_limit" => "TriggerRateLimit",
60846084
"v2.trigger_source" => "TriggerSource",
60856085
"v2.trigger_type" => "TriggerType",
6086+
"v2.trigger_workflow_automation_action" => "TriggerWorkflowAutomationAction",
6087+
"v2.trigger_workflow_automation_action_type" => "TriggerWorkflowAutomationActionType",
60866088
"v2.uc_config_pair" => "UCConfigPair",
60876089
"v2.uc_config_pair_data" => "UCConfigPairData",
60886090
"v2.uc_config_pair_data_attributes" => "UCConfigPairDataAttributes",

lib/datadog_api_client/v2/models/routing_rule_action.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class << self
2727
def openapi_one_of
2828
[
2929
:'SendSlackMessageAction',
30-
:'SendTeamsMessageAction'
30+
:'SendTeamsMessageAction',
31+
:'TriggerWorkflowAutomationAction'
3132
]
3233
end
3334
# Builds the object
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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 a Workflow Automation.
21+
class TriggerWorkflowAutomationAction
22+
include BaseGenericModel
23+
24+
# The handle of the Workflow Automation to trigger.
25+
attr_reader :handle
26+
27+
# Indicates that the action triggers a Workflow Automation.
28+
attr_reader :type
29+
30+
attr_accessor :additional_properties
31+
32+
# Attribute mapping from ruby-style variable name to JSON key.
33+
# @!visibility private
34+
def self.attribute_map
35+
{
36+
:'handle' => :'handle',
37+
:'type' => :'type'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'handle' => :'String',
46+
:'type' => :'TriggerWorkflowAutomationActionType'
47+
}
48+
end
49+
50+
# Initializes the object
51+
# @param attributes [Hash] Model attributes in the form of hash
52+
# @!visibility private
53+
def initialize(attributes = {})
54+
if (!attributes.is_a?(Hash))
55+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TriggerWorkflowAutomationAction` initialize method"
56+
end
57+
58+
self.additional_properties = {}
59+
# check to see if the attribute exists and convert string to symbol for hash key
60+
attributes = attributes.each_with_object({}) { |(k, v), h|
61+
if (!self.class.attribute_map.key?(k.to_sym))
62+
self.additional_properties[k.to_sym] = v
63+
else
64+
h[k.to_sym] = v
65+
end
66+
}
67+
68+
if attributes.key?(:'handle')
69+
self.handle = attributes[:'handle']
70+
end
71+
72+
if attributes.key?(:'type')
73+
self.type = attributes[:'type']
74+
end
75+
end
76+
77+
# Check to see if the all the properties in the model are valid
78+
# @return true if the model is valid
79+
# @!visibility private
80+
def valid?
81+
return false if @handle.nil?
82+
return false if @type.nil?
83+
true
84+
end
85+
86+
# Custom attribute writer method with validation
87+
# @param handle [Object] Object to be assigned
88+
# @!visibility private
89+
def handle=(handle)
90+
if handle.nil?
91+
fail ArgumentError, 'invalid value for "handle", handle cannot be nil.'
92+
end
93+
@handle = handle
94+
end
95+
96+
# Custom attribute writer method with validation
97+
# @param type [Object] Object to be assigned
98+
# @!visibility private
99+
def type=(type)
100+
if type.nil?
101+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
102+
end
103+
@type = type
104+
end
105+
106+
# Returns the object in the form of hash, with additionalProperties support.
107+
# @return [Hash] Returns the object in the form of hash
108+
# @!visibility private
109+
def to_hash
110+
hash = {}
111+
self.class.attribute_map.each_pair do |attr, param|
112+
value = self.send(attr)
113+
if value.nil?
114+
is_nullable = self.class.openapi_nullable.include?(attr)
115+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
116+
end
117+
118+
hash[param] = _to_hash(value)
119+
end
120+
self.additional_properties.each_pair do |attr, value|
121+
hash[attr] = value
122+
end
123+
hash
124+
end
125+
126+
# Checks equality by comparing each attribute.
127+
# @param o [Object] Object to be compared
128+
# @!visibility private
129+
def ==(o)
130+
return true if self.equal?(o)
131+
self.class == o.class &&
132+
handle == o.handle &&
133+
type == o.type &&
134+
additional_properties == o.additional_properties
135+
end
136+
137+
# Calculates hash code according to all attributes.
138+
# @return [Integer] Hash code
139+
# @!visibility private
140+
def hash
141+
[handle, type, additional_properties].hash
142+
end
143+
end
144+
end
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
# Indicates that the action triggers a Workflow Automation.
21+
class TriggerWorkflowAutomationActionType
22+
include BaseEnumModel
23+
24+
TRIGGER_WORKFLOW_AUTOMATION = "workflow".freeze
25+
end
26+
end

0 commit comments

Comments
 (0)