Skip to content
Open
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
202 changes: 202 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,14 @@ components:
schema:
example: 00000000-0000-9999-0000-000000000000
type: string
UserUUIDPathParameter:
description: User UUID
example: 8146583c-0b5f-11ec-abf8-da7ad0900001
in: path
name: user_id
required: true
schema:
type: string
WorkflowId:
description: The ID of the workflow.
in: path
Expand Down Expand Up @@ -64692,6 +64700,57 @@ components:
- X_CONTENT_TYPE_HEADER_MISSING
- X_PATH_INJECTION
- XSS
Watcher:
description: Case watcher
properties:
id:
description: User UUID of the watcher
example: 8146583c-0b5f-11ec-abf8-da7ad0900001
type: string
relationships:
$ref: '#/components/schemas/WatcherRelationships'
type:
$ref: '#/components/schemas/WatcherResourceType'
required:
- id
- type
- relationships
type: object
WatcherRelationships:
description: Watcher relationships
properties:
user:
$ref: '#/components/schemas/WatcherUserRelationship'
required:
- user
type: object
WatcherResourceType:
description: Watcher resource type
enum:
- watcher
example: watcher
type: string
x-enum-varnames:
- WATCHER
WatcherUserRelationship:
description: Relationship to user
properties:
data:
$ref: '#/components/schemas/UserRelationshipData'
required:
- data
type: object
WatchersResponse:
description: Response with case watchers
properties:
data:
description: Array of watchers
items:
$ref: '#/components/schemas/Watcher'
type: array
required:
- data
type: object
Weekday:
description: A day of the week.
enum:
Expand Down Expand Up @@ -70202,6 +70261,149 @@ paths:
summary: Unassign case
tags:
- Case Management
/api/v2/cases/{case_id}/watchers:
get:
description: Get all users watching a case
operationId: ListCaseWatchers
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WatchersResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_read
summary: Get case watchers
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/cases/{case_id}/watchers/{user_id}:
delete:
description: Remove a user from the watchers list for a case
operationId: UnwatchCase
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
- $ref: '#/components/parameters/UserUUIDPathParameter'
responses:
'204':
description: No Content
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Remove user as watcher
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
post:
description: Add a user as a watcher for a case
operationId: WatchCase
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
- $ref: '#/components/parameters/UserUUIDPathParameter'
responses:
'201':
description: Created
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Add user as watcher
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/catalog/entity:
get:
description: Get a list of entities from Software Catalog.
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/case-management/ListCaseWatchers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get case watchers returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_case_watchers".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.list_case_watchers("case_id")
8 changes: 8 additions & 0 deletions examples/v2/case-management/UnwatchCase.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Remove user as watcher returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.unwatch_case".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.unwatch_case("case_id", "user_id")
8 changes: 8 additions & 0 deletions examples/v2/case-management/WatchCase.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Add user as watcher returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.watch_case".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.watch_case("case_id", "user_id")
11 changes: 11 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,17 @@
"case_id" => "String",
"body" => "CaseEmptyRequest",
},
"v2.ListCaseWatchers" => {
"case_id" => "String",
},
"v2.UnwatchCase" => {
"case_id" => "String",
"user_id" => "String",
},
"v2.WatchCase" => {
"case_id" => "String",
"user_id" => "String",
},
"v2.CreateCaseType" => {
"body" => "CaseTypeCreateRequest",
},
Expand Down
78 changes: 78 additions & 0 deletions features/v2/case_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,33 @@ Feature: Case Management
And a valid "appKeyAuth" key in the system
And an instance of "CaseManagement" API

@generated @skip @team:DataDog/case-management
Scenario: Add user as watcher returns "Bad Request" response
Given operation "WatchCase" enabled
And new "WatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_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: Add user as watcher returns "Created" response
Given operation "WatchCase" enabled
And new "WatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/case-management
Scenario: Add user as watcher returns "Not Found" response
Given operation "WatchCase" enabled
And new "WatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/case-management
Scenario: Archive case returns "Bad Request" response
Given new "ArchiveCase" request
Expand Down Expand Up @@ -203,6 +230,30 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Get case watchers returns "Bad Request" response
Given operation "ListCaseWatchers" enabled
And new "ListCaseWatchers" request
And request contains "case_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 case watchers returns "Not Found" response
Given operation "ListCaseWatchers" enabled
And new "ListCaseWatchers" request
And request contains "case_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 case watchers returns "OK" response
Given operation "ListCaseWatchers" enabled
And new "ListCaseWatchers" request
And request contains "case_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 @@ -261,6 +312,33 @@ Feature: Case Management
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Remove user as watcher returns "Bad Request" response
Given operation "UnwatchCase" enabled
And new "UnwatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_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: Remove user as watcher returns "No Content" response
Given operation "UnwatchCase" enabled
And new "UnwatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Remove user as watcher returns "Not Found" response
Given operation "UnwatchCase" enabled
And new "UnwatchCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And request contains "user_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: Search cases returns "Bad Request" response
Given new "SearchCases" request
Expand Down
20 changes: 20 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,26 @@
"type": "idempotent"
}
},
"ListCaseWatchers": {
"tag": "Case Management",
"undo": {
"type": "safe"
}
},
"UnwatchCase": {
"tag": "Case Management",
"undo": {
"type": "idempotent"
}
},
"WatchCase": {
"tag": "Case Management",
"undo": {
"operationId": "TODO",
"parameters": [],
"type": "unsafe"
}
},
"ListCatalogEntity": {
"tag": "Software Catalog",
"undo": {
Expand Down
Loading
Loading