diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bd320edb5e..d048c676f6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -142692,7 +142692,7 @@ paths: - apiKeyAuth: [] summary: Send AI tool user activity tags: - - AI Impact + - DORA Metrics x-codegen-request-body-name: body /api/v2/annotation: get: @@ -246906,9 +246906,6 @@ servers: default: api description: The subdomain where the API is deployed. tags: - - description: |- - Send AI coding tool usage data to measure the impact of AI tools on software delivery. - name: AI Impact - description: |- Configure your API endpoints through the Datadog API. name: API Management diff --git a/examples/v2/ai-impact/CreateAIImpactUserActivity.py b/examples/v2/dora-metrics/CreateAIImpactUserActivity.py similarity index 91% rename from examples/v2/ai-impact/CreateAIImpactUserActivity.py rename to examples/v2/dora-metrics/CreateAIImpactUserActivity.py index 77d422ad16..de20e22233 100644 --- a/examples/v2/ai-impact/CreateAIImpactUserActivity.py +++ b/examples/v2/dora-metrics/CreateAIImpactUserActivity.py @@ -3,7 +3,7 @@ """ from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ai_impact_api import AIImpactApi +from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi from datadog_api_client.v2.model.ai_impact_user_activity_attributes import AIImpactUserActivityAttributes from datadog_api_client.v2.model.ai_impact_user_activity_data import AIImpactUserActivityData from datadog_api_client.v2.model.ai_impact_user_activity_request import AIImpactUserActivityRequest @@ -32,5 +32,5 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = AIImpactApi(api_client) + api_instance = DORAMetricsApi(api_client) api_instance.create_ai_impact_user_activity(body=body) diff --git a/src/datadog_api_client/v2/api/ai_impact_api.py b/src/datadog_api_client/v2/api/ai_impact_api.py deleted file mode 100644 index fbd1e8ba75..0000000000 --- a/src/datadog_api_client/v2/api/ai_impact_api.py +++ /dev/null @@ -1,60 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Any, Dict - -from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint -from datadog_api_client.configuration import Configuration -from datadog_api_client.v2.model.ai_impact_user_activity_request import AIImpactUserActivityRequest - - -class AIImpactApi: - """ - Send AI coding tool usage data to measure the impact of AI tools on software delivery. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient(Configuration()) - self.api_client = api_client - - self._create_ai_impact_user_activity_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["apiKeyAuth"], - "endpoint_path": "/api/v2/ai_impact/user_activity", - "operation_id": "create_ai_impact_user_activity", - "http_method": "POST", - "version": "v2", - }, - params_map={ - "body": { - "required": True, - "openapi_types": (AIImpactUserActivityRequest,), - "location": "body", - }, - }, - headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, - api_client=api_client, - ) - - def create_ai_impact_user_activity( - self, - body: AIImpactUserActivityRequest, - ) -> None: - """Send AI tool user activity. - - Send daily AI coding tool activity for one or more users. Each entry records whether a - user was active on a given day, along with the AI tools and models they used. An entry - is stored once per tool, and sending the same user, day, and tool again overwrites the - previous value. - - :type body: AIImpactUserActivityRequest - :rtype: None - """ - kwargs: Dict[str, Any] = {} - kwargs["body"] = body - - return self._create_ai_impact_user_activity_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/dora_metrics_api.py b/src/datadog_api_client/v2/api/dora_metrics_api.py index 248af44593..534f7b1a8e 100644 --- a/src/datadog_api_client/v2/api/dora_metrics_api.py +++ b/src/datadog_api_client/v2/api/dora_metrics_api.py @@ -8,6 +8,7 @@ from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.ai_impact_user_activity_request import AIImpactUserActivityRequest from datadog_api_client.v2.model.dora_deployment_response import DORADeploymentResponse from datadog_api_client.v2.model.dora_deployment_request import DORADeploymentRequest from datadog_api_client.v2.model.dora_deployment_patch_by_version_request import DORADeploymentPatchByVersionRequest @@ -34,6 +35,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_ai_impact_user_activity_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth"], + "endpoint_path": "/api/v2/ai_impact/user_activity", + "operation_id": "create_ai_impact_user_activity", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AIImpactUserActivityRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_dora_deployment_endpoint = _Endpoint( settings={ "response_type": (DORADeploymentResponse,), @@ -272,6 +293,25 @@ def __init__(self, api_client=None): api_client=api_client, ) + def create_ai_impact_user_activity( + self, + body: AIImpactUserActivityRequest, + ) -> None: + """Send AI tool user activity. + + Send daily AI coding tool activity for one or more users. Each entry records whether a + user was active on a given day, along with the AI tools and models they used. An entry + is stored once per tool, and sending the same user, day, and tool again overwrites the + previous value. + + :type body: AIImpactUserActivityRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_ai_impact_user_activity_endpoint.call_with_http_info(**kwargs) + def create_dora_deployment( self, body: DORADeploymentRequest, diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index cb8e0f2a3e..2fde805f3c 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -1,4 +1,3 @@ -from datadog_api_client.v2.api.ai_impact_api import AIImpactApi from datadog_api_client.v2.api.api_management_api import APIManagementApi from datadog_api_client.v2.api.apm_api import APMApi from datadog_api_client.v2.api.apm_retention_filters_api import APMRetentionFiltersApi @@ -156,7 +155,6 @@ __all__ = [ - "AIImpactApi", "APIManagementApi", "APMApi", "APMRetentionFiltersApi", diff --git a/tests/v2/features/ai_impact.feature b/tests/v2/features/ai_impact.feature deleted file mode 100644 index ee04200c6b..0000000000 --- a/tests/v2/features/ai_impact.feature +++ /dev/null @@ -1,20 +0,0 @@ -@endpoint(ai-impact) @endpoint(ai-impact-v2) -Feature: AI Impact - Send AI coding tool usage data to measure the impact of AI tools on - software delivery. - - Background: - Given a valid "apiKeyAuth" key in the system - And an instance of "AIImpact" API - And new "CreateAIImpactUserActivity" request - And body with value {"data": [{"attributes": {"day": "2026-05-26", "is_active": true, "models": ["claude-sonnet-4.5", "gpt-5"], "tools": ["Claude Code", "Cursor"], "user_email": "user@example.com"}, "type": "ai_impact_user_activity"}]} - - @generated @skip @team:ddoghq/ci-app-backend - Scenario: Send AI tool user activity returns "Bad Request: the batch is empty, has more than 1,000 entries, or contains an invalid entry." response - When the request is sent - Then the response status is 400 Bad Request: the batch is empty, has more than 1,000 entries, or contains an invalid entry. - - @generated @skip @team:ddoghq/ci-app-backend - Scenario: Send AI tool user activity returns "OK" response - When the request is sent - Then the response status is 200 OK diff --git a/tests/v2/features/dora_metrics.feature b/tests/v2/features/dora_metrics.feature index 148966a7fe..07de747ff3 100644 --- a/tests/v2/features/dora_metrics.feature +++ b/tests/v2/features/dora_metrics.feature @@ -190,6 +190,20 @@ Feature: DORA Metrics When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:ddoghq/ci-app-backend + Scenario: Send AI tool user activity returns "Bad Request: the batch is empty, has more than 1,000 entries, or contains an invalid entry." response + Given new "CreateAIImpactUserActivity" request + And body with value {"data": [{"attributes": {"day": "2026-05-26", "is_active": true, "models": ["claude-sonnet-4.5", "gpt-5"], "tools": ["Claude Code", "Cursor"], "user_email": "user@example.com"}, "type": "ai_impact_user_activity"}]} + When the request is sent + Then the response status is 400 Bad Request: the batch is empty, has more than 1,000 entries, or contains an invalid entry. + + @generated @skip @team:ddoghq/ci-app-backend + Scenario: Send AI tool user activity returns "OK" response + Given new "CreateAIImpactUserActivity" request + And body with value {"data": [{"attributes": {"day": "2026-05-26", "is_active": true, "models": ["claude-sonnet-4.5", "gpt-5"], "tools": ["Claude Code", "Cursor"], "user_email": "user@example.com"}, "type": "ai_impact_user_activity"}]} + When the request is sent + Then the response status is 200 OK + @skip @team:ddoghq/ci-app-backend Scenario: Send a deployment event returns "Bad Request" response Given new "CreateDORADeployment" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 633391ec1a..b2a13dfd74 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -369,7 +369,7 @@ } }, "CreateAIImpactUserActivity": { - "tag": "AI Impact", + "tag": "DORA Metrics", "undo": { "type": "idempotent" }