Skip to content

Commit c96e1c3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4ed44e4c of spec repo
1 parent 2ea4c68 commit c96e1c3

File tree

8 files changed

+29
-66
lines changed

8 files changed

+29
-66
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-06-27 17:06:14.233742",
8-
"spec_repo_commit": "5ebef994"
7+
"regenerated": "2024-06-27 21:40:21.421531",
8+
"spec_repo_commit": "4ed44e4c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-27 17:06:14.251551",
13-
"spec_repo_commit": "5ebef994"
12+
"regenerated": "2024-06-27 21:40:21.439142",
13+
"spec_repo_commit": "4ed44e4c"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6615,8 +6615,6 @@ components:
66156615
priority:
66166616
description: Integer from 1 (high) to 5 (low) indicating alert severity.
66176617
format: int64
6618-
maximum: 5
6619-
minimum: 1
66206618
nullable: true
66216619
type: integer
66226620
query:
@@ -7705,8 +7703,7 @@ components:
77057703
priority:
77067704
description: Integer from 1 (high) to 5 (low) indicating alert severity.
77077705
format: int64
7708-
maximum: 5
7709-
minimum: 1
7706+
nullable: true
77107707
type: integer
77117708
query:
77127709
description: The monitor query.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-01-18T18:37:19.255Z
1+
2024-06-20T19:37:04.361Z

cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml

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

examples/v1/monitors/UpdateMonitor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
body = DatadogAPIClient::V1::MonitorUpdateRequest.new({
1111
name: "My monitor-updated",
12+
priority: nil,
1213
options: DatadogAPIClient::V1::MonitorOptions.new({
1314
evaluation_delay: nil,
1415
new_group_delay: 600,

features/v1/monitors.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Feature: Monitors
157157
Scenario: Edit a monitor returns "Bad Request" response
158158
Given new "UpdateMonitor" request
159159
And request contains "monitor_id" parameter from "REPLACE.ME"
160-
And body with value {"options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
160+
And body with value {"options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
161161
When the request is sent
162162
Then the response status is 400 Bad Request
163163

@@ -174,10 +174,11 @@ Feature: Monitors
174174
Given there is a valid "monitor" in the system
175175
And new "UpdateMonitor" request
176176
And request contains "monitor_id" parameter from "monitor.id"
177-
And body with value {"name": "{{ monitor.name }}-updated", "options": {"evaluation_delay": null, "new_group_delay": 600, "new_host_delay":null, "renotify_interval":null, "thresholds": {"critical":2, "warning": null}, "timeout_h": null}}
177+
And body with value {"name": "{{ monitor.name }}-updated", "priority": null, "options": {"evaluation_delay": null, "new_group_delay": 600, "new_host_delay":null, "renotify_interval":null, "thresholds": {"critical":2, "warning": null}, "timeout_h": null}}
178178
When the request is sent
179179
Then the response status is 200 OK
180180
And the response "name" is equal to "{{ monitor.name }}-updated"
181+
And the response "priority" is equal to null
181182

182183
@generated @skip @team:DataDog/monitor-app
183184
Scenario: Get a monitor's details returns "Bad Request" response

lib/datadog_api_client/v1/models/monitor.rb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Monitor
5555
attr_accessor :overall_state
5656

5757
# Integer from 1 (high) to 5 (low) indicating alert severity.
58-
attr_reader :priority
58+
attr_accessor :priority
5959

6060
# The monitor query.
6161
attr_reader :query
@@ -225,26 +225,11 @@ def initialize(attributes = {})
225225
# @return true if the model is valid
226226
# @!visibility private
227227
def valid?
228-
return false if !@priority.nil? && @priority > 5
229-
return false if !@priority.nil? && @priority < 1
230228
return false if @query.nil?
231229
return false if @type.nil?
232230
true
233231
end
234232

235-
# Custom attribute writer method with validation
236-
# @param priority [Object] Object to be assigned
237-
# @!visibility private
238-
def priority=(priority)
239-
if !priority.nil? && priority > 5
240-
fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.'
241-
end
242-
if !priority.nil? && priority < 1
243-
fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.'
244-
end
245-
@priority = priority
246-
end
247-
248233
# Custom attribute writer method with validation
249234
# @param query [Object] Object to be assigned
250235
# @!visibility private

lib/datadog_api_client/v1/models/monitor_update_request.rb

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class MonitorUpdateRequest
5252
attr_accessor :overall_state
5353

5454
# Integer from 1 (high) to 5 (low) indicating alert severity.
55-
attr_reader :priority
55+
attr_accessor :priority
5656

5757
# The monitor query.
5858
attr_accessor :query
@@ -120,6 +120,7 @@ def self.openapi_types
120120
def self.openapi_nullable
121121
Set.new([
122122
:'deleted',
123+
:'priority',
123124
:'restricted_roles',
124125
])
125126
end
@@ -209,28 +210,6 @@ def initialize(attributes = {})
209210
end
210211
end
211212

212-
# Check to see if the all the properties in the model are valid
213-
# @return true if the model is valid
214-
# @!visibility private
215-
def valid?
216-
return false if !@priority.nil? && @priority > 5
217-
return false if !@priority.nil? && @priority < 1
218-
true
219-
end
220-
221-
# Custom attribute writer method with validation
222-
# @param priority [Object] Object to be assigned
223-
# @!visibility private
224-
def priority=(priority)
225-
if !priority.nil? && priority > 5
226-
fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.'
227-
end
228-
if !priority.nil? && priority < 1
229-
fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.'
230-
end
231-
@priority = priority
232-
end
233-
234213
# Checks equality by comparing each attribute.
235214
# @param o [Object] Object to be compared
236215
# @!visibility private

0 commit comments

Comments
 (0)