Skip to content

Commit 81befa8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit ce55d33 of spec repo (#3201)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 94d8319 commit 81befa8

17 files changed

Lines changed: 1293 additions & 33 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3980,6 +3980,114 @@ components:
39803980
description: The `markdownTextAnnotation` `text`.
39813981
type: string
39823982
type: object
3983+
AnonymizeUserError:
3984+
description: Error encountered when anonymizing a specific user.
3985+
properties:
3986+
error:
3987+
description: Error message describing why anonymization failed.
3988+
example: ""
3989+
type: string
3990+
user_id:
3991+
description: UUID of the user that failed to be anonymized.
3992+
example: "00000000-0000-0000-0000-000000000000"
3993+
type: string
3994+
required:
3995+
- user_id
3996+
- error
3997+
type: object
3998+
AnonymizeUsersRequest:
3999+
description: Request body for anonymizing users.
4000+
properties:
4001+
data:
4002+
$ref: "#/components/schemas/AnonymizeUsersRequestData"
4003+
required:
4004+
- data
4005+
type: object
4006+
AnonymizeUsersRequestAttributes:
4007+
description: Attributes of an anonymize users request.
4008+
properties:
4009+
user_ids:
4010+
description: List of user IDs (UUIDs) to anonymize.
4011+
example:
4012+
- "00000000-0000-0000-0000-000000000000"
4013+
items:
4014+
example: "00000000-0000-0000-0000-000000000000"
4015+
type: string
4016+
type: array
4017+
required:
4018+
- user_ids
4019+
type: object
4020+
AnonymizeUsersRequestData:
4021+
description: Object to anonymize a list of users.
4022+
properties:
4023+
attributes:
4024+
$ref: "#/components/schemas/AnonymizeUsersRequestAttributes"
4025+
id:
4026+
description: Unique identifier for the request. Not used server-side.
4027+
example: "00000000-0000-0000-0000-000000000000"
4028+
type: string
4029+
type:
4030+
$ref: "#/components/schemas/AnonymizeUsersRequestType"
4031+
required:
4032+
- type
4033+
- attributes
4034+
type: object
4035+
AnonymizeUsersRequestType:
4036+
default: anonymize_users_request
4037+
description: Type of the anonymize users request.
4038+
enum:
4039+
- anonymize_users_request
4040+
example: anonymize_users_request
4041+
type: string
4042+
x-enum-varnames:
4043+
- ANONYMIZE_USERS_REQUEST
4044+
AnonymizeUsersResponse:
4045+
description: Response containing the result of an anonymize users request.
4046+
properties:
4047+
data:
4048+
$ref: "#/components/schemas/AnonymizeUsersResponseData"
4049+
type: object
4050+
AnonymizeUsersResponseAttributes:
4051+
description: Attributes of an anonymize users response.
4052+
properties:
4053+
anonymize_errors:
4054+
description: List of errors encountered during anonymization, one entry per failed user.
4055+
items:
4056+
$ref: "#/components/schemas/AnonymizeUserError"
4057+
type: array
4058+
anonymized_user_ids:
4059+
description: List of user IDs (UUIDs) that were successfully anonymized.
4060+
example:
4061+
- "00000000-0000-0000-0000-000000000000"
4062+
items:
4063+
example: "00000000-0000-0000-0000-000000000000"
4064+
type: string
4065+
type: array
4066+
required:
4067+
- anonymized_user_ids
4068+
- anonymize_errors
4069+
type: object
4070+
AnonymizeUsersResponseData:
4071+
description: Response data for anonymizing users.
4072+
properties:
4073+
attributes:
4074+
$ref: "#/components/schemas/AnonymizeUsersResponseAttributes"
4075+
id:
4076+
description: Unique identifier of the response.
4077+
example: "00000000-0000-0000-0000-000000000000"
4078+
type: string
4079+
type:
4080+
$ref: "#/components/schemas/AnonymizeUsersResponseType"
4081+
type: object
4082+
AnonymizeUsersResponseType:
4083+
default: anonymize_users_response
4084+
description: Type of the anonymize users response.
4085+
enum:
4086+
- anonymize_users_response
4087+
example: anonymize_users_response
4088+
type: string
4089+
x-enum-varnames:
4090+
- ANONYMIZE_USERS_RESPONSE
39834091
AnthropicAPIKey:
39844092
description: The definition of the `AnthropicAPIKey` object.
39854093
properties:
@@ -83081,6 +83189,53 @@ paths:
8308183189
operator: OR
8308283190
permissions:
8308383191
- security_monitoring_findings_read
83192+
/api/v2/anonymize_users:
83193+
put:
83194+
description: |-
83195+
Anonymize a list of users, removing their personal data. This operation is irreversible.
83196+
Requires the `user_access_manage` permission.
83197+
operationId: AnonymizeUsers
83198+
requestBody:
83199+
content:
83200+
application/json:
83201+
schema:
83202+
$ref: "#/components/schemas/AnonymizeUsersRequest"
83203+
required: true
83204+
responses:
83205+
"200":
83206+
content:
83207+
application/json:
83208+
schema:
83209+
$ref: "#/components/schemas/AnonymizeUsersResponse"
83210+
description: OK
83211+
"400":
83212+
content:
83213+
application/json:
83214+
schema:
83215+
$ref: "#/components/schemas/APIErrorResponse"
83216+
description: Bad Request
83217+
"403":
83218+
content:
83219+
application/json:
83220+
schema:
83221+
$ref: "#/components/schemas/APIErrorResponse"
83222+
description: Authentication error
83223+
"429":
83224+
$ref: "#/components/responses/TooManyRequestsResponse"
83225+
security:
83226+
- apiKeyAuth: []
83227+
appKeyAuth: []
83228+
- AuthZ:
83229+
- user_access_manage
83230+
summary: Anonymize users
83231+
tags:
83232+
- Users
83233+
x-codegen-request-body-name: body
83234+
x-permission:
83235+
operator: OR
83236+
permissions:
83237+
- user_access_manage
83238+
x-unstable: "**Note**: This endpoint is in Preview and may be subject to changes."
8308483239
/api/v2/api_keys:
8308583240
get:
8308683241
description: List all API keys available for your account.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Anonymize users returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.anonymize_users".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::UsersAPI.new
8+
9+
body = DatadogAPIClient::V2::AnonymizeUsersRequest.new({
10+
data: DatadogAPIClient::V2::AnonymizeUsersRequestData.new({
11+
attributes: DatadogAPIClient::V2::AnonymizeUsersRequestAttributes.new({
12+
user_ids: [
13+
"00000000-0000-0000-0000-000000000000",
14+
],
15+
}),
16+
id: "00000000-0000-0000-0000-000000000000",
17+
type: DatadogAPIClient::V2::AnonymizeUsersRequestType::ANONYMIZE_USERS_REQUEST,
18+
}),
19+
})
20+
p api_instance.anonymize_users(body)

features/scenarios_model_mapping.rb

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,42 @@
11311131
"v2.GetAwsOnDemandTask" => {
11321132
"task_id" => "String",
11331133
},
1134+
"v2.AnonymizeUsers" => {
1135+
"body" => "AnonymizeUsersRequest",
1136+
},
1137+
"v2.SendInvitations" => {
1138+
"body" => "UserInvitationsRequest",
1139+
},
1140+
"v2.GetInvitation" => {
1141+
"user_invitation_uuid" => "String",
1142+
},
1143+
"v2.ListUsers" => {
1144+
"page_size" => "Integer",
1145+
"page_number" => "Integer",
1146+
"sort" => "String",
1147+
"sort_dir" => "QuerySortOrder",
1148+
"filter" => "String",
1149+
"filter_status" => "String",
1150+
},
1151+
"v2.CreateUser" => {
1152+
"body" => "UserCreateRequest",
1153+
},
1154+
"v2.DisableUser" => {
1155+
"user_id" => "String",
1156+
},
1157+
"v2.GetUser" => {
1158+
"user_id" => "String",
1159+
},
1160+
"v2.UpdateUser" => {
1161+
"user_id" => "String",
1162+
"body" => "UserUpdateRequest",
1163+
},
1164+
"v2.ListUserOrganizations" => {
1165+
"user_id" => "String",
1166+
},
1167+
"v2.ListUserPermissions" => {
1168+
"user_id" => "String",
1169+
},
11341170
"v2.ListAPIKeys" => {
11351171
"page_size" => "Integer",
11361172
"page_number" => "Integer",
@@ -4509,39 +4545,6 @@
45094545
"team_id" => "String",
45104546
"body" => "IncidentTeamUpdateRequest",
45114547
},
4512-
"v2.SendInvitations" => {
4513-
"body" => "UserInvitationsRequest",
4514-
},
4515-
"v2.GetInvitation" => {
4516-
"user_invitation_uuid" => "String",
4517-
},
4518-
"v2.ListUsers" => {
4519-
"page_size" => "Integer",
4520-
"page_number" => "Integer",
4521-
"sort" => "String",
4522-
"sort_dir" => "QuerySortOrder",
4523-
"filter" => "String",
4524-
"filter_status" => "String",
4525-
},
4526-
"v2.CreateUser" => {
4527-
"body" => "UserCreateRequest",
4528-
},
4529-
"v2.DisableUser" => {
4530-
"user_id" => "String",
4531-
},
4532-
"v2.GetUser" => {
4533-
"user_id" => "String",
4534-
},
4535-
"v2.UpdateUser" => {
4536-
"user_id" => "String",
4537-
"body" => "UserUpdateRequest",
4538-
},
4539-
"v2.ListUserOrganizations" => {
4540-
"user_id" => "String",
4541-
},
4542-
"v2.ListUserPermissions" => {
4543-
"user_id" => "String",
4544-
},
45454548
"v2.SearchWidgets" => {
45464549
"experience_type" => "WidgetExperienceType",
45474550
"filter_widget_type" => "WidgetType",

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,12 @@
411411
"type": "safe"
412412
}
413413
},
414+
"AnonymizeUsers": {
415+
"tag": "Users",
416+
"undo": {
417+
"type": "idempotent"
418+
}
419+
},
414420
"ListAPIKeys": {
415421
"tag": "Key Management",
416422
"undo": {

features/v2/users.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ Feature: Users
77
And a valid "appKeyAuth" key in the system
88
And an instance of "Users" API
99

10+
@generated @skip @team:DataDog/org-management
11+
Scenario: Anonymize users returns "Bad Request" response
12+
Given operation "AnonymizeUsers" enabled
13+
And new "AnonymizeUsers" request
14+
And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}}
15+
When the request is sent
16+
Then the response status is 400 Bad Request
17+
18+
@generated @skip @team:DataDog/org-management
19+
Scenario: Anonymize users returns "OK" response
20+
Given operation "AnonymizeUsers" enabled
21+
And new "AnonymizeUsers" request
22+
And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}}
23+
When the request is sent
24+
Then the response status is 200 OK
25+
1026
@generated @skip @team:DataDog/org-management
1127
Scenario: Create a user returns "Bad Request" response
1228
Given new "CreateUser" request

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def initialize
234234
"v2.update_llm_obs_dataset_records": false,
235235
"v2.update_llm_obs_experiment": false,
236236
"v2.update_llm_obs_project": false,
237+
"v2.anonymize_users": false,
237238
"v2.create_open_api": false,
238239
"v2.delete_open_api": false,
239240
"v2.get_open_api": false,

