diff --git a/.apigentools-info b/.apigentools-info index 5b95ac6f2d1..9770ac8fc11 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-13 13:31:33.088278", - "spec_repo_commit": "bee8c3e1" + "regenerated": "2024-09-13 20:35:28.796889", + "spec_repo_commit": "6093038f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-13 13:31:33.106799", - "spec_repo_commit": "bee8c3e1" + "regenerated": "2024-09-13 20:35:28.815151", + "spec_repo_commit": "6093038f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cf861e314c4..56725cba720 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10442,6 +10442,13 @@ components: notification_handles: description: Notification handles that will be notified of the incident at creation. + example: + - display_name: Jane Doe + handle: '@user@email.com' + - display_name: Slack Channel + handle: '@slack-channel' + - display_name: Incident Workflow + handle: '@workflow-from-incident' items: $ref: '#/components/schemas/IncidentNotificationHandle' type: array @@ -10728,7 +10735,8 @@ components: example: Jane Doe type: string handle: - description: The email address used for the notification. + description: The handle used for the notification. This includes an email + address, Slack channel, or workflow. example: '@test.user@test.com' type: string type: object @@ -10841,6 +10849,13 @@ components: notification_handles: description: Notification handles that will be notified of the incident during update. + example: + - display_name: Jane Doe + handle: '@user@email.com' + - display_name: Slack Channel + handle: '@slack-channel' + - display_name: Incident Workflow + handle: '@workflow-from-incident' items: $ref: '#/components/schemas/IncidentNotificationHandle' nullable: true @@ -11808,6 +11823,13 @@ components: notification_handles: description: Notification handles that will be notified of the incident during update. + example: + - display_name: Jane Doe + handle: '@user@email.com' + - display_name: Slack Channel + handle: '@slack-channel' + - display_name: Incident Workflow + handle: '@workflow-from-incident' items: $ref: '#/components/schemas/IncidentNotificationHandle' type: array diff --git a/api/datadogV2/model_incident_notification_handle.go b/api/datadogV2/model_incident_notification_handle.go index 3cbfbcbc11a..a980401a1aa 100644 --- a/api/datadogV2/model_incident_notification_handle.go +++ b/api/datadogV2/model_incident_notification_handle.go @@ -12,7 +12,7 @@ import ( type IncidentNotificationHandle struct { // The name of the notified handle. DisplayName *string `json:"display_name,omitempty"` - // The email address used for the notification. + // The handle used for the notification. This includes an email address, Slack channel, or workflow. Handle *string `json:"handle,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/tests/scenarios/features/v2/incidents.feature b/tests/scenarios/features/v2/incidents.feature index e14dba55560..c50d4c925d5 100644 --- a/tests/scenarios/features/v2/incidents.feature +++ b/tests/scenarios/features/v2/incidents.feature @@ -70,7 +70,7 @@ Feature: Incidents Scenario: Create an incident returns "Bad Request" response Given operation "CreateIncident" enabled And new "CreateIncident" request - 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"}} + 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"}} When the request is sent Then the response status is 400 Bad Request @@ -89,7 +89,7 @@ Feature: Incidents Scenario: Create an incident returns "Not Found" response Given operation "CreateIncident" enabled And new "CreateIncident" request - 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"}} + 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"}} When the request is sent Then the response status is 404 Not Found @@ -530,7 +530,7 @@ Feature: Incidents Given operation "UpdateIncident" enabled And new "UpdateIncident" request And request contains "incident_id" parameter from "REPLACE.ME" - 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"}} + 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"}} When the request is sent Then the response status is 400 Bad Request @@ -539,7 +539,7 @@ Feature: Incidents Given operation "UpdateIncident" enabled And new "UpdateIncident" request And request contains "incident_id" parameter from "REPLACE.ME" - 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"}} + 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"}} When the request is sent Then the response status is 404 Not Found