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
155 changes: 155 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 20 additions & 0 deletions examples/v2/users/AnonymizeUsers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Anonymize users returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.anonymize_users".to_sym] = true
end
api_instance = DatadogAPIClient::V2::UsersAPI.new

body = DatadogAPIClient::V2::AnonymizeUsersRequest.new({
data: DatadogAPIClient::V2::AnonymizeUsersRequestData.new({
attributes: DatadogAPIClient::V2::AnonymizeUsersRequestAttributes.new({
user_ids: [
"00000000-0000-0000-0000-000000000000",
],
}),
id: "00000000-0000-0000-0000-000000000000",
type: DatadogAPIClient::V2::AnonymizeUsersRequestType::ANONYMIZE_USERS_REQUEST,
}),
})
p api_instance.anonymize_users(body)
69 changes: 36 additions & 33 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,42 @@
"v2.GetAwsOnDemandTask" => {
"task_id" => "String",
},
"v2.AnonymizeUsers" => {
"body" => "AnonymizeUsersRequest",
},
"v2.SendInvitations" => {
"body" => "UserInvitationsRequest",
},
"v2.GetInvitation" => {
"user_invitation_uuid" => "String",
},
"v2.ListUsers" => {
"page_size" => "Integer",
"page_number" => "Integer",
"sort" => "String",
"sort_dir" => "QuerySortOrder",
"filter" => "String",
"filter_status" => "String",
},
"v2.CreateUser" => {
"body" => "UserCreateRequest",
},
"v2.DisableUser" => {
"user_id" => "String",
},
"v2.GetUser" => {
"user_id" => "String",
},
"v2.UpdateUser" => {
"user_id" => "String",
"body" => "UserUpdateRequest",
},
"v2.ListUserOrganizations" => {
"user_id" => "String",
},
"v2.ListUserPermissions" => {
"user_id" => "String",
},
"v2.ListAPIKeys" => {
"page_size" => "Integer",
"page_number" => "Integer",
Expand Down Expand Up @@ -4228,39 +4264,6 @@
"team_id" => "String",
"body" => "IncidentTeamUpdateRequest",
},
"v2.SendInvitations" => {
"body" => "UserInvitationsRequest",
},
"v2.GetInvitation" => {
"user_invitation_uuid" => "String",
},
"v2.ListUsers" => {
"page_size" => "Integer",
"page_number" => "Integer",
"sort" => "String",
"sort_dir" => "QuerySortOrder",
"filter" => "String",
"filter_status" => "String",
},
"v2.CreateUser" => {
"body" => "UserCreateRequest",
},
"v2.DisableUser" => {
"user_id" => "String",
},
"v2.GetUser" => {
"user_id" => "String",
},
"v2.UpdateUser" => {
"user_id" => "String",
"body" => "UserUpdateRequest",
},
"v2.ListUserOrganizations" => {
"user_id" => "String",
},
"v2.ListUserPermissions" => {
"user_id" => "String",
},
"v2.SearchWidgets" => {
"experience_type" => "WidgetExperienceType",
"filter_widget_type" => "WidgetType",
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@
"type": "safe"
}
},
"AnonymizeUsers": {
"tag": "Users",
"undo": {
"type": "idempotent"
}
},
"ListAPIKeys": {
"tag": "Key Management",
"undo": {
Expand Down
16 changes: 16 additions & 0 deletions features/v2/users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def initialize
"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,
Expand Down
9 changes: 9 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,15 @@ def overrides
"v2.annotation_display" => "AnnotationDisplay",
"v2.annotation_display_bounds" => "AnnotationDisplayBounds",
"v2.annotation_markdown_text_annotation" => "AnnotationMarkdownTextAnnotation",
"v2.anonymize_user_error" => "AnonymizeUserError",
"v2.anonymize_users_request" => "AnonymizeUsersRequest",
"v2.anonymize_users_request_attributes" => "AnonymizeUsersRequestAttributes",
"v2.anonymize_users_request_data" => "AnonymizeUsersRequestData",
"v2.anonymize_users_request_type" => "AnonymizeUsersRequestType",
"v2.anonymize_users_response" => "AnonymizeUsersResponse",
"v2.anonymize_users_response_attributes" => "AnonymizeUsersResponseAttributes",
"v2.anonymize_users_response_data" => "AnonymizeUsersResponseData",
"v2.anonymize_users_response_type" => "AnonymizeUsersResponseType",
"v2.anthropic_api_key" => "AnthropicAPIKey",
"v2.anthropic_api_key_type" => "AnthropicAPIKeyType",
"v2.anthropic_api_key_update" => "AnthropicAPIKeyUpdate",
Expand Down
Loading
Loading