Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 162 additions & 15 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26598,6 +26598,10 @@ components:
description: Indicates whether this feature flag requires approval for changes.
example: false
type: boolean
staleness_status:
description: Indicates the whether a feature flag is stale or not.
example: "ACTIVE"
type: string
tags:
description: Tags associated with the feature flag.
example: []
Expand Down Expand Up @@ -26681,24 +26685,171 @@ components:
description: Indicates whether feature flag changes require approval in this environment.
example: false
type: boolean
rollout_percentage:
description: Rollout percentage for this environment.
example: 0
format: int64
maximum: 100
minimum: 0
type: integer
rules:
description: Environment targeting rules for this feature flag.
status:
$ref: "#/components/schemas/FeatureFlagStatus"
required:
- environment_id
- status
type: object
FeatureFlagEnvironmentListItem:
description: Environment-specific settings for a feature flag in list responses.
properties:
default_allocation_key:
description: The allocation key used for the default variant.
example: "allocation-default-123abc"
type: string
default_variant_id:
description: The ID of the default variant for this environment.
example: "550e8400-e29b-41d4-a716-446655440002"
nullable: true
type: string
environment_id:
description: The ID of the environment.
example: "550e8400-e29b-41d4-a716-446655440001"
format: uuid
type: string
environment_name:
description: The name of the environment.
example: "env-search-term"
type: string
environment_queries:
description: Queries that target this environment.
example:
- "test-feature-flag"
- "env-search-term"
items:
$ref: "#/components/schemas/FeatureFlagTargetingRule"
description: A query string targeting the environment.
type: string
type: array
is_production:
description: Indicates whether the environment is production.
example: false
type: boolean
override_allocation_key:
description: The allocation key used for the override variant.
example: "allocation-override-123abc"
type: string
override_variant_id:
description: The ID of the override variant for this environment.
example: "550e8400-e29b-41d4-a716-446655440003"
nullable: true
type: string
pending_suggestion_id:
description: Pending suggestion identifier, if approval is required.
example: "550e8400-e29b-41d4-a716-446655440099"
nullable: true
type: string
require_feature_flag_approval:
description: Indicates whether feature flag changes require approval in this environment.
example: false
type: boolean
status:
$ref: "#/components/schemas/FeatureFlagStatus"
required:
- environment_id
- status
type: object
FeatureFlagListItem:
description: A feature flag resource for list responses.
properties:
attributes:
$ref: "#/components/schemas/FeatureFlagListItemAttributes"
id:
description: The unique identifier of the feature flag.
example: "550e8400-e29b-41d4-a716-446655440000"
format: uuid
type: string
type:
$ref: "#/components/schemas/CreateFeatureFlagDataType"
required:
- id
- type
- attributes
type: object
FeatureFlagListItemAttributes:
description: Attributes of a feature flag in list responses.
properties:
archived_at:
description: The timestamp when the feature flag was archived.
example: "2023-01-01T00:00:00Z"
format: date-time
nullable: true
type: string
created_at:
description: The timestamp when the feature flag was created.
example: "2023-01-01T00:00:00Z"
format: date-time
type: string
created_by:
description: The ID of the user who created the feature flag.
example: "550e8400-e29b-41d4-a716-446655440010"
format: uuid
type: string
description:
description: The description of the feature flag.
example: "This is an example feature flag for demonstration"
type: string
distribution_channel:
description: Distribution channel for the feature flag.
example: "ALL"
type: string
feature_flag_environments:
description: Environment-specific settings for the feature flag.
items:
$ref: "#/components/schemas/FeatureFlagEnvironmentListItem"
type: array
json_schema:
description: JSON schema for validation when value_type is JSON.
example: '{"type": "object", "properties": {"enabled": {"type": "boolean"}}}'
nullable: true
type: string
key:
description: The unique key of the feature flag.
example: "feature-flag-abc123"
type: string
last_updated_by:
description: The ID of the user who last updated the feature flag.
example: "550e8400-e29b-41d4-a716-446655440010"
format: uuid
type: string
name:
description: The name of the feature flag.
example: "Feature Flag ABC123"
type: string
require_approval:
description: Indicates whether this feature flag requires approval for changes.
example: false
type: boolean
staleness_status:
description: Indicates the staleness status of the feature flag.
example: "ACTIVE"
type: string
tags:
description: Tags associated with the feature flag.
example: []
items:
description: A tag associated with the feature flag.
type: string
type: array
updated_at:
description: The timestamp when the feature flag was last updated.
example: "2023-01-01T00:00:00Z"
format: date-time
type: string
value_type:
$ref: "#/components/schemas/ValueType"
variants:
description: The variants of the feature flag.
items:
$ref: "#/components/schemas/Variant"
type: array
required:
- key
- name
- description
- value_type
- variants
type: object
FeatureFlagResponse:
description: Response containing a feature flag.
properties:
Expand All @@ -26717,10 +26868,6 @@ components:
x-enum-varnames:
- ENABLED
- DISABLED
FeatureFlagTargetingRule:
additionalProperties: {}
description: A targeting rule for a feature flag.
type: object
FeatureFlagsPaginationMeta:
description: Pagination metadata for feature flags.
properties:
Expand Down Expand Up @@ -40561,7 +40708,7 @@ components:
data:
description: List of feature flags.
items:
$ref: "#/components/schemas/FeatureFlag"
$ref: "#/components/schemas/FeatureFlagListItem"
type: array
meta:
$ref: "#/components/schemas/FeatureFlagsPaginationMeta"
Expand Down
28 changes: 21 additions & 7 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11183,6 +11183,27 @@ datadog\_api\_client.v2.model.feature\_flag\_environment module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flag\_environment\_list\_item module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.feature_flag_environment_list_item
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flag\_list\_item module
--------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.feature_flag_list_item
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flag\_list\_item\_attributes module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.feature_flag_list_item_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flag\_response module
------------------------------------------------------------

