Skip to content

Commit 57ffded

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 302b39c of spec repo
1 parent 06f047a commit 57ffded

6 files changed

Lines changed: 104 additions & 48 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19568,10 +19568,14 @@ components:
1956819568
- CONTAINER
1956919569
- CALLOUTVALUE
1957019570
Condition:
19571-
description: Targeting condition details.
19571+
description: |-
19572+
Targeting condition details. A condition is either an inline
19573+
predicate with `operator`, `attribute`, and `value`, or a reference to a
19574+
saved filter with `saved_filter_id`. The inline fields are omitted for saved-filter
19575+
references.
1957219576
properties:
1957319577
attribute:
19574-
description: The user or request attribute to evaluate.
19578+
description: The user or request attribute to evaluate. Omitted for saved-filter references.
1957519579
example: "country"
1957619580
type: string
1957719581
created_at:
@@ -19586,23 +19590,26 @@ components:
1958619590
type: string
1958719591
operator:
1958819592
$ref: "#/components/schemas/ConditionOperator"
19593+
saved_filter_id:
19594+
description: The ID of the saved filter referenced by this condition, or null for inline conditions.
19595+
example: "550e8400-e29b-41d4-a716-446655440090"
19596+
format: uuid
19597+
nullable: true
19598+
type: string
1958919599
updated_at:
1959019600
description: The timestamp when the condition was last updated.
1959119601
example: "2024-01-01T12:00:00Z"
1959219602
format: date-time
1959319603
type: string
1959419604
value:
19595-
description: Values used by the selected operator.
19605+
description: Values used by the selected operator. Omitted for saved-filter references.
1959619606
example: ["US", "CA"]
1959719607
items:
1959819608
description: Target value for the selected operator.
1959919609
type: string
1960019610
type: array
1960119611
required:
1960219612
- id
19603-
- operator
19604-
- attribute
19605-
- value
1960619613
- created_at
1960719614
- updated_at
1960819615
type: object
@@ -19633,25 +19640,32 @@ components:
1963319640
- IS_NULL
1963419641
- EQUALS
1963519642
ConditionRequest:
19636-
description: Condition request payload for targeting rules.
19643+
description: |-
19644+
Condition request payload for targeting rules. A condition is either an inline
19645+
predicate with `operator`, `attribute`, and `value`, or a reference to a
19646+
saved filter with `saved_filter_id`. The two shapes are mutually exclusive.
1963719647
properties:
1963819648
attribute:
19639-
description: The user or request attribute to evaluate.
19649+
description: The user or request attribute to evaluate. Required for inline conditions; omit when `saved_filter_id` is set.
1964019650
example: "user_tier"
1964119651
type: string
1964219652
operator:
1964319653
$ref: "#/components/schemas/ConditionOperator"
19654+
saved_filter_id:
19655+
description: |-
19656+
The ID of a saved filter to reference as this condition. Mutually exclusive
19657+
with `operator`, `attribute`, and `value`. When set, the saved filter's
19658+
targeting rules are evaluated in place of an inline predicate.
19659+
example: "550e8400-e29b-41d4-a716-446655440090"
19660+
format: uuid
19661+
type: string
1964419662
value:
19645-
description: Values used by the selected operator.
19663+
description: Values used by the selected operator. Required for inline conditions; omit when `saved_filter_id` is set.
1964619664
example: ["premium", "enterprise"]
1964719665
items:
1964819666
description: Target value for the selected operator.
1964919667
type: string
1965019668
type: array
19651-
required:
19652-
- operator
19653-
- attribute
19654-
- value
1965519669
type: object
1965619670
ConfigCatCredentials:
1965719671
description: The definition of the `ConfigCatCredentials` object.

