From a794493ebb9ae060802070b215835791f72475f4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 11 Nov 2026 18:17:25 +0000 Subject: [PATCH] Regenerate client from commit fab680f of spec repo --- .generator/schemas/v2/openapi.yaml | 253 +++++++++++++++++- .../v2/experiments/ListExperimentHoldouts.py | 20 ++ .../v2/api/experiments_api.py | 43 +++ ...riments_experiment_holdout_v2_dto_array.py | 44 +++ ...eriments_experiment_holdout_v2_dto_data.py | 72 +++++ ...periment_holdout_v2_dto_data_attributes.py | 111 ++++++++ ...out_v2_dto_data_attributes_holdout_type.py | 49 ++++ ...ent_holdout_v2_dto_data_attributes_kind.py | 47 ++++ ...nt_holdout_v2_dto_data_attributes_state.py | 62 +++++ ...nts_experiment_holdout_v2_dto_data_type.py | 37 +++ ..._experiment_v2_list_dto_data_attributes.py | 8 + ..._experiment_v2_response_data_attributes.py | 8 + src/datadog_api_client/v2/models/__init__.py | 26 ++ .../test-runner-data/manifest.json | 7 + ...periment-holdouts-returns-ok-response.json | 35 +++ .../test-server-data/v2/experiments.json | 82 ++++++ tests/v2/features/experiments.feature | 23 ++ tests/v2/features/undo.json | 6 + 18 files changed, 932 insertions(+), 1 deletion(-) create mode 100644 examples/v2/experiments/ListExperimentHoldouts.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_array.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_holdout_type.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_kind.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_state.py create mode 100644 src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_type.py create mode 100644 tests/generated-test/test-runner-data/v2/experiments/list-experiment-holdouts-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 34b3825145..c5df769feb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -50696,6 +50696,119 @@ components: type: string x-enum-varnames: - EXPERIMENT_DIAGNOSTICS + ExperimentsExperimentHoldoutV2DTOArray: + description: "Response containing the holdouts an experiment is attached to." + properties: + data: + description: "Holdouts the experiment is attached to, in evaluation order." + example: [] + items: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTOData" + type: array + required: + - data + type: object + ExperimentsExperimentHoldoutV2DTOData: + description: "A holdout the experiment is attached to." + properties: + attributes: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTODataAttributes" + id: + description: "Identifier of the holdout." + example: e1e2e3e4-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTODataType" + required: + - type + - id + type: object + ExperimentsExperimentHoldoutV2DTODataAttributes: + description: "Attributes of a holdout that the experiment is attached to." + properties: + evaluation_order: + description: >- + Zero-based position of this MANAGED holdout in the experiment's evaluation order. The GLOBAL holdout is evaluated first. Null for EXTERNAL holdouts. + example: 0 + format: int64 + nullable: true + type: integer + holdout_type: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType" + key: + description: "Key of the holdout." + example: q3-global-holdout + type: string + kind: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTODataAttributesKind" + name: + description: "Display name of the holdout." + example: Q3 global holdout + type: string + state: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTODataAttributesState" + traffic_allocation: + description: "Share of subjects the holdout holds back, from 0 to 1." + example: 0.05 + format: double + type: number + type: object + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType: + description: >- + How Datadog serves a MANAGED holdout. GLOBAL holdouts apply to every eligible experiment of a subject type. SELECTIVE holdouts apply only to the experiments attached to them. Null for EXTERNAL holdouts. + enum: + - GLOBAL + - SELECTIVE + - UNKNOWN + example: GLOBAL + nullable: true + type: string + x-enum-varnames: + - GLOBAL + - SELECTIVE + - UNKNOWN + ExperimentsExperimentHoldoutV2DTODataAttributesKind: + description: >- + Whether Datadog serves the holdout. Datadog serves MANAGED holdouts. EXTERNAL holdouts record what your own feature flagging system holds back, and Datadog does not serve them. + enum: + - MANAGED + - EXTERNAL + - UNKNOWN + example: MANAGED + type: string + x-enum-varnames: + - MANAGED + - EXTERNAL + - UNKNOWN + ExperimentsExperimentHoldoutV2DTODataAttributesState: + description: >- + Lifecycle phase of the holdout. PENDING holdouts have not started including experiments. INCLUDING holdouts are adding experiments. WAITING_FOR_ANALYSIS holdouts have stopped including experiments but have not started analysis. ANALYSING holdouts are in their analysis window. COMPLETE applies only to EXTERNAL holdouts that have ended their analysis window but are not archived. + enum: + - PENDING + - INCLUDING + - WAITING_FOR_ANALYSIS + - ANALYSING + - COMPLETE + - UNKNOWN + example: INCLUDING + type: string + x-enum-varnames: + - PENDING + - INCLUDING + - WAITING_FOR_ANALYSIS + - ANALYSING + - COMPLETE + - UNKNOWN + ExperimentsExperimentHoldoutV2DTODataType: + default: experiment-holdouts + description: Experiment holdout resource type. + enum: + - experiment-holdouts + example: experiment-holdouts + type: string + x-enum-varnames: + - EXPERIMENT_HOLDOUTS ExperimentsExperimentMetricGroupMutationV2: description: "Response containing the saved experiment metric group and result refresh information." properties: @@ -50822,6 +50935,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -50896,6 +51011,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -51078,6 +51195,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -51123,6 +51242,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -51177,6 +51298,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -51234,6 +51357,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -51304,6 +51429,16 @@ components: Kind of experiment. STANDARD is an ordinary experiment. Other values, such as CANARY and HOLDOUT, identify experiments owned by another workflow. New kinds may be added; treat unknown values as non-standard. example: STANDARD type: string + holdout_ids: + description: >- + IDs of the holdouts the experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the list includes the GLOBAL holdout that the experiment would join if it started. `GET /api/v2/experiments/{experiment_id}/holdouts` returns their details. + example: + - a1a2a3a4-0000-0000-0000-000000000000 + items: + description: "Identifier of a holdout." + format: uuid + type: string + type: array hypothesis: description: "Expected effect that the experiment is designed to test." example: A clearer checkout button increases purchase conversion @@ -53299,6 +53434,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -53374,6 +53511,8 @@ components: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -53477,6 +53616,16 @@ components: Kind of experiment. STANDARD is an ordinary experiment. Other values, such as CANARY and HOLDOUT, identify experiments owned by another workflow. New kinds may be added; treat unknown values as non-standard. example: STANDARD type: string + holdout_ids: + description: >- + IDs of the holdouts the experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the list includes the GLOBAL holdout that the experiment would join if it started. `GET /api/v2/experiments/{experiment_id}/holdouts` returns their details. + example: + - a1a2a3a4-0000-0000-0000-000000000000 + items: + description: "Identifier of a holdout." + format: uuid + type: string + type: array hypothesis: description: "Expected effect that the experiment is intended to test." example: A clearer checkout button increases purchase conversion @@ -53612,7 +53761,8 @@ components: nullable: true properties: allocation_key: - description: "Key of the feature flag allocation linked to the experiment. Matches the allocation key that SDKs report in flag evaluation results and exposure events." + description: >- + Key of the feature flag allocation linked to the experiment. Matches the allocation key that SDKs report in flag evaluation results and exposure events. type: string entry_point: $ref: >- @@ -181492,6 +181642,8 @@ paths: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -181691,6 +181843,7 @@ paths: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: [] name: Checkout button test pipeline_table_suffix: a1b2c3d4 related_links: [] @@ -185175,6 +185328,8 @@ paths: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: + - a1a2a3a4-0000-0000-0000-000000000000 hypothesis: A clearer checkout button increases purchase conversion name: Checkout button test pipeline_table_suffix: a1b2c3d4 @@ -185404,6 +185559,7 @@ paths: events_end_date: "2026-08-22T00:00:00Z" events_start_date: "2026-08-01T00:00:00Z" experiment_type: STANDARD + holdout_ids: [] name: Checkout button test pipeline_table_suffix: a1b2c3d4 related_links: [] @@ -185941,6 +186097,101 @@ paths: operator: AND permissions: - product_analytics_experiments_read + /api/v2/experiments/{experiment_id}/holdouts: + get: + description: >- + List the holdouts an experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the response includes the GLOBAL holdout that the experiment would join if it started. The response excludes archived and deleted holdouts, and MANAGED holdouts past their analysis window. EXTERNAL holdouts are listed until they are archived. MANAGED holdouts are listed only for experiments that use a Datadog feature flag, because Datadog serves holdouts only through its flags. The order matches the experiment's `holdout_ids` attribute. + operationId: ListExperimentHoldouts + parameters: + - description: "The UUID of the experiment." + in: path + name: experiment_id + required: true + schema: + description: "The UUID of the experiment." + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + evaluation_order: 0 + holdout_type: GLOBAL + key: q3-global-holdout + kind: MANAGED + name: Q3 global holdout + state: INCLUDING + traffic_allocation: 0.05 + id: e1e2e3e4-0000-0000-0000-000000000000 + type: experiment-holdouts + - attributes: + evaluation_order: 1 + holdout_type: SELECTIVE + key: checkout-holdout + kind: MANAGED + name: Checkout holdout + state: INCLUDING + traffic_allocation: 0.1 + id: f1f2f3f4-0000-0000-0000-000000000000 + type: experiment-holdouts + - attributes: + evaluation_order: + holdout_type: + key: partner-holdout + kind: EXTERNAL + name: Partner holdout + state: INCLUDING + traffic_allocation: 0.1 + id: a1a2a3a4-0000-0000-0000-000000000000 + type: experiment-holdouts + schema: + $ref: "#/components/schemas/ExperimentsExperimentHoldoutV2DTOArray" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Malformed experiment ID (not a valid UUID). + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: >- + The caller lacks the `product_analytics_experiments_read` permission or lacks permission to view this experiment. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No experiment with this ID exists for the organization. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_read + summary: List experiment holdouts + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_read /api/v2/experiments/{experiment_id}/metric-groups: get: description: >- diff --git a/examples/v2/experiments/ListExperimentHoldouts.py b/examples/v2/experiments/ListExperimentHoldouts.py new file mode 100644 index 0000000000..701cd0cf72 --- /dev/null +++ b/examples/v2/experiments/ListExperimentHoldouts.py @@ -0,0 +1,20 @@ +""" +List experiment holdouts returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.experiments_api import ExperimentsApi + +# there is a valid "experiment" in the system +EXPERIMENT_DATA_ID = environ["EXPERIMENT_DATA_ID"] + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = ExperimentsApi(api_client) + response = api_instance.list_experiment_holdouts( + experiment_id=EXPERIMENT_DATA_ID, + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/experiments_api.py b/src/datadog_api_client/v2/api/experiments_api.py index 3ef64e1d23..f3619759d2 100644 --- a/src/datadog_api_client/v2/api/experiments_api.py +++ b/src/datadog_api_client/v2/api/experiments_api.py @@ -81,6 +81,9 @@ ExperimentsConcludeExperimentV2Request, ) from datadog_api_client.v2.model.experiments_experiment_diagnostics_v2_dto import ExperimentsExperimentDiagnosticsV2DTO +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_array import ( + ExperimentsExperimentHoldoutV2DTOArray, +) from datadog_api_client.v2.model.experiments_experiment_metric_group_v2_dto_array import ( ExperimentsExperimentMetricGroupV2DTOArray, ) @@ -834,6 +837,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_experiment_holdouts_endpoint = _Endpoint( + settings={ + "response_type": (ExperimentsExperimentHoldoutV2DTOArray,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/experiments/{experiment_id}/holdouts", + "operation_id": "list_experiment_holdouts", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "experiment_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "experiment_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_experiment_metric_groups_endpoint = _Endpoint( settings={ "response_type": (ExperimentsExperimentMetricGroupV2DTOArray,), @@ -2196,6 +2222,23 @@ def get_subject_type( return self._get_subject_type_endpoint.call_with_http_info(**kwargs) + def list_experiment_holdouts( + self, + experiment_id: UUID, + ) -> ExperimentsExperimentHoldoutV2DTOArray: + """List experiment holdouts. + + List the holdouts an experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the response includes the GLOBAL holdout that the experiment would join if it started. The response excludes archived and deleted holdouts, and MANAGED holdouts past their analysis window. EXTERNAL holdouts are listed until they are archived. MANAGED holdouts are listed only for experiments that use a Datadog feature flag, because Datadog serves holdouts only through its flags. The order matches the experiment's ``holdout_ids`` attribute. + + :param experiment_id: The UUID of the experiment. + :type experiment_id: UUID + :rtype: ExperimentsExperimentHoldoutV2DTOArray + """ + kwargs: Dict[str, Any] = {} + kwargs["experiment_id"] = experiment_id + + return self._list_experiment_holdouts_endpoint.call_with_http_info(**kwargs) + def list_experiment_metric_groups( self, experiment_id: UUID, diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_array.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_array.py new file mode 100644 index 0000000000..f983c59047 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_array.py @@ -0,0 +1,44 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data import ( + ExperimentsExperimentHoldoutV2DTOData, + ) + + +class ExperimentsExperimentHoldoutV2DTOArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data import ( + ExperimentsExperimentHoldoutV2DTOData, + ) + + return { + "data": ([ExperimentsExperimentHoldoutV2DTOData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ExperimentsExperimentHoldoutV2DTOData], **kwargs): + """ + Response containing the holdouts an experiment is attached to. + + :param data: Holdouts the experiment is attached to, in evaluation order. + :type data: [ExperimentsExperimentHoldoutV2DTOData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data.py new file mode 100644 index 0000000000..846facfcea --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data.py @@ -0,0 +1,72 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes import ( + ExperimentsExperimentHoldoutV2DTODataAttributes, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_type import ( + ExperimentsExperimentHoldoutV2DTODataType, + ) + + +class ExperimentsExperimentHoldoutV2DTOData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes import ( + ExperimentsExperimentHoldoutV2DTODataAttributes, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_type import ( + ExperimentsExperimentHoldoutV2DTODataType, + ) + + return { + "attributes": (ExperimentsExperimentHoldoutV2DTODataAttributes,), + "id": (UUID,), + "type": (ExperimentsExperimentHoldoutV2DTODataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: UUID, + type: ExperimentsExperimentHoldoutV2DTODataType, + attributes: Union[ExperimentsExperimentHoldoutV2DTODataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + A holdout the experiment is attached to. + + :param attributes: Attributes of a holdout that the experiment is attached to. + :type attributes: ExperimentsExperimentHoldoutV2DTODataAttributes, optional + + :param id: Identifier of the holdout. + :type id: UUID + + :param type: Experiment holdout resource type. + :type type: ExperimentsExperimentHoldoutV2DTODataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes.py new file mode 100644 index 0000000000..28a2ea4112 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes.py @@ -0,0 +1,111 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_holdout_type import ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_kind import ( + ExperimentsExperimentHoldoutV2DTODataAttributesKind, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_state import ( + ExperimentsExperimentHoldoutV2DTODataAttributesState, + ) + + +class ExperimentsExperimentHoldoutV2DTODataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_holdout_type import ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_kind import ( + ExperimentsExperimentHoldoutV2DTODataAttributesKind, + ) + from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_state import ( + ExperimentsExperimentHoldoutV2DTODataAttributesState, + ) + + return { + "evaluation_order": (int, none_type), + "holdout_type": (ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType,), + "key": (str,), + "kind": (ExperimentsExperimentHoldoutV2DTODataAttributesKind,), + "name": (str,), + "state": (ExperimentsExperimentHoldoutV2DTODataAttributesState,), + "traffic_allocation": (float,), + } + + attribute_map = { + "evaluation_order": "evaluation_order", + "holdout_type": "holdout_type", + "key": "key", + "kind": "kind", + "name": "name", + "state": "state", + "traffic_allocation": "traffic_allocation", + } + + def __init__( + self_, + evaluation_order: Union[int, none_type, UnsetType] = unset, + holdout_type: Union[ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType, none_type, UnsetType] = unset, + key: Union[str, UnsetType] = unset, + kind: Union[ExperimentsExperimentHoldoutV2DTODataAttributesKind, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + state: Union[ExperimentsExperimentHoldoutV2DTODataAttributesState, UnsetType] = unset, + traffic_allocation: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a holdout that the experiment is attached to. + + :param evaluation_order: Zero-based position of this MANAGED holdout in the experiment's evaluation order. The GLOBAL holdout is evaluated first. Null for EXTERNAL holdouts. + :type evaluation_order: int, none_type, optional + + :param holdout_type: How Datadog serves a MANAGED holdout. GLOBAL holdouts apply to every eligible experiment of a subject type. SELECTIVE holdouts apply only to the experiments attached to them. Null for EXTERNAL holdouts. + :type holdout_type: ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType, none_type, optional + + :param key: Key of the holdout. + :type key: str, optional + + :param kind: Whether Datadog serves the holdout. Datadog serves MANAGED holdouts. EXTERNAL holdouts record what your own feature flagging system holds back, and Datadog does not serve them. + :type kind: ExperimentsExperimentHoldoutV2DTODataAttributesKind, optional + + :param name: Display name of the holdout. + :type name: str, optional + + :param state: Lifecycle phase of the holdout. PENDING holdouts have not started including experiments. INCLUDING holdouts are adding experiments. WAITING_FOR_ANALYSIS holdouts have stopped including experiments but have not started analysis. ANALYSING holdouts are in their analysis window. COMPLETE applies only to EXTERNAL holdouts that have ended their analysis window but are not archived. + :type state: ExperimentsExperimentHoldoutV2DTODataAttributesState, optional + + :param traffic_allocation: Share of subjects the holdout holds back, from 0 to 1. + :type traffic_allocation: float, optional + """ + if evaluation_order is not unset: + kwargs["evaluation_order"] = evaluation_order + if holdout_type is not unset: + kwargs["holdout_type"] = holdout_type + if key is not unset: + kwargs["key"] = key + if kind is not unset: + kwargs["kind"] = kind + if name is not unset: + kwargs["name"] = name + if state is not unset: + kwargs["state"] = state + if traffic_allocation is not unset: + kwargs["traffic_allocation"] = traffic_allocation + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_holdout_type.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_holdout_type.py new file mode 100644 index 0000000000..cbae06bfe5 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_holdout_type.py @@ -0,0 +1,49 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType(ModelSimple): + """ + How Datadog serves a MANAGED holdout. GLOBAL holdouts apply to every eligible experiment of a subject type. SELECTIVE holdouts apply only to the experiments attached to them. Null for EXTERNAL holdouts. + + :param value: Must be one of ["GLOBAL", "SELECTIVE", "UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "GLOBAL", + "SELECTIVE", + "UNKNOWN", + } + GLOBAL: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType"] + SELECTIVE: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType"] + UNKNOWN: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType"] + + _nullable = True + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType.GLOBAL = ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType("GLOBAL") +) +ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType.SELECTIVE = ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType("SELECTIVE") +) +ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType.UNKNOWN = ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType("UNKNOWN") +) diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_kind.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_kind.py new file mode 100644 index 0000000000..a6cbfda371 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_kind.py @@ -0,0 +1,47 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ExperimentsExperimentHoldoutV2DTODataAttributesKind(ModelSimple): + """ + Whether Datadog serves the holdout. Datadog serves MANAGED holdouts. EXTERNAL holdouts record what your own feature flagging system holds back, and Datadog does not serve them. + + :param value: Must be one of ["MANAGED", "EXTERNAL", "UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "MANAGED", + "EXTERNAL", + "UNKNOWN", + } + MANAGED: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesKind"] + EXTERNAL: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesKind"] + UNKNOWN: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesKind"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ExperimentsExperimentHoldoutV2DTODataAttributesKind.MANAGED = ExperimentsExperimentHoldoutV2DTODataAttributesKind( + "MANAGED" +) +ExperimentsExperimentHoldoutV2DTODataAttributesKind.EXTERNAL = ExperimentsExperimentHoldoutV2DTODataAttributesKind( + "EXTERNAL" +) +ExperimentsExperimentHoldoutV2DTODataAttributesKind.UNKNOWN = ExperimentsExperimentHoldoutV2DTODataAttributesKind( + "UNKNOWN" +) diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_state.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_state.py new file mode 100644 index 0000000000..ccc394e113 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_attributes_state.py @@ -0,0 +1,62 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ExperimentsExperimentHoldoutV2DTODataAttributesState(ModelSimple): + """ + Lifecycle phase of the holdout. PENDING holdouts have not started including experiments. INCLUDING holdouts are adding experiments. WAITING_FOR_ANALYSIS holdouts have stopped including experiments but have not started analysis. ANALYSING holdouts are in their analysis window. COMPLETE applies only to EXTERNAL holdouts that have ended their analysis window but are not archived. + + :param value: Must be one of ["PENDING", "INCLUDING", "WAITING_FOR_ANALYSIS", "ANALYSING", "COMPLETE", "UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "PENDING", + "INCLUDING", + "WAITING_FOR_ANALYSIS", + "ANALYSING", + "COMPLETE", + "UNKNOWN", + } + PENDING: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + INCLUDING: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + WAITING_FOR_ANALYSIS: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + ANALYSING: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + COMPLETE: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + UNKNOWN: ClassVar["ExperimentsExperimentHoldoutV2DTODataAttributesState"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ExperimentsExperimentHoldoutV2DTODataAttributesState.PENDING = ExperimentsExperimentHoldoutV2DTODataAttributesState( + "PENDING" +) +ExperimentsExperimentHoldoutV2DTODataAttributesState.INCLUDING = ExperimentsExperimentHoldoutV2DTODataAttributesState( + "INCLUDING" +) +ExperimentsExperimentHoldoutV2DTODataAttributesState.WAITING_FOR_ANALYSIS = ( + ExperimentsExperimentHoldoutV2DTODataAttributesState("WAITING_FOR_ANALYSIS") +) +ExperimentsExperimentHoldoutV2DTODataAttributesState.ANALYSING = ExperimentsExperimentHoldoutV2DTODataAttributesState( + "ANALYSING" +) +ExperimentsExperimentHoldoutV2DTODataAttributesState.COMPLETE = ExperimentsExperimentHoldoutV2DTODataAttributesState( + "COMPLETE" +) +ExperimentsExperimentHoldoutV2DTODataAttributesState.UNKNOWN = ExperimentsExperimentHoldoutV2DTODataAttributesState( + "UNKNOWN" +) diff --git a/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_type.py b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_type.py new file mode 100644 index 0000000000..6ae1cc66e2 --- /dev/null +++ b/src/datadog_api_client/v2/model/experiments_experiment_holdout_v2_dto_data_type.py @@ -0,0 +1,37 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ExperimentsExperimentHoldoutV2DTODataType(ModelSimple): + """ + Experiment holdout resource type. + + :param value: If omitted defaults to "experiment-holdouts". Must be one of ["experiment-holdouts"]. + :type value: str + """ + + allowed_values = { + "experiment-holdouts", + } + EXPERIMENT_HOLDOUTS: ClassVar["ExperimentsExperimentHoldoutV2DTODataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ExperimentsExperimentHoldoutV2DTODataType.EXPERIMENT_HOLDOUTS = ExperimentsExperimentHoldoutV2DTODataType( + "experiment-holdouts" +) diff --git a/src/datadog_api_client/v2/model/experiments_experiment_v2_list_dto_data_attributes.py b/src/datadog_api_client/v2/model/experiments_experiment_v2_list_dto_data_attributes.py index 9e392dd96f..d356f92fd4 100644 --- a/src/datadog_api_client/v2/model/experiments_experiment_v2_list_dto_data_attributes.py +++ b/src/datadog_api_client/v2/model/experiments_experiment_v2_list_dto_data_attributes.py @@ -57,6 +57,7 @@ def openapi_types(_): "events_end_date": (datetime, none_type), "events_start_date": (datetime, none_type), "experiment_type": (str,), + "holdout_ids": ([UUID],), "hypothesis": (str,), "migration_metadata": ( bool, @@ -93,6 +94,7 @@ def openapi_types(_): "events_end_date": "events_end_date", "events_start_date": "events_start_date", "experiment_type": "experiment_type", + "holdout_ids": "holdout_ids", "hypothesis": "hypothesis", "migration_metadata": "migration_metadata", "name": "name", @@ -119,6 +121,7 @@ def __init__( events_end_date: Union[datetime, none_type, UnsetType] = unset, events_start_date: Union[datetime, none_type, UnsetType] = unset, experiment_type: Union[str, UnsetType] = unset, + holdout_ids: Union[List[UUID], UnsetType] = unset, hypothesis: Union[str, UnsetType] = unset, migration_metadata: Union[Any, UnsetType] = unset, name: Union[str, UnsetType] = unset, @@ -164,6 +167,9 @@ def __init__( :param experiment_type: Kind of experiment. STANDARD is an ordinary experiment. Other values, such as CANARY and HOLDOUT, identify experiments owned by another workflow. New kinds may be added; treat unknown values as non-standard. :type experiment_type: str, optional + :param holdout_ids: IDs of the holdouts the experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the list includes the GLOBAL holdout that the experiment would join if it started. ``GET /api/v2/experiments/{experiment_id}/holdouts`` returns their details. + :type holdout_ids: [UUID], optional + :param hypothesis: Expected effect that the experiment is designed to test. :type hypothesis: str, optional @@ -222,6 +228,8 @@ def __init__( kwargs["events_start_date"] = events_start_date if experiment_type is not unset: kwargs["experiment_type"] = experiment_type + if holdout_ids is not unset: + kwargs["holdout_ids"] = holdout_ids if hypothesis is not unset: kwargs["hypothesis"] = hypothesis if migration_metadata is not unset: diff --git a/src/datadog_api_client/v2/model/experiments_patch_experiment_v2_response_data_attributes.py b/src/datadog_api_client/v2/model/experiments_patch_experiment_v2_response_data_attributes.py index 53d231248c..be66854471 100644 --- a/src/datadog_api_client/v2/model/experiments_patch_experiment_v2_response_data_attributes.py +++ b/src/datadog_api_client/v2/model/experiments_patch_experiment_v2_response_data_attributes.py @@ -96,6 +96,7 @@ def openapi_types(_): "events_end_date": (datetime, none_type), "events_start_date": (datetime, none_type), "experiment_type": (str,), + "holdout_ids": ([UUID],), "hypothesis": (str,), "migration_metadata": ( bool, @@ -141,6 +142,7 @@ def openapi_types(_): "events_end_date": "events_end_date", "events_start_date": "events_start_date", "experiment_type": "experiment_type", + "holdout_ids": "holdout_ids", "hypothesis": "hypothesis", "migration_metadata": "migration_metadata", "name": "name", @@ -178,6 +180,7 @@ def __init__( events_end_date: Union[datetime, none_type, UnsetType] = unset, events_start_date: Union[datetime, none_type, UnsetType] = unset, experiment_type: Union[str, UnsetType] = unset, + holdout_ids: Union[List[UUID], UnsetType] = unset, hypothesis: Union[str, UnsetType] = unset, migration_metadata: Union[Any, UnsetType] = unset, name: Union[str, UnsetType] = unset, @@ -240,6 +243,9 @@ def __init__( :param experiment_type: Kind of experiment. STANDARD is an ordinary experiment. Other values, such as CANARY and HOLDOUT, identify experiments owned by another workflow. New kinds may be added; treat unknown values as non-standard. :type experiment_type: str, optional + :param holdout_ids: IDs of the holdouts the experiment is attached to, in evaluation order: MANAGED holdouts first, starting with the GLOBAL holdout, followed by EXTERNAL holdouts. For a draft experiment, the list includes the GLOBAL holdout that the experiment would join if it started. ``GET /api/v2/experiments/{experiment_id}/holdouts`` returns their details. + :type holdout_ids: [UUID], optional + :param hypothesis: Expected effect that the experiment is intended to test. :type hypothesis: str, optional @@ -316,6 +322,8 @@ def __init__( kwargs["events_start_date"] = events_start_date if experiment_type is not unset: kwargs["experiment_type"] = experiment_type + if holdout_ids is not unset: + kwargs["holdout_ids"] = holdout_ids if hypothesis is not unset: kwargs["hypothesis"] = hypothesis if migration_metadata is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b6d861d14a..5730fdc6bc 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4001,6 +4001,25 @@ from datadog_api_client.v2.model.experiments_experiment_diagnostics_v2_dto_data_type import ( ExperimentsExperimentDiagnosticsV2DTODataType, ) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_array import ( + ExperimentsExperimentHoldoutV2DTOArray, +) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data import ExperimentsExperimentHoldoutV2DTOData +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes import ( + ExperimentsExperimentHoldoutV2DTODataAttributes, +) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_holdout_type import ( + ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType, +) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_kind import ( + ExperimentsExperimentHoldoutV2DTODataAttributesKind, +) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_attributes_state import ( + ExperimentsExperimentHoldoutV2DTODataAttributesState, +) +from datadog_api_client.v2.model.experiments_experiment_holdout_v2_dto_data_type import ( + ExperimentsExperimentHoldoutV2DTODataType, +) from datadog_api_client.v2.model.experiments_experiment_metric_group_mutation_v2 import ( ExperimentsExperimentMetricGroupMutationV2, ) @@ -16756,6 +16775,13 @@ "ExperimentsExperimentDiagnosticsV2DTODataAttributesResult", "ExperimentsExperimentDiagnosticsV2DTODataAttributesState", "ExperimentsExperimentDiagnosticsV2DTODataType", + "ExperimentsExperimentHoldoutV2DTOArray", + "ExperimentsExperimentHoldoutV2DTOData", + "ExperimentsExperimentHoldoutV2DTODataAttributes", + "ExperimentsExperimentHoldoutV2DTODataAttributesHoldoutType", + "ExperimentsExperimentHoldoutV2DTODataAttributesKind", + "ExperimentsExperimentHoldoutV2DTODataAttributesState", + "ExperimentsExperimentHoldoutV2DTODataType", "ExperimentsExperimentMetricGroupMutationV2", "ExperimentsExperimentMetricGroupMutationV2Data", "ExperimentsExperimentMetricGroupMutationV2DataAttributesMetricsItems", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 4620b31977..76efa3cef5 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -6118,6 +6118,13 @@ "scenario": "Get subject type returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../v2/features/experiments.feature", + "file": "v2/experiments/list-experiment-holdouts-returns-ok-response.json", + "scenario": "List experiment holdouts returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../v2/features/experiments.feature", diff --git a/tests/generated-test/test-runner-data/v2/experiments/list-experiment-holdouts-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/experiments/list-experiment-holdouts-returns-ok-response.json new file mode 100644 index 0000000000..8fe5d14bad --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/experiments/list-experiment-holdouts-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/List experiment holdouts returns \"OK\" response", + "operation_id": "ListExperimentHoldouts", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "experiment_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/{experiment_id}/holdouts" + }, + "scenario": "List experiment holdouts returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-server-data/v2/experiments.json b/tests/generated-test/test-server-data/v2/experiments.json index f3f77b5130..c70c16f199 100644 --- a/tests/generated-test/test-server-data/v2/experiments.json +++ b/tests/generated-test/test-server-data/v2/experiments.json @@ -2235,6 +2235,88 @@ "scenario": "Get subject type returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "frozen_at": "2026-11-11T15:51:16.342Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-b11fe042126dd95f" + }, + "type": "experiments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06af48ef-5322-7000-ba71-98a43ecc3fc0\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-11-11T15:51:17.802364Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"holdout_ids\":[],\"name\":\"ex-b11fe042126dd95f\",\"pipeline_table_suffix\":\"yor8f7\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-11-11T15:51:17.834103Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/experiments/06af48ef-5322-7000-ba71-98a43ecc3fc0/holdouts", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/06af48ef-5322-7000-ba71-98a43ecc3fc0", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "List experiment holdouts returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "frozen_at": "2026-09-29T01:19:20.780Z", diff --git a/tests/v2/features/experiments.feature b/tests/v2/features/experiments.feature index 24f086abe3..d0741a1475 100644 --- a/tests/v2/features/experiments.feature +++ b/tests/v2/features/experiments.feature @@ -861,6 +861,29 @@ Feature: Experiments When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/experimentation + Scenario: List experiment holdouts returns "Malformed experiment ID (not a valid UUID)." response + Given new "ListExperimentHoldouts" request + And request contains "experiment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Malformed experiment ID (not a valid UUID). + + @generated @skip @team:ddoghq/experimentation + Scenario: List experiment holdouts returns "No experiment with this ID exists for the organization." response + Given new "ListExperimentHoldouts" request + And request contains "experiment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 No experiment with this ID exists for the organization. + + @team:ddoghq/experimentation + Scenario: List experiment holdouts returns "OK" response + Given new "ListExperimentHoldouts" request + And there is a valid "experiment" in the system + And request contains "experiment_id" parameter from "experiment.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 0 + @generated @skip @team:ddoghq/experimentation Scenario: List experiment metric groups returns "Malformed experiment ID." response Given new "ListExperimentMetricGroups" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 2f7556080e..993492a315 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3142,6 +3142,12 @@ "type": "safe" } }, + "ListExperimentHoldouts": { + "tag": "Experiments", + "undo": { + "type": "safe" + } + }, "ListExperimentMetricGroups": { "tag": "Experiments", "undo": {