Skip to content

Commit 53085a4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add On-Call Trigger to Workflow Automation Public API (#2943)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 287a8fd commit 53085a4

5 files changed

Lines changed: 262 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42479,6 +42479,24 @@ components:
4247942479
- type
4248042480
- method
4248142481
type: object
42482+
OnCallTrigger:
42483+
description: Trigger a workflow from an On-Call Page or On-Call Handover. For
42484+
automatic triggering a handle must be configured and the workflow must be
42485+
published.
42486+
properties:
42487+
rateLimit:
42488+
$ref: '#/components/schemas/TriggerRateLimit'
42489+
type: object
42490+
OnCallTriggerWrapper:
42491+
description: Schema for an On-Call-based trigger.
42492+
properties:
42493+
onCallTrigger:
42494+
$ref: '#/components/schemas/OnCallTrigger'
42495+
startStepNames:
42496+
$ref: '#/components/schemas/StartStepNames'
42497+
required:
42498+
- onCallTrigger
42499+
type: object
4248242500
OnDemandConcurrencyCap:
4248342501
description: On-demand concurrency cap.
4248442502
properties:
@@ -62075,6 +62093,7 @@ components:
6207562093
- $ref: '#/components/schemas/IncidentTriggerWrapper'
6207662094
- $ref: '#/components/schemas/MonitorTriggerWrapper'
6207762095
- $ref: '#/components/schemas/NotebookTriggerWrapper'
62096+
- $ref: '#/components/schemas/OnCallTriggerWrapper'
6207862097
- $ref: '#/components/schemas/ScheduleTriggerWrapper'
6207962098
- $ref: '#/components/schemas/SecurityTriggerWrapper'
6208062099
- $ref: '#/components/schemas/SelfServiceTriggerWrapper'

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3578,6 +3578,8 @@ def overrides
35783578
"v2.on_call_page_target_type" => "OnCallPageTargetType",
35793579
"v2.on_call_phone_notification_rule_method" => "OnCallPhoneNotificationRuleMethod",
35803580
"v2.on_call_phone_notification_rule_settings" => "OnCallPhoneNotificationRuleSettings",
3581+
"v2.on_call_trigger" => "OnCallTrigger",
3582+
"v2.on_call_trigger_wrapper" => "OnCallTriggerWrapper",
35813583
"v2.on_demand_concurrency_cap" => "OnDemandConcurrencyCap",
35823584
"v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes",
35833585
"v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse",
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
# Trigger a workflow from an On-Call Page or On-Call Handover. For automatic triggering a handle must be configured and the workflow must be published.
21+
class OnCallTrigger
22+
include BaseGenericModel
23+
24+
# Defines a rate limit for a trigger.
25+
attr_accessor :rate_limit
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'rate_limit' => :'rateLimit'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'rate_limit' => :'TriggerRateLimit'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OnCallTrigger` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'rate_limit')
64+
self.rate_limit = attributes[:'rate_limit']
65+
end
66+
end
67+
68+
# Returns the object in the form of hash, with additionalProperties support.
69+
# @return [Hash] Returns the object in the form of hash
70+
# @!visibility private
71+
def to_hash
72+
hash = {}
73+
self.class.attribute_map.each_pair do |attr, param|
74+
value = self.send(attr)
75+
if value.nil?
76+
is_nullable = self.class.openapi_nullable.include?(attr)
77+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
78+
end
79+
80+
hash[param] = _to_hash(value)
81+
end
82+
self.additional_properties.each_pair do |attr, value|
83+
hash[attr] = value
84+
end
85+
hash
86+
end
87+
88+
# Checks equality by comparing each attribute.
89+
# @param o [Object] Object to be compared
90+
# @!visibility private
91+
def ==(o)
92+
return true if self.equal?(o)
93+
self.class == o.class &&
94+
rate_limit == o.rate_limit &&
95+
additional_properties == o.additional_properties
96+
end
97+
98+
# Calculates hash code according to all attributes.
99+
# @return [Integer] Hash code
100+
# @!visibility private
101+
def hash
102+
[rate_limit, additional_properties].hash
103+
end
104+
end
105+
end
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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+
# Schema for an On-Call-based trigger.
21+
class OnCallTriggerWrapper
22+
include BaseGenericModel
23+
24+
# Trigger a workflow from an On-Call Page or On-Call Handover. For automatic triggering a handle must be configured and the workflow must be published.
25+
attr_reader :on_call_trigger
26+
27+
# A list of steps that run first after a trigger fires.
28+
attr_accessor :start_step_names
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+
:'on_call_trigger' => :'onCallTrigger',
37+
:'start_step_names' => :'startStepNames'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'on_call_trigger' => :'OnCallTrigger',
46+
:'start_step_names' => :'Array<String>'
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::OnCallTriggerWrapper` 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?(:'on_call_trigger')
69+
self.on_call_trigger = attributes[:'on_call_trigger']
70+
end
71+
72+
if attributes.key?(:'start_step_names')
73+
if (value = attributes[:'start_step_names']).is_a?(Array)
74+
self.start_step_names = value
75+
end
76+
end
77+
end
78+
79+
# Check to see if the all the properties in the model are valid
80+
# @return true if the model is valid
81+
# @!visibility private
82+
def valid?
83+
return false if @on_call_trigger.nil?
84+
true
85+
end
86+
87+
# Custom attribute writer method with validation
88+
# @param on_call_trigger [Object] Object to be assigned
89+
# @!visibility private
90+
def on_call_trigger=(on_call_trigger)
91+
if on_call_trigger.nil?
92+
fail ArgumentError, 'invalid value for "on_call_trigger", on_call_trigger cannot be nil.'
93+
end
94+
@on_call_trigger = on_call_trigger
95+
end
96+
97+
# Returns the object in the form of hash, with additionalProperties support.
98+
# @return [Hash] Returns the object in the form of hash
99+
# @!visibility private
100+
def to_hash
101+
hash = {}
102+
self.class.attribute_map.each_pair do |attr, param|
103+
value = self.send(attr)
104+
if value.nil?
105+
is_nullable = self.class.openapi_nullable.include?(attr)
106+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
107+
end
108+
109+
hash[param] = _to_hash(value)
110+
end
111+
self.additional_properties.each_pair do |attr, value|
112+
hash[attr] = value
113+
end
114+
hash
115+
end
116+
117+
# Checks equality by comparing each attribute.
118+
# @param o [Object] Object to be compared
119+
# @!visibility private
120+
def ==(o)
121+
return true if self.equal?(o)
122+
self.class == o.class &&
123+
on_call_trigger == o.on_call_trigger &&
124+
start_step_names == o.start_step_names &&
125+
additional_properties == o.additional_properties
126+
end
127+
128+
# Calculates hash code according to all attributes.
129+
# @return [Integer] Hash code
130+
# @!visibility private
131+
def hash
132+
[on_call_trigger, start_step_names, additional_properties].hash
133+
end
134+
end
135+
end

lib/datadog_api_client/v2/models/trigger.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def openapi_one_of
3737
:'IncidentTriggerWrapper',
3838
:'MonitorTriggerWrapper',
3939
:'NotebookTriggerWrapper',
40+
:'OnCallTriggerWrapper',
4041
:'ScheduleTriggerWrapper',
4142
:'SecurityTriggerWrapper',
4243
:'SelfServiceTriggerWrapper',

0 commit comments

Comments
 (0)