examples/v2/feature-flags/CreateAllocationsForFeatureFlagInEnvironment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
ConditionRequest(
6363
attribute="user_tier",
6464
operator=ConditionOperator.ONE_OF,
65+
saved_filter_id=UUID("550e8400-e29b-41d4-a716-446655440090"),
6566
value=[
6667
"premium",
6768
"enterprise",

examples/v2/feature-flags/UpdateAllocationsForFeatureFlagInEnvironment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
ConditionRequest(
6464
attribute="user_tier",
6565
operator=ConditionOperator.ONE_OF,
66+
saved_filter_id=UUID("550e8400-e29b-41d4-a716-446655440090"),
6667
value=[
6768
"premium",
6869
"enterprise",

src/datadog_api_client/v2/model/condition.py

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
1111
datetime,
12+
none_type,
13+
unset,
14+
UnsetType,
1215
UUID,
1316
)
1417

@@ -27,6 +30,7 @@ def openapi_types(_):
2730
"created_at": (datetime,),
2831
"id": (UUID,),
2932
"operator": (ConditionOperator,),
33+
"saved_filter_id": (UUID, none_type),
3034
"updated_at": (datetime,),
3135
"value": ([str],),
3236
}
@@ -36,25 +40,30 @@ def openapi_types(_):
3640
"created_at": "created_at",
3741
"id": "id",
3842
"operator": "operator",
43+
"saved_filter_id": "saved_filter_id",
3944
"updated_at": "updated_at",
4045
"value": "value",
4146
}
4247

4348
def __init__(
4449
self_,
45-
attribute: str,
4650
created_at: datetime,
4751
id: UUID,
48-
operator: ConditionOperator,
4952
updated_at: datetime,
50-
value: List[str],
53+
attribute: Union[str, UnsetType] = unset,
54+
operator: Union[ConditionOperator, UnsetType] = unset,
55+
saved_filter_id: Union[UUID, none_type, UnsetType] = unset,
56+
value: Union[List[str], UnsetType] = unset,
5157
**kwargs,
5258
):
5359
"""
54-
Targeting condition details.
60+
Targeting condition details. A condition is either an inline
61+
predicate with ``operator`` , ``attribute`` , and ``value`` , or a reference to a
62+
saved filter with ``saved_filter_id``. The inline fields are omitted for saved-filter
63+
references.
5564
56-
:param attribute: The user or request attribute to evaluate.
57-
:type attribute: str
65+
:param attribute: The user or request attribute to evaluate. Omitted for saved-filter references.
66+
:type attribute: str, optional
5867
5968
:param created_at: The timestamp when the condition was created.
6069
:type created_at: datetime
@@ -63,19 +72,27 @@ def __init__(
6372
:type id: UUID
6473
6574
:param operator: The operator used in a targeting condition.
66-
:type operator: ConditionOperator
75+
:type operator: ConditionOperator, optional
76+
77+
:param saved_filter_id: The ID of the saved filter referenced by this condition, or null for inline conditions.
78+
:type saved_filter_id: UUID, none_type, optional
6779
6880
:param updated_at: The timestamp when the condition was last updated.
6981
:type updated_at: datetime
7082
71-
:param value: Values used by the selected operator.
72-
:type value: [str]
83+
:param value: Values used by the selected operator. Omitted for saved-filter references.
84+
:type value: [str], optional
7385
"""
86+
if attribute is not unset:
87+
kwargs["attribute"] = attribute
88+
if operator is not unset:
89+
kwargs["operator"] = operator
90+
if saved_filter_id is not unset:
91+
kwargs["saved_filter_id"] = saved_filter_id
92+
if value is not unset:
93+
kwargs["value"] = value
7494
super().__init__(kwargs)
7595

76-
self_.attribute = attribute
7796
self_.created_at = created_at
7897
self_.id = id
79-
self_.operator = operator
8098
self_.updated_at = updated_at
81-
self_.value = value

src/datadog_api_client/v2/model/condition_request.py

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
13+
UUID,
1114
)
1215

1316

@@ -23,30 +26,50 @@ def openapi_types(_):
2326
return {
2427
"attribute": (str,),
2528
"operator": (ConditionOperator,),
29+
"saved_filter_id": (UUID,),
2630
"value": ([str],),
2731
}
2832

2933
attribute_map = {
3034
"attribute": "attribute",
3135
"operator": "operator",
36+
"saved_filter_id": "saved_filter_id",
3237
"value": "value",
3338
}
3439

35-
def __init__(self_, attribute: str, operator: ConditionOperator, value: List[str], **kwargs):
40+
def __init__(
41+
self_,
42+
attribute: Union[str, UnsetType] = unset,
43+
operator: Union[ConditionOperator, UnsetType] = unset,
44+
saved_filter_id: Union[UUID, UnsetType] = unset,
45+
value: Union[List[str], UnsetType] = unset,
46+
**kwargs,
47+
):
3648
"""
37-
Condition request payload for targeting rules.
49+
Condition request payload for targeting rules. A condition is either an inline
50+
predicate with ``operator`` , ``attribute`` , and ``value`` , or a reference to a
51+
saved filter with ``saved_filter_id``. The two shapes are mutually exclusive.
3852
39-
:param attribute: The user or request attribute to evaluate.
40-
:type attribute: str
53+
:param attribute: The user or request attribute to evaluate. Required for inline conditions; omit when ``saved_filter_id`` is set.
54+
:type attribute: str, optional
4155
4256
:param operator: The operator used in a targeting condition.
43-
:type operator: ConditionOperator
57+
:type operator: ConditionOperator, optional
4458
45-
:param value: Values used by the selected operator.
46-
:type value: [str]
59+
:param saved_filter_id: The ID of a saved filter to reference as this condition. Mutually exclusive
60+
with ``operator`` , ``attribute`` , and ``value``. When set, the saved filter's
61+
targeting rules are evaluated in place of an inline predicate.
62+
:type saved_filter_id: UUID, optional
63+
64+
:param value: Values used by the selected operator. Required for inline conditions; omit when ``saved_filter_id`` is set.
65+
:type value: [str], optional
4766
"""
67+
if attribute is not unset:
68+
kwargs["attribute"] = attribute
69+
if operator is not unset:
70+
kwargs["operator"] = operator
71+
if saved_filter_id is not unset:
72+
kwargs["saved_filter_id"] = saved_filter_id
73+
if value is not unset:
74+
kwargs["value"] = value
4875
super().__init__(kwargs)
49-
50-
self_.attribute = attribute
51-
self_.operator = operator
52-
self_.value = value

0 commit comments

Comments
 (0)