From 94d8319d2543f8542fc3f011c62b2cfcbfb3cae0 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:33:50 +0000 Subject: [PATCH 1/2] Rename pat_uuid to pat_id and remove alias field from PAT spec (#3234) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 22 ++++----- ...ce-account-returns-Created-response.frozen | 2 +- ...rvice-account-returns-Created-response.yml | 22 ++++----- ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 28 +++++------ ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 18 +++---- ...account-returns-No-Content-response.frozen | 2 +- ...ce-account-returns-No-Content-response.yml | 26 +++++----- ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 30 ++++++------ features/scenarios_model_mapping.rb | 12 ++--- features/v2/key_management.feature | 14 +++--- features/v2/service_accounts.feature | 14 +++--- features/v2/undo.json | 4 +- .../v2/api/key_management_api.rb | 48 +++++++++---------- .../v2/api/service_accounts_api.rb | 48 +++++++++---------- .../full_personal_access_token_attributes.rb | 12 +---- .../personal_access_token_attributes.rb | 12 +---- .../v2/models/user_attributes.rb | 12 ++++- 20 files changed, 159 insertions(+), 173 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 30596739d0f7..5861fba12e8a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1140,9 +1140,9 @@ components: schema: type: string PersonalAccessTokenID: - description: The UUID of the personal access token. + description: The ID of the personal access token. in: path - name: pat_uuid + name: pat_id required: true schema: example: "00000000-0000-1234-0000-000000000000" @@ -29180,11 +29180,6 @@ components: FullPersonalAccessTokenAttributes: description: Attributes of a full personal access token, including the token key. properties: - alias: - description: The alias (short identifier) of the personal access token. - example: "2H9MCNMBM8FQjQ16YucXkX" - readOnly: true - type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -53447,11 +53442,6 @@ components: PersonalAccessTokenAttributes: description: Attributes of a personal access token. properties: - alias: - description: The alias (short identifier) of the personal access token. - example: "2H9MCNMBM8FQjQ16YucXkX" - readOnly: true - type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -77997,6 +77987,10 @@ components: description: Title of the user. nullable: true type: string + uuid: + description: UUID of the user. + readOnly: true + type: string verified: description: Whether the user is verified. type: boolean @@ -109770,7 +109764,7 @@ paths: operator: OR permissions: - user_app_keys - /api/v2/personal_access_tokens/{pat_uuid}: + /api/v2/personal_access_tokens/{pat_id}: delete: description: Revoke a specific personal access token. operationId: RevokePersonalAccessToken @@ -121349,7 +121343,7 @@ paths: operator: OR permissions: - service_account_write - /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}: + /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}: delete: description: Revoke a specific access token for a service account. operationId: RevokeServiceAccountAccessToken diff --git a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen index b457d0ec92cf..7ccf87f4bd58 100644 --- a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen @@ -1 +1 @@ -2026-04-03T21:02:56.793Z \ No newline at end of file +2026-04-16T20:03:06.304Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml index 2964b70349fb..b7dbeb9a60d3 100644 --- a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:02:56.980609+00:00","modified_at":"2026-04-03T21:02:56.980609+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1775250176@datadoghq.com","icon":"https://secure.gravatar.com/avatar/1a703b50769c96d7b84a5470f474ef74?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"498cce13-39cf-11f1-9928-be1871753dee","attributes":{"uuid":"498cce13-39cf-11f1-9928-be1871753dee","name":null,"handle":"498cce13-39cf-11f1-9928-be1871753dee","created_at":"2026-04-16T20:03:08.017467+00:00","modified_at":"2026-04-16T20:03:08.017467+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1776369786@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ed167ebfacd06c99ea70d4c121f5a7f1?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens response: body: encoding: UTF-8 - string: '{"data":{"id":"6f2491f5-8c3f-45a3-962a-5f769b95e806","type":"personal_access_tokens","attributes":{"alias":"3NirNJ5Y2qB4Fmac8B4wnm","created_at":"2026-04-03T21:02:57.288351972Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","public_portion":"3NirNJ5Y2qB4Fmac8B4wnm","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"88337232-8552-4495-987c-1cfed567d461","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:08.381725456Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","public_portion":"ddpat_490SyfYQqhqnr008BTjQWn","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"498cce13-39cf-11f1-9928-be1871753dee","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens/6f2491f5-8c3f-45a3-962a-5f769b95e806 + uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens/88337232-8552-4495-987c-1cfed567d461 response: body: encoding: UTF-8 @@ -63,14 +63,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0 + uri: https://api.datadoghq.com/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen index 55c4828532cb..767a9f9c2502 100644 --- a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2026-04-03T21:03:03.500Z \ No newline at end of file +2026-04-16T20:03:09.123Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml index 9c7f35598c0a..df8615ef834c 100644 --- a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:03.714879+00:00","modified_at":"2026-04-03T21:03:03.714879+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1775250183@datadoghq.com","icon":"https://secure.gravatar.com/avatar/bb3c6df0d99066bbe05cf7dff99b5561?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","attributes":{"uuid":"4a56376d-39cf-11f1-9a29-2eb65349fc01","name":null,"handle":"4a56376d-39cf-11f1-9a29-2eb65349fc01","created_at":"2026-04-16T20:03:09.337439+00:00","modified_at":"2026-04-16T20:03:09.337439+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1776369789@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7473377b9dced0689feddb50f5d82d29?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,54 +25,54 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens response: body: encoding: UTF-8 - string: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376467Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802251Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 response: body: encoding: UTF-8 - string: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 response: body: encoding: UTF-8 @@ -81,14 +81,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/8161ef90-2fa0-11f1-991f-62f4bfc595d0 + uri: https://api.datadoghq.com/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen index 6234af8a3e4b..db15643c3b71 100644 --- a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2026-04-03T21:03:09.026Z \ No newline at end of file +2026-04-16T20:03:10.610Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml index 2ffc4b46ca58..e72127e401aa 100644 --- a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:10 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-List_access_tokens_for_a_service_account_returns_OK_response-1775250189@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-List_access_tokens_for_a_service_account_returns_OK_response-1776369790@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,22 +15,24 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","attributes":{"name":null,"handle":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","created_at":"2026-04-03T21:03:09.205232+00:00","modified_at":"2026-04-03T21:03:09.205232+00:00","email":"test-list_access_tokens_for_a_service_account_returns_ok_response-1775250189@datadoghq.com","icon":"https://secure.gravatar.com/avatar/816e106f74328dd4c20e98c116a9edeb?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' + string: '{"data":{"type":"users","id":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","attributes":{"uuid":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","name":null,"handle":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","created_at":"2026-04-16T20:03:10.837056+00:00","modified_at":"2026-04-16T20:03:10.837056+00:00","email":"test-list_access_tokens_for_a_service_account_returns_ok_response-1776369790@datadoghq.com","icon":"https://secure.gravatar.com/avatar/0a5772e4c2381e3c1061e55142e2281a?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:10 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens response: body: encoding: UTF-8 @@ -41,14 +43,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:10 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7 + uri: https://api.datadoghq.com/api/v2/users/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen index fa38ba91a95f..4a8602fd9133 100644 --- a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen @@ -1 +1 @@ -2026-04-03T21:03:10.520Z \ No newline at end of file +2026-04-16T20:03:12.932Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml index 09cd39263394..f0f819471571 100644 --- a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"860878b5-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:11.517157+00:00","modified_at":"2026-04-03T21:03:11.517157+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1775250190@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7d18813f3cbc71a5e46b1184fc3ad8fb?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","attributes":{"uuid":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","name":null,"handle":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","created_at":"2026-04-16T20:03:13.136998+00:00","modified_at":"2026-04-16T20:03:13.136998+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1776369792@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7586d09a6a08e32a963f425a34463a4d?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens response: body: encoding: UTF-8 - string: '{"data":{"id":"7346d75b-83f3-48ba-9186-899fc80bce16","type":"personal_access_tokens","attributes":{"alias":"3VWUVmuRsjFIKue2Uq9ii6","created_at":"2026-04-03T21:03:11.782016283Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","public_portion":"3VWUVmuRsjFIKue2Uq9ii6","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"a5b5e3c3-2b58-448b-a1b1-5c97f16837a6","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:13.505344652Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","public_portion":"ddpat_52grBIAi4zKGY0uxhjLVVW","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 response: body: encoding: UTF-8 @@ -63,14 +63,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 response: body: encoding: UTF-8 @@ -79,14 +79,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/860878b5-2fa0-11f1-991f-62f4bfc595d0 + uri: https://api.datadoghq.com/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen index 6a894d59da19..58278ff6c0fe 100644 --- a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2026-04-03T21:03:12.499Z \ No newline at end of file +2026-04-16T20:03:14.527Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml index 95f7be33a040..55be92bbc34a 100644 --- a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:12.706435+00:00","modified_at":"2026-04-03T21:03:12.706435+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1775250192@datadoghq.com","icon":"https://secure.gravatar.com/avatar/8ef25c203ebdbe5e11acb74bd99ba7da?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","attributes":{"uuid":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","name":null,"handle":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","created_at":"2026-04-16T20:03:14.742691+00:00","modified_at":"2026-04-16T20:03:14.742691+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1776369794@datadoghq.com","icon":"https://secure.gravatar.com/avatar/05aacae415f13819561258b03c973881?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,58 +25,58 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens response: body: encoding: UTF-8 - string: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132411Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxXxxx_xxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533237Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated"},"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated"},"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 response: body: encoding: UTF-8 - string: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-03T21:03:13.152078Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + string: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-16T20:03:15.375809Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 response: body: encoding: UTF-8 @@ -85,14 +85,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT +- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0 + uri: https://api.datadoghq.com/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4 response: body: encoding: UTF-8 diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 7e04a29fd734..8490276de584 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1211,13 +1211,13 @@ "body" => "PersonalAccessTokenCreateRequest", }, "v2.RevokePersonalAccessToken" => { - "pat_uuid" => "String", + "pat_id" => "String", }, "v2.GetPersonalAccessToken" => { - "pat_uuid" => "String", + "pat_id" => "String", }, "v2.UpdatePersonalAccessToken" => { - "pat_uuid" => "String", + "pat_id" => "String", "body" => "PersonalAccessTokenUpdateRequest", }, "v2.ListAPIs" => { @@ -3996,15 +3996,15 @@ }, "v2.RevokeServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_uuid" => "String", + "pat_id" => "String", }, "v2.GetServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_uuid" => "String", + "pat_id" => "String", }, "v2.UpdateServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_uuid" => "String", + "pat_id" => "String", "body" => "PersonalAccessTokenUpdateRequest", }, "v2.ListServiceAccountApplicationKeys" => { diff --git a/features/v2/key_management.feature b/features/v2/key_management.feature index 6c4648455625..365c53ed7c27 100644 --- a/features/v2/key_management.feature +++ b/features/v2/key_management.feature @@ -221,7 +221,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response Given new "GetPersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -229,7 +229,7 @@ Feature: Key Management Scenario: Get a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "personal_access_tokens" @@ -355,21 +355,21 @@ Feature: Key Management Scenario: Revoke a personal access token returns "No Content" response Given there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 204 No Content @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response Given new "RevokePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -377,7 +377,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -386,7 +386,7 @@ Feature: Key Management Scenario: Update a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/features/v2/service_accounts.feature b/features/v2/service_accounts.feature index 25744abc832d..fa8c81440e26 100644 --- a/features/v2/service_accounts.feature +++ b/features/v2/service_accounts.feature @@ -142,7 +142,7 @@ Feature: Service Accounts Scenario: Get an access token for a service account returns "Not Found" response Given new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -152,7 +152,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.attributes.name" has the same value as "service_account_access_token.data.attributes.name" @@ -232,7 +232,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -240,7 +240,7 @@ Feature: Service Accounts Scenario: Revoke an access token for a service account returns "Not Found" response Given new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -248,7 +248,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Bad Request" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -257,7 +257,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Not Found" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -268,7 +268,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "personal_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 9152f6b2278b..994abc25242e 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4330,7 +4330,7 @@ "operationId": "RevokePersonalAccessToken", "parameters": [ { - "name": "pat_uuid", + "name": "pat_id", "source": "data.id" } ], @@ -5895,7 +5895,7 @@ "source": "data.relationships.owned_by.data.id" }, { - "name": "pat_uuid", + "name": "pat_id", "source": "data.id" } ], diff --git a/lib/datadog_api_client/v2/api/key_management_api.rb b/lib/datadog_api_client/v2/api/key_management_api.rb index 8a6d256738c4..a27d81dbfd96 100644 --- a/lib/datadog_api_client/v2/api/key_management_api.rb +++ b/lib/datadog_api_client/v2/api/key_management_api.rb @@ -622,8 +622,8 @@ def get_current_user_application_key_with_http_info(app_key_id, opts = {}) # Get a personal access token. # # @see #get_personal_access_token_with_http_info - def get_personal_access_token(pat_uuid, opts = {}) - data, _status_code, _headers = get_personal_access_token_with_http_info(pat_uuid, opts) + def get_personal_access_token(pat_id, opts = {}) + data, _status_code, _headers = get_personal_access_token_with_http_info(pat_id, opts) data end @@ -631,20 +631,20 @@ def get_personal_access_token(pat_uuid, opts = {}) # # Get a specific personal access token by its UUID. # - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def get_personal_access_token_with_http_info(pat_uuid, opts = {}) + def get_personal_access_token_with_http_info(pat_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.get_personal_access_token ...' end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.get_personal_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.get_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1004,8 +1004,8 @@ def list_personal_access_tokens_with_http_info(opts = {}) # Revoke a personal access token. # # @see #revoke_personal_access_token_with_http_info - def revoke_personal_access_token(pat_uuid, opts = {}) - revoke_personal_access_token_with_http_info(pat_uuid, opts) + def revoke_personal_access_token(pat_id, opts = {}) + revoke_personal_access_token_with_http_info(pat_id, opts) nil end @@ -1013,20 +1013,20 @@ def revoke_personal_access_token(pat_uuid, opts = {}) # # Revoke a specific personal access token. # - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def revoke_personal_access_token_with_http_info(pat_uuid, opts = {}) + def revoke_personal_access_token_with_http_info(pat_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.revoke_personal_access_token ...' end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.revoke_personal_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.revoke_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1286,8 +1286,8 @@ def update_current_user_application_key_with_http_info(app_key_id, body, opts = # Update a personal access token. # # @see #update_personal_access_token_with_http_info - def update_personal_access_token(pat_uuid, body, opts = {}) - data, _status_code, _headers = update_personal_access_token_with_http_info(pat_uuid, body, opts) + def update_personal_access_token(pat_id, body, opts = {}) + data, _status_code, _headers = update_personal_access_token_with_http_info(pat_id, body, opts) data end @@ -1295,25 +1295,25 @@ def update_personal_access_token(pat_uuid, body, opts = {}) # # Update a specific personal access token. # - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param body [PersonalAccessTokenUpdateRequest] # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def update_personal_access_token_with_http_info(pat_uuid, body, opts = {}) + def update_personal_access_token_with_http_info(pat_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.update_personal_access_token ...' end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.update_personal_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.update_personal_access_token" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling KeyManagementAPI.update_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} diff --git a/lib/datadog_api_client/v2/api/service_accounts_api.rb b/lib/datadog_api_client/v2/api/service_accounts_api.rb index b4f6aa2afaea..ef823b7d407f 100644 --- a/lib/datadog_api_client/v2/api/service_accounts_api.rb +++ b/lib/datadog_api_client/v2/api/service_accounts_api.rb @@ -307,8 +307,8 @@ def delete_service_account_application_key_with_http_info(service_account_id, ap # Get an access token for a service account. # # @see #get_service_account_access_token_with_http_info - def get_service_account_access_token(service_account_id, pat_uuid, opts = {}) - data, _status_code, _headers = get_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts) + def get_service_account_access_token(service_account_id, pat_id, opts = {}) + data, _status_code, _headers = get_service_account_access_token_with_http_info(service_account_id, pat_id, opts) data end @@ -317,10 +317,10 @@ def get_service_account_access_token(service_account_id, pat_uuid, opts = {}) # Get a specific access token for a service account by its UUID. # # @param service_account_id [String] The ID of the service account. - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def get_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts = {}) + def get_service_account_access_token_with_http_info(service_account_id, pat_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.get_service_account_access_token ...' @@ -329,12 +329,12 @@ def get_service_account_access_token_with_http_info(service_account_id, pat_uuid if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.get_service_account_access_token" end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.get_service_account_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.get_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -605,8 +605,8 @@ def list_service_account_application_keys_with_http_info(service_account_id, opt # Revoke an access token for a service account. # # @see #revoke_service_account_access_token_with_http_info - def revoke_service_account_access_token(service_account_id, pat_uuid, opts = {}) - revoke_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts) + def revoke_service_account_access_token(service_account_id, pat_id, opts = {}) + revoke_service_account_access_token_with_http_info(service_account_id, pat_id, opts) nil end @@ -615,10 +615,10 @@ def revoke_service_account_access_token(service_account_id, pat_uuid, opts = {}) # Revoke a specific access token for a service account. # # @param service_account_id [String] The ID of the service account. - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def revoke_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts = {}) + def revoke_service_account_access_token_with_http_info(service_account_id, pat_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.revoke_service_account_access_token ...' @@ -627,12 +627,12 @@ def revoke_service_account_access_token_with_http_info(service_account_id, pat_u if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.revoke_service_account_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -675,8 +675,8 @@ def revoke_service_account_access_token_with_http_info(service_account_id, pat_u # Update an access token for a service account. # # @see #update_service_account_access_token_with_http_info - def update_service_account_access_token(service_account_id, pat_uuid, body, opts = {}) - data, _status_code, _headers = update_service_account_access_token_with_http_info(service_account_id, pat_uuid, body, opts) + def update_service_account_access_token(service_account_id, pat_id, body, opts = {}) + data, _status_code, _headers = update_service_account_access_token_with_http_info(service_account_id, pat_id, body, opts) data end @@ -685,11 +685,11 @@ def update_service_account_access_token(service_account_id, pat_uuid, body, opts # Update a specific access token for a service account. # # @param service_account_id [String] The ID of the service account. - # @param pat_uuid [String] The UUID of the personal access token. + # @param pat_id [String] The ID of the personal access token. # @param body [PersonalAccessTokenUpdateRequest] # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def update_service_account_access_token_with_http_info(service_account_id, pat_uuid, body, opts = {}) + def update_service_account_access_token_with_http_info(service_account_id, pat_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.update_service_account_access_token ...' @@ -698,16 +698,16 @@ def update_service_account_access_token_with_http_info(service_account_id, pat_u if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.update_service_account_access_token" end - # verify the required parameter 'pat_uuid' is set - if @api_client.config.client_side_validation && pat_uuid.nil? - fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.update_service_account_access_token" + # verify the required parameter 'pat_id' is set + if @api_client.config.client_side_validation && pat_id.nil? + fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.update_service_account_access_token" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ServiceAccountsAPI.update_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} diff --git a/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb index 023240d058c4..6052e702996d 100644 --- a/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb +++ b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb @@ -21,9 +21,6 @@ module DatadogAPIClient::V2 class FullPersonalAccessTokenAttributes include BaseGenericModel - # The alias (short identifier) of the personal access token. - attr_accessor :_alias - # Creation date of the personal access token. attr_accessor :created_at @@ -48,7 +45,6 @@ class FullPersonalAccessTokenAttributes # @!visibility private def self.attribute_map { - :'_alias' => :'alias', :'created_at' => :'created_at', :'expires_at' => :'expires_at', :'key' => :'key', @@ -62,7 +58,6 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'_alias' => :'String', :'created_at' => :'Time', :'expires_at' => :'Time', :'key' => :'String', @@ -98,10 +93,6 @@ def initialize(attributes = {}) end } - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -155,7 +146,6 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - _alias == o._alias && created_at == o.created_at && expires_at == o.expires_at && key == o.key && @@ -169,7 +159,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [_alias, created_at, expires_at, key, name, public_portion, scopes, additional_properties].hash + [created_at, expires_at, key, name, public_portion, scopes, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb index 76dcff50d4b8..118f6c7514b8 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb @@ -21,9 +21,6 @@ module DatadogAPIClient::V2 class PersonalAccessTokenAttributes include BaseGenericModel - # The alias (short identifier) of the personal access token. - attr_accessor :_alias - # Creation date of the personal access token. attr_accessor :created_at @@ -51,7 +48,6 @@ class PersonalAccessTokenAttributes # @!visibility private def self.attribute_map { - :'_alias' => :'alias', :'created_at' => :'created_at', :'expires_at' => :'expires_at', :'last_used_at' => :'last_used_at', @@ -66,7 +62,6 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'_alias' => :'String', :'created_at' => :'Time', :'expires_at' => :'Time', :'last_used_at' => :'Time', @@ -105,10 +100,6 @@ def initialize(attributes = {}) end } - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -166,7 +157,6 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - _alias == o._alias && created_at == o.created_at && expires_at == o.expires_at && last_used_at == o.last_used_at && @@ -181,7 +171,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [_alias, created_at, expires_at, last_used_at, modified_at, name, public_portion, scopes, additional_properties].hash + [created_at, expires_at, last_used_at, modified_at, name, public_portion, scopes, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/user_attributes.rb b/lib/datadog_api_client/v2/models/user_attributes.rb index a62ccc455cec..f15a2014c001 100644 --- a/lib/datadog_api_client/v2/models/user_attributes.rb +++ b/lib/datadog_api_client/v2/models/user_attributes.rb @@ -57,6 +57,9 @@ class UserAttributes # Title of the user. attr_accessor :title + # UUID of the user. + attr_accessor :uuid + # Whether the user is verified. attr_accessor :verified @@ -78,6 +81,7 @@ def self.attribute_map :'service_account' => :'service_account', :'status' => :'status', :'title' => :'title', + :'uuid' => :'uuid', :'verified' => :'verified' } end @@ -98,6 +102,7 @@ def self.openapi_types :'service_account' => :'Boolean', :'status' => :'String', :'title' => :'String', + :'uuid' => :'String', :'verified' => :'Boolean' } end @@ -178,6 +183,10 @@ def initialize(attributes = {}) self.title = attributes[:'title'] end + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + if attributes.key?(:'verified') self.verified = attributes[:'verified'] end @@ -221,6 +230,7 @@ def ==(o) service_account == o.service_account && status == o.status && title == o.title && + uuid == o.uuid && verified == o.verified && additional_properties == o.additional_properties end @@ -229,7 +239,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, disabled, email, handle, icon, last_login_time, mfa_enabled, modified_at, name, service_account, status, title, verified, additional_properties].hash + [created_at, disabled, email, handle, icon, last_login_time, mfa_enabled, modified_at, name, service_account, status, title, uuid, verified, additional_properties].hash end end end From 81befa82b34329a6bcdcb00a109363b533430363 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:09:46 -0400 Subject: [PATCH 2/2] Regenerate client from commit ce55d33 of spec repo (#3201) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 155 ++++++++++++++++++ examples/v2/users/AnonymizeUsers.rb | 20 +++ features/scenarios_model_mapping.rb | 69 ++++---- features/v2/undo.json | 6 + features/v2/users.feature | 16 ++ lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 9 + lib/datadog_api_client/v2/api/users_api.rb | 74 +++++++++ .../v2/models/anonymize_user_error.rb | 144 ++++++++++++++++ .../v2/models/anonymize_users_request.rb | 123 ++++++++++++++ .../anonymize_users_request_attributes.rb | 125 ++++++++++++++ .../v2/models/anonymize_users_request_data.rb | 154 +++++++++++++++++ .../v2/models/anonymize_users_request_type.rb | 26 +++ .../v2/models/anonymize_users_response.rb | 105 ++++++++++++ .../anonymize_users_response_attributes.rb | 148 +++++++++++++++++ .../models/anonymize_users_response_data.rb | 125 ++++++++++++++ .../models/anonymize_users_response_type.rb | 26 +++ 17 files changed, 1293 insertions(+), 33 deletions(-) create mode 100644 examples/v2/users/AnonymizeUsers.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_user_error.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_request.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_response.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/anonymize_users_response_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5861fba12e8a..b02440dcf094 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3980,6 +3980,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: @@ -83081,6 +83189,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/examples/v2/users/AnonymizeUsers.rb b/examples/v2/users/AnonymizeUsers.rb new file mode 100644 index 000000000000..45af5881713e --- /dev/null +++ b/examples/v2/users/AnonymizeUsers.rb @@ -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) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 8490276de584..cc1c17b6bc22 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1131,6 +1131,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", @@ -4509,39 +4545,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", diff --git a/features/v2/undo.json b/features/v2/undo.json index 994abc25242e..484b2541ffbb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -411,6 +411,12 @@ "type": "safe" } }, + "AnonymizeUsers": { + "tag": "Users", + "undo": { + "type": "idempotent" + } + }, "ListAPIKeys": { "tag": "Key Management", "undo": { diff --git a/features/v2/users.feature b/features/v2/users.feature index f64d3b894634..b7f134da607d 100644 --- a/features/v2/users.feature +++ b/features/v2/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/org-management + 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/org-management + 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/org-management Scenario: Create a user returns "Bad Request" response Given new "CreateUser" request diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7275d82599ee..5770a08aa66f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -234,6 +234,7 @@ def initialize "v2.update_llm_obs_dataset_records": false, "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, + "v2.anonymize_users": false, "v2.create_open_api": false, "v2.delete_open_api": false, "v2.get_open_api": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 0b2afd9c0965..d52fb1a0f6e8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1152,6 +1152,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", diff --git a/lib/datadog_api_client/v2/api/users_api.rb b/lib/datadog_api_client/v2/api/users_api.rb index 71cb5bfe4bf3..14dd65917d1f 100644 --- a/lib/datadog_api_client/v2/api/users_api.rb +++ b/lib/datadog_api_client/v2/api/users_api.rb @@ -23,6 +23,80 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Anonymize users. + # + # @see #anonymize_users_with_http_info + def anonymize_users(body, opts = {}) + data, _status_code, _headers = anonymize_users_with_http_info(body, opts) + data + end + + # Anonymize users. + # + # Anonymize a list of users, removing their personal data. This operation is irreversible. + # Requires the `user_access_manage` permission. + # + # @param body [AnonymizeUsersRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AnonymizeUsersResponse, Integer, Hash)>] AnonymizeUsersResponse data, response status code and response headers + def anonymize_users_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.anonymize_users".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.anonymize_users") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.anonymize_users")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersAPI.anonymize_users ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UsersAPI.anonymize_users" + end + # resource path + local_var_path = '/api/v2/anonymize_users' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AnonymizeUsersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :anonymize_users, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersAPI#anonymize_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a user. # # @see #create_user_with_http_info diff --git a/lib/datadog_api_client/v2/models/anonymize_user_error.rb b/lib/datadog_api_client/v2/models/anonymize_user_error.rb new file mode 100644 index 000000000000..eb29f73e3e49 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_user_error.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Error encountered when anonymizing a specific user. + class AnonymizeUserError + include BaseGenericModel + + # Error message describing why anonymization failed. + attr_reader :error + + # UUID of the user that failed to be anonymized. + attr_reader :user_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'user_id' => :'user_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'user_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUserError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @error.nil? + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + user_id == o.user_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, user_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_request.rb b/lib/datadog_api_client/v2/models/anonymize_users_request.rb new file mode 100644 index 000000000000..a26a541c631b --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for anonymizing users. + class AnonymizeUsersRequest + include BaseGenericModel + + # Object to anonymize a list of users. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnonymizeUsersRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_request_attributes.rb b/lib/datadog_api_client/v2/models/anonymize_users_request_attributes.rb new file mode 100644 index 000000000000..26707c587e05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_request_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an anonymize users request. + class AnonymizeUsersRequestAttributes + include BaseGenericModel + + # List of user IDs (UUIDs) to anonymize. + attr_reader :user_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'user_ids' => :'user_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'user_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'user_ids') + if (value = attributes[:'user_ids']).is_a?(Array) + self.user_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @user_ids.nil? + true + end + + # Custom attribute writer method with validation + # @param user_ids [Object] Object to be assigned + # @!visibility private + def user_ids=(user_ids) + if user_ids.nil? + fail ArgumentError, 'invalid value for "user_ids", user_ids cannot be nil.' + end + @user_ids = user_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_ids == o.user_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [user_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_request_data.rb b/lib/datadog_api_client/v2/models/anonymize_users_request_data.rb new file mode 100644 index 000000000000..d40887ee4a49 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object to anonymize a list of users. + class AnonymizeUsersRequestData + include BaseGenericModel + + # Attributes of an anonymize users request. + attr_reader :attributes + + # Unique identifier for the request. Not used server-side. + attr_accessor :id + + # Type of the anonymize users request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnonymizeUsersRequestAttributes', + :'id' => :'String', + :'type' => :'AnonymizeUsersRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_request_type.rb b/lib/datadog_api_client/v2/models/anonymize_users_request_type.rb new file mode 100644 index 000000000000..c18ffc7b9ca5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the anonymize users request. + class AnonymizeUsersRequestType + include BaseEnumModel + + ANONYMIZE_USERS_REQUEST = "anonymize_users_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_response.rb b/lib/datadog_api_client/v2/models/anonymize_users_response.rb new file mode 100644 index 000000000000..a6f9d6e59d30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the result of an anonymize users request. + class AnonymizeUsersResponse + include BaseGenericModel + + # Response data for anonymizing users. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnonymizeUsersResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_response_attributes.rb b/lib/datadog_api_client/v2/models/anonymize_users_response_attributes.rb new file mode 100644 index 000000000000..57c66be38808 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_response_attributes.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an anonymize users response. + class AnonymizeUsersResponseAttributes + include BaseGenericModel + + # List of errors encountered during anonymization, one entry per failed user. + attr_reader :anonymize_errors + + # List of user IDs (UUIDs) that were successfully anonymized. + attr_reader :anonymized_user_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anonymize_errors' => :'anonymize_errors', + :'anonymized_user_ids' => :'anonymized_user_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anonymize_errors' => :'Array', + :'anonymized_user_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'anonymize_errors') + if (value = attributes[:'anonymize_errors']).is_a?(Array) + self.anonymize_errors = value + end + end + + if attributes.key?(:'anonymized_user_ids') + if (value = attributes[:'anonymized_user_ids']).is_a?(Array) + self.anonymized_user_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @anonymize_errors.nil? + return false if @anonymized_user_ids.nil? + true + end + + # Custom attribute writer method with validation + # @param anonymize_errors [Object] Object to be assigned + # @!visibility private + def anonymize_errors=(anonymize_errors) + if anonymize_errors.nil? + fail ArgumentError, 'invalid value for "anonymize_errors", anonymize_errors cannot be nil.' + end + @anonymize_errors = anonymize_errors + end + + # Custom attribute writer method with validation + # @param anonymized_user_ids [Object] Object to be assigned + # @!visibility private + def anonymized_user_ids=(anonymized_user_ids) + if anonymized_user_ids.nil? + fail ArgumentError, 'invalid value for "anonymized_user_ids", anonymized_user_ids cannot be nil.' + end + @anonymized_user_ids = anonymized_user_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + anonymize_errors == o.anonymize_errors && + anonymized_user_ids == o.anonymized_user_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anonymize_errors, anonymized_user_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_response_data.rb b/lib/datadog_api_client/v2/models/anonymize_users_response_data.rb new file mode 100644 index 000000000000..b7d98fc14753 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for anonymizing users. + class AnonymizeUsersResponseData + include BaseGenericModel + + # Attributes of an anonymize users response. + attr_accessor :attributes + + # Unique identifier of the response. + attr_accessor :id + + # Type of the anonymize users response. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnonymizeUsersResponseAttributes', + :'id' => :'String', + :'type' => :'AnonymizeUsersResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnonymizeUsersResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/anonymize_users_response_type.rb b/lib/datadog_api_client/v2/models/anonymize_users_response_type.rb new file mode 100644 index 000000000000..b06c2b772289 --- /dev/null +++ b/lib/datadog_api_client/v2/models/anonymize_users_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the anonymize users response. + class AnonymizeUsersResponseType + include BaseEnumModel + + ANONYMIZE_USERS_RESPONSE = "anonymize_users_response".freeze + end +end