Skip to content

Commit 0b09602

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove deprecated allocation key fields from feature flags API (#3985)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f9841bf commit 0b09602

25 files changed

Lines changed: 1861 additions & 532 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 162 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26836,6 +26836,10 @@ components:
2683626836
description: Indicates whether this feature flag requires approval for changes.
2683726837
example: false
2683826838
type: boolean
26839+
staleness_status:
26840+
description: Indicates the whether a feature flag is stale or not.
26841+
example: "ACTIVE"
26842+
type: string
2683926843
tags:
2684026844
description: Tags associated with the feature flag.
2684126845
example: []
@@ -26919,24 +26923,171 @@ components:
2691926923
description: Indicates whether feature flag changes require approval in this environment.
2692026924
example: false
2692126925
type: boolean
26922-
rollout_percentage:
26923-
description: Rollout percentage for this environment.
26924-
example: 0
26925-
format: int64
26926-
maximum: 100
26927-
minimum: 0
26928-
type: integer
26929-
rules:
26930-
description: Environment targeting rules for this feature flag.
26926+
status:
26927+
$ref: "#/components/schemas/FeatureFlagStatus"
26928+
required:
26929+
- environment_id
26930+
- status
26931+
type: object
26932+
FeatureFlagEnvironmentListItem:
26933+
description: Environment-specific settings for a feature flag in list responses.
26934+
properties:
26935+
default_allocation_key:
26936+
description: The allocation key used for the default variant.
26937+
example: "allocation-default-123abc"
26938+
type: string
26939+
default_variant_id:
26940+
description: The ID of the default variant for this environment.
26941+
example: "550e8400-e29b-41d4-a716-446655440002"
26942+
nullable: true
26943+
type: string
26944+
environment_id:
26945+
description: The ID of the environment.
26946+
example: "550e8400-e29b-41d4-a716-446655440001"
26947+
format: uuid
26948+
type: string
26949+
environment_name:
26950+
description: The name of the environment.
26951+
example: "env-search-term"
26952+
type: string
26953+
environment_queries:
26954+
description: Queries that target this environment.
26955+
example:
26956+
- "test-feature-flag"
26957+
- "env-search-term"
2693126958
items:
26932-
$ref: "#/components/schemas/FeatureFlagTargetingRule"
26959+
description: A query string targeting the environment.
26960+
type: string
2693326961
type: array
26962+
is_production:
26963+
description: Indicates whether the environment is production.
26964+
example: false
26965+
type: boolean
26966+
override_allocation_key:
26967+
description: The allocation key used for the override variant.
26968+
example: "allocation-override-123abc"
26969+
type: string
26970+
override_variant_id:
26971+
description: The ID of the override variant for this environment.
26972+
example: "550e8400-e29b-41d4-a716-446655440003"
26973+
nullable: true
26974+
type: string
26975+
pending_suggestion_id:
26976+
description: Pending suggestion identifier, if approval is required.
26977+
example: "550e8400-e29b-41d4-a716-446655440099"
26978+
nullable: true
26979+
type: string
26980+
require_feature_flag_approval:
26981+
description: Indicates whether feature flag changes require approval in this environment.
26982+
example: false
26983+
type: boolean
2693426984
status:
2693526985
$ref: "#/components/schemas/FeatureFlagStatus"
2693626986
required:
2693726987
- environment_id
2693826988
- status
2693926989
type: object
26990+
FeatureFlagListItem:
26991+
description: A feature flag resource for list responses.
26992+
properties:
26993+
attributes:
26994+
$ref: "#/components/schemas/FeatureFlagListItemAttributes"
26995+
id:
26996+
description: The unique identifier of the feature flag.
26997+
example: "550e8400-e29b-41d4-a716-446655440000"
26998+
format: uuid
26999+
type: string
27000+
type:
27001+
$ref: "#/components/schemas/CreateFeatureFlagDataType"
27002+
required:
27003+
- id
27004+
- type
27005+
- attributes
27006+
type: object
27007+
FeatureFlagListItemAttributes:
27008+
description: Attributes of a feature flag in list responses.
27009+
properties:
27010+
archived_at:
27011+
description: The timestamp when the feature flag was archived.
27012+
example: "2023-01-01T00:00:00Z"
27013+
format: date-time
27014+
nullable: true
27015+
type: string
27016+
created_at:
27017+
description: The timestamp when the feature flag was created.
27018+
example: "2023-01-01T00:00:00Z"
27019+
format: date-time
27020+
type: string
27021+
created_by:
27022+
description: The ID of the user who created the feature flag.
27023+
example: "550e8400-e29b-41d4-a716-446655440010"
27024+
format: uuid
27025+
type: string
27026+
description:
27027+
description: The description of the feature flag.
27028+
example: "This is an example feature flag for demonstration"
27029+
type: string
27030+
distribution_channel:
27031+
description: Distribution channel for the feature flag.
27032+
example: "ALL"
27033+
type: string
27034+
feature_flag_environments:
27035+
description: Environment-specific settings for the feature flag.
27036+
items:
27037+
$ref: "#/components/schemas/FeatureFlagEnvironmentListItem"
27038+
type: array
27039+
json_schema:
27040+
description: JSON schema for validation when value_type is JSON.
27041+
example: '{"type": "object", "properties": {"enabled": {"type": "boolean"}}}'
27042+
nullable: true
27043+
type: string
27044+
key:
27045+
description: The unique key of the feature flag.
27046+
example: "feature-flag-abc123"
27047+
type: string
27048+
last_updated_by:
27049+
description: The ID of the user who last updated the feature flag.
27050+
example: "550e8400-e29b-41d4-a716-446655440010"
27051+
format: uuid
27052+
type: string
27053+
name:
27054+
description: The name of the feature flag.
27055+
example: "Feature Flag ABC123"
27056+
type: string
27057+
require_approval:
27058+
description: Indicates whether this feature flag requires approval for changes.
27059+
example: false
27060+
type: boolean
27061+
staleness_status:
27062+
description: Indicates the staleness status of the feature flag.
27063+
example: "ACTIVE"
27064+
type: string
27065+
tags:
27066+
description: Tags associated with the feature flag.
27067+
example: []
27068+
items:
27069+
description: A tag associated with the feature flag.
27070+
type: string
27071+
type: array
27072+
updated_at:
27073+
description: The timestamp when the feature flag was last updated.
27074+
example: "2023-01-01T00:00:00Z"
27075+
format: date-time
27076+
type: string
27077+
value_type:
27078+
$ref: "#/components/schemas/ValueType"
27079+
variants:
27080+
description: The variants of the feature flag.
27081+
items:
27082+
$ref: "#/components/schemas/Variant"
27083+
type: array
27084+
required:
27085+
- key
27086+
- name
27087+
- description
27088+
- value_type
27089+
- variants
27090+
type: object
2694027091
FeatureFlagResponse:
2694127092
description: Response containing a feature flag.
2694227093
properties:
@@ -26955,10 +27106,6 @@ components:
2695527106
x-enum-varnames:
2695627107
- ENABLED
2695727108
- DISABLED
26958-
FeatureFlagTargetingRule:
26959-
additionalProperties: {}
26960-
description: A targeting rule for a feature flag.
26961-
type: object
2696227109
FeatureFlagsPaginationMeta:
2696327110
description: Pagination metadata for feature flags.
2696427111
properties:
@@ -40813,7 +40960,7 @@ components:
4081340960
data:
4081440961
description: List of feature flags.
4081540962
items:
40816-
$ref: "#/components/schemas/FeatureFlag"
40963+
$ref: "#/components/schemas/FeatureFlagListItem"
4081740964
type: array
4081840965
meta:
4081940966
$ref: "#/components/schemas/FeatureFlagsPaginationMeta"

api/datadogV2/model_feature_flag_attributes.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type FeatureFlagAttributes struct {
3737
Name string `json:"name"`
3838
// Indicates whether this feature flag requires approval for changes.
3939
RequireApproval *bool `json:"require_approval,omitempty"`
40+
// Indicates the whether a feature flag is stale or not.
41+
StalenessStatus *string `json:"staleness_status,omitempty"`
4042
// Tags associated with the feature flag.
4143
Tags []string `json:"tags,omitempty"`
4244
// The timestamp when the feature flag was last updated.
@@ -387,6 +389,34 @@ func (o *FeatureFlagAttributes) SetRequireApproval(v bool) {
387389
o.RequireApproval = &v
388390
}
389391

392+
// GetStalenessStatus returns the StalenessStatus field value if set, zero value otherwise.
393+
func (o *FeatureFlagAttributes) GetStalenessStatus() string {
394+
if o == nil || o.StalenessStatus == nil {
395+
var ret string
396+
return ret
397+
}
398+
return *o.StalenessStatus
399+
}
400+
401+
// GetStalenessStatusOk returns a tuple with the StalenessStatus field value if set, nil otherwise
402+
// and a boolean to check if the value has been set.
403+
func (o *FeatureFlagAttributes) GetStalenessStatusOk() (*string, bool) {
404+
if o == nil || o.StalenessStatus == nil {
405+
return nil, false
406+
}
407+
return o.StalenessStatus, true
408+
}
409+
410+
// HasStalenessStatus returns a boolean if a field has been set.
411+
func (o *FeatureFlagAttributes) HasStalenessStatus() bool {
412+
return o != nil && o.StalenessStatus != nil
413+
}
414+
415+
// SetStalenessStatus gets a reference to the given string and assigns it to the StalenessStatus field.
416+
func (o *FeatureFlagAttributes) SetStalenessStatus(v string) {
417+
o.StalenessStatus = &v
418+
}
419+
390420
// GetTags returns the Tags field value if set, zero value otherwise.
391421
func (o *FeatureFlagAttributes) GetTags() []string {
392422
if o == nil || o.Tags == nil {
@@ -526,6 +556,9 @@ func (o FeatureFlagAttributes) MarshalJSON() ([]byte, error) {
526556
if o.RequireApproval != nil {
527557
toSerialize["require_approval"] = o.RequireApproval
528558
}
559+
if o.StalenessStatus != nil {
560+
toSerialize["staleness_status"] = o.StalenessStatus
561+
}
529562
if o.Tags != nil {
530563
toSerialize["tags"] = o.Tags
531564
}
@@ -559,6 +592,7 @@ func (o *FeatureFlagAttributes) UnmarshalJSON(bytes []byte) (err error) {
559592
LastUpdatedBy *uuid.UUID `json:"last_updated_by,omitempty"`
560593
Name *string `json:"name"`
561594
RequireApproval *bool `json:"require_approval,omitempty"`
595+
StalenessStatus *string `json:"staleness_status,omitempty"`
562596
Tags []string `json:"tags,omitempty"`
563597
UpdatedAt *time.Time `json:"updated_at,omitempty"`
564598
ValueType *ValueType `json:"value_type"`
@@ -584,7 +618,7 @@ func (o *FeatureFlagAttributes) UnmarshalJSON(bytes []byte) (err error) {
584618
}
585619
additionalProperties := make(map[string]interface{})
586620
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
587-
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "created_at", "created_by", "description", "distribution_channel", "feature_flag_environments", "json_schema", "key", "last_updated_by", "name", "require_approval", "tags", "updated_at", "value_type", "variants"})
621+
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "created_at", "created_by", "description", "distribution_channel", "feature_flag_environments", "json_schema", "key", "last_updated_by", "name", "require_approval", "staleness_status", "tags", "updated_at", "value_type", "variants"})
588622
} else {
589623
return err
590624
}
@@ -601,6 +635,7 @@ func (o *FeatureFlagAttributes) UnmarshalJSON(bytes []byte) (err error) {
601635
o.LastUpdatedBy = all.LastUpdatedBy
602636
o.Name = *all.Name
603637
o.RequireApproval = all.RequireApproval
638+
o.StalenessStatus = all.StalenessStatus
604639
o.Tags = all.Tags
605640
o.UpdatedAt = all.UpdatedAt
606641
if !all.ValueType.IsValid() {

0 commit comments

Comments
 (0)