Skip to content

Commit 47c5fa6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1865878 of spec repo
1 parent 28d6577 commit 47c5fa6

9 files changed

Lines changed: 208 additions & 25 deletions

File tree

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

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24852,6 +24852,8 @@ components:
2485224852
description: The description of the feature flag.
2485324853
example: "This is an example feature flag for demonstration"
2485424854
type: string
24855+
distribution_channel:
24856+
$ref: "#/components/schemas/FeatureFlagDistributionChannel"
2485524857
json_schema:
2485624858
description: JSON schema for validation when value_type is JSON.
2485724859
example: '{"type": "object", "properties": {"enabled": {"type": "boolean"}}}'
@@ -24865,6 +24867,19 @@ components:
2486524867
description: The name of the feature flag.
2486624868
example: "Feature Flag ABC123"
2486724869
type: string
24870+
require_approval:
24871+
description: Indicates whether this feature flag requires approval for changes.
24872+
example: false
24873+
type: boolean
24874+
staleness_status:
24875+
$ref: "#/components/schemas/CreateFeatureFlagStalenessStatus"
24876+
tags:
24877+
description: Tags associated with the feature flag.
24878+
example: []
24879+
items:
24880+
description: A tag associated with the feature flag.
24881+
type: string
24882+
type: array
2486824883
value_type:
2486924884
$ref: "#/components/schemas/ValueType"
2487024885
variants:
@@ -24875,7 +24890,6 @@ components:
2487524890
required:
2487624891
- key
2487724892
- name
24878-
- description
2487924893
- value_type
2488024894
- variants
2488124895
type: object
@@ -24906,6 +24920,16 @@ components:
2490624920
required:
2490724921
- data
2490824922
type: object
24923+
CreateFeatureFlagStalenessStatus:
24924+
description: The staleness status for a feature flag at creation.
24925+
enum:
24926+
- ACTIVE
24927+
- PERMANENT
24928+
example: "ACTIVE"
24929+
type: string
24930+
x-enum-varnames:
24931+
- ACTIVE
24932+
- PERMANENT
2490924933
CreateFormData:
2491024934
description: The data for creating a form.
2491124935
properties:
@@ -39130,6 +39154,18 @@ components:
3913039154
- value_type
3913139155
- variants
3913239156
type: object
39157+
FeatureFlagDistributionChannel:
39158+
description: The distribution channel for a feature flag.
39159+
enum:
39160+
- ALL
39161+
- CLIENT
39162+
- SERVER
39163+
example: "ALL"
39164+
type: string
39165+
x-enum-varnames:
39166+
- ALL
39167+
- CLIENT
39168+
- SERVER
3913339169
FeatureFlagEnvironment:
3913439170
description: Environment-specific settings for a feature flag.
3913539171
properties:
@@ -148249,14 +148285,21 @@ paths:
148249148285
attributes:
148250148286
default_variant_key: variant-a
148251148287
description: A sample feature flag
148252-
enabled: true
148288+
distribution_channel: ALL
148253148289
key: feature-flag-abc123
148254148290
name: Feature Flag ABC 123
148291+
require_approval: false
148292+
staleness_status: ACTIVE
148293+
tags:
148294+
- team:feature-flags-app
148295+
value_type: BOOLEAN
148255148296
variants:
148256-
- description: Variant A
148257-
key: variant-a
148258-
- description: Variant B
148259-
key: variant-b
148297+
- key: variant-a
148298+
name: Variant A
148299+
value: "true"
148300+
- key: variant-b
148301+
name: Variant B
148302+
value: "false"
148260148303
type: feature-flags
148261148304
schema:
148262148305
$ref: "#/components/schemas/CreateFeatureFlagRequest"

‎examples/v2/feature-flags/CreateFeatureFlag.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@
88
from datadog_api_client.v2.model.create_feature_flag_data import CreateFeatureFlagData
99
from datadog_api_client.v2.model.create_feature_flag_data_type import CreateFeatureFlagDataType
1010
from datadog_api_client.v2.model.create_feature_flag_request import CreateFeatureFlagRequest
11+
from datadog_api_client.v2.model.create_feature_flag_staleness_status import CreateFeatureFlagStalenessStatus
1112
from datadog_api_client.v2.model.create_variant import CreateVariant
13+
from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel
1214
from datadog_api_client.v2.model.value_type import ValueType
1315

