Skip to content

Commit 059f371

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d656549 of spec repo
1 parent c1f424a commit 059f371

10 files changed

Lines changed: 734 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,15 @@ components:
19661966
example: "550e8400-e29b-41d4-a716-446655440000"
19671967
format: uuid
19681968
type: string
1969+
variant_id:
1970+
description: The ID of the variant.
1971+
in: path
1972+
name: variant_id
1973+
required: true
1974+
schema:
1975+
example: "550e8400-e29b-41d4-a716-446655440002"
1976+
format: uuid
1977+
type: string
19691978
requestBodies: {}
19701979
responses:
19711980
BadRequestResponse:
@@ -105626,6 +105635,18 @@ components:
105626105635
required:
105627105636
- data
105628105637
type: object
105638+
UpdateVariantRequest:
105639+
description: Request to update an existing variant's name and value.
105640+
properties:
105641+
name:
105642+
description: The display name of the variant.
105643+
example: "Variant ABC123 Updated"
105644+
type: string
105645+
value:
105646+
description: The value of the variant as a string.
105647+
example: "new_value"
105648+
type: string
105649+
type: object
105629105650
UpdateWorkflowRequest:
105630105651
description: A request object for updating an existing workflow.
105631105652
example:
@@ -132923,6 +132944,217 @@ paths:
132923132944
permissions:
132924132945
- feature_flag_config_write
132925132946
- feature_flag_environment_config_read
132947+
/api/v2/feature-flags/{feature_flag_id}/variants:
132948+
post:
132949+
description: |-
132950+
Adds a single new variant to an existing feature flag. This endpoint is
132951+
additive-only: it never modifies existing variants. A request whose `key`
132952+
already exists on the flag is rejected with `409 Conflict`; a `value`
132953+
whose type does not match the flag's `value_type` is rejected with `400`.
132954+
The server generates the variant UUID and returns it in the response body;
132955+
callers (for example, the flag-migration tool) need this UUID to reference
132956+
the new variant in subsequent allocation syncs.
132957+
operationId: CreateVariantForFeatureFlag
132958+
parameters:
132959+
- $ref: "#/components/parameters/feature_flag_id"
132960+
requestBody:
132961+
content:
132962+
application/json:
132963+
examples:
132964+
default:
132965+
value:
132966+
data:
132967+
attributes:
132968+
key: dark
132969+
name: Dark Theme
132970+
value: dark
132971+
type: variants
132972+
schema:
132973+
$ref: "#/components/schemas/CreateVariant"
132974+
required: true
132975+
responses:
132976+
"201":
132977+
content:
132978+
application/json:
132979+
examples:
132980+
default:
132981+
value:
132982+
data:
132983+
attributes:
132984+
created_at: "2024-01-01T00:00:00+00:00"
132985+
key: dark
132986+
name: Dark Theme
132987+
updated_at: "2024-01-01T00:00:00+00:00"
132988+
value: dark
132989+
id: "550e8400-e29b-41d4-a716-446655440002"
132990+
type: variants
132991+
schema:
132992+
$ref: "#/components/schemas/Variant"
132993+
description: Created
132994+
"400":
132995+
content:
132996+
application/json:
132997+
schema:
132998+
$ref: "#/components/schemas/APIErrorResponse"
132999+
description: Bad Request
133000+
"403":
133001+
content:
133002+
application/json:
133003+
schema:
133004+
$ref: "#/components/schemas/APIErrorResponse"
133005+
description: Forbidden
133006+
"404":
133007+
content:
133008+
application/json:
133009+
schema:
133010+
$ref: "#/components/schemas/APIErrorResponse"
133011+
description: Not Found
133012+
"409":
133013+
content:
133014+
application/json:
133015+
schema:
133016+
$ref: "#/components/schemas/APIErrorResponse"
133017+
description: Conflict - A variant with this key already exists on the flag.
133018+
"429":
133019+
$ref: "#/components/responses/TooManyRequestsResponse"
133020+
security:
133021+
- apiKeyAuth: []
133022+
appKeyAuth: []
133023+
summary: Add a variant to a feature flag
133024+
tags:
133025+
- Feature Flags
133026+
x-permission:
133027+
operator: AND
133028+
permissions:
133029+
- feature_flag_config_write
133030+
/api/v2/feature-flags/{feature_flag_id}/variants/{variant_id}:
133031+
delete:
133032+
description: |-
133033+
Deletes a variant from a feature flag.
133034+
133035+
When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a `FlagSuggestion` with `201 Created` instead of deleting the variant immediately. If a pending suggestion already exists for this flag's variant property, the endpoint returns `409 Conflict`.
133036+
operationId: DeleteVariantFromFeatureFlag
133037+
parameters:
133038+
- $ref: "#/components/parameters/feature_flag_id"
133039+
- $ref: "#/components/parameters/variant_id"
133040+
responses:
133041+
"204":
133042+
description: No Content
133043+
"400":
133044+
content:
133045+
application/json:
133046+
schema:
133047+
$ref: "#/components/schemas/APIErrorResponse"
133048+
description: Bad Request
133049+
"403":
133050+
content:
133051+
application/json:
133052+
schema:
133053+
$ref: "#/components/schemas/APIErrorResponse"
133054+
description: Forbidden
133055+
"404":
133056+
content:
133057+
application/json:
133058+
schema:
133059+
$ref: "#/components/schemas/APIErrorResponse"
133060+
description: Not Found
133061+
"409":
133062+
content:
133063+
application/json:
133064+
schema:
133065+
$ref: "#/components/schemas/APIErrorResponse"
133066+
description: Conflict - A pending suggestion already exists for this property.
133067+
"429":
133068+
$ref: "#/components/responses/TooManyRequestsResponse"
133069+
security:
133070+
- apiKeyAuth: []
133071+
appKeyAuth: []
133072+
summary: Delete a variant
133073+
tags:
133074+
- Feature Flags
133075+
x-permission:
133076+
operator: AND
133077+
permissions:
133078+
- feature_flag_config_write
133079+
put:
133080+
description: |-
133081+
Updates the name and value of an existing variant on a feature flag.
133082+
133083+
When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a `FlagSuggestion` with `201 Created` instead of applying the change immediately. Use the returned suggestion `id` to approve or reject the change. If a pending suggestion already exists for this flag's variant property, the endpoint returns `409 Conflict`.
133084+
operationId: UpdateVariantForFeatureFlag
133085+
parameters:
133086+
- $ref: "#/components/parameters/feature_flag_id"
133087+
- $ref: "#/components/parameters/variant_id"
133088+
requestBody:
133089+
content:
133090+
application/json:
133091+
examples:
133092+
default:
133093+
value:
133094+
data:
133095+
attributes:
133096+
name: Dark Theme Updated
133097+
value: dark_v2
133098+
id: "550e8400-e29b-41d4-a716-446655440002"
133099+
type: variants
133100+
schema:
133101+
$ref: "#/components/schemas/UpdateVariantRequest"
133102+
required: true
133103+
responses:
133104+
"200":
133105+
content:
133106+
application/json:
133107+
examples:
133108+
default:
133109+
value:
133110+
data:
133111+
attributes:
133112+
created_at: "2024-01-01T00:00:00+00:00"
133113+
key: dark
133114+
name: Dark Theme Updated
133115+
updated_at: "2024-06-01T00:00:00+00:00"
133116+
value: dark_v2
133117+
id: "550e8400-e29b-41d4-a716-446655440002"
133118+
type: variants
133119+
schema:
133120+
$ref: "#/components/schemas/Variant"
133121+
description: OK
133122+
"400":
133123+
content:
133124+
application/json:
133125+
schema:
133126+
$ref: "#/components/schemas/APIErrorResponse"
133127+
description: Bad Request
133128+
"403":
133129+
content:
133130+
application/json:
133131+
schema:
133132+
$ref: "#/components/schemas/APIErrorResponse"
133133+
description: Forbidden
133134+
"404":
133135+
content:
133136+
application/json:
133137+
schema:
133138+
$ref: "#/components/schemas/APIErrorResponse"
133139+
description: Not Found
133140+
"409":
133141+
content:
133142+
application/json:
133143+
schema:
133144+
$ref: "#/components/schemas/APIErrorResponse"
133145+
description: Conflict - A pending suggestion already exists for this property.
133146+
"429":
133147+
$ref: "#/components/responses/TooManyRequestsResponse"
133148+
security:
133149+
- apiKeyAuth: []
133150+
appKeyAuth: []
133151+
summary: Update a variant
133152+
tags:
133153+
- Feature Flags
133154+
x-permission:
133155+
operator: AND
133156+
permissions:
133157+
- feature_flag_config_write
132926133158
/api/v2/forms:
132927133159
get:
132928133160
description: Get all forms for the authenticated user's organization.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Add a variant to a feature flag returns "Created" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
6+
body = DatadogAPIClient::V2::CreateVariant.new({
7+
key: "variant-abc123",
8+
name: "Variant ABC123",
9+
value: "true",
10+
})
11+
p api_instance.create_variant_for_feature_flag("550e8400-e29b-41d4-a716-446655440000", body)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Delete a variant returns "No Content" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
api_instance.delete_variant_from_feature_flag("550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440002")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Update a variant returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
6+
body = DatadogAPIClient::V2::UpdateVariantRequest.new({
7+
name: "Variant ABC123 Updated",
8+
value: "new_value",
9+
})
10+
p api_instance.update_variant_for_feature_flag("550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440002", body)

features/scenarios_model_mapping.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,19 @@
32893289
"v2.UnarchiveFeatureFlag" => {
32903290
"feature_flag_id" => "UUID",
32913291
},
3292+
"v2.CreateVariantForFeatureFlag" => {
3293+
"feature_flag_id" => "UUID",
3294+
"body" => "CreateVariant",
3295+
},
3296+
"v2.DeleteVariantFromFeatureFlag" => {
3297+
"feature_flag_id" => "UUID",
3298+
"variant_id" => "UUID",
3299+
},
3300+
"v2.UpdateVariantForFeatureFlag" => {
3301+
"feature_flag_id" => "UUID",
3302+
"variant_id" => "UUID",
3303+
"body" => "UpdateVariantRequest",
3304+
},
32923305
"v2.CreateForm" => {
32933306
"body" => "CreateFormRequest",
32943307
},

0 commit comments

Comments
 (0)