Skip to content

Commit 80ee18b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add examples of different types of notification handles (#2161)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent ced8485 commit 80ee18b

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
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-09-13 13:31:54.562583",
8-
"spec_repo_commit": "bee8c3e1"
7+
"regenerated": "2024-09-13 20:35:30.960636",
8+
"spec_repo_commit": "6093038f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-13 13:31:54.580011",
13-
"spec_repo_commit": "bee8c3e1"
12+
"regenerated": "2024-09-13 20:35:30.978308",
13+
"spec_repo_commit": "6093038f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10442,6 +10442,13 @@ components:
1044210442
notification_handles:
1044310443
description: Notification handles that will be notified of the incident
1044410444
at creation.
10445+
example:
10446+
- display_name: Jane Doe
10447+
handle: '@[email protected]'
10448+
- display_name: Slack Channel
10449+
handle: '@slack-channel'
10450+
- display_name: Incident Workflow
10451+
handle: '@workflow-from-incident'
1044510452
items:
1044610453
$ref: '#/components/schemas/IncidentNotificationHandle'
1044710454
type: array
@@ -10728,7 +10735,8 @@ components:
1072810735
example: Jane Doe
1072910736
type: string
1073010737
handle:
10731-
description: The email address used for the notification.
10738+
description: The handle used for the notification. This includes an email
10739+
address, Slack channel, or workflow.
1073210740
example: '@[email protected]'
1073310741
type: string
1073410742
type: object
@@ -10841,6 +10849,13 @@ components:
1084110849
notification_handles:
1084210850
description: Notification handles that will be notified of the incident
1084310851
during update.
10852+
example:
10853+
- display_name: Jane Doe
10854+
handle: '@[email protected]'
10855+
- display_name: Slack Channel
10856+
handle: '@slack-channel'
10857+
- display_name: Incident Workflow
10858+
handle: '@workflow-from-incident'
1084410859
items:
1084510860
$ref: '#/components/schemas/IncidentNotificationHandle'
1084610861
nullable: true
@@ -11808,6 +11823,13 @@ components:
1180811823
notification_handles:
1180911824
description: Notification handles that will be notified of the incident
1181011825
during update.
11826+
example:
11827+
- display_name: Jane Doe
11828+
handle: '@[email protected]'
11829+
- display_name: Slack Channel
11830+
handle: '@slack-channel'
11831+
- display_name: Incident Workflow
11832+
handle: '@workflow-from-incident'
1181111833
items:
1181211834
$ref: '#/components/schemas/IncidentNotificationHandle'
1181311835
type: array

src/datadog_api_client/v2/model/incident_notification_handle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self_, display_name: Union[str, UnsetType] = unset, handle: Union[s
3333
:param display_name: The name of the notified handle.
3434
:type display_name: str, optional
3535
36-
:param handle: The email address used for the notification.
36+
:param handle: The handle used for the notification. This includes an email address, Slack channel, or workflow.
3737
:type handle: str, optional
3838
"""
3939
if display_name is not unset:

tests/v2/features/incidents.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Feature: Incidents
7070
Scenario: Create an incident returns "Bad Request" response
7171
Given operation "CreateIncident" enabled
7272
And new "CreateIncident" request
73-
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
73+
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
7474
When the request is sent
7575
Then the response status is 400 Bad Request
7676

@@ -89,7 +89,7 @@ Feature: Incidents
8989
Scenario: Create an incident returns "Not Found" response
9090
Given operation "CreateIncident" enabled
9191
And new "CreateIncident" request
92-
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
92+
And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
9393
When the request is sent
9494
Then the response status is 404 Not Found
9595

@@ -530,7 +530,7 @@ Feature: Incidents
530530
Given operation "UpdateIncident" enabled
531531
And new "UpdateIncident" request
532532
And request contains "incident_id" parameter from "REPLACE.ME"
533-
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "id": "00000000-0000-0000-4567-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-abcd-0005-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-abcd-0006-0000-000000000000", "type": "incident_integrations"}]}, "postmortem": {"data": {"id": "00000000-0000-abcd-3000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
533+
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "id": "00000000-0000-0000-4567-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-abcd-0005-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-abcd-0006-0000-000000000000", "type": "incident_integrations"}]}, "postmortem": {"data": {"id": "00000000-0000-abcd-3000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
534534
When the request is sent
535535
Then the response status is 400 Bad Request
536536

@@ -539,7 +539,7 @@ Feature: Incidents
539539
Given operation "UpdateIncident" enabled
540540
And new "UpdateIncident" request
541541
And request contains "incident_id" parameter from "REPLACE.ME"
542-
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "id": "00000000-0000-0000-4567-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-abcd-0005-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-abcd-0006-0000-000000000000", "type": "incident_integrations"}]}, "postmortem": {"data": {"id": "00000000-0000-abcd-3000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
542+
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@user@email.com"}, {"display_name": "Slack Channel", "handle": "@slack-channel"}, {"display_name": "Incident Workflow", "handle": "@workflow-from-incident"}], "title": "A test incident title"}, "id": "00000000-0000-0000-4567-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-abcd-0005-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-abcd-0006-0000-000000000000", "type": "incident_integrations"}]}, "postmortem": {"data": {"id": "00000000-0000-abcd-3000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
543543
When the request is sent
544544
Then the response status is 404 Not Found
545545

0 commit comments

Comments
 (0)