1416
body = CreateFeatureFlagRequest(
1517
data=CreateFeatureFlagData(
1618
type=CreateFeatureFlagDataType.FEATURE_FLAGS,
1719
attributes=CreateFeatureFlagAttributes(
1820
default_variant_key="variant-Example-Feature-Flag-1",
19-
description="Test feature flag for BDD scenarios",
21+
distribution_channel=FeatureFlagDistributionChannel.SERVER,
2022
key="test-feature-flag-Example-Feature-Flag",
2123
name="Test Feature Flag Example-Feature-Flag",
24+
require_approval=False,
25+
staleness_status=CreateFeatureFlagStalenessStatus.PERMANENT,
26+
tags=[
27+
"env:api-client-test",
28+
],
2229
value_type=ValueType.BOOLEAN,
2330
variants=[
2431
CreateVariant(

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

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,61 @@
1515

1616

1717
if TYPE_CHECKING:
18+
from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel
19+
from datadog_api_client.v2.model.create_feature_flag_staleness_status import CreateFeatureFlagStalenessStatus
1820
from datadog_api_client.v2.model.value_type import ValueType
1921
from datadog_api_client.v2.model.create_variant import CreateVariant
2022

2123

2224
class CreateFeatureFlagAttributes(ModelNormal):
2325
@cached_property
2426
def openapi_types(_):
27+
from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel
28+
from datadog_api_client.v2.model.create_feature_flag_staleness_status import CreateFeatureFlagStalenessStatus
2529
from datadog_api_client.v2.model.value_type import ValueType
2630
from datadog_api_client.v2.model.create_variant import CreateVariant
2731

2832
return {
2933
"default_variant_key": (str, none_type),
3034
"description": (str,),
35+
"distribution_channel": (FeatureFlagDistributionChannel,),
3136
"json_schema": (str, none_type),
3237
"key": (str,),
3338
"name": (str,),
39+
"require_approval": (bool,),
40+
"staleness_status": (CreateFeatureFlagStalenessStatus,),
41+
"tags": ([str],),
3442
"value_type": (ValueType,),
3543
"variants": ([CreateVariant],),
3644
}
3745

3846
attribute_map = {
3947
"default_variant_key": "default_variant_key",
4048
"description": "description",
49+
"distribution_channel": "distribution_channel",
4150
"json_schema": "json_schema",
4251
"key": "key",
4352
"name": "name",
53+
"require_approval": "require_approval",
54+
"staleness_status": "staleness_status",
55+
"tags": "tags",
4456
"value_type": "value_type",
4557
"variants": "variants",
4658
}
4759

4860
def __init__(
4961
self_,
50-
description: str,
5162
key: str,
5263
name: str,
5364
value_type: ValueType,
5465
variants: List[CreateVariant],
5566
default_variant_key: Union[str, none_type, UnsetType] = unset,
67+
description: Union[str, UnsetType] = unset,
68+
distribution_channel: Union[FeatureFlagDistributionChannel, UnsetType] = unset,
5669
json_schema: Union[str, none_type, UnsetType] = unset,
70+
require_approval: Union[bool, UnsetType] = unset,
71+
staleness_status: Union[CreateFeatureFlagStalenessStatus, UnsetType] = unset,
72+
tags: Union[List[str], UnsetType] = unset,
5773
**kwargs,
5874
):
5975
"""
@@ -63,7 +79,10 @@ def __init__(
6379
:type default_variant_key: str, none_type, optional
6480
6581
:param description: The description of the feature flag.
66-
:type description: str
82+
:type description: str, optional
83+
84+
:param distribution_channel: The distribution channel for a feature flag.
85+
:type distribution_channel: FeatureFlagDistributionChannel, optional
6786
6887
:param json_schema: JSON schema for validation when value_type is JSON.
6988
:type json_schema: str, none_type, optional
@@ -74,6 +93,15 @@ def __init__(
7493
:param name: The name of the feature flag.
7594
:type name: str
7695
96+
:param require_approval: Indicates whether this feature flag requires approval for changes.
97+
:type require_approval: bool, optional
98+
99+
:param staleness_status: The staleness status for a feature flag at creation.
100+
:type staleness_status: CreateFeatureFlagStalenessStatus, optional
101+
102+
:param tags: Tags associated with the feature flag.
103+
:type tags: [str], optional
104+
77105
:param value_type: The type of values for the feature flag variants.
78106
:type value_type: ValueType
79107
@@ -82,11 +110,20 @@ def __init__(
82110
"""
83111
if default_variant_key is not unset:
84112
kwargs["default_variant_key"] = default_variant_key
113+
if description is not unset:
114+
kwargs["description"] = description
115+
if distribution_channel is not unset:
116+
kwargs["distribution_channel"] = distribution_channel
85117
if json_schema is not unset:
86118
kwargs["json_schema"] = json_schema
119+
if require_approval is not unset:
120+
kwargs["require_approval"] = require_approval
121+
if staleness_status is not unset:
122+
kwargs["staleness_status"] = staleness_status
123+
if tags is not unset:
124+
kwargs["tags"] = tags
87125
super().__init__(kwargs)
88126

89-
self_.description = description
90127
self_.key = key
91128
self_.name = name
92129
self_.value_type = value_type
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class CreateFeatureFlagStalenessStatus(ModelSimple):
16+
"""
17+
The staleness status for a feature flag at creation.
18+
19+
:param value: Must be one of ["ACTIVE", "PERMANENT"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"ACTIVE",
25+
"PERMANENT",
26+
}
27+
ACTIVE: ClassVar["CreateFeatureFlagStalenessStatus"]
28+
PERMANENT: ClassVar["CreateFeatureFlagStalenessStatus"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
CreateFeatureFlagStalenessStatus.ACTIVE = CreateFeatureFlagStalenessStatus("ACTIVE")
38+
CreateFeatureFlagStalenessStatus.PERMANENT = CreateFeatureFlagStalenessStatus("PERMANENT")
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class FeatureFlagDistributionChannel(ModelSimple):
16+
"""
17+
The distribution channel for a feature flag.
18+
19+
:param value: Must be one of ["ALL", "CLIENT", "SERVER"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"ALL",
25+
"CLIENT",
26+
"SERVER",
27+
}
28+
ALL: ClassVar["FeatureFlagDistributionChannel"]
29+
CLIENT: ClassVar["FeatureFlagDistributionChannel"]
30+
SERVER: ClassVar["FeatureFlagDistributionChannel"]
31+
32+
@cached_property
33+
def openapi_types(_):
34+
return {
35+
"value": (str,),
36+
}
37+
38+
39+
FeatureFlagDistributionChannel.ALL = FeatureFlagDistributionChannel("ALL")
40+
FeatureFlagDistributionChannel.CLIENT = FeatureFlagDistributionChannel("CLIENT")
41+
FeatureFlagDistributionChannel.SERVER = FeatureFlagDistributionChannel("SERVER")

‎src/datadog_api_client/v2/models/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,7 @@
17821782
from datadog_api_client.v2.model.create_feature_flag_data import CreateFeatureFlagData
17831783
from datadog_api_client.v2.model.create_feature_flag_data_type import CreateFeatureFlagDataType
17841784
from datadog_api_client.v2.model.create_feature_flag_request import CreateFeatureFlagRequest
1785+
from datadog_api_client.v2.model.create_feature_flag_staleness_status import CreateFeatureFlagStalenessStatus
17851786
from datadog_api_client.v2.model.create_form_data import CreateFormData
17861787
from datadog_api_client.v2.model.create_form_data_attributes import CreateFormDataAttributes
17871788
from datadog_api_client.v2.model.create_form_request import CreateFormRequest
@@ -3114,6 +3115,7 @@
31143115
from datadog_api_client.v2.model.fastly_services_response import FastlyServicesResponse
31153116
from datadog_api_client.v2.model.feature_flag import FeatureFlag
31163117
from datadog_api_client.v2.model.feature_flag_attributes import FeatureFlagAttributes
3118+
from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel
31173119
from datadog_api_client.v2.model.feature_flag_environment import FeatureFlagEnvironment
31183120
from datadog_api_client.v2.model.feature_flag_environment_list_item import FeatureFlagEnvironmentListItem
31193121
from datadog_api_client.v2.model.feature_flag_list_item import FeatureFlagListItem
@@ -12636,6 +12638,7 @@
1263612638
"CreateFeatureFlagData",
1263712639
"CreateFeatureFlagDataType",
1263812640
"CreateFeatureFlagRequest",
12641+
"CreateFeatureFlagStalenessStatus",
1263912642
"CreateFormData",
1264012643
"CreateFormDataAttributes",
1264112644
"CreateFormRequest",
@@ -13546,6 +13549,7 @@
1354613549
"FastlyServicesResponse",
1354713550
"FeatureFlag",
1354813551
"FeatureFlagAttributes",
13552+
"FeatureFlagDistributionChannel",
1354913553
"FeatureFlagEnvironment",
1355013554
"FeatureFlagEnvironmentListItem",
1355113555
"FeatureFlagListItem",

‎tests/generated-test/test-runner-data/v2/feature-flags/create-a-feature-flag-returns-created-response.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616
"data": {
1717
"attributes": {
1818
"default_variant_key": "variant-{{ unique }}-1",
19-
"description": "Test feature flag for BDD scenarios",
19+
"distribution_channel": "SERVER",
2020
"key": "test-feature-flag-{{ unique }}",
2121
"name": "Test Feature Flag {{ unique }}",
22+
"require_approval": false,
23+
"staleness_status": "PERMANENT",
24+
"tags": [
25+
"env:api-client-test"
26+
],
2227
"value_type": "BOOLEAN",
2328
"variants": [
2429
{

0 commit comments

Comments
 (0)