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
26 changes: 26 additions & 0 deletions examples/v2/case-management/ListCaseWatchers.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Get case watchers returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.WatchersResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listCaseWatchers", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
WatchersResponse result =
apiInstance.listCaseWatchers("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#listCaseWatchers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
24 changes: 24 additions & 0 deletions examples/v2/case-management/UnwatchCase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Remove user as watcher returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.unwatchCase", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
apiInstance.unwatchCase(
"f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001");
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#unwatchCase");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
24 changes: 24 additions & 0 deletions examples/v2/case-management/WatchCase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Add user as watcher returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.watchCase", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
apiInstance.watchCase(
"f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001");
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#watchCase");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ public class ApiClient {
put("v2.getOpenAPI", false);
put("v2.listAPIs", false);
put("v2.updateOpenAPI", false);
put("v2.listCaseWatchers", false);
put("v2.unwatchCase", false);
put("v2.watchCase", false);
put("v2.cancelThreatHuntingJob", false);
put("v2.convertJobResultToSignal", false);
put("v2.deleteThreatHuntingJob", false);
Expand Down
Loading
Loading