Skip to content

Commit 7713313

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Datastore trigger to Workflow Automation public API (#2686)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent cbbb19a commit 7713313

File tree

5 files changed

+261
-0
lines changed

5 files changed

+261
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14697,6 +14697,23 @@ components:
1469714697
x-enum-varnames:
1469814698
- NONE
1469914699
- UUID
14700+
DatastoreTrigger:
14701+
description: Trigger a workflow from a Datastore. For automatic triggering a
14702+
handle must be configured and the workflow must be published.
14703+
properties:
14704+
rateLimit:
14705+
$ref: '#/components/schemas/TriggerRateLimit'
14706+
type: object
14707+
DatastoreTriggerWrapper:
14708+
description: Schema for a Datastore-based trigger.
14709+
properties:
14710+
datastoreTrigger:
14711+
$ref: '#/components/schemas/DatastoreTrigger'
14712+
startStepNames:
14713+
$ref: '#/components/schemas/StartStepNames'
14714+
required:
14715+
- datastoreTrigger
14716+
type: object
1470014717
Date:
1470114718
description: Date as Unix timestamp in milliseconds.
1470214719
example: 1722439510282
@@ -47710,6 +47727,7 @@ components:
4771047727
- $ref: '#/components/schemas/CaseTriggerWrapper'
4771147728
- $ref: '#/components/schemas/ChangeEventTriggerWrapper'
4771247729
- $ref: '#/components/schemas/DatabaseMonitoringTriggerWrapper'
47730+
- $ref: '#/components/schemas/DatastoreTriggerWrapper'
4771347731
- $ref: '#/components/schemas/DashboardTriggerWrapper'
4771447732
- $ref: '#/components/schemas/GithubWebhookTriggerWrapper'
4771547733
- $ref: '#/components/schemas/IncidentTriggerWrapper'

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,8 @@ def overrides
17531753
"v2.datastore_item_conflict_mode" => "DatastoreItemConflictMode",
17541754
"v2.datastore_items_data_type" => "DatastoreItemsDataType",
17551755
"v2.datastore_primary_key_generation_strategy" => "DatastorePrimaryKeyGenerationStrategy",
1756+
"v2.datastore_trigger" => "DatastoreTrigger",
1757+
"v2.datastore_trigger_wrapper" => "DatastoreTriggerWrapper",
17561758
"v2.data_transform" => "DataTransform",
17571759
"v2.data_transform_properties" => "DataTransformProperties",
17581760
"v2.data_transform_type" => "DataTransformType",
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+
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 a Datastore. For automatic triggering a handle must be configured and the workflow must be published.
21+
class DatastoreTrigger
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::DatastoreTrigger` 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+
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 a Datastore-based trigger.
21+
class DatastoreTriggerWrapper
22+
include BaseGenericModel
23+
24+
# Trigger a workflow from a Datastore. For automatic triggering a handle must be configured and the workflow must be published.
25+
attr_reader :datastore_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+
:'datastore_trigger' => :'datastoreTrigger',
37+
:'start_step_names' => :'startStepNames'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'datastore_trigger' => :'DatastoreTrigger',
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::DatastoreTriggerWrapper` 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?(:'datastore_trigger')
69+
self.datastore_trigger = attributes[:'datastore_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 @datastore_trigger.nil?
84+
true
85+
end
86+
87+
# Custom attribute writer method with validation
88+
# @param datastore_trigger [Object] Object to be assigned
89+
# @!visibility private
90+
def datastore_trigger=(datastore_trigger)
91+
if datastore_trigger.nil?
92+
fail ArgumentError, 'invalid value for "datastore_trigger", datastore_trigger cannot be nil.'
93+
end
94+
@datastore_trigger = datastore_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+
datastore_trigger == o.datastore_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+
[datastore_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
@@ -31,6 +31,7 @@ def openapi_one_of
3131
:'CaseTriggerWrapper',
3232
:'ChangeEventTriggerWrapper',
3333
:'DatabaseMonitoringTriggerWrapper',
34+
:'DatastoreTriggerWrapper',
3435
:'DashboardTriggerWrapper',
3536
:'GithubWebhookTriggerWrapper',
3637
:'IncidentTriggerWrapper',

0 commit comments

Comments
 (0)