Skip to content

Commit 70d1ae6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8db3ca6 of spec repo
1 parent 39d931d commit 70d1ae6

27 files changed

Lines changed: 2676 additions & 657 deletions

File tree

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 142 additions & 70 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
Create an environment with full evaluation data true returns "Created" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.create_environment_attributes import CreateEnvironmentAttributes
9+
from datadog_api_client.v2.model.create_environment_data import CreateEnvironmentData
10+
from datadog_api_client.v2.model.create_environment_data_type import CreateEnvironmentDataType
11+
from datadog_api_client.v2.model.create_environment_request import CreateEnvironmentRequest
12+
13+
body = CreateEnvironmentRequest(
14+
data=CreateEnvironmentData(
15+
type=CreateEnvironmentDataType.ENVIRONMENTS,
16+
attributes=CreateEnvironmentAttributes(
17+
name="Evaluation Privacy Example-Feature-Flag",
18+
queries=[
19+
"privacy-example-feature-flag",
20+
],
21+
observe_full_evaluation_data=True,
22+
),
23+
),
24+
)
25+
26+
configuration = Configuration()
27+
configuration.access_token = environ["DD_BEARER_TOKEN"]
28+
with ApiClient(configuration) as api_client:
29+
api_instance = FeatureFlagsApi(api_client)
30+
response = api_instance.create_feature_flags_environment(body=body)
31+
32+
print(response)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
Create an environment with full evaluation data false returns "Created" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.create_environment_attributes import CreateEnvironmentAttributes
9+
from datadog_api_client.v2.model.create_environment_data import CreateEnvironmentData
10+
from datadog_api_client.v2.model.create_environment_data_type import CreateEnvironmentDataType
11+
from datadog_api_client.v2.model.create_environment_request import CreateEnvironmentRequest
12+
13+
body = CreateEnvironmentRequest(
14+
data=CreateEnvironmentData(
15+
type=CreateEnvironmentDataType.ENVIRONMENTS,
16+
attributes=CreateEnvironmentAttributes(
17+
name="Evaluation Privacy Example-Feature-Flag",
18+
queries=[
19+
"privacy-example-feature-flag",
20+
],
21+
observe_full_evaluation_data=False,
22+
),
23+
),
24+
)
25+
26+
configuration = Configuration()
27+
configuration.access_token = environ["DD_BEARER_TOKEN"]
28+
with ApiClient(configuration) as api_client:
29+
api_instance = FeatureFlagsApi(api_client)
30+
response = api_instance.create_feature_flags_environment(body=body)
31+
32+
print(response)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
Update an environment to enable full evaluation data returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.update_environment_attributes import UpdateEnvironmentAttributes
9+
from datadog_api_client.v2.model.update_environment_data import UpdateEnvironmentData
10+
from datadog_api_client.v2.model.update_environment_data_type import UpdateEnvironmentDataType
11+
from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest
12+
13+
# there is a valid "environment" in the system
14+
ENVIRONMENT_DATA_ID = environ["ENVIRONMENT_DATA_ID"]
15+
16+
body = UpdateEnvironmentRequest(
17+
data=UpdateEnvironmentData(
18+
type=UpdateEnvironmentDataType.ENVIRONMENTS,
19+
attributes=UpdateEnvironmentAttributes(
20+
name="Updated Privacy Example-Feature-Flag",
21+
queries=[
22+
"updated-privacy-example-feature-flag",
23+
],
24+
observe_full_evaluation_data=True,
25+
),
26+
),
27+
)
28+
29+
configuration = Configuration()
30+
configuration.access_token = environ["DD_BEARER_TOKEN"]
31+
with ApiClient(configuration) as api_client:
32+
api_instance = FeatureFlagsApi(api_client)
33+
response = api_instance.update_feature_flags_environment(environment_id=ENVIRONMENT_DATA_ID, body=body)
34+
35+
print(response)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
Update an environment to preserve enabled full evaluation data when omitted returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.update_environment_attributes import UpdateEnvironmentAttributes
9+
from datadog_api_client.v2.model.update_environment_data import UpdateEnvironmentData
10+
from datadog_api_client.v2.model.update_environment_data_type import UpdateEnvironmentDataType
11+
from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest
12+
13+
# there is a valid "environment_with_full_evaluation_data" in the system
14+
ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID = environ["ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID"]
15+
16+
body = UpdateEnvironmentRequest(
17+
data=UpdateEnvironmentData(
18+
type=UpdateEnvironmentDataType.ENVIRONMENTS,
19+
attributes=UpdateEnvironmentAttributes(
20+
name="Updated Privacy Example-Feature-Flag",
21+
queries=[
22+
"updated-privacy-example-feature-flag",
23+
],
24+
),
25+
),
26+
)
27+
28+
configuration = Configuration()
29+
configuration.access_token = environ["DD_BEARER_TOKEN"]
30+
with ApiClient(configuration) as api_client:
31+
api_instance = FeatureFlagsApi(api_client)
32+
response = api_instance.update_feature_flags_environment(
33+
environment_id=ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID, body=body
34+
)
35+
36+
print(response)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
Update an environment to preserve disabled full evaluation data when omitted returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.update_environment_attributes import UpdateEnvironmentAttributes
9+
from datadog_api_client.v2.model.update_environment_data import UpdateEnvironmentData
10+
from datadog_api_client.v2.model.update_environment_data_type import UpdateEnvironmentDataType
11+
from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest
12+
13+
# there is a valid "environment" in the system
14+
ENVIRONMENT_DATA_ID = environ["ENVIRONMENT_DATA_ID"]
15+
16+
body = UpdateEnvironmentRequest(
17+
data=UpdateEnvironmentData(
18+
type=UpdateEnvironmentDataType.ENVIRONMENTS,
19+
attributes=UpdateEnvironmentAttributes(
20+
name="Updated Privacy Example-Feature-Flag",
21+
queries=[
22+
"updated-privacy-example-feature-flag",
23+
],
24+
),
25+
),
26+
)
27+
28+
configuration = Configuration()
29+
configuration.access_token = environ["DD_BEARER_TOKEN"]
30+
with ApiClient(configuration) as api_client:
31+
api_instance = FeatureFlagsApi(api_client)
32+
response = api_instance.update_feature_flags_environment(environment_id=ENVIRONMENT_DATA_ID, body=body)
33+
34+
print(response)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
Update an environment to disable full evaluation data returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi
8+
from datadog_api_client.v2.model.update_environment_attributes import UpdateEnvironmentAttributes
9+
from datadog_api_client.v2.model.update_environment_data import UpdateEnvironmentData
10+
from datadog_api_client.v2.model.update_environment_data_type import UpdateEnvironmentDataType
11+
from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest
12+
13+
# there is a valid "environment_with_full_evaluation_data" in the system
14+
ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID = environ["ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID"]
15+
16+
body = UpdateEnvironmentRequest(
17+
data=UpdateEnvironmentData(
18+
type=UpdateEnvironmentDataType.ENVIRONMENTS,
19+
attributes=UpdateEnvironmentAttributes(
20+
name="Updated Privacy Example-Feature-Flag",
21+
queries=[
22+
"updated-privacy-example-feature-flag",
23+
],
24+
observe_full_evaluation_data=False,
25+
),
26+
),
27+
)
28+
29+
configuration = Configuration()
30+
configuration.access_token = environ["DD_BEARER_TOKEN"]
31+
with ApiClient(configuration) as api_client:
32+
api_instance = FeatureFlagsApi(api_client)
33+
response = api_instance.update_feature_flags_environment(
34+
environment_id=ENVIRONMENT_WITH_FULL_EVALUATION_DATA_DATA_ID, body=body
35+
)
36+
37+
print(response)

