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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 49 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24862,6 +24862,8 @@ components:
description: The description of the feature flag.
example: "This is an example feature flag for demonstration"
type: string
distribution_channel:
$ref: "#/components/schemas/FeatureFlagDistributionChannel"
json_schema:
description: JSON schema for validation when value_type is JSON.
example: '{"type": "object", "properties": {"enabled": {"type": "boolean"}}}'
Expand All @@ -24875,6 +24877,19 @@ components:
description: The name of the feature flag.
example: "Feature Flag ABC123"
type: string
require_approval:
description: Indicates whether this feature flag requires approval for changes.
example: false
type: boolean
staleness_status:
$ref: "#/components/schemas/CreateFeatureFlagStalenessStatus"
tags:
description: Tags associated with the feature flag.
example: []
items:
description: A tag associated with the feature flag.
type: string
type: array
value_type:
$ref: "#/components/schemas/ValueType"
variants:
Expand All @@ -24885,7 +24900,6 @@ components:
required:
- key
- name
- description
- value_type
- variants
type: object
Expand Down Expand Up @@ -24916,6 +24930,16 @@ components:
required:
- data
type: object
CreateFeatureFlagStalenessStatus:
description: The staleness status for the feature flag at creation.
enum:
- ACTIVE
- PERMANENT
example: "ACTIVE"
type: string
x-enum-varnames:
- ACTIVE
- PERMANENT
CreateFormData:
description: The data for creating a form.
properties:
Expand Down Expand Up @@ -39184,6 +39208,18 @@ components:
- value_type
- variants
type: object
FeatureFlagDistributionChannel:
description: The distribution channel for the feature flag.
enum:
- ALL
- CLIENT
- SERVER
example: "ALL"
type: string
x-enum-varnames:
- ALL
- CLIENT
- SERVER
FeatureFlagEnvironment:
description: Environment-specific settings for a feature flag.
properties:
Expand Down Expand Up @@ -148869,14 +148905,21 @@ paths:
attributes:
default_variant_key: variant-a
description: A sample feature flag
enabled: true
distribution_channel: ALL
key: feature-flag-abc123
name: Feature Flag ABC 123
require_approval: false
staleness_status: ACTIVE
tags:
- team:feature-flags-app
value_type: BOOLEAN
variants:
- description: Variant A
key: variant-a
- description: Variant B
key: variant-b
- key: variant-a
name: Variant A
value: "true"
- key: variant-b
name: Variant B
value: "false"
type: feature-flags
schema:
$ref: "#/components/schemas/CreateFeatureFlagRequest"
Expand Down
8 changes: 7 additions & 1 deletion examples/v2/feature-flags/CreateFeatureFlag.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
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.CreateFeatureFlagStalenessStatus;
import com.datadog.api.client.v2.model.CreateVariant;
import com.datadog.api.client.v2.model.FeatureFlagDistributionChannel;
import com.datadog.api.client.v2.model.FeatureFlagResponse;
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) {
Expand All @@ -25,9 +28,12 @@ public static void main(String[] args) {
.attributes(
new CreateFeatureFlagAttributes()
.defaultVariantKey("variant-Example-Feature-Flag-1")
.description("Test feature flag for BDD scenarios")
.distributionChannel(FeatureFlagDistributionChannel.SERVER)
.key("test-feature-flag-Example-Feature-Flag")
.name("Test Feature Flag Example-Feature-Flag")
.requireApproval(false)
.stalenessStatus(CreateFeatureFlagStalenessStatus.PERMANENT)
.tags(Collections.singletonList("env:api-client-test"))
.valueType(ValueType.BOOLEAN)
.variants(
Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
@JsonPropertyOrder({
CreateFeatureFlagAttributes.JSON_PROPERTY_DEFAULT_VARIANT_KEY,
CreateFeatureFlagAttributes.JSON_PROPERTY_DESCRIPTION,
CreateFeatureFlagAttributes.JSON_PROPERTY_DISTRIBUTION_CHANNEL,
CreateFeatureFlagAttributes.JSON_PROPERTY_JSON_SCHEMA,
CreateFeatureFlagAttributes.JSON_PROPERTY_KEY,
CreateFeatureFlagAttributes.JSON_PROPERTY_NAME,
CreateFeatureFlagAttributes.JSON_PROPERTY_REQUIRE_APPROVAL,
CreateFeatureFlagAttributes.JSON_PROPERTY_STALENESS_STATUS,
CreateFeatureFlagAttributes.JSON_PROPERTY_TAGS,
CreateFeatureFlagAttributes.JSON_PROPERTY_VALUE_TYPE,
CreateFeatureFlagAttributes.JSON_PROPERTY_VARIANTS
})
Expand All @@ -40,6 +44,9 @@ public class CreateFeatureFlagAttributes {
public static final String JSON_PROPERTY_DESCRIPTION = "description";
private String description;

public static final String JSON_PROPERTY_DISTRIBUTION_CHANNEL = "distribution_channel";
private FeatureFlagDistributionChannel distributionChannel;

public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema";
private JsonNullable<String> jsonSchema = JsonNullable.<String>undefined();

Expand All @@ -49,6 +56,15 @@ public class CreateFeatureFlagAttributes {
public static final String JSON_PROPERTY_NAME = "name";
private String name;

public static final String JSON_PROPERTY_REQUIRE_APPROVAL = "require_approval";
private Boolean requireApproval;

public static final String JSON_PROPERTY_STALENESS_STATUS = "staleness_status";
private CreateFeatureFlagStalenessStatus stalenessStatus;

public static final String JSON_PROPERTY_TAGS = "tags";
private List<String> tags = null;

public static final String JSON_PROPERTY_VALUE_TYPE = "value_type";
private ValueType valueType;

Expand All @@ -59,12 +75,10 @@ public CreateFeatureFlagAttributes() {}

@JsonCreator
public CreateFeatureFlagAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description,
@JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key,
@JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name,
@JsonProperty(required = true, value = JSON_PROPERTY_VALUE_TYPE) ValueType valueType,
@JsonProperty(required = true, value = JSON_PROPERTY_VARIANTS) List<CreateVariant> variants) {
this.description = description;
this.key = key;
this.name = name;
this.valueType = valueType;
Expand Down Expand Up @@ -116,8 +130,9 @@ public CreateFeatureFlagAttributes description(String description) {
*
* @return description
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getDescription() {
return description;
}
Expand All @@ -126,6 +141,32 @@ public void setDescription(String description) {
this.description = description;
}

public CreateFeatureFlagAttributes distributionChannel(
FeatureFlagDistributionChannel distributionChannel) {
this.distributionChannel = distributionChannel;
this.unparsed |= !distributionChannel.isValid();
return this;
}

/**
* The distribution channel for the feature flag.
*
* @return distributionChannel
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DISTRIBUTION_CHANNEL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public FeatureFlagDistributionChannel getDistributionChannel() {
return distributionChannel;
}

public void setDistributionChannel(FeatureFlagDistributionChannel distributionChannel) {
if (!distributionChannel.isValid()) {
this.unparsed = true;
}
this.distributionChannel = distributionChannel;
}

public CreateFeatureFlagAttributes jsonSchema(String jsonSchema) {
this.jsonSchema = JsonNullable.<String>of(jsonSchema);
return this;
Expand Down Expand Up @@ -197,6 +238,82 @@ public void setName(String name) {
this.name = name;
}

public CreateFeatureFlagAttributes requireApproval(Boolean requireApproval) {
this.requireApproval = requireApproval;
return this;
}

/**
* Indicates whether this feature flag requires approval for changes.
*
* @return requireApproval
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_REQUIRE_APPROVAL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getRequireApproval() {
return requireApproval;
}

public void setRequireApproval(Boolean requireApproval) {
this.requireApproval = requireApproval;
}

public CreateFeatureFlagAttributes stalenessStatus(
CreateFeatureFlagStalenessStatus stalenessStatus) {
this.stalenessStatus = stalenessStatus;
this.unparsed |= !stalenessStatus.isValid();
return this;
}

/**
* The staleness status for the feature flag at creation.
*
* @return stalenessStatus
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STALENESS_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CreateFeatureFlagStalenessStatus getStalenessStatus() {
return stalenessStatus;
}

public void setStalenessStatus(CreateFeatureFlagStalenessStatus stalenessStatus) {
if (!stalenessStatus.isValid()) {
this.unparsed = true;
}
this.stalenessStatus = stalenessStatus;
}

public CreateFeatureFlagAttributes tags(List<String> tags) {
this.tags = tags;
return this;
}

public CreateFeatureFlagAttributes addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}

/**
* Tags associated with the feature flag.
*
* @return tags
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getTags() {
return tags;
}

public void setTags(List<String> tags) {
this.tags = tags;
}

public CreateFeatureFlagAttributes valueType(ValueType valueType) {
this.valueType = valueType;
this.unparsed |= !valueType.isValid();
Expand Down Expand Up @@ -313,9 +430,13 @@ public boolean equals(Object o) {
CreateFeatureFlagAttributes createFeatureFlagAttributes = (CreateFeatureFlagAttributes) o;
return Objects.equals(this.defaultVariantKey, createFeatureFlagAttributes.defaultVariantKey)
&& Objects.equals(this.description, createFeatureFlagAttributes.description)
&& Objects.equals(this.distributionChannel, createFeatureFlagAttributes.distributionChannel)
&& Objects.equals(this.jsonSchema, createFeatureFlagAttributes.jsonSchema)
&& Objects.equals(this.key, createFeatureFlagAttributes.key)
&& Objects.equals(this.name, createFeatureFlagAttributes.name)
&& Objects.equals(this.requireApproval, createFeatureFlagAttributes.requireApproval)
&& Objects.equals(this.stalenessStatus, createFeatureFlagAttributes.stalenessStatus)
&& Objects.equals(this.tags, createFeatureFlagAttributes.tags)
&& Objects.equals(this.valueType, createFeatureFlagAttributes.valueType)
&& Objects.equals(this.variants, createFeatureFlagAttributes.variants)
&& Objects.equals(
Expand All @@ -327,9 +448,13 @@ public int hashCode() {
return Objects.hash(
defaultVariantKey,
description,
distributionChannel,
jsonSchema,
key,
name,
requireApproval,
stalenessStatus,
tags,
valueType,
variants,
additionalProperties);
Expand All @@ -341,9 +466,15 @@ public String toString() {
sb.append("class CreateFeatureFlagAttributes {\n");
sb.append(" defaultVariantKey: ").append(toIndentedString(defaultVariantKey)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" distributionChannel: ")
.append(toIndentedString(distributionChannel))
.append("\n");
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(" requireApproval: ").append(toIndentedString(requireApproval)).append("\n");
sb.append(" stalenessStatus: ").append(toIndentedString(stalenessStatus)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n");
sb.append(" variants: ").append(toIndentedString(variants)).append("\n");
sb.append(" additionalProperties: ")
Expand Down
Loading
Loading