From 46ed8d55915c1650c8d3fc85d07721592230efde Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 12 Aug 2026 07:30:30 +0000 Subject: [PATCH] Regenerate client from commit 5d9eb84 of spec repo --- .generator/schemas/v2/openapi.yaml | 123 +++++ .../CreateFeatureFlag_2426084719.java | 70 +++ .../v2/model/CreateFeatureFlagAttributes.java | 99 ++++ .../v2/model/NotificationRuleTarget.java | 213 ++++++++ .../NotificationRuleTargetConfiguration.java | 514 ++++++++++++++++++ ...ationRuleTargetConfigurationRecipient.java | 139 +++++ .../v2/model/NotificationRuleTargetType.java | 73 +++ ...le_targets_returns_Created_response.freeze | 1 + ...rule_targets_returns_Created_response.json | 58 ++ .../api/client/v2/api/feature_flags.feature | 9 + 10 files changed, 1299 insertions(+) create mode 100644 examples/v2/feature-flags/CreateFeatureFlag_2426084719.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/NotificationRuleTarget.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfiguration.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfigurationRecipient.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetType.java create mode 100644 src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b9855adfad5..a6682bd69a7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24714,6 +24714,26 @@ 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 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: @@ -69678,6 +69698,109 @@ 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. + example: "C0123456789" + type: string + channel_name: + description: Microsoft Teams channel name, for an `MS_TEAMS_CHANNEL` target. + example: "Feature Flags" + type: string + connector_name: + description: Microsoft Teams connector name, for an `MS_TEAMS_CHANNEL` target. + example: "datadog-connector" + type: string + recipient: + $ref: "#/components/schemas/NotificationRuleTargetConfigurationRecipient" + service_name: + description: PagerDuty service name, for a `PAGERDUTY_SERVICE` target. + example: "feature-flags-oncall" + type: string + team_id: + description: Microsoft Teams team ID, for an `MS_TEAMS_CHANNEL` target. + example: "19:abcdef0123456789@thread.tacv2" + type: string + team_name: + description: Microsoft Teams team name, for an `MS_TEAMS_CHANNEL` target. + example: "Engineering" + type: string + tenant_id: + description: Microsoft Teams tenant ID, for an `MS_TEAMS_CHANNEL` target. + example: "72f988bf-86f1-41af-91ab-2d7cd011db47" + type: string + tenant_name: + description: Microsoft Teams tenant name, for an `MS_TEAMS_CHANNEL` target. + example: "Datadog" + type: string + username: + description: Slack username, for a `SLACK_USER` target. + example: "jane.doe" + type: string + webhook_name: + description: Name of the configured webhook, for a `WEBHOOK` target. + example: "feature-flags-webhook" + type: string + workspace: + description: Slack workspace name, for a `SLACK_CHANNEL` or `SLACK_USER` target. + example: "datadoghq" + type: string + workspace_id: + description: Slack workspace ID, for a `SLACK_CHANNEL` target. + example: "T0123456789" + 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/examples/v2/feature-flags/CreateFeatureFlag_2426084719.java b/examples/v2/feature-flags/CreateFeatureFlag_2426084719.java new file mode 100644 index 00000000000..b5eb879d421 --- /dev/null +++ b/examples/v2/feature-flags/CreateFeatureFlag_2426084719.java @@ -0,0 +1,70 @@ +// Create a feature flag with notification rule targets returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FeatureFlagsApi; +import com.datadog.api.client.v2.model.CreateFeatureFlagAttributes; +import com.datadog.api.client.v2.model.CreateFeatureFlagData; +import com.datadog.api.client.v2.model.CreateFeatureFlagDataType; +import com.datadog.api.client.v2.model.CreateFeatureFlagRequest; +import com.datadog.api.client.v2.model.CreateVariant; +import com.datadog.api.client.v2.model.FeatureFlagResponse; +import com.datadog.api.client.v2.model.NotificationRuleTarget; +import com.datadog.api.client.v2.model.NotificationRuleTargetConfiguration; +import com.datadog.api.client.v2.model.NotificationRuleTargetType; +import com.datadog.api.client.v2.model.ValueType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + FeatureFlagsApi apiInstance = new FeatureFlagsApi(defaultClient); + + CreateFeatureFlagRequest body = + new CreateFeatureFlagRequest() + .data( + new CreateFeatureFlagData() + .type(CreateFeatureFlagDataType.FEATURE_FLAGS) + .attributes( + new CreateFeatureFlagAttributes() + .defaultVariantKey("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") + .valueType(ValueType.BOOLEAN) + .variants( + Arrays.asList( + new CreateVariant() + .key("variant-Example-Feature-Flag-1") + .name("Variant Example-Feature-Flag A") + .value("true"), + new CreateVariant() + .key("variant-Example-Feature-Flag-2") + .name("Variant Example-Feature-Flag B") + .value("false"))) + .notificationRuleQuery("notification_type:rollout_started") + .ruleTargets( + Collections.singletonList( + new NotificationRuleTarget() + .type(NotificationRuleTargetType.SLACK_CHANNEL) + .version(1L) + .configuration( + new NotificationRuleTargetConfiguration() + .channel("#feature-flags-test") + .workspace("datadoghq")))))); + + try { + FeatureFlagResponse result = apiInstance.createFeatureFlag(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#createFeatureFlag"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateFeatureFlagAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateFeatureFlagAttributes.java index 8f915d45ea4..3fd158a5902 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateFeatureFlagAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateFeatureFlagAttributes.java @@ -27,6 +27,8 @@ CreateFeatureFlagAttributes.JSON_PROPERTY_JSON_SCHEMA, CreateFeatureFlagAttributes.JSON_PROPERTY_KEY, CreateFeatureFlagAttributes.JSON_PROPERTY_NAME, + CreateFeatureFlagAttributes.JSON_PROPERTY_NOTIFICATION_RULE_QUERY, + CreateFeatureFlagAttributes.JSON_PROPERTY_RULE_TARGETS, CreateFeatureFlagAttributes.JSON_PROPERTY_VALUE_TYPE, CreateFeatureFlagAttributes.JSON_PROPERTY_VARIANTS }) @@ -49,6 +51,12 @@ public class CreateFeatureFlagAttributes { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_NOTIFICATION_RULE_QUERY = "notification_rule_query"; + private JsonNullable notificationRuleQuery = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RULE_TARGETS = "rule_targets"; + private List ruleTargets = null; + public static final String JSON_PROPERTY_VALUE_TYPE = "value_type"; private ValueType valueType; @@ -197,6 +205,88 @@ public void setName(String name) { this.name = name; } + public CreateFeatureFlagAttributes notificationRuleQuery(String notificationRuleQuery) { + this.notificationRuleQuery = JsonNullable.of(notificationRuleQuery); + return this; + } + + /** + * Query used to determine which change events on this feature flag trigger notifications to + * rule_targets. Uses Datadog 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. + * + * @return notificationRuleQuery + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNotificationRuleQuery() { + return notificationRuleQuery.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATION_RULE_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNotificationRuleQuery_JsonNullable() { + return notificationRuleQuery; + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATION_RULE_QUERY) + public void setNotificationRuleQuery_JsonNullable(JsonNullable notificationRuleQuery) { + this.notificationRuleQuery = notificationRuleQuery; + } + + public void setNotificationRuleQuery(String notificationRuleQuery) { + this.notificationRuleQuery = JsonNullable.of(notificationRuleQuery); + } + + public CreateFeatureFlagAttributes ruleTargets(List ruleTargets) { + this.ruleTargets = ruleTargets; + if (ruleTargets != null) { + for (NotificationRuleTarget item : ruleTargets) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public CreateFeatureFlagAttributes addRuleTargetsItem(NotificationRuleTarget ruleTargetsItem) { + if (this.ruleTargets == null) { + this.ruleTargets = new ArrayList<>(); + } + this.ruleTargets.add(ruleTargetsItem); + this.unparsed |= ruleTargetsItem.unparsed; + return this; + } + + /** + * Targets to notify about changes to this feature flag that match notification_rule_query + * . + * + * @return ruleTargets + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE_TARGETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRuleTargets() { + return ruleTargets; + } + + public void setRuleTargets(List ruleTargets) { + this.ruleTargets = ruleTargets; + if (ruleTargets != null) { + for (NotificationRuleTarget item : ruleTargets) { + this.unparsed |= item.unparsed; + } + } + } + public CreateFeatureFlagAttributes valueType(ValueType valueType) { this.valueType = valueType; this.unparsed |= !valueType.isValid(); @@ -316,6 +406,9 @@ public boolean equals(Object o) { && Objects.equals(this.jsonSchema, createFeatureFlagAttributes.jsonSchema) && Objects.equals(this.key, createFeatureFlagAttributes.key) && Objects.equals(this.name, createFeatureFlagAttributes.name) + && Objects.equals( + this.notificationRuleQuery, createFeatureFlagAttributes.notificationRuleQuery) + && Objects.equals(this.ruleTargets, createFeatureFlagAttributes.ruleTargets) && Objects.equals(this.valueType, createFeatureFlagAttributes.valueType) && Objects.equals(this.variants, createFeatureFlagAttributes.variants) && Objects.equals( @@ -330,6 +423,8 @@ public int hashCode() { jsonSchema, key, name, + notificationRuleQuery, + ruleTargets, valueType, variants, additionalProperties); @@ -344,6 +439,10 @@ public String toString() { sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" notificationRuleQuery: ") + .append(toIndentedString(notificationRuleQuery)) + .append("\n"); + sb.append(" ruleTargets: ").append(toIndentedString(ruleTargets)).append("\n"); sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); sb.append(" variants: ").append(toIndentedString(variants)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTarget.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTarget.java new file mode 100644 index 00000000000..f75ae9d98b8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTarget.java @@ -0,0 +1,213 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A notification target that receives change alerts for a feature flag. */ +@JsonPropertyOrder({ + NotificationRuleTarget.JSON_PROPERTY_CONFIGURATION, + NotificationRuleTarget.JSON_PROPERTY_TYPE, + NotificationRuleTarget.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotificationRuleTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; + private NotificationRuleTargetConfiguration configuration; + + public static final String JSON_PROPERTY_TYPE = "type"; + private NotificationRuleTargetType type; + + public static final String JSON_PROPERTY_VERSION = "version"; + private Long version; + + public NotificationRuleTarget() {} + + @JsonCreator + public NotificationRuleTarget( + @JsonProperty(required = true, value = JSON_PROPERTY_CONFIGURATION) + NotificationRuleTargetConfiguration configuration, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) NotificationRuleTargetType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) Long version) { + this.configuration = configuration; + this.unparsed |= configuration.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + this.version = version; + } + + public NotificationRuleTarget configuration(NotificationRuleTargetConfiguration configuration) { + this.configuration = configuration; + this.unparsed |= configuration.unparsed; + return this; + } + + /** + * Configuration for a notification target. Which fields apply depends on the target's type + * . + * + * @return configuration + */ + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotificationRuleTargetConfiguration getConfiguration() { + return configuration; + } + + public void setConfiguration(NotificationRuleTargetConfiguration configuration) { + this.configuration = configuration; + if (configuration != null) { + this.unparsed |= configuration.unparsed; + } + } + + public NotificationRuleTarget type(NotificationRuleTargetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of notification target. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotificationRuleTargetType getType() { + return type; + } + + public void setType(NotificationRuleTargetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public NotificationRuleTarget version(Long version) { + this.version = version; + return this; + } + + /** + * Schema version of configuration. + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotificationRuleTarget + */ + @JsonAnySetter + public NotificationRuleTarget putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotificationRuleTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationRuleTarget notificationRuleTarget = (NotificationRuleTarget) o; + return Objects.equals(this.configuration, notificationRuleTarget.configuration) + && Objects.equals(this.type, notificationRuleTarget.type) + && Objects.equals(this.version, notificationRuleTarget.version) + && Objects.equals(this.additionalProperties, notificationRuleTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(configuration, type, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationRuleTarget {\n"); + sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfiguration.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfiguration.java new file mode 100644 index 00000000000..6dc94496232 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfiguration.java @@ -0,0 +1,514 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Configuration for a notification target. Which fields apply depends on the target's type + * . + */ +@JsonPropertyOrder({ + NotificationRuleTargetConfiguration.JSON_PROPERTY_CHANNEL, + NotificationRuleTargetConfiguration.JSON_PROPERTY_CHANNEL_ID, + NotificationRuleTargetConfiguration.JSON_PROPERTY_CHANNEL_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_CONNECTOR_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_RECIPIENT, + NotificationRuleTargetConfiguration.JSON_PROPERTY_SERVICE_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_TEAM_ID, + NotificationRuleTargetConfiguration.JSON_PROPERTY_TEAM_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_TENANT_ID, + NotificationRuleTargetConfiguration.JSON_PROPERTY_TENANT_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_USERNAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_WEBHOOK_NAME, + NotificationRuleTargetConfiguration.JSON_PROPERTY_WORKSPACE, + NotificationRuleTargetConfiguration.JSON_PROPERTY_WORKSPACE_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotificationRuleTargetConfiguration { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANNEL = "channel"; + private String channel; + + public static final String JSON_PROPERTY_CHANNEL_ID = "channel_id"; + private String channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "channel_name"; + private String channelName; + + public static final String JSON_PROPERTY_CONNECTOR_NAME = "connector_name"; + private String connectorName; + + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private NotificationRuleTargetConfigurationRecipient recipient; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_TEAM_NAME = "team_name"; + private String teamName; + + public static final String JSON_PROPERTY_TENANT_ID = "tenant_id"; + private String tenantId; + + public static final String JSON_PROPERTY_TENANT_NAME = "tenant_name"; + private String tenantName; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_WEBHOOK_NAME = "webhook_name"; + private String webhookName; + + public static final String JSON_PROPERTY_WORKSPACE = "workspace"; + private String workspace; + + public static final String JSON_PROPERTY_WORKSPACE_ID = "workspace_id"; + private String workspaceId; + + public NotificationRuleTargetConfiguration channel(String channel) { + this.channel = channel; + return this; + } + + /** + * Slack channel name, for a SLACK_CHANNEL target. + * + * @return channel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannel() { + return channel; + } + + public void setChannel(String channel) { + this.channel = channel; + } + + public NotificationRuleTargetConfiguration channelId(String channelId) { + this.channelId = channelId; + return this; + } + + /** + * Slack channel ID for a SLACK_CHANNEL target, or Microsoft Teams channel ID for an + * MS_TEAMS_CHANNEL target. + * + * @return channelId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelId() { + return channelId; + } + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + public NotificationRuleTargetConfiguration channelName(String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Microsoft Teams channel name, for an MS_TEAMS_CHANNEL target. + * + * @return channelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + public NotificationRuleTargetConfiguration connectorName(String connectorName) { + this.connectorName = connectorName; + return this; + } + + /** + * Microsoft Teams connector name, for an MS_TEAMS_CHANNEL target. + * + * @return connectorName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTOR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConnectorName() { + return connectorName; + } + + public void setConnectorName(String connectorName) { + this.connectorName = connectorName; + } + + public NotificationRuleTargetConfiguration recipient( + NotificationRuleTargetConfigurationRecipient recipient) { + this.recipient = recipient; + this.unparsed |= recipient.unparsed; + return this; + } + + /** + * Recipient for an EMAIL target. + * + * @return recipient + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotificationRuleTargetConfigurationRecipient getRecipient() { + return recipient; + } + + public void setRecipient(NotificationRuleTargetConfigurationRecipient recipient) { + this.recipient = recipient; + if (recipient != null) { + this.unparsed |= recipient.unparsed; + } + } + + public NotificationRuleTargetConfiguration serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * PagerDuty service name, for a PAGERDUTY_SERVICE target. + * + * @return serviceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public NotificationRuleTargetConfiguration teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * Microsoft Teams team ID, for an MS_TEAMS_CHANNEL target. + * + * @return teamId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public NotificationRuleTargetConfiguration teamName(String teamName) { + this.teamName = teamName; + return this; + } + + /** + * Microsoft Teams team name, for an MS_TEAMS_CHANNEL target. + * + * @return teamName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamName() { + return teamName; + } + + public void setTeamName(String teamName) { + this.teamName = teamName; + } + + public NotificationRuleTargetConfiguration tenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Microsoft Teams tenant ID, for an MS_TEAMS_CHANNEL target. + * + * @return tenantId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public NotificationRuleTargetConfiguration tenantName(String tenantName) { + this.tenantName = tenantName; + return this; + } + + /** + * Microsoft Teams tenant name, for an MS_TEAMS_CHANNEL target. + * + * @return tenantName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TENANT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public NotificationRuleTargetConfiguration username(String username) { + this.username = username; + return this; + } + + /** + * Slack username, for a SLACK_USER target. + * + * @return username + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public NotificationRuleTargetConfiguration webhookName(String webhookName) { + this.webhookName = webhookName; + return this; + } + + /** + * Name of the configured webhook, for a WEBHOOK target. + * + * @return webhookName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBHOOK_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebhookName() { + return webhookName; + } + + public void setWebhookName(String webhookName) { + this.webhookName = webhookName; + } + + public NotificationRuleTargetConfiguration workspace(String workspace) { + this.workspace = workspace; + return this; + } + + /** + * Slack workspace name, for a SLACK_CHANNEL or SLACK_USER target. + * + * @return workspace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspace() { + return workspace; + } + + public void setWorkspace(String workspace) { + this.workspace = workspace; + } + + public NotificationRuleTargetConfiguration workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Slack workspace ID, for a SLACK_CHANNEL target. + * + * @return workspaceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotificationRuleTargetConfiguration + */ + @JsonAnySetter + public NotificationRuleTargetConfiguration putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotificationRuleTargetConfiguration object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationRuleTargetConfiguration notificationRuleTargetConfiguration = + (NotificationRuleTargetConfiguration) o; + return Objects.equals(this.channel, notificationRuleTargetConfiguration.channel) + && Objects.equals(this.channelId, notificationRuleTargetConfiguration.channelId) + && Objects.equals(this.channelName, notificationRuleTargetConfiguration.channelName) + && Objects.equals(this.connectorName, notificationRuleTargetConfiguration.connectorName) + && Objects.equals(this.recipient, notificationRuleTargetConfiguration.recipient) + && Objects.equals(this.serviceName, notificationRuleTargetConfiguration.serviceName) + && Objects.equals(this.teamId, notificationRuleTargetConfiguration.teamId) + && Objects.equals(this.teamName, notificationRuleTargetConfiguration.teamName) + && Objects.equals(this.tenantId, notificationRuleTargetConfiguration.tenantId) + && Objects.equals(this.tenantName, notificationRuleTargetConfiguration.tenantName) + && Objects.equals(this.username, notificationRuleTargetConfiguration.username) + && Objects.equals(this.webhookName, notificationRuleTargetConfiguration.webhookName) + && Objects.equals(this.workspace, notificationRuleTargetConfiguration.workspace) + && Objects.equals(this.workspaceId, notificationRuleTargetConfiguration.workspaceId) + && Objects.equals( + this.additionalProperties, notificationRuleTargetConfiguration.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + channel, + channelId, + channelName, + connectorName, + recipient, + serviceName, + teamId, + teamName, + tenantId, + tenantName, + username, + webhookName, + workspace, + workspaceId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationRuleTargetConfiguration {\n"); + sb.append(" channel: ").append(toIndentedString(channel)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" connectorName: ").append(toIndentedString(connectorName)).append("\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); + sb.append(" tenantName: ").append(toIndentedString(tenantName)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n"); + sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfigurationRecipient.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfigurationRecipient.java new file mode 100644 index 00000000000..670dc0d25bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetConfigurationRecipient.java @@ -0,0 +1,139 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Recipient for an EMAIL target. */ +@JsonPropertyOrder({NotificationRuleTargetConfigurationRecipient.JSON_PROPERTY_EMAIL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotificationRuleTargetConfigurationRecipient { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public NotificationRuleTargetConfigurationRecipient email(String email) { + this.email = email; + return this; + } + + /** + * Email address to notify. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotificationRuleTargetConfigurationRecipient + */ + @JsonAnySetter + public NotificationRuleTargetConfigurationRecipient putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotificationRuleTargetConfigurationRecipient object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationRuleTargetConfigurationRecipient notificationRuleTargetConfigurationRecipient = + (NotificationRuleTargetConfigurationRecipient) o; + return Objects.equals(this.email, notificationRuleTargetConfigurationRecipient.email) + && Objects.equals( + this.additionalProperties, + notificationRuleTargetConfigurationRecipient.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationRuleTargetConfigurationRecipient {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetType.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetType.java new file mode 100644 index 00000000000..1cff2d143e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleTargetType.java @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of notification target. */ +@JsonSerialize(using = NotificationRuleTargetType.NotificationRuleTargetTypeSerializer.class) +public class NotificationRuleTargetType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "EMAIL", + "SLACK_CHANNEL", + "SLACK_USER", + "WEBHOOK", + "PAGERDUTY_SERVICE", + "MS_TEAMS_CHANNEL")); + + public static final NotificationRuleTargetType EMAIL = new NotificationRuleTargetType("EMAIL"); + public static final NotificationRuleTargetType SLACK_CHANNEL = + new NotificationRuleTargetType("SLACK_CHANNEL"); + public static final NotificationRuleTargetType SLACK_USER = + new NotificationRuleTargetType("SLACK_USER"); + public static final NotificationRuleTargetType WEBHOOK = + new NotificationRuleTargetType("WEBHOOK"); + public static final NotificationRuleTargetType PAGERDUTY_SERVICE = + new NotificationRuleTargetType("PAGERDUTY_SERVICE"); + public static final NotificationRuleTargetType MS_TEAMS_CHANNEL = + new NotificationRuleTargetType("MS_TEAMS_CHANNEL"); + + NotificationRuleTargetType(String value) { + super(value, allowedValues); + } + + public static class NotificationRuleTargetTypeSerializer + extends StdSerializer { + public NotificationRuleTargetTypeSerializer(Class t) { + super(t); + } + + public NotificationRuleTargetTypeSerializer() { + this(null); + } + + @Override + public void serialize( + NotificationRuleTargetType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static NotificationRuleTargetType fromValue(String value) { + return new NotificationRuleTargetType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.freeze new file mode 100644 index 00000000000..0ef87c70b9a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-08-10T13:53:40.860Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.json new file mode 100644 index 00000000000..f62377cc8ed --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_feature_flag_with_notification_rule_targets_returns_Created_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"default_variant_key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-1\",\"description\":\"Test feature flag with notification rule targets for BDD scenarios\",\"key\":\"test-feature-flag-notify-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"name\":\"Test Feature Flag Notify Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"notification_rule_query\":\"notification_type:rollout_started\",\"rule_targets\":[{\"configuration\":{\"channel\":\"#feature-flags-test\",\"workspace\":\"datadoghq\"},\"type\":\"SLACK_CHANNEL\",\"version\":1}],\"value_type\":\"BOOLEAN\",\"variants\":[{\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-1\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 A\",\"value\":\"true\"},{\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-2\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 B\",\"value\":\"false\"}]},\"type\":\"feature-flags\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/feature-flags", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9d8682a3-bee3-4c44-9dbb-0c440677560a\",\"type\":\"feature-flags\",\"attributes\":{\"archived_at\":null,\"created_at\":\"2026-08-10T13:53:41.832729Z\",\"created_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"description\":\"Test feature flag with notification rule targets for BDD scenarios\",\"distribution_channel\":\"ALL\",\"feature_flag_environments\":[{\"environment_id\":\"592600c2-8327-424d-960f-608c327ee96d\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\",\"environment_queries\":[\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\",\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-1d656919df39\",\"override_allocation_key\":\"allocation-override-1d656919df39\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"809cd83d-51ac-4f60-9ce5-cfad4d662114\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\",\"environment_queries\":[\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\",\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-5b37830ecf82\",\"override_allocation_key\":\"allocation-override-5b37830ecf82\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"21c84268-9fc7-4b6d-82ea-bb2090469aba\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\",\"environment_queries\":[\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\",\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-a51b0d0ad816\",\"override_allocation_key\":\"allocation-override-a51b0d0ad816\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"0b94dbaa-9efb-419d-8bd7-ef56f3828986\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1773321543\",\"environment_queries\":[\"staging\",\"test\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-d2f89ef224fa\",\"override_allocation_key\":\"allocation-override-d2f89ef224fa\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"afdaa512-6307-4965-bf92-62cc6bea5d00\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1773322166\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1773322166\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1773322166\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-47857e41dc6a\",\"override_allocation_key\":\"allocation-override-47857e41dc6a\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"04136d44-b58d-445b-b5c9-055f99575766\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1784893502\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1784893502\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1784893502\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-226c05eccc4c\",\"override_allocation_key\":\"allocation-override-226c05eccc4c\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"1203bcba-445f-4731-8842-a59d1073914f\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785154419\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785154419\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785154419\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-a94e04898e28\",\"override_allocation_key\":\"allocation-override-a94e04898e28\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"3e2bf225-677f-49c2-8cab-d16c0f1b0d5f\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785239524\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785239524\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785239524\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-0794ae4bccf7\",\"override_allocation_key\":\"allocation-override-0794ae4bccf7\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"5e00d2e3-2b06-4e60-a7ae-8c1a684a1fc5\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785326063\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785326063\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785326063\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-7f61c654cf38\",\"override_allocation_key\":\"allocation-override-7f61c654cf38\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"895d6669-f281-40ca-905f-95764b063997\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785412365\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785412365\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785412365\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-ef1b5324d5fb\",\"override_allocation_key\":\"allocation-override-ef1b5324d5fb\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"7477eea0-4499-452d-ad94-1e6188b8c5bc\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785498929\",\"environment_queries\":[\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785498929\",\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785498929\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-71403bfeb6d8\",\"override_allocation_key\":\"allocation-override-71403bfeb6d8\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"ecfbcdb4-306b-4adb-8438-03f3afaff0c9\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785759287\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785759287\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785759287\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9bc2239d583a\",\"override_allocation_key\":\"allocation-override-9bc2239d583a\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"414342a5-9711-4cf2-b55e-9c573c669795\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785844421\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785844421\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785844421\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9a54cdadf135\",\"override_allocation_key\":\"allocation-override-9a54cdadf135\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"1b7521fe-8131-46e2-b56c-e089d0b7270c\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785930926\",\"environment_queries\":[\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785930926\",\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785930926\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-31afdce5a980\",\"override_allocation_key\":\"allocation-override-31afdce5a980\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"230474f1-a11d-48b2-ba97-db27be150ae3\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786017494\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786017494\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786017494\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-18ef39c3ed0c\",\"override_allocation_key\":\"allocation-override-18ef39c3ed0c\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"30dbdd46-0371-4d6f-9f0e-560900b80df9\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786102241\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786102241\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786102241\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9083b0fad5f0\",\"override_allocation_key\":\"allocation-override-9083b0fad5f0\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"838b7cae-0e39-4a49-a039-6192291e1180\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786361780\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786361780\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786361780\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-4f7dfc5fe4ab\",\"override_allocation_key\":\"allocation-override-4f7dfc5fe4ab\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null}],\"is_favorite\":false,\"key\":\"test-feature-flag-notify-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"last_updated_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"Test Feature Flag Notify Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"require_approval\":false,\"staleness_details\":{\"id\":\"9d8682a3-bee3-4c44-9dbb-0c440677560a\",\"staleness_status\":\"ACTIVE\",\"stale_reason\":null,\"recommended_actions\":null,\"code_references\":null,\"skip_state_check_until\":null,\"dismissed_by\":null},\"staleness_status\":\"ACTIVE\",\"tags\":[],\"updated_at\":\"2026-08-10T13:53:41.832729Z\",\"value_type\":\"BOOLEAN\",\"variants\":[{\"id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-1\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 A\",\"value\":\"true\",\"created_at\":\"2026-08-10T13:53:41.847275Z\",\"updated_at\":\"2026-08-10T13:53:41.847275Z\"},{\"id\":\"ce277a45-cc74-4b66-b20c-9bea61d3eba9\",\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-2\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 B\",\"value\":\"false\",\"created_at\":\"2026-08-10T13:53:41.851104Z\",\"updated_at\":\"2026-08-10T13:53:41.851104Z\"}]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "71f343a1-a5db-7f50-de78-b5410999be5c" + }, + { + "httpRequest": { + "headers": {}, + "method": "POST", + "path": "/api/v2/feature-flags/9d8682a3-bee3-4c44-9dbb-0c440677560a/archive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9d8682a3-bee3-4c44-9dbb-0c440677560a\",\"type\":\"feature-flags\",\"attributes\":{\"archived_at\":\"2026-08-10T13:53:42.468506Z\",\"created_at\":\"2026-08-10T13:53:41.832729Z\",\"created_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"description\":\"Test feature flag with notification rule targets for BDD scenarios\",\"distribution_channel\":\"ALL\",\"feature_flag_environments\":[{\"environment_id\":\"592600c2-8327-424d-960f-608c327ee96d\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\",\"environment_queries\":[\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\",\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774470658\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-1d656919df39\",\"override_allocation_key\":\"allocation-override-1d656919df39\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"809cd83d-51ac-4f60-9ce5-cfad4d662114\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\",\"environment_queries\":[\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\",\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774471346\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-5b37830ecf82\",\"override_allocation_key\":\"allocation-override-5b37830ecf82\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"21c84268-9fc7-4b6d-82ea-bb2090469aba\",\"environment_name\":\"Test Environment Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\",\"environment_queries\":[\"test-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\",\"env-Test-Typescript-Create_allocation_for_a_flag_in_an_environment_returns_Created_response-1774472385\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-a51b0d0ad816\",\"override_allocation_key\":\"allocation-override-a51b0d0ad816\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"0b94dbaa-9efb-419d-8bd7-ef56f3828986\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1773321543\",\"environment_queries\":[\"staging\",\"test\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-d2f89ef224fa\",\"override_allocation_key\":\"allocation-override-d2f89ef224fa\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"afdaa512-6307-4965-bf92-62cc6bea5d00\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1773322166\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1773322166\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1773322166\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-47857e41dc6a\",\"override_allocation_key\":\"allocation-override-47857e41dc6a\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"04136d44-b58d-445b-b5c9-055f99575766\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1784893502\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1784893502\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1784893502\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-226c05eccc4c\",\"override_allocation_key\":\"allocation-override-226c05eccc4c\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"1203bcba-445f-4731-8842-a59d1073914f\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785154419\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785154419\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785154419\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-a94e04898e28\",\"override_allocation_key\":\"allocation-override-a94e04898e28\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"3e2bf225-677f-49c2-8cab-d16c0f1b0d5f\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785239524\",\"environment_queries\":[\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785239524\",\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785239524\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-0794ae4bccf7\",\"override_allocation_key\":\"allocation-override-0794ae4bccf7\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"5e00d2e3-2b06-4e60-a7ae-8c1a684a1fc5\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785326063\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785326063\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785326063\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-7f61c654cf38\",\"override_allocation_key\":\"allocation-override-7f61c654cf38\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"895d6669-f281-40ca-905f-95764b063997\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785412365\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785412365\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785412365\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-ef1b5324d5fb\",\"override_allocation_key\":\"allocation-override-ef1b5324d5fb\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"7477eea0-4499-452d-ad94-1e6188b8c5bc\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785498929\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785498929\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785498929\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-71403bfeb6d8\",\"override_allocation_key\":\"allocation-override-71403bfeb6d8\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"ecfbcdb4-306b-4adb-8438-03f3afaff0c9\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785759287\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785759287\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785759287\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9bc2239d583a\",\"override_allocation_key\":\"allocation-override-9bc2239d583a\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"414342a5-9711-4cf2-b55e-9c573c669795\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785844421\",\"environment_queries\":[\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785844421\",\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785844421\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9a54cdadf135\",\"override_allocation_key\":\"allocation-override-9a54cdadf135\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"1b7521fe-8131-46e2-b56c-e089d0b7270c\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1785930926\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1785930926\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1785930926\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-31afdce5a980\",\"override_allocation_key\":\"allocation-override-31afdce5a980\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"230474f1-a11d-48b2-ba97-db27be150ae3\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786017494\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786017494\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786017494\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-18ef39c3ed0c\",\"override_allocation_key\":\"allocation-override-18ef39c3ed0c\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"30dbdd46-0371-4d6f-9f0e-560900b80df9\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786102241\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786102241\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786102241\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-9083b0fad5f0\",\"override_allocation_key\":\"allocation-override-9083b0fad5f0\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null},{\"environment_id\":\"838b7cae-0e39-4a49-a039-6192291e1180\",\"environment_name\":\"Test Environment Test-Typescript-Create_an_environment_returns_Created_response-1786361780\",\"environment_queries\":[\"test-Test-Typescript-Create_an_environment_returns_Created_response-1786361780\",\"env-Test-Typescript-Create_an_environment_returns_Created_response-1786361780\"],\"status\":\"DISABLED\",\"default_variant_id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"override_variant_id\":null,\"default_allocation_key\":\"allocation-default-4f7dfc5fe4ab\",\"override_allocation_key\":\"allocation-override-4f7dfc5fe4ab\",\"allocations\":null,\"is_production\":false,\"require_feature_flag_approval\":false,\"observe_full_evaluation_data\":false,\"pending_suggestion_id\":null}],\"is_favorite\":false,\"key\":\"test-feature-flag-notify-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"last_updated_by\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"Test Feature Flag Notify Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020\",\"require_approval\":false,\"staleness_details\":{\"id\":\"9d8682a3-bee3-4c44-9dbb-0c440677560a\",\"staleness_status\":\"ACTIVE\",\"stale_reason\":null,\"recommended_actions\":null,\"code_references\":[],\"skip_state_check_until\":null,\"dismissed_by\":null},\"staleness_status\":\"ACTIVE\",\"tags\":[],\"updated_at\":\"2026-08-10T13:53:42.468506Z\",\"value_type\":\"BOOLEAN\",\"variants\":[{\"id\":\"d20d7517-d398-47f3-9ede-1db93a4ff44b\",\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-1\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 A\",\"value\":\"true\",\"created_at\":\"2026-08-10T13:53:41.847275Z\",\"updated_at\":\"2026-08-10T13:53:41.847275Z\"},{\"id\":\"ce277a45-cc74-4b66-b20c-9bea61d3eba9\",\"key\":\"variant-Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020-2\",\"name\":\"Variant Test-Create_a_feature_flag_with_notification_rule_targets_returns_Created_response-1786370020 B\",\"value\":\"false\",\"created_at\":\"2026-08-10T13:53:41.851104Z\",\"updated_at\":\"2026-08-10T13:53:41.851104Z\"}]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b3d6aad7-0640-8f84-656a-e2ad003b3fb9" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature b/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature index f44699236d8..36ffeb8de6f 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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