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
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28536,6 +28536,41 @@ datadog\_api\_client.v2.model.vulnerability\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.watcher module
--------------------------------------------

.. automodule:: datadog_api_client.v2.model.watcher
:members:
:show-inheritance:

datadog\_api\_client.v2.model.watcher\_relationships module
-----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.watcher_relationships
:members:
:show-inheritance:

datadog\_api\_client.v2.model.watcher\_resource\_type module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.watcher_resource_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.watcher\_user\_relationship module
----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.watcher_user_relationship
:members:
:show-inheritance:

datadog\_api\_client.v2.model.watchers\_response module
-------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.watchers_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.weekday module
--------------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions examples/v2/case-management/ListCaseWatchers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Get case watchers returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
configuration.unstable_operations["list_case_watchers"] = True
with ApiClient(configuration) as api_client:
api_instance = CaseManagementApi(api_client)
response = api_instance.list_case_watchers(
case_id="case_id",
)

print(response)
15 changes: 15 additions & 0 deletions examples/v2/case-management/UnwatchCase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Remove user as watcher returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
configuration.unstable_operations["unwatch_case"] = True
with ApiClient(configuration) as api_client:
api_instance = CaseManagementApi(api_client)
api_instance.unwatch_case(
case_id="case_id",
user_id="user_id",
)
15 changes: 15 additions & 0 deletions examples/v2/case-management/WatchCase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Add user as watcher returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
configuration.unstable_operations["watch_case"] = True
with ApiClient(configuration) as api_client:
api_instance = CaseManagementApi(api_client)
api_instance.watch_case(
case_id="case_id",
user_id="user_id",
)
3 changes: 3 additions & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def __init__(
"v2.get_open_api": False,
"v2.list_apis": False,
"v2.update_open_api": False,
"v2.list_case_watchers": False,
"v2.unwatch_case": False,
"v2.watch_case": False,
"v2.cancel_threat_hunting_job": False,
"v2.convert_job_result_to_signal": False,
"v2.delete_threat_hunting_job": False,
Expand Down
Loading