From 1019a7a418fc2c7088865ec054b020fb769e5c4e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 22 Oct 2026 20:39:40 +0000 Subject: [PATCH] Regenerate client from commit 50be271 of spec repo --- .generator/schemas/v2/openapi.yaml | 9 +++++ examples/v2/users/ListUsers_850007038.ts | 31 ++++++++++++++++ .../test-runner-data/manifest.json | 7 ++++ ...iltered-by-handle-returns-ok-response.json | 35 +++++++++++++++++++ features/support/scenarios_model_mapping.ts | 4 +++ features/v2/users.feature | 10 ++++++ .../datadog-api-client-v2/apis/UsersApi.ts | 16 +++++++++ 7 files changed, 112 insertions(+) create mode 100644 examples/v2/users/ListUsers_850007038.ts create mode 100644 features/generated-test/test-runner-data/v2/users/list-all-users-filtered-by-handle-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c680cd9d1d49..638dad74895e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -249124,6 +249124,15 @@ paths: schema: example: Active type: string + - description: |- + Filter on the exact user handle. This filter also returns Datadog-managed users, + which the list otherwise excludes. Defaults to no filtering. + in: query + name: filter[handle] + required: false + schema: + example: example-handle + type: string responses: "200": content: diff --git a/examples/v2/users/ListUsers_850007038.ts b/examples/v2/users/ListUsers_850007038.ts new file mode 100644 index 000000000000..4b57c2a238d8 --- /dev/null +++ b/examples/v2/users/ListUsers_850007038.ts @@ -0,0 +1,31 @@ +/** + * List all users filtered by handle returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +const apiInstance = new v2.UsersApi(configuration); + +// there is a valid "user" in the system +const USER_DATA_ATTRIBUTES_HANDLE = process.env + .USER_DATA_ATTRIBUTES_HANDLE as string; + +const params: v2.UsersApiListUsersRequest = { + filterHandle: USER_DATA_ATTRIBUTES_HANDLE, +}; + +apiInstance + .listUsers(params) + .then((data: v2.UsersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/generated-test/test-runner-data/manifest.json b/features/generated-test/test-runner-data/manifest.json index 4f3515da3992..30d4f2d76539 100644 --- a/features/generated-test/test-runner-data/manifest.json +++ b/features/generated-test/test-runner-data/manifest.json @@ -12614,6 +12614,13 @@ "scenario": "Get user details returns \"OK\" response", "version": "v2" }, + { + "feature": "Users", + "feature_file": "../../v2/users.feature", + "file": "v2/users/list-all-users-filtered-by-handle-returns-ok-response.json", + "scenario": "List all users filtered by handle returns \"OK\" response", + "version": "v2" + }, { "feature": "Users", "feature_file": "../../v2/users.feature", diff --git a/features/generated-test/test-runner-data/v2/users/list-all-users-filtered-by-handle-returns-ok-response.json b/features/generated-test/test-runner-data/v2/users/list-all-users-filtered-by-handle-returns-ok-response.json new file mode 100644 index 000000000000..2bb3eb28cdd6 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/users/list-all-users-filtered-by-handle-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "Users", + "expected_status": 200, + "feature": "Users", + "id": "v2/Users/List all users filtered by handle returns \"OK\" response", + "operation_id": "ListUsers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "filter[handle]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "user.data.attributes.handle", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/users" + }, + "scenario": "List all users filtered by handle returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 71832642b3db..94c08165ccff 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3979,6 +3979,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "string", "format": "", }, + "filterHandle": { + "type": "string", + "format": "", + }, "operationResponseType": "UsersResponse", }, "v2.CreateUser": { diff --git a/features/v2/users.feature b/features/v2/users.feature index 2a6c59fa1304..4281f26fd755 100644 --- a/features/v2/users.feature +++ b/features/v2/users.feature @@ -156,6 +156,16 @@ Feature: Users And the response "data.type" is equal to "users" And the response "data.attributes.handle" is equal to "{{ unique_lower }}@datadoghq.com" + @team:ddoghq/org-management + Scenario: List all users filtered by handle returns "OK" response + Given there is a valid "user" in the system + And new "ListUsers" request + And request contains "filter[handle]" parameter from "user.data.attributes.handle" + When the request is sent + Then the response status is 200 OK + And the response "meta.page.total_filtered_count" is equal to 1 + And the response "data[0].id" has the same value as "user.data.id" + @generated @skip @team:ddoghq/org-management Scenario: List all users returns "Bad Request" response Given new "ListUsers" request diff --git a/packages/datadog-api-client-v2/apis/UsersApi.ts b/packages/datadog-api-client-v2/apis/UsersApi.ts index be5a46c674b4..5c095c4c1f1a 100644 --- a/packages/datadog-api-client-v2/apis/UsersApi.ts +++ b/packages/datadog-api-client-v2/apis/UsersApi.ts @@ -443,6 +443,7 @@ export class UsersApiRequestFactory extends BaseAPIRequestFactory { sortDir?: QuerySortOrder, filter?: string, filterStatus?: string, + filterHandle?: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -505,6 +506,13 @@ export class UsersApiRequestFactory extends BaseAPIRequestFactory { "" ); } + if (filterHandle !== undefined) { + requestContext.setQueryParam( + "filter[handle]", + ObjectSerializer.serialize(filterHandle, "string", ""), + "" + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -1730,6 +1738,12 @@ export interface UsersApiListUsersRequest { * @type string */ filterStatus?: string; + /** + * Filter on the exact user handle. This filter also returns Datadog-managed users, + * which the list otherwise excludes. Defaults to no filtering. + * @type string + */ + filterHandle?: string; } export interface UsersApiSendInvitationsRequest { @@ -2019,6 +2033,7 @@ export class UsersApi { param.sortDir, param.filter, param.filterStatus, + param.filterHandle, options ); return requestContextPromise.then((requestContext) => { @@ -2051,6 +2066,7 @@ export class UsersApi { param.sortDir, param.filter, param.filterStatus, + param.filterHandle, options ); const responseContext = await this.configuration.httpApi.send(