Skip to content

Commit 4a197f9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e047585 of spec repo
1 parent 9303913 commit 4a197f9

6 files changed

Lines changed: 447 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29582,6 +29582,19 @@ components:
2958229582
type: string
2958329583
x-enum-varnames:
2958429584
- INCIDENT_ATTACHMENTS
29585+
IncidentCondition:
29586+
description: A condition evaluated against incident tags.
29587+
properties:
29588+
tags:
29589+
description: Tags that must match for the condition to pass.
29590+
example:
29591+
- ''
29592+
items:
29593+
type: string
29594+
type: array
29595+
required:
29596+
- tags
29597+
type: object
2958529598
IncidentCreateAttributes:
2958629599
description: The incident's attributes for a create request.
2958729600
properties:
@@ -31416,6 +31429,32 @@ components:
3141631429
user_defined_fields:
3141731430
$ref: '#/components/schemas/RelationshipToIncidentUserDefinedFields'
3141831431
type: object
31432+
IncidentScheduleTrigger:
31433+
description: Trigger a workflow from an Incident Schedule. The workflow must
31434+
be published.
31435+
properties:
31436+
incidentType:
31437+
description: Incident type filter for the schedule.
31438+
type: string
31439+
rrule:
31440+
description: Recurrence rule expression for scheduling.
31441+
example: ''
31442+
type: string
31443+
tagCondition:
31444+
$ref: '#/components/schemas/IncidentCondition'
31445+
required:
31446+
- rrule
31447+
type: object
31448+
IncidentScheduleTriggerWrapper:
31449+
description: Schema for an Incident Schedule-based trigger.
31450+
properties:
31451+
incidentScheduleTrigger:
31452+
$ref: '#/components/schemas/IncidentScheduleTrigger'
31453+
startStepNames:
31454+
$ref: '#/components/schemas/StartStepNames'
31455+
required:
31456+
- incidentScheduleTrigger
31457+
type: object
3141931458
IncidentSearchResponse:
3142031459
description: Response with incidents and facets.
3142131460
properties:
@@ -67073,6 +67112,7 @@ components:
6707367112
- $ref: '#/components/schemas/FormTriggerWrapper'
6707467113
- $ref: '#/components/schemas/GithubWebhookTriggerWrapper'
6707567114
- $ref: '#/components/schemas/IncidentTriggerWrapper'
67115+
- $ref: '#/components/schemas/IncidentScheduleTriggerWrapper'
6707667116
- $ref: '#/components/schemas/MonitorTriggerWrapper'
6707767117
- $ref: '#/components/schemas/NotebookTriggerWrapper'
6707867118
- $ref: '#/components/schemas/OnCallTriggerWrapper'

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,7 @@ def overrides
27592759
"v2.http_token_update" => "HTTPTokenUpdate",
27602760
"v2.idp_metadata_form_data" => "IdPMetadataFormData",
27612761
"v2.incident_attachment_type" => "IncidentAttachmentType",
2762+
"v2.incident_condition" => "IncidentCondition",
27622763
"v2.incident_create_attributes" => "IncidentCreateAttributes",
27632764
"v2.incident_create_data" => "IncidentCreateData",
27642765
"v2.incident_create_relationships" => "IncidentCreateRelationships",
@@ -2864,6 +2865,8 @@ def overrides
28642865
"v2.incident_response_meta" => "IncidentResponseMeta",
28652866
"v2.incident_response_meta_pagination" => "IncidentResponseMetaPagination",
28662867
"v2.incident_response_relationships" => "IncidentResponseRelationships",
2868+
"v2.incident_schedule_trigger" => "IncidentScheduleTrigger",
2869+
"v2.incident_schedule_trigger_wrapper" => "IncidentScheduleTriggerWrapper",
28672870
"v2.incident_search_response" => "IncidentSearchResponse",
28682871
"v2.incident_search_response_attributes" => "IncidentSearchResponseAttributes",
28692872
"v2.incident_search_response_data" => "IncidentSearchResponseData",
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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+
# A condition evaluated against incident tags.
21+
class IncidentCondition
22+
include BaseGenericModel
23+
24+
# Tags that must match for the condition to pass.
25+
attr_reader :tags
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+
:'tags' => :'tags'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'tags' => :'Array<String>'
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::IncidentCondition` 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?(:'tags')
64+
if (value = attributes[:'tags']).is_a?(Array)
65+
self.tags = value
66+
end
67+
end
68+
end
69+
70+
# Check to see if the all the properties in the model are valid
71+
# @return true if the model is valid
72+
# @!visibility private
73+
def valid?
74+
return false if @tags.nil?
75+
true
76+
end
77+
78+
# Custom attribute writer method with validation
79+
# @param tags [Object] Object to be assigned
80+
# @!visibility private
81+
def tags=(tags)
82+
if tags.nil?
83+
fail ArgumentError, 'invalid value for "tags", tags cannot be nil.'
84+
end
85+
@tags = tags
86+
end
87+
88+
# Returns the object in the form of hash, with additionalProperties support.
89+
# @return [Hash] Returns the object in the form of hash
90+
# @!visibility private
91+
def to_hash
92+
hash = {}
93+
self.class.attribute_map.each_pair do |attr, param|
94+
value = self.send(attr)
95+
if value.nil?
96+
is_nullable = self.class.openapi_nullable.include?(attr)
97+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
98+
end
99+
100+
hash[param] = _to_hash(value)
101+
end
102+
self.additional_properties.each_pair do |attr, value|
103+
hash[attr] = value
104+
end
105+
hash
106+
end
107+
108+
# Checks equality by comparing each attribute.
109+
# @param o [Object] Object to be compared
110+
# @!visibility private
111+
def ==(o)
112+
return true if self.equal?(o)
113+
self.class == o.class &&
114+
tags == o.tags &&
115+
additional_properties == o.additional_properties
116+
end
117+
118+
# Calculates hash code according to all attributes.
119+
# @return [Integer] Hash code
120+
# @!visibility private
121+
def hash
122+
[tags, additional_properties].hash
123+
end
124+
end
125+
end
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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 Incident Schedule. The workflow must be published.
21+
class IncidentScheduleTrigger
22+
include BaseGenericModel
23+
24+
# Incident type filter for the schedule.
25+
attr_accessor :incident_type
26+
27+
# Recurrence rule expression for scheduling.
28+
attr_reader :rrule
29+
30+
# A condition evaluated against incident tags.
31+
attr_accessor :tag_condition
32+
33+
attr_accessor :additional_properties
34+
35+
# Attribute mapping from ruby-style variable name to JSON key.
36+
# @!visibility private
37+
def self.attribute_map
38+
{
39+
:'incident_type' => :'incidentType',
40+
:'rrule' => :'rrule',
41+
:'tag_condition' => :'tagCondition'
42+
}
43+
end
44+
45+
# Attribute type mapping.
46+
# @!visibility private
47+
def self.openapi_types
48+
{
49+
:'incident_type' => :'String',
50+
:'rrule' => :'String',
51+
:'tag_condition' => :'IncidentCondition'
52+
}
53+
end
54+
55+
# Initializes the object
56+
# @param attributes [Hash] Model attributes in the form of hash
57+
# @!visibility private
58+
def initialize(attributes = {})
59+
if (!attributes.is_a?(Hash))
60+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentScheduleTrigger` initialize method"
61+
end
62+
63+
self.additional_properties = {}
64+
# check to see if the attribute exists and convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}) { |(k, v), h|
66+
if (!self.class.attribute_map.key?(k.to_sym))
67+
self.additional_properties[k.to_sym] = v
68+
else
69+
h[k.to_sym] = v
70+
end
71+
}
72+
73+
if attributes.key?(:'incident_type')
74+
self.incident_type = attributes[:'incident_type']
75+
end
76+
77+
if attributes.key?(:'rrule')
78+
self.rrule = attributes[:'rrule']
79+
end
80+
81+
if attributes.key?(:'tag_condition')
82+
self.tag_condition = attributes[:'tag_condition']
83+
end
84+
end
85+
86+
# Check to see if the all the properties in the model are valid
87+
# @return true if the model is valid
88+
# @!visibility private
89+
def valid?
90+
return false if @rrule.nil?
91+
true
92+
end
93+
94+
# Custom attribute writer method with validation
95+
# @param rrule [Object] Object to be assigned
96+
# @!visibility private
97+
def rrule=(rrule)
98+
if rrule.nil?
99+
fail ArgumentError, 'invalid value for "rrule", rrule cannot be nil.'
100+
end
101+
@rrule = rrule
102+
end
103+
104+
# Returns the object in the form of hash, with additionalProperties support.
105+
# @return [Hash] Returns the object in the form of hash
106+
# @!visibility private
107+
def to_hash
108+
hash = {}
109+
self.class.attribute_map.each_pair do |attr, param|
110+
value = self.send(attr)
111+
if value.nil?
112+
is_nullable = self.class.openapi_nullable.include?(attr)
113+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
114+
end
115+
116+
hash[param] = _to_hash(value)
117+
end
118+
self.additional_properties.each_pair do |attr, value|
119+
hash[attr] = value
120+
end
121+
hash
122+
end
123+
124+
# Checks equality by comparing each attribute.
125+
# @param o [Object] Object to be compared
126+
# @!visibility private
127+
def ==(o)
128+
return true if self.equal?(o)
129+
self.class == o.class &&
130+
incident_type == o.incident_type &&
131+
rrule == o.rrule &&
132+
tag_condition == o.tag_condition &&
133+
additional_properties == o.additional_properties
134+
end
135+
136+
# Calculates hash code according to all attributes.
137+
# @return [Integer] Hash code
138+
# @!visibility private
139+
def hash
140+
[incident_type, rrule, tag_condition, additional_properties].hash
141+
end
142+
end
143+
end

0 commit comments

Comments
 (0)