Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
812 changes: 811 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-01-28T12:51:16.724Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-01-28T12:51:17.270Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-01-28T12:51:17.621Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/v2/case-management/CreateProject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
body = DatadogAPIClient::V2::ProjectCreateRequest.new({
data: DatadogAPIClient::V2::ProjectCreate.new({
attributes: DatadogAPIClient::V2::ProjectCreateAttributes.new({
enabled_custom_case_types: [],
key: "SEC",
name: "Security Investigation",
}),
Expand Down
26 changes: 26 additions & 0 deletions examples/v2/case-management/CreateProjectNotificationRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Create a notification rule returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::CaseNotificationRuleCreateRequest.new({
data: DatadogAPIClient::V2::CaseNotificationRuleCreate.new({
attributes: DatadogAPIClient::V2::CaseNotificationRuleCreateAttributes.new({
is_enabled: true,
recipients: [
DatadogAPIClient::V2::CaseNotificationRuleRecipient.new({
data: DatadogAPIClient::V2::CaseNotificationRuleRecipientData.new({}),
type: "EMAIL",
}),
],
triggers: [
DatadogAPIClient::V2::CaseNotificationRuleTrigger.new({
data: DatadogAPIClient::V2::CaseNotificationRuleTriggerData.new({}),
type: "CASE_CREATED",
}),
],
}),
type: DatadogAPIClient::V2::CaseNotificationRuleResourceType::NOTIFICATION_RULE,
}),
})
p api_instance.create_project_notification_rule("project_id", body)
5 changes: 5 additions & 0 deletions examples/v2/case-management/DeleteProjectNotificationRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a notification rule returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.delete_project_notification_rule("project_id", "notification_rule_id")
5 changes: 5 additions & 0 deletions examples/v2/case-management/GetProjectNotificationRules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get notification rules returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.get_project_notification_rules("project_id")
14 changes: 14 additions & 0 deletions examples/v2/case-management/UpdateProject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Update a project returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ProjectUpdateRequest.new({
data: DatadogAPIClient::V2::ProjectUpdate.new({
type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
attributes: DatadogAPIClient::V2::ProjectUpdateAttributes.new({
name: "Updated Project Name Example-Case-Management",
}),
}),
})
p api_instance.update_project("d4bbe1af-f36e-42f1-87c1-493ca35c320e", body)
25 changes: 25 additions & 0 deletions examples/v2/case-management/UpdateProjectNotificationRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Update a notification rule returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::CaseNotificationRuleUpdateRequest.new({
data: DatadogAPIClient::V2::CaseNotificationRuleUpdate.new({
attributes: DatadogAPIClient::V2::CaseNotificationRuleAttributes.new({
recipients: [
DatadogAPIClient::V2::CaseNotificationRuleRecipient.new({
data: DatadogAPIClient::V2::CaseNotificationRuleRecipientData.new({}),
type: "EMAIL",
}),
],
triggers: [
DatadogAPIClient::V2::CaseNotificationRuleTrigger.new({
data: DatadogAPIClient::V2::CaseNotificationRuleTriggerData.new({}),
type: "CASE_CREATED",
}),
],
}),
type: DatadogAPIClient::V2::CaseNotificationRuleResourceType::NOTIFICATION_RULE,
}),
})
api_instance.update_project_notification_rule("project_id", "notification_rule_id", body)
20 changes: 20 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,26 @@
"v2.GetProject" => {
"project_id" => "String",
},
"v2.UpdateProject" => {
"project_id" => "String",
"body" => "ProjectUpdateRequest",
},
"v2.GetProjectNotificationRules" => {
"project_id" => "String",
},
"v2.CreateProjectNotificationRule" => {
"project_id" => "String",
"body" => "CaseNotificationRuleCreateRequest",
},
"v2.DeleteProjectNotificationRule" => {
"project_id" => "String",
"notification_rule_id" => "String",
},
"v2.UpdateProjectNotificationRule" => {
"project_id" => "String",
"notification_rule_id" => "String",
"body" => "CaseNotificationRuleUpdateRequest",
},
"v2.GetCase" => {
"case_id" => "String",
},
Expand Down
120 changes: 117 additions & 3 deletions features/v2/case_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,67 @@ Feature: Case Management
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Create a notification rule returns "Bad Request" response
Given new "CreateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Create a notification rule returns "CREATED" response
Given new "CreateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/case-management
Scenario: Create a notification rule returns "Not Found" response
Given new "CreateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Create a project returns "Bad Request" response
Given new "CreateProject" request
And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}}
And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Create a project returns "CREATED" response
Given new "CreateProject" request
And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}}
And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/case-management
Scenario: Create a project returns "Not Found" response
Given new "CreateProject" request
And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}}
And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Delete a notification rule returns "API error response" response
Given new "DeleteProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And request contains "notification_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 API error response