lib/datadog_api_client/inflector.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,15 @@ def overrides
11521152
"v2.annotation_display" => "AnnotationDisplay",
11531153
"v2.annotation_display_bounds" => "AnnotationDisplayBounds",
11541154
"v2.annotation_markdown_text_annotation" => "AnnotationMarkdownTextAnnotation",
1155+
"v2.anonymize_user_error" => "AnonymizeUserError",
1156+
"v2.anonymize_users_request" => "AnonymizeUsersRequest",
1157+
"v2.anonymize_users_request_attributes" => "AnonymizeUsersRequestAttributes",
1158+
"v2.anonymize_users_request_data" => "AnonymizeUsersRequestData",
1159+
"v2.anonymize_users_request_type" => "AnonymizeUsersRequestType",
1160+
"v2.anonymize_users_response" => "AnonymizeUsersResponse",
1161+
"v2.anonymize_users_response_attributes" => "AnonymizeUsersResponseAttributes",
1162+
"v2.anonymize_users_response_data" => "AnonymizeUsersResponseData",
1163+
"v2.anonymize_users_response_type" => "AnonymizeUsersResponseType",
11551164
"v2.anthropic_api_key" => "AnthropicAPIKey",
11561165
"v2.anthropic_api_key_type" => "AnthropicAPIKeyType",
11571166
"v2.anthropic_api_key_update" => "AnthropicAPIKeyUpdate",

0 commit comments

Comments
 (0)