Expand All @@ -11197,13 +11218,6 @@ datadog\_api\_client.v2.model.feature\_flag\_status module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flag\_targeting\_rule module
-------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.feature_flag_targeting_rule
:members:
:show-inheritance:

datadog\_api\_client.v2.model.feature\_flags\_pagination\_meta module
---------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion examples/v2/feature-flags/ListFeatureFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = FeatureFlagsApi(api_client)
response = api_instance.list_feature_flags()
response = api_instance.list_feature_flags(
limit=10,
)

print(response)
8 changes: 8 additions & 0 deletions src/datadog_api_client/v2/model/feature_flag_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def openapi_types(_):
"last_updated_by": (UUID,),
"name": (str,),
"require_approval": (bool,),
"staleness_status": (str,),
"tags": ([str],),
"updated_at": (datetime,),
"value_type": (ValueType,),
Expand All @@ -59,6 +60,7 @@ def openapi_types(_):
"last_updated_by": "last_updated_by",
"name": "name",
"require_approval": "require_approval",
"staleness_status": "staleness_status",
"tags": "tags",
"updated_at": "updated_at",
"value_type": "value_type",
Expand All @@ -80,6 +82,7 @@ def __init__(
json_schema: Union[str, none_type, UnsetType] = unset,
last_updated_by: Union[UUID, UnsetType] = unset,
require_approval: Union[bool, UnsetType] = unset,
staleness_status: Union[str, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
updated_at: Union[datetime, UnsetType] = unset,
**kwargs,
Expand Down Expand Up @@ -120,6 +123,9 @@ def __init__(
:param require_approval: Indicates whether this feature flag requires approval for changes.
:type require_approval: bool, optional

:param staleness_status: Indicates the whether a feature flag is stale or not.
:type staleness_status: str, optional

:param tags: Tags associated with the feature flag.
:type tags: [str], optional

Expand Down Expand Up @@ -148,6 +154,8 @@ def __init__(
kwargs["last_updated_by"] = last_updated_by
if require_approval is not unset:
kwargs["require_approval"] = require_approval
if staleness_status is not unset:
kwargs["staleness_status"] = staleness_status
if tags is not unset:
kwargs["tags"] = tags
if updated_at is not unset:
Expand Down
25 changes: 0 additions & 25 deletions src/datadog_api_client/v2/model/feature_flag_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.feature_flag_targeting_rule import FeatureFlagTargetingRule
from datadog_api_client.v2.model.feature_flag_status import FeatureFlagStatus


class FeatureFlagEnvironment(ModelNormal):
validations = {
"rollout_percentage": {
"inclusive_maximum": 100,
"inclusive_minimum": 0,
},
}

@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.feature_flag_targeting_rule import FeatureFlagTargetingRule
from datadog_api_client.v2.model.feature_flag_status import FeatureFlagStatus

return {
Expand Down Expand Up @@ -63,8 +54,6 @@ def openapi_types(_):
"override_variant_id": (str, none_type),
"pending_suggestion_id": (str, none_type),
"require_feature_flag_approval": (bool,),
"rollout_percentage": (int,),
"rules": ([FeatureFlagTargetingRule],),
"status": (FeatureFlagStatus,),
}

Expand All @@ -80,8 +69,6 @@ def openapi_types(_):
"override_variant_id": "override_variant_id",
"pending_suggestion_id": "pending_suggestion_id",
"require_feature_flag_approval": "require_feature_flag_approval",
"rollout_percentage": "rollout_percentage",
"rules": "rules",
"status": "status",
}

Expand All @@ -99,8 +86,6 @@ def __init__(
override_variant_id: Union[str, none_type, UnsetType] = unset,
pending_suggestion_id: Union[str, none_type, UnsetType] = unset,
require_feature_flag_approval: Union[bool, UnsetType] = unset,
rollout_percentage: Union[int, UnsetType] = unset,
rules: Union[List[FeatureFlagTargetingRule], UnsetType] = unset,
**kwargs,
):
"""
Expand Down Expand Up @@ -139,12 +124,6 @@ def __init__(
:param require_feature_flag_approval: Indicates whether feature flag changes require approval in this environment.
:type require_feature_flag_approval: bool, optional

:param rollout_percentage: Rollout percentage for this environment.
:type rollout_percentage: int, optional

:param rules: Environment targeting rules for this feature flag.
:type rules: [FeatureFlagTargetingRule], optional

:param status: The status of a feature flag in an environment.
:type status: FeatureFlagStatus
"""
Expand All @@ -168,10 +147,6 @@ def __init__(
kwargs["pending_suggestion_id"] = pending_suggestion_id
if require_feature_flag_approval is not unset:
kwargs["require_feature_flag_approval"] = require_feature_flag_approval
if rollout_percentage is not unset:
kwargs["rollout_percentage"] = rollout_percentage
if rules is not unset:
kwargs["rules"] = rules
super().__init__(kwargs)

self_.environment_id = environment_id
Expand Down
Loading
Loading