@generated @skip @team:DataDog/case-management
Scenario: Delete a notification rule returns "No Content" response
Given new "DeleteProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And request contains "notification_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@skip @team:DataDog/case-management
Scenario: Delete case comment returns "Bad Request" response
Given new "DeleteCaseComment" request
Expand Down Expand Up @@ -203,6 +243,27 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Get notification rules returns "Bad Request" response
Given new "GetProjectNotificationRules" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Get notification rules returns "Not Found" response
Given new "GetProjectNotificationRules" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Get notification rules returns "OK" response
Given new "GetProjectNotificationRules" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/case-management
Scenario: Get the details of a case returns "Bad Request" response
Given new "GetCase" request
Expand Down Expand Up @@ -337,6 +398,59 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Update a notification rule returns "Bad Request" response
Given new "UpdateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And request contains "notification_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Update a notification rule returns "No Content" response
Given new "UpdateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And request contains "notification_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Update a notification rule returns "Not Found" response
Given new "UpdateProjectNotificationRule" request
And request contains "project_id" parameter from "REPLACE.ME"
And request contains "notification_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/case-management
Scenario: Update a project returns "Bad Request" response
Given new "UpdateProject" request
And request contains "project_id" parameter with value "d4bbe1af-f36e-42f1-87c1-493ca35c320e"
And body with value {"data": {"type": "invalid_type"}}
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/case-management
Scenario: Update a project returns "Not Found" response
Given new "UpdateProject" request
And request contains "project_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737"
And body with value {"data": {"type": "project", "attributes": {"name": "Updated Project Name"}}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/case-management
Scenario: Update a project returns "OK" response
Given new "UpdateProject" request
And request contains "project_id" parameter with value "d4bbe1af-f36e-42f1-87c1-493ca35c320e"
And body with value {"data": {"type": "project", "attributes": {"name": "Updated Project Name {{ unique }}"}}}
When the request is sent
Then the response status is 200 OK
And the response "data" has field "id"
And the response "data.attributes.name" is equal to "Updated Project Name {{ unique }}"

@skip @team:DataDog/case-management
Scenario: Update case attributes returns "Bad Request" response
Given new "UpdateAttributes" request
Expand Down
30 changes: 30 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,36 @@
"tag": "Case Management",
"operationId": "CreateCase"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"project\",\n \"attributes\": {\n \"key\": \"TST\",\n \"name\": \"Test Project {{ unique }}\"\n }\n }\n}"
}
],
"source": "data",
"step": "there is a valid \"project\" in the system",
"key": "project",
"tag": "Case Management",
"operationId": "CreateProject"
},
{
"parameters": [
{
"name": "project_id",
"value": "d4bbe1af-f36e-42f1-87c1-493ca35c320e"
},
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"notification_rule\",\n \"attributes\": {\n \"is_enabled\": true,\n \"triggers\": [{\"type\": \"CASE_CREATED\", \"data\": {}}],\n \"recipients\": [{\"type\": \"EMAIL\", \"data\": {\"email\": \"test-{{ unique }}@example.com\"}}]\n }\n }\n}"
}
],
"source": "data",
"step": "there is a valid \"case_notification_rule\" in the system",
"key": "case_notification_rule",
"tag": "Case Management",
"operationId": "CreateProjectNotificationRule"
},
{
"parameters": [
{
Expand Down
Loading
Loading