‎src/datadog_api_client/v2/api/feature_flags_api.py‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,17 +1147,17 @@ def list_feature_flags_environments(
11471147
"""List environments.
11481148
11491149
Returns a list of environments for the organization.
1150-
Supports filtering by name, key, and DD_ENV.
1150+
Use ``dd_env`` to filter by an exact DD_ENV value in an environment's ``queries`` list.
11511151
1152-
:param name: Filter environments by name (partial matching).
1152+
:param name: This parameter is currently ignored. Use dd_env to filter environments.
11531153
:type name: str, optional
1154-
:param key: Filter environments by key (partial matching).
1154+
:param key: This parameter is currently ignored. Use dd_env to filter environments.
11551155
:type key: str, optional
1156-
:param dd_env: Filter environments by queries that contain the provided DD_ENV value.
1156+
:param dd_env: Filter environments whose queries list contains an exact match for the provided DD_ENV value.
11571157
:type dd_env: str, optional
1158-
:param limit: Maximum number of results to return.
1158+
:param limit: This parameter is currently ignored. All matching environments are returned.
11591159
:type limit: int, optional
1160-
:param offset: Number of results to skip.
1160+
:param offset: This parameter is currently ignored. All matching environments are returned.
11611161
:type offset: int, optional
11621162
:rtype: ListEnvironmentsResponse
11631163
"""
@@ -1326,8 +1326,13 @@ def update_feature_flags_environment(
13261326
) -> EnvironmentResponse:
13271327
"""Update an environment.
13281328
1329-
Updates an existing environment's metadata such as
1330-
name and description.
1329+
Updates an environment's name, DD_ENV values, and settings.
1330+
1331+
Every request must include ``name`` and ``queries`` , even when changing only ``observe_full_evaluation_data``.
1332+
To preserve the current name and DD_ENV values, get the environment first and include those values in the request.
1333+
1334+
Omitting ``is_production`` or ``require_feature_flag_approval`` resets that setting to ``false``.
1335+
Include their current values to preserve them. Omitting ``observe_full_evaluation_data`` preserves its current value.
13311336
13321337
:param environment_id: The ID of the environment.
13331338
:type environment_id: UUID

‎src/datadog_api_client/v2/model/create_environment_attributes.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ def openapi_types(_):
2525
return {
2626
"is_production": (bool,),
2727
"name": (str,),
28+
"observe_full_evaluation_data": (bool,),
2829
"queries": ([str],),
2930
"require_feature_flag_approval": (bool,),
3031
}
3132

3233
attribute_map = {
3334
"is_production": "is_production",
3435
"name": "name",
36+
"observe_full_evaluation_data": "observe_full_evaluation_data",
3537
"queries": "queries",
3638
"require_feature_flag_approval": "require_feature_flag_approval",
3739
}
@@ -41,6 +43,7 @@ def __init__(
4143
name: str,
4244
queries: List[str],
4345
is_production: Union[bool, UnsetType] = unset,
46+
observe_full_evaluation_data: Union[bool, UnsetType] = unset,
4447
require_feature_flag_approval: Union[bool, UnsetType] = unset,
4548
**kwargs,
4649
):
@@ -50,17 +53,22 @@ def __init__(
5053
:param is_production: Indicates whether this is a production environment.
5154
:type is_production: bool, optional
5255
53-
:param name: The name of the environment.
56+
:param name: The name of the environment. Required on every request and unique within the organization. Must contain 1 to 200 ASCII characters, start with a letter or digit, and contain only letters, digits, spaces, underscores, hyphens, and periods.
5457
:type name: str
5558
56-
:param queries: List of queries to define the environment scope.
59+
:param observe_full_evaluation_data: Controls whether feature flag evaluation events may include original targeting identifiers and full evaluation context. When true, SDKs may include this data. When false, SDKs hash targeting identifiers and omit evaluation context. If omitted, defaults to false.
60+
:type observe_full_evaluation_data: bool, optional
61+
62+
:param queries: Required list of at least one exact DD_ENV value associated with this environment. Values cannot be used by another environment in the same organization. Wildcards and search expressions are not supported.
5763
:type queries: [str]
5864
5965
:param require_feature_flag_approval: Indicates whether feature flag changes require approval in this environment.
6066
:type require_feature_flag_approval: bool, optional
6167
"""
6268
if is_production is not unset:
6369
kwargs["is_production"] = is_production
70+
if observe_full_evaluation_data is not unset:
71+
kwargs["observe_full_evaluation_data"] = observe_full_evaluation_data
6472
if require_feature_flag_approval is not unset:
6573
kwargs["require_feature_flag_approval"] = require_feature_flag_approval
6674
super().__init__(kwargs)

‎src/datadog_api_client/v2/model/update_environment_attributes.py‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ def openapi_types(_):
2525
return {
2626
"is_production": (bool,),
2727
"name": (str,),
28+
"observe_full_evaluation_data": (bool,),
2829
"queries": ([str],),
2930
"require_feature_flag_approval": (bool,),
3031
}
3132

3233
attribute_map = {
3334
"is_production": "is_production",
3435
"name": "name",
36+
"observe_full_evaluation_data": "observe_full_evaluation_data",
3537
"queries": "queries",
3638
"require_feature_flag_approval": "require_feature_flag_approval",
3739
}
@@ -40,29 +42,35 @@ def __init__(
4042
self_,
4143
is_production: Union[bool, UnsetType] = unset,
4244
name: Union[str, UnsetType] = unset,
45+
observe_full_evaluation_data: Union[bool, UnsetType] = unset,
4346
queries: Union[List[str], UnsetType] = unset,
4447
require_feature_flag_approval: Union[bool, UnsetType] = unset,
4548
**kwargs,
4649
):
4750
"""
4851
Attributes for updating an environment.
4952
50-
:param is_production: Indicates whether this is a production environment.
53+
:param is_production: Indicates whether this is a production environment. If omitted, resets to false. Include the existing value to preserve it.
5154
:type is_production: bool, optional
5255
53-
:param name: The name of the environment.
56+
:param name: The name of the environment. Required on every request and unique within the organization. Must contain 1 to 200 ASCII characters, start with a letter or digit, and contain only letters, digits, spaces, underscores, hyphens, and periods.
5457
:type name: str, optional
5558
56-
:param queries: List of queries to define the environment scope.
59+
:param observe_full_evaluation_data: Controls whether feature flag evaluation events may include original targeting identifiers and full evaluation context. When true, SDKs may include this data. When false, SDKs hash targeting identifiers and omit evaluation context. If omitted, the existing value is preserved.
60+
:type observe_full_evaluation_data: bool, optional
61+
62+
:param queries: Required list of at least one exact DD_ENV value associated with this environment. Values cannot be used by another environment in the same organization. Wildcards and search expressions are not supported.
5763
:type queries: [str], optional
5864
59-
:param require_feature_flag_approval: Indicates whether feature flag changes require approval in this environment.
65+
:param require_feature_flag_approval: Indicates whether feature flag changes require approval in this environment. If omitted, resets to false. Include the existing value to preserve it.
6066
:type require_feature_flag_approval: bool, optional
6167
"""
6268
if is_production is not unset:
6369
kwargs["is_production"] = is_production
6470
if name is not unset:
6571
kwargs["name"] = name
72+
if observe_full_evaluation_data is not unset:
73+
kwargs["observe_full_evaluation_data"] = observe_full_evaluation_data
6674
if queries is not unset:
6775
kwargs["queries"] = queries
6876
if require_feature_flag_approval is not unset:

0 commit comments

Comments
 (0)