From e6ebbde7327bb329e82aa975dc7809940ffbb97c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 10 Nov 2026 15:50:06 +0000 Subject: [PATCH] Regenerate client from commit 774c9ef of spec repo --- .generator/schemas/v2/openapi.yaml | 46 +++++++++++++++++++ .../DeleteUserProfile.py | 16 +++++++ src/datadog_api_client/configuration.py | 1 + .../v2/api/rum_audience_management_api.py | 42 +++++++++++++++++ .../features/rum_audience_management.feature | 16 +++++++ tests/v2/features/undo.json | 6 +++ 6 files changed, 127 insertions(+) create mode 100644 examples/v2/rum-audience-management/DeleteUserProfile.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index aaae703e3a..c005ae3d31 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -226557,6 +226557,52 @@ paths: tags: - Rum Audience Management x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/product-analytics/users/{user_id}: + delete: + description: |- + Delete a Product Analytics user profile. + Deletion is asynchronous: the request is accepted and the profile is removed shortly after, usually within a few minutes. + This only deletes the user profile. To delete the RUM events of the user, use the RUM data deletion API. + operationId: DeleteUserProfile + parameters: + - description: The ID of the user to delete, as sent in the `usr.id` attribute. + in: path + name: user_id + required: true + schema: + example: user-1234 + type: string + responses: + "202": + description: Deletion accepted; the profile will be removed asynchronously + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete a user profile + tags: + - Rum Audience Management + x-permission: + operator: OR + permissions: + - rum_apps_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/product-analytics/{entity}/mapping: get: description: Get entity mapping configuration including all available attributes and their properties diff --git a/examples/v2/rum-audience-management/DeleteUserProfile.py b/examples/v2/rum-audience-management/DeleteUserProfile.py new file mode 100644 index 0000000000..949e832076 --- /dev/null +++ b/examples/v2/rum-audience-management/DeleteUserProfile.py @@ -0,0 +1,16 @@ +""" +Delete a user profile returns "Deletion accepted; the profile will be removed asynchronously" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["delete_user_profile"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + api_instance.delete_user_profile( + user_id="user-1234", + ) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9755f40f34..21a6d634c3 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -856,6 +856,7 @@ def __init__( "v2.query_product_analytics_sankey": False, "v2.create_connection": False, "v2.delete_connection": False, + "v2.delete_user_profile": False, "v2.get_account_facet_info": False, "v2.get_mapping": False, "v2.get_user_facet_info": False, diff --git a/src/datadog_api_client/v2/api/rum_audience_management_api.py b/src/datadog_api_client/v2/api/rum_audience_management_api.py index 52cbf0a88b..71e3537774 100644 --- a/src/datadog_api_client/v2/api/rum_audience_management_api.py +++ b/src/datadog_api_client/v2/api/rum_audience_management_api.py @@ -84,6 +84,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_user_profile_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/users/{user_id}", + "operation_id": "delete_user_profile", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._get_account_facet_info_endpoint = _Endpoint( settings={ "response_type": (FacetInfoResponse,), @@ -299,6 +322,25 @@ def delete_connection( return self._delete_connection_endpoint.call_with_http_info(**kwargs) + def delete_user_profile( + self, + user_id: str, + ) -> None: + """Delete a user profile. + + Delete a Product Analytics user profile. + Deletion is asynchronous: the request is accepted and the profile is removed shortly after, usually within a few minutes. + This only deletes the user profile. To delete the RUM events of the user, use the RUM data deletion API. + + :param user_id: The ID of the user to delete, as sent in the ``usr.id`` attribute. + :type user_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["user_id"] = user_id + + return self._delete_user_profile_endpoint.call_with_http_info(**kwargs) + def get_account_facet_info( self, body: FacetInfoRequest, diff --git a/tests/v2/features/rum_audience_management.feature b/tests/v2/features/rum_audience_management.feature index 7591800a0d..e4514231df 100644 --- a/tests/v2/features/rum_audience_management.feature +++ b/tests/v2/features/rum_audience_management.feature @@ -16,6 +16,22 @@ Feature: Rum Audience Management When the request is sent Then the response status is 201 Connection created successfully + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Delete a user profile returns "Bad Request" response + Given operation "DeleteUserProfile" enabled + And new "DeleteUserProfile" request + 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:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Delete a user profile returns "Deletion accepted; the profile will be removed asynchronously" response + Given operation "DeleteUserProfile" enabled + And new "DeleteUserProfile" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 202 Deletion accepted; the profile will be removed asynchronously + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Delete connection returns "Connection deleted successfully" response Given operation "DeleteConnection" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index ecd54435b6..89d6143a64 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7535,6 +7535,12 @@ "type": "unsafe" } }, + "DeleteUserProfile": { + "tag": "Rum Audience Management", + "undo": { + "type": "idempotent" + } + }, "GetMapping": { "tag": "Rum Audience Management", "undo": {