diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 05592fbb55..fe8496d757 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24463,6 +24463,19 @@ components: description: The name of the feature flag. example: "Feature Flag ABC123" type: string + notification_rule_query: + description: |- + Query used to determine which change events on this feature flag trigger notifications to `rule_targets`. Uses Datadog's standard log search syntax (`AND`, `OR`, `NOT`, parentheses) to match against the `notification_type` facet. + + Supported `notification_type` values for a feature flag are: `flag_enabled_disabled`, `flag_archived`, `flag_approval_required`, `rollout_started`, `rollout_scheduled`, `rollout_step_started`, `rollout_paused_guardrail`, `rollout_paused_user`, `rollout_aborted_guardrail`, `rollout_aborted_user`, `targeting_rule_created`, `targeting_rule_updated`, `targeting_rule_updated_via_filter`, and `targeting_rule_deleted`. + example: "notification_type:rollout_started OR notification_type:targeting_rule_updated" + nullable: true + type: string + rule_targets: + description: Targets to notify about changes to this feature flag that match `notification_rule_query`. + items: + $ref: "#/components/schemas/NotificationRuleTarget" + type: array value_type: $ref: "#/components/schemas/ValueType" variants: @@ -69161,6 +69174,95 @@ components: type: string x-enum-varnames: - MANUAL + NotificationRuleTarget: + description: A notification target that receives change alerts for a feature flag. + properties: + configuration: + $ref: "#/components/schemas/NotificationRuleTargetConfiguration" + type: + $ref: "#/components/schemas/NotificationRuleTargetType" + version: + description: Schema version of `configuration`. + example: 1 + format: int64 + type: integer + required: + - type + - version + - configuration + type: object + NotificationRuleTargetConfiguration: + description: "Configuration for a notification target. Which fields apply depends on the target's `type`." + properties: + channel: + description: Slack channel name, for a `SLACK_CHANNEL` target. + example: "#feature-flags" + type: string + channel_id: + description: Slack channel ID, for a `SLACK_CHANNEL` target, or Microsoft Teams channel ID, for an `MS_TEAMS_CHANNEL` target. + type: string + channel_name: + description: Microsoft Teams channel name, for an `MS_TEAMS_CHANNEL` target. + type: string + connector_name: + description: Microsoft Teams connector name, for an `MS_TEAMS_CHANNEL` target. + type: string + recipient: + $ref: "#/components/schemas/NotificationRuleTargetConfigurationRecipient" + service_name: + description: PagerDuty service name, for a `PAGERDUTY_SERVICE` target. + type: string + team_id: + description: Microsoft Teams team ID, for an `MS_TEAMS_CHANNEL` target. + type: string + team_name: + description: Microsoft Teams team name, for an `MS_TEAMS_CHANNEL` target. + type: string + tenant_id: + description: Microsoft Teams tenant ID, for an `MS_TEAMS_CHANNEL` target. + type: string + tenant_name: + description: Microsoft Teams tenant name, for an `MS_TEAMS_CHANNEL` target. + type: string + username: + description: Slack username, for a `SLACK_USER` target. + type: string + webhook_name: + description: Name of the configured webhook, for a `WEBHOOK` target. + type: string + workspace: + description: Slack workspace name, for a `SLACK_CHANNEL` or `SLACK_USER` target. + type: string + workspace_id: + description: Slack workspace ID, for a `SLACK_CHANNEL` target. + type: string + type: object + NotificationRuleTargetConfigurationRecipient: + description: Recipient for an `EMAIL` target. + properties: + email: + description: Email address to notify. + example: "user@example.com" + type: string + type: object + NotificationRuleTargetType: + description: The type of notification target. + enum: + - "EMAIL" + - "SLACK_CHANNEL" + - "SLACK_USER" + - "WEBHOOK" + - "PAGERDUTY_SERVICE" + - "MS_TEAMS_CHANNEL" + example: "SLACK_CHANNEL" + type: string + x-enum-varnames: + - EMAIL + - SLACK_CHANNEL + - SLACK_USER + - WEBHOOK + - PAGERDUTY_SERVICE + - MS_TEAMS_CHANNEL NotificationRulesListResponse: description: The list of notification rules. properties: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5b9aacb4a7..7d473ad241 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -28767,6 +28767,34 @@ datadog\_api\_client.v2.model.notification\_rule\_routing\_mode module :members: :show-inheritance: +datadog\_api\_client.v2.model.notification\_rule\_target module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.notification_rule_target + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.notification\_rule\_target\_configuration module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.notification_rule_target_configuration + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.notification\_rule\_target\_configuration\_recipient module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.notification_rule_target_configuration_recipient + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.notification\_rule\_target\_type module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.notification_rule_target_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.notification\_rules\_list\_response module ------------------------------------------------------------------------ diff --git a/examples/v2/feature-flags/CreateFeatureFlag_2426084719.py b/examples/v2/feature-flags/CreateFeatureFlag_2426084719.py new file mode 100644 index 0000000000..305005d752 --- /dev/null +++ b/examples/v2/feature-flags/CreateFeatureFlag_2426084719.py @@ -0,0 +1,58 @@ +""" +Create a feature flag with notification rule targets returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from datadog_api_client.v2.model.create_feature_flag_attributes import CreateFeatureFlagAttributes +from datadog_api_client.v2.model.create_feature_flag_data import CreateFeatureFlagData +from datadog_api_client.v2.model.create_feature_flag_data_type import CreateFeatureFlagDataType +from datadog_api_client.v2.model.create_feature_flag_request import CreateFeatureFlagRequest +from datadog_api_client.v2.model.create_variant import CreateVariant +from datadog_api_client.v2.model.notification_rule_target import NotificationRuleTarget +from datadog_api_client.v2.model.notification_rule_target_configuration import NotificationRuleTargetConfiguration +from datadog_api_client.v2.model.notification_rule_target_type import NotificationRuleTargetType +from datadog_api_client.v2.model.value_type import ValueType + +body = CreateFeatureFlagRequest( + data=CreateFeatureFlagData( + type=CreateFeatureFlagDataType.FEATURE_FLAGS, + attributes=CreateFeatureFlagAttributes( + default_variant_key="variant-Example-Feature-Flag-1", + description="Test feature flag with notification rule targets for BDD scenarios", + key="test-feature-flag-notify-Example-Feature-Flag", + name="Test Feature Flag Notify Example-Feature-Flag", + value_type=ValueType.BOOLEAN, + variants=[ + CreateVariant( + key="variant-Example-Feature-Flag-1", + name="Variant Example-Feature-Flag A", + value="true", + ), + CreateVariant( + key="variant-Example-Feature-Flag-2", + name="Variant Example-Feature-Flag B", + value="false", + ), + ], + notification_rule_query="notification_type:rollout_started", + rule_targets=[ + NotificationRuleTarget( + type=NotificationRuleTargetType.SLACK_CHANNEL, + version=1, + configuration=NotificationRuleTargetConfiguration( + channel="#feature-flags-test", + workspace="datadoghq", + ), + ), + ], + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.create_feature_flag(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/model/create_feature_flag_attributes.py b/src/datadog_api_client/v2/model/create_feature_flag_attributes.py index 1ef7c88d86..fbd3615ae6 100644 --- a/src/datadog_api_client/v2/model/create_feature_flag_attributes.py +++ b/src/datadog_api_client/v2/model/create_feature_flag_attributes.py @@ -15,6 +15,7 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.notification_rule_target import NotificationRuleTarget from datadog_api_client.v2.model.value_type import ValueType from datadog_api_client.v2.model.create_variant import CreateVariant @@ -22,6 +23,7 @@ class CreateFeatureFlagAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.notification_rule_target import NotificationRuleTarget from datadog_api_client.v2.model.value_type import ValueType from datadog_api_client.v2.model.create_variant import CreateVariant @@ -31,6 +33,8 @@ def openapi_types(_): "json_schema": (str, none_type), "key": (str,), "name": (str,), + "notification_rule_query": (str, none_type), + "rule_targets": ([NotificationRuleTarget],), "value_type": (ValueType,), "variants": ([CreateVariant],), } @@ -41,6 +45,8 @@ def openapi_types(_): "json_schema": "json_schema", "key": "key", "name": "name", + "notification_rule_query": "notification_rule_query", + "rule_targets": "rule_targets", "value_type": "value_type", "variants": "variants", } @@ -54,6 +60,8 @@ def __init__( variants: List[CreateVariant], default_variant_key: Union[str, none_type, UnsetType] = unset, json_schema: Union[str, none_type, UnsetType] = unset, + notification_rule_query: Union[str, none_type, UnsetType] = unset, + rule_targets: Union[List[NotificationRuleTarget], UnsetType] = unset, **kwargs, ): """ @@ -74,6 +82,14 @@ def __init__( :param name: The name of the feature flag. :type name: str + :param notification_rule_query: Query used to determine which change events on this feature flag trigger notifications to ``rule_targets``. Uses Datadog's standard log search syntax ( ``AND`` , ``OR`` , ``NOT`` , parentheses) to match against the ``notification_type`` facet. + + Supported ``notification_type`` values for a feature flag are: ``flag_enabled_disabled`` , ``flag_archived`` , ``flag_approval_required`` , ``rollout_started`` , ``rollout_scheduled`` , ``rollout_step_started`` , ``rollout_paused_guardrail`` , ``rollout_paused_user`` , ``rollout_aborted_guardrail`` , ``rollout_aborted_user`` , ``targeting_rule_created`` , ``targeting_rule_updated`` , ``targeting_rule_updated_via_filter`` , and ``targeting_rule_deleted``. + :type notification_rule_query: str, none_type, optional + + :param rule_targets: Targets to notify about changes to this feature flag that match ``notification_rule_query``. + :type rule_targets: [NotificationRuleTarget], optional + :param value_type: The type of values for the feature flag variants. :type value_type: ValueType @@ -84,6 +100,10 @@ def __init__( kwargs["default_variant_key"] = default_variant_key if json_schema is not unset: kwargs["json_schema"] = json_schema + if notification_rule_query is not unset: + kwargs["notification_rule_query"] = notification_rule_query + if rule_targets is not unset: + kwargs["rule_targets"] = rule_targets super().__init__(kwargs) self_.description = description diff --git a/src/datadog_api_client/v2/model/notification_rule_target.py b/src/datadog_api_client/v2/model/notification_rule_target.py new file mode 100644 index 0000000000..5b6de6ec7e --- /dev/null +++ b/src/datadog_api_client/v2/model/notification_rule_target.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 typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.notification_rule_target_configuration import NotificationRuleTargetConfiguration + from datadog_api_client.v2.model.notification_rule_target_type import NotificationRuleTargetType + + +class NotificationRuleTarget(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.notification_rule_target_configuration import ( + NotificationRuleTargetConfiguration, + ) + from datadog_api_client.v2.model.notification_rule_target_type import NotificationRuleTargetType + + return { + "configuration": (NotificationRuleTargetConfiguration,), + "type": (NotificationRuleTargetType,), + "version": (int,), + } + + attribute_map = { + "configuration": "configuration", + "type": "type", + "version": "version", + } + + def __init__( + self_, + configuration: NotificationRuleTargetConfiguration, + type: NotificationRuleTargetType, + version: int, + **kwargs, + ): + """ + A notification target that receives change alerts for a feature flag. + + :param configuration: Configuration for a notification target. Which fields apply depends on the target's ``type``. + :type configuration: NotificationRuleTargetConfiguration + + :param type: The type of notification target. + :type type: NotificationRuleTargetType + + :param version: Schema version of ``configuration``. + :type version: int + """ + super().__init__(kwargs) + + self_.configuration = configuration + self_.type = type + self_.version = version diff --git a/src/datadog_api_client/v2/model/notification_rule_target_configuration.py b/src/datadog_api_client/v2/model/notification_rule_target_configuration.py new file mode 100644 index 0000000000..a61a0d3293 --- /dev/null +++ b/src/datadog_api_client/v2/model/notification_rule_target_configuration.py @@ -0,0 +1,154 @@ +# 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, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.notification_rule_target_configuration_recipient import ( + NotificationRuleTargetConfigurationRecipient, + ) + + +class NotificationRuleTargetConfiguration(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.notification_rule_target_configuration_recipient import ( + NotificationRuleTargetConfigurationRecipient, + ) + + return { + "channel": (str,), + "channel_id": (str,), + "channel_name": (str,), + "connector_name": (str,), + "recipient": (NotificationRuleTargetConfigurationRecipient,), + "service_name": (str,), + "team_id": (str,), + "team_name": (str,), + "tenant_id": (str,), + "tenant_name": (str,), + "username": (str,), + "webhook_name": (str,), + "workspace": (str,), + "workspace_id": (str,), + } + + attribute_map = { + "channel": "channel", + "channel_id": "channel_id", + "channel_name": "channel_name", + "connector_name": "connector_name", + "recipient": "recipient", + "service_name": "service_name", + "team_id": "team_id", + "team_name": "team_name", + "tenant_id": "tenant_id", + "tenant_name": "tenant_name", + "username": "username", + "webhook_name": "webhook_name", + "workspace": "workspace", + "workspace_id": "workspace_id", + } + + def __init__( + self_, + channel: Union[str, UnsetType] = unset, + channel_id: Union[str, UnsetType] = unset, + channel_name: Union[str, UnsetType] = unset, + connector_name: Union[str, UnsetType] = unset, + recipient: Union[NotificationRuleTargetConfigurationRecipient, UnsetType] = unset, + service_name: Union[str, UnsetType] = unset, + team_id: Union[str, UnsetType] = unset, + team_name: Union[str, UnsetType] = unset, + tenant_id: Union[str, UnsetType] = unset, + tenant_name: Union[str, UnsetType] = unset, + username: Union[str, UnsetType] = unset, + webhook_name: Union[str, UnsetType] = unset, + workspace: Union[str, UnsetType] = unset, + workspace_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Configuration for a notification target. Which fields apply depends on the target's ``type``. + + :param channel: Slack channel name, for a ``SLACK_CHANNEL`` target. + :type channel: str, optional + + :param channel_id: Slack channel ID, for a ``SLACK_CHANNEL`` target, or Microsoft Teams channel ID, for an ``MS_TEAMS_CHANNEL`` target. + :type channel_id: str, optional + + :param channel_name: Microsoft Teams channel name, for an ``MS_TEAMS_CHANNEL`` target. + :type channel_name: str, optional + + :param connector_name: Microsoft Teams connector name, for an ``MS_TEAMS_CHANNEL`` target. + :type connector_name: str, optional + + :param recipient: Recipient for an ``EMAIL`` target. + :type recipient: NotificationRuleTargetConfigurationRecipient, optional + + :param service_name: PagerDuty service name, for a ``PAGERDUTY_SERVICE`` target. + :type service_name: str, optional + + :param team_id: Microsoft Teams team ID, for an ``MS_TEAMS_CHANNEL`` target. + :type team_id: str, optional + + :param team_name: Microsoft Teams team name, for an ``MS_TEAMS_CHANNEL`` target. + :type team_name: str, optional + + :param tenant_id: Microsoft Teams tenant ID, for an ``MS_TEAMS_CHANNEL`` target. + :type tenant_id: str, optional + + :param tenant_name: Microsoft Teams tenant name, for an ``MS_TEAMS_CHANNEL`` target. + :type tenant_name: str, optional + + :param username: Slack username, for a ``SLACK_USER`` target. + :type username: str, optional + + :param webhook_name: Name of the configured webhook, for a ``WEBHOOK`` target. + :type webhook_name: str, optional + + :param workspace: Slack workspace name, for a ``SLACK_CHANNEL`` or ``SLACK_USER`` target. + :type workspace: str, optional + + :param workspace_id: Slack workspace ID, for a ``SLACK_CHANNEL`` target. + :type workspace_id: str, optional + """ + if channel is not unset: + kwargs["channel"] = channel + if channel_id is not unset: + kwargs["channel_id"] = channel_id + if channel_name is not unset: + kwargs["channel_name"] = channel_name + if connector_name is not unset: + kwargs["connector_name"] = connector_name + if recipient is not unset: + kwargs["recipient"] = recipient + if service_name is not unset: + kwargs["service_name"] = service_name + if team_id is not unset: + kwargs["team_id"] = team_id + if team_name is not unset: + kwargs["team_name"] = team_name + if tenant_id is not unset: + kwargs["tenant_id"] = tenant_id + if tenant_name is not unset: + kwargs["tenant_name"] = tenant_name + if username is not unset: + kwargs["username"] = username + if webhook_name is not unset: + kwargs["webhook_name"] = webhook_name + if workspace is not unset: + kwargs["workspace"] = workspace + if workspace_id is not unset: + kwargs["workspace_id"] = workspace_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/notification_rule_target_configuration_recipient.py b/src/datadog_api_client/v2/model/notification_rule_target_configuration_recipient.py new file mode 100644 index 0000000000..84b5c463a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/notification_rule_target_configuration_recipient.py @@ -0,0 +1,36 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class NotificationRuleTargetConfigurationRecipient(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + } + + attribute_map = { + "email": "email", + } + + def __init__(self_, email: Union[str, UnsetType] = unset, **kwargs): + """ + Recipient for an ``EMAIL`` target. + + :param email: Email address to notify. + :type email: str, optional + """ + if email is not unset: + kwargs["email"] = email + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/notification_rule_target_type.py b/src/datadog_api_client/v2/model/notification_rule_target_type.py new file mode 100644 index 0000000000..3e7088b7c9 --- /dev/null +++ b/src/datadog_api_client/v2/model/notification_rule_target_type.py @@ -0,0 +1,50 @@ +# 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 NotificationRuleTargetType(ModelSimple): + """ + The type of notification target. + + :param value: Must be one of ["EMAIL", "SLACK_CHANNEL", "SLACK_USER", "WEBHOOK", "PAGERDUTY_SERVICE", "MS_TEAMS_CHANNEL"]. + :type value: str + """ + + allowed_values = { + "EMAIL", + "SLACK_CHANNEL", + "SLACK_USER", + "WEBHOOK", + "PAGERDUTY_SERVICE", + "MS_TEAMS_CHANNEL", + } + EMAIL: ClassVar["NotificationRuleTargetType"] + SLACK_CHANNEL: ClassVar["NotificationRuleTargetType"] + SLACK_USER: ClassVar["NotificationRuleTargetType"] + WEBHOOK: ClassVar["NotificationRuleTargetType"] + PAGERDUTY_SERVICE: ClassVar["NotificationRuleTargetType"] + MS_TEAMS_CHANNEL: ClassVar["NotificationRuleTargetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +NotificationRuleTargetType.EMAIL = NotificationRuleTargetType("EMAIL") +NotificationRuleTargetType.SLACK_CHANNEL = NotificationRuleTargetType("SLACK_CHANNEL") +NotificationRuleTargetType.SLACK_USER = NotificationRuleTargetType("SLACK_USER") +NotificationRuleTargetType.WEBHOOK = NotificationRuleTargetType("WEBHOOK") +NotificationRuleTargetType.PAGERDUTY_SERVICE = NotificationRuleTargetType("PAGERDUTY_SERVICE") +NotificationRuleTargetType.MS_TEAMS_CHANNEL = NotificationRuleTargetType("MS_TEAMS_CHANNEL") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 4895c420d3..5bb1af0350 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5476,6 +5476,12 @@ from datadog_api_client.v2.model.notification_rule_response import NotificationRuleResponse from datadog_api_client.v2.model.notification_rule_routing import NotificationRuleRouting from datadog_api_client.v2.model.notification_rule_routing_mode import NotificationRuleRoutingMode +from datadog_api_client.v2.model.notification_rule_target import NotificationRuleTarget +from datadog_api_client.v2.model.notification_rule_target_configuration import NotificationRuleTargetConfiguration +from datadog_api_client.v2.model.notification_rule_target_configuration_recipient import ( + NotificationRuleTargetConfigurationRecipient, +) +from datadog_api_client.v2.model.notification_rule_target_type import NotificationRuleTargetType from datadog_api_client.v2.model.notification_rules_list_response import NotificationRulesListResponse from datadog_api_client.v2.model.notification_rules_type import NotificationRulesType from datadog_api_client.v2.model.notion_api_key import NotionAPIKey @@ -14602,6 +14608,10 @@ "NotificationRuleResponse", "NotificationRuleRouting", "NotificationRuleRoutingMode", + "NotificationRuleTarget", + "NotificationRuleTargetConfiguration", + "NotificationRuleTargetConfigurationRecipient", + "NotificationRuleTargetType", "NotificationRulesListResponse", "NotificationRulesType", "NotionAPIKey", diff --git a/tests/v2/features/feature_flags.feature b/tests/v2/features/feature_flags.feature index f44699236d..36ffeb8de6 100644 --- a/tests/v2/features/feature_flags.feature +++ b/tests/v2/features/feature_flags.feature @@ -85,6 +85,15 @@ Feature: Feature Flags And the response "data.attributes.name" is equal to "Test Feature Flag {{ unique }}" And the response "data.attributes.value_type" is equal to "BOOLEAN" + @team:DataDog/feature-flags + Scenario: Create a feature flag with notification rule targets returns "Created" response + Given new "CreateFeatureFlag" request + And body with value {"data": {"type": "feature-flags", "attributes": {"default_variant_key": "variant-{{ unique }}-1", "description": "Test feature flag with notification rule targets for BDD scenarios", "key": "test-feature-flag-notify-{{ unique }}", "name": "Test Feature Flag Notify {{ unique }}", "value_type": "BOOLEAN", "variants": [{"key": "variant-{{ unique }}-1", "name": "Variant {{ unique }} A", "value": "true"}, {"key": "variant-{{ unique }}-2", "name": "Variant {{ unique }} B", "value": "false"}], "notification_rule_query": "notification_type:rollout_started", "rule_targets": [{"type": "SLACK_CHANNEL", "version": 1, "configuration": {"channel": "#feature-flags-test", "workspace": "datadoghq"}}]}}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.key" is equal to "test-feature-flag-notify-{{ unique }}" + And the response "data.attributes.name" is equal to "Test Feature Flag Notify {{ unique }}" + @team:DataDog/feature-flags Scenario: Create allocation for a flag in an environment returns "Created" response Given there is a valid "feature_flag" in the system