diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e83df8269e..7f2cc7c1b2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3734,6 +3734,114 @@ components: description: The `markdownTextAnnotation` `text`. type: string type: object + AnonymizeUserError: + description: Error encountered when anonymizing a specific user. + properties: + error: + description: Error message describing why anonymization failed. + example: "" + type: string + user_id: + description: UUID of the user that failed to be anonymized. + example: "00000000-0000-0000-0000-000000000000" + type: string + required: + - user_id + - error + type: object + AnonymizeUsersRequest: + description: Request body for anonymizing users. + properties: + data: + $ref: "#/components/schemas/AnonymizeUsersRequestData" + required: + - data + type: object + AnonymizeUsersRequestAttributes: + description: Attributes of an anonymize users request. + properties: + user_ids: + description: List of user IDs (UUIDs) to anonymize. + example: + - "00000000-0000-0000-0000-000000000000" + items: + example: "00000000-0000-0000-0000-000000000000" + type: string + type: array + required: + - user_ids + type: object + AnonymizeUsersRequestData: + description: Object to anonymize a list of users. + properties: + attributes: + $ref: "#/components/schemas/AnonymizeUsersRequestAttributes" + id: + description: Unique identifier for the request. Not used server-side. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/AnonymizeUsersRequestType" + required: + - type + - attributes + type: object + AnonymizeUsersRequestType: + default: anonymize_users_request + description: Type of the anonymize users request. + enum: + - anonymize_users_request + example: anonymize_users_request + type: string + x-enum-varnames: + - ANONYMIZE_USERS_REQUEST + AnonymizeUsersResponse: + description: Response containing the result of an anonymize users request. + properties: + data: + $ref: "#/components/schemas/AnonymizeUsersResponseData" + type: object + AnonymizeUsersResponseAttributes: + description: Attributes of an anonymize users response. + properties: + anonymize_errors: + description: List of errors encountered during anonymization, one entry per failed user. + items: + $ref: "#/components/schemas/AnonymizeUserError" + type: array + anonymized_user_ids: + description: List of user IDs (UUIDs) that were successfully anonymized. + example: + - "00000000-0000-0000-0000-000000000000" + items: + example: "00000000-0000-0000-0000-000000000000" + type: string + type: array + required: + - anonymized_user_ids + - anonymize_errors + type: object + AnonymizeUsersResponseData: + description: Response data for anonymizing users. + properties: + attributes: + $ref: "#/components/schemas/AnonymizeUsersResponseAttributes" + id: + description: Unique identifier of the response. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/AnonymizeUsersResponseType" + type: object + AnonymizeUsersResponseType: + default: anonymize_users_response + description: Type of the anonymize users response. + enum: + - anonymize_users_response + example: anonymize_users_response + type: string + x-enum-varnames: + - ANONYMIZE_USERS_RESPONSE AnthropicAPIKey: description: The definition of the `AnthropicAPIKey` object. properties: @@ -76578,6 +76686,53 @@ paths: operator: OR permissions: - security_monitoring_findings_read + /api/v2/anonymize_users: + put: + description: |- + Anonymize a list of users, removing their personal data. This operation is irreversible. + Requires the `user_access_manage` permission. + operationId: AnonymizeUsers + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/AnonymizeUsersRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AnonymizeUsersResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Anonymize users + tags: + - Users + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: "**Note**: This endpoint is in Preview and may be subject to changes." /api/v2/api_keys: get: description: List all API keys available for your account. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index d1dc990342..ff1bc3d65e 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -410,6 +410,69 @@ datadog\_api\_client.v2.model.annotation\_markdown\_text\_annotation module :members: :show-inheritance: +datadog\_api\_client.v2.model.anonymize\_user\_error module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_user_error + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_request\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_request\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_request\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_response\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_response\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.anonymize\_users\_response\_type module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.anonymize_users_response_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.anthropic\_api\_key module -------------------------------------------------------- diff --git a/examples/v2/users/AnonymizeUsers.py b/examples/v2/users/AnonymizeUsers.py new file mode 100644 index 0000000000..10df9207b8 --- /dev/null +++ b/examples/v2/users/AnonymizeUsers.py @@ -0,0 +1,30 @@ +""" +Anonymize users returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.users_api import UsersApi +from datadog_api_client.v2.model.anonymize_users_request import AnonymizeUsersRequest +from datadog_api_client.v2.model.anonymize_users_request_attributes import AnonymizeUsersRequestAttributes +from datadog_api_client.v2.model.anonymize_users_request_data import AnonymizeUsersRequestData +from datadog_api_client.v2.model.anonymize_users_request_type import AnonymizeUsersRequestType + +body = AnonymizeUsersRequest( + data=AnonymizeUsersRequestData( + attributes=AnonymizeUsersRequestAttributes( + user_ids=[ + "00000000-0000-0000-0000-000000000000", + ], + ), + id="00000000-0000-0000-0000-000000000000", + type=AnonymizeUsersRequestType.ANONYMIZE_USERS_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["anonymize_users"] = True +with ApiClient(configuration) as api_client: + api_instance = UsersApi(api_client) + response = api_instance.anonymize_users(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index c40c8ba9fc..f914379f7f 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -261,6 +261,7 @@ def __init__( "v2.list_fleet_schedules": False, "v2.trigger_fleet_schedule": False, "v2.update_fleet_schedule": False, + "v2.anonymize_users": False, "v2.create_open_api": False, "v2.delete_open_api": False, "v2.get_open_api": False, diff --git a/src/datadog_api_client/v2/api/users_api.py b/src/datadog_api_client/v2/api/users_api.py index 7f08f1aa8e..6b356e9f7c 100644 --- a/src/datadog_api_client/v2/api/users_api.py +++ b/src/datadog_api_client/v2/api/users_api.py @@ -14,6 +14,8 @@ UnsetType, unset, ) +from datadog_api_client.v2.model.anonymize_users_response import AnonymizeUsersResponse +from datadog_api_client.v2.model.anonymize_users_request import AnonymizeUsersRequest from datadog_api_client.v2.model.user_invitations_response import UserInvitationsResponse from datadog_api_client.v2.model.user_invitations_request import UserInvitationsRequest from datadog_api_client.v2.model.user_invitation_response import UserInvitationResponse @@ -36,6 +38,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._anonymize_users_endpoint = _Endpoint( + settings={ + "response_type": (AnonymizeUsersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/anonymize_users", + "operation_id": "anonymize_users", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AnonymizeUsersRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_user_endpoint = _Endpoint( settings={ "response_type": (UserResponse,), @@ -264,6 +286,23 @@ def __init__(self, api_client=None): api_client=api_client, ) + def anonymize_users( + self, + body: AnonymizeUsersRequest, + ) -> AnonymizeUsersResponse: + """Anonymize users. + + Anonymize a list of users, removing their personal data. This operation is irreversible. + Requires the ``user_access_manage`` permission. + + :type body: AnonymizeUsersRequest + :rtype: AnonymizeUsersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._anonymize_users_endpoint.call_with_http_info(**kwargs) + def create_user( self, body: UserCreateRequest, diff --git a/src/datadog_api_client/v2/model/anonymize_user_error.py b/src/datadog_api_client/v2/model/anonymize_user_error.py new file mode 100644 index 0000000000..3ed7ceb2cb --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_user_error.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AnonymizeUserError(ModelNormal): + @cached_property + def openapi_types(_): + return { + "error": (str,), + "user_id": (str,), + } + + attribute_map = { + "error": "error", + "user_id": "user_id", + } + + def __init__(self_, error: str, user_id: str, **kwargs): + """ + Error encountered when anonymizing a specific user. + + :param error: Error message describing why anonymization failed. + :type error: str + + :param user_id: UUID of the user that failed to be anonymized. + :type user_id: str + """ + super().__init__(kwargs) + + self_.error = error + self_.user_id = user_id diff --git a/src/datadog_api_client/v2/model/anonymize_users_request.py b/src/datadog_api_client/v2/model/anonymize_users_request.py new file mode 100644 index 0000000000..0cbdaf3d45 --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.anonymize_users_request_data import AnonymizeUsersRequestData + + +class AnonymizeUsersRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.anonymize_users_request_data import AnonymizeUsersRequestData + + return { + "data": (AnonymizeUsersRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AnonymizeUsersRequestData, **kwargs): + """ + Request body for anonymizing users. + + :param data: Object to anonymize a list of users. + :type data: AnonymizeUsersRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/anonymize_users_request_attributes.py b/src/datadog_api_client/v2/model/anonymize_users_request_attributes.py new file mode 100644 index 0000000000..60cac61a26 --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_request_attributes.py @@ -0,0 +1,34 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AnonymizeUsersRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "user_ids": ([str],), + } + + attribute_map = { + "user_ids": "user_ids", + } + + def __init__(self_, user_ids: List[str], **kwargs): + """ + Attributes of an anonymize users request. + + :param user_ids: List of user IDs (UUIDs) to anonymize. + :type user_ids: [str] + """ + super().__init__(kwargs) + + self_.user_ids = user_ids diff --git a/src/datadog_api_client/v2/model/anonymize_users_request_data.py b/src/datadog_api_client/v2/model/anonymize_users_request_data.py new file mode 100644 index 0000000000..fecbcd0c6a --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_request_data.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.anonymize_users_request_attributes import AnonymizeUsersRequestAttributes + from datadog_api_client.v2.model.anonymize_users_request_type import AnonymizeUsersRequestType + + +class AnonymizeUsersRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.anonymize_users_request_attributes import AnonymizeUsersRequestAttributes + from datadog_api_client.v2.model.anonymize_users_request_type import AnonymizeUsersRequestType + + return { + "attributes": (AnonymizeUsersRequestAttributes,), + "id": (str,), + "type": (AnonymizeUsersRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: AnonymizeUsersRequestAttributes, + type: AnonymizeUsersRequestType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Object to anonymize a list of users. + + :param attributes: Attributes of an anonymize users request. + :type attributes: AnonymizeUsersRequestAttributes + + :param id: Unique identifier for the request. Not used server-side. + :type id: str, optional + + :param type: Type of the anonymize users request. + :type type: AnonymizeUsersRequestType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/anonymize_users_request_type.py b/src/datadog_api_client/v2/model/anonymize_users_request_type.py new file mode 100644 index 0000000000..67c0f5cf8d --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_request_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AnonymizeUsersRequestType(ModelSimple): + """ + Type of the anonymize users request. + + :param value: If omitted defaults to "anonymize_users_request". Must be one of ["anonymize_users_request"]. + :type value: str + """ + + allowed_values = { + "anonymize_users_request", + } + ANONYMIZE_USERS_REQUEST: ClassVar["AnonymizeUsersRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AnonymizeUsersRequestType.ANONYMIZE_USERS_REQUEST = AnonymizeUsersRequestType("anonymize_users_request") diff --git a/src/datadog_api_client/v2/model/anonymize_users_response.py b/src/datadog_api_client/v2/model/anonymize_users_response.py new file mode 100644 index 0000000000..3d72f34a00 --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.anonymize_users_response_data import AnonymizeUsersResponseData + + +class AnonymizeUsersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.anonymize_users_response_data import AnonymizeUsersResponseData + + return { + "data": (AnonymizeUsersResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AnonymizeUsersResponseData, UnsetType] = unset, **kwargs): + """ + Response containing the result of an anonymize users request. + + :param data: Response data for anonymizing users. + :type data: AnonymizeUsersResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/anonymize_users_response_attributes.py b/src/datadog_api_client/v2/model/anonymize_users_response_attributes.py new file mode 100644 index 0000000000..a39b2127f4 --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_response_attributes.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.anonymize_user_error import AnonymizeUserError + + +class AnonymizeUsersResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.anonymize_user_error import AnonymizeUserError + + return { + "anonymize_errors": ([AnonymizeUserError],), + "anonymized_user_ids": ([str],), + } + + attribute_map = { + "anonymize_errors": "anonymize_errors", + "anonymized_user_ids": "anonymized_user_ids", + } + + def __init__(self_, anonymize_errors: List[AnonymizeUserError], anonymized_user_ids: List[str], **kwargs): + """ + Attributes of an anonymize users response. + + :param anonymize_errors: List of errors encountered during anonymization, one entry per failed user. + :type anonymize_errors: [AnonymizeUserError] + + :param anonymized_user_ids: List of user IDs (UUIDs) that were successfully anonymized. + :type anonymized_user_ids: [str] + """ + super().__init__(kwargs) + + self_.anonymize_errors = anonymize_errors + self_.anonymized_user_ids = anonymized_user_ids diff --git a/src/datadog_api_client/v2/model/anonymize_users_response_data.py b/src/datadog_api_client/v2/model/anonymize_users_response_data.py new file mode 100644 index 0000000000..d118087bdf --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_response_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.anonymize_users_response_attributes import AnonymizeUsersResponseAttributes + from datadog_api_client.v2.model.anonymize_users_response_type import AnonymizeUsersResponseType + + +class AnonymizeUsersResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.anonymize_users_response_attributes import AnonymizeUsersResponseAttributes + from datadog_api_client.v2.model.anonymize_users_response_type import AnonymizeUsersResponseType + + return { + "attributes": (AnonymizeUsersResponseAttributes,), + "id": (str,), + "type": (AnonymizeUsersResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[AnonymizeUsersResponseAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[AnonymizeUsersResponseType, UnsetType] = unset, + **kwargs, + ): + """ + Response data for anonymizing users. + + :param attributes: Attributes of an anonymize users response. + :type attributes: AnonymizeUsersResponseAttributes, optional + + :param id: Unique identifier of the response. + :type id: str, optional + + :param type: Type of the anonymize users response. + :type type: AnonymizeUsersResponseType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/anonymize_users_response_type.py b/src/datadog_api_client/v2/model/anonymize_users_response_type.py new file mode 100644 index 0000000000..f0405444ee --- /dev/null +++ b/src/datadog_api_client/v2/model/anonymize_users_response_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AnonymizeUsersResponseType(ModelSimple): + """ + Type of the anonymize users response. + + :param value: If omitted defaults to "anonymize_users_response". Must be one of ["anonymize_users_response"]. + :type value: str + """ + + allowed_values = { + "anonymize_users_response", + } + ANONYMIZE_USERS_RESPONSE: ClassVar["AnonymizeUsersResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AnonymizeUsersResponseType.ANONYMIZE_USERS_RESPONSE = AnonymizeUsersResponseType("anonymize_users_response") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 22f4a4d800..e690b232d6 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -184,6 +184,15 @@ from datadog_api_client.v2.model.annotation_display import AnnotationDisplay from datadog_api_client.v2.model.annotation_display_bounds import AnnotationDisplayBounds from datadog_api_client.v2.model.annotation_markdown_text_annotation import AnnotationMarkdownTextAnnotation +from datadog_api_client.v2.model.anonymize_user_error import AnonymizeUserError +from datadog_api_client.v2.model.anonymize_users_request import AnonymizeUsersRequest +from datadog_api_client.v2.model.anonymize_users_request_attributes import AnonymizeUsersRequestAttributes +from datadog_api_client.v2.model.anonymize_users_request_data import AnonymizeUsersRequestData +from datadog_api_client.v2.model.anonymize_users_request_type import AnonymizeUsersRequestType +from datadog_api_client.v2.model.anonymize_users_response import AnonymizeUsersResponse +from datadog_api_client.v2.model.anonymize_users_response_attributes import AnonymizeUsersResponseAttributes +from datadog_api_client.v2.model.anonymize_users_response_data import AnonymizeUsersResponseData +from datadog_api_client.v2.model.anonymize_users_response_type import AnonymizeUsersResponseType from datadog_api_client.v2.model.anthropic_api_key import AnthropicAPIKey from datadog_api_client.v2.model.anthropic_api_key_type import AnthropicAPIKeyType from datadog_api_client.v2.model.anthropic_api_key_update import AnthropicAPIKeyUpdate @@ -6967,6 +6976,15 @@ "AnnotationDisplay", "AnnotationDisplayBounds", "AnnotationMarkdownTextAnnotation", + "AnonymizeUserError", + "AnonymizeUsersRequest", + "AnonymizeUsersRequestAttributes", + "AnonymizeUsersRequestData", + "AnonymizeUsersRequestType", + "AnonymizeUsersResponse", + "AnonymizeUsersResponseAttributes", + "AnonymizeUsersResponseData", + "AnonymizeUsersResponseType", "AnthropicAPIKey", "AnthropicAPIKeyType", "AnthropicAPIKeyUpdate", diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 1f11ffb7e7..1df03bf266 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -362,6 +362,12 @@ "type": "safe" } }, + "AnonymizeUsers": { + "tag": "Users", + "undo": { + "type": "idempotent" + } + }, "ListAPIKeys": { "tag": "Key Management", "undo": { diff --git a/tests/v2/features/users.feature b/tests/v2/features/users.feature index ce27d72998..bb2f3fb989 100644 --- a/tests/v2/features/users.feature +++ b/tests/v2/features/users.feature @@ -7,6 +7,22 @@ Feature: Users And a valid "appKeyAuth" key in the system And an instance of "Users" API + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Anonymize users returns "Bad Request" response + Given operation "AnonymizeUsers" enabled + And new "AnonymizeUsers" request + And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Anonymize users returns "OK" response + Given operation "AnonymizeUsers" enabled + And new "AnonymizeUsers" request + And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/team-aaa-identity Scenario: Create a user returns "Bad Request" response Given new "CreateUser" request