From a8c321025597581fcf10b332ad84f1a75b08e5d7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 11 Nov 2026 04:03:17 +0000 Subject: [PATCH] Regenerate client from commit d0f856a of spec repo --- .generator/schemas/v2/openapi.yaml | 1295 ++++++++++++++++- .../v2/feature-flags/ApplyFlagSuggestion.py | 18 + .../v2/feature-flags/ApproveFlagSuggestion.py | 32 + .../v2/feature-flags/CreateFlagSuggestion.py | 42 + .../v2/feature-flags/DeleteFlagSuggestion.py | 16 + .../v2/feature-flags/GetFlagSuggestion.py | 18 + .../v2/feature-flags/RejectFlagSuggestion.py | 31 + .../UpdateFeatureFlagApprovals.py | 31 + .../v2/api/feature_flags_api.py | 504 ++++++- .../approve_flag_suggestion_attributes.py | 44 + .../v2/model/approve_flag_suggestion_data.py | 48 + .../model/approve_flag_suggestion_request.py | 40 + .../create_flag_suggestion_attributes.py | 105 ++ .../v2/model/create_flag_suggestion_data.py | 48 + .../model/create_flag_suggestion_request.py | 40 + .../model/feature_flag_approval_required.py | 67 + ...ature_flag_approval_required_attributes.py | 77 + ...eature_flag_approval_required_data_type.py | 35 + ...feature_flag_approval_required_response.py | 40 + .../model/feature_flag_approvals_data_type.py | 35 + .../v2/model/feature_flag_attributes.py | 4 +- .../feature_flag_list_item_attributes.py | 4 +- .../v2/model/feature_flag_suggestion.py | 57 + .../feature_flag_suggestion_attributes.py | 188 +++ ...ag_suggestion_attributes_current_status.py | 41 + ..._suggestion_attributes_lifecycle_status.py | 47 + .../feature_flag_suggestion_data_type.py | 35 + ...ature_flag_suggestion_experiment_action.py | 46 + .../model/feature_flag_suggestion_metadata.py | 75 + ...eature_flag_suggestion_metadata_request.py | 37 + .../model/feature_flag_suggestion_response.py | 40 + .../reject_flag_suggestion_attributes.py | 36 + .../v2/model/reject_flag_suggestion_data.py | 48 + .../model/reject_flag_suggestion_request.py | 40 + .../model/review_flag_suggestion_data_type.py | 35 + ...pdate_feature_flag_approvals_attributes.py | 33 + .../update_feature_flag_approvals_data.py | 52 + .../update_feature_flag_approvals_request.py | 40 + .../model/update_feature_flag_attributes.py | 29 +- .../update_feature_flag_staleness_status.py | 41 + src/datadog_api_client/v2/models/__init__.py | 60 + tests/v2/features/feature_flags.feature | 333 ++++- tests/v2/features/undo.json | 49 + 43 files changed, 3854 insertions(+), 82 deletions(-) create mode 100644 examples/v2/feature-flags/ApplyFlagSuggestion.py create mode 100644 examples/v2/feature-flags/ApproveFlagSuggestion.py create mode 100644 examples/v2/feature-flags/CreateFlagSuggestion.py create mode 100644 examples/v2/feature-flags/DeleteFlagSuggestion.py create mode 100644 examples/v2/feature-flags/GetFlagSuggestion.py create mode 100644 examples/v2/feature-flags/RejectFlagSuggestion.py create mode 100644 examples/v2/feature-flags/UpdateFeatureFlagApprovals.py create mode 100644 src/datadog_api_client/v2/model/approve_flag_suggestion_attributes.py create mode 100644 src/datadog_api_client/v2/model/approve_flag_suggestion_data.py create mode 100644 src/datadog_api_client/v2/model/approve_flag_suggestion_request.py create mode 100644 src/datadog_api_client/v2/model/create_flag_suggestion_attributes.py create mode 100644 src/datadog_api_client/v2/model/create_flag_suggestion_data.py create mode 100644 src/datadog_api_client/v2/model/create_flag_suggestion_request.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_approval_required.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_approval_required_attributes.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_approval_required_data_type.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_approval_required_response.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_approvals_data_type.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_attributes.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_current_status.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_lifecycle_status.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_data_type.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_experiment_action.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_metadata.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_metadata_request.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_suggestion_response.py create mode 100644 src/datadog_api_client/v2/model/reject_flag_suggestion_attributes.py create mode 100644 src/datadog_api_client/v2/model/reject_flag_suggestion_data.py create mode 100644 src/datadog_api_client/v2/model/reject_flag_suggestion_request.py create mode 100644 src/datadog_api_client/v2/model/review_flag_suggestion_data_type.py create mode 100644 src/datadog_api_client/v2/model/update_feature_flag_approvals_attributes.py create mode 100644 src/datadog_api_client/v2/model/update_feature_flag_approvals_data.py create mode 100644 src/datadog_api_client/v2/model/update_feature_flag_approvals_request.py create mode 100644 src/datadog_api_client/v2/model/update_feature_flag_staleness_status.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c2e35f9985..c2bf9d0935 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2775,6 +2775,15 @@ components: example: "550e8400-e29b-41d4-a716-446655440000" format: uuid type: string + suggestion_id: + description: The ID of the feature flag change suggestion. + in: path + name: suggestion_id + required: true + schema: + example: "550e8400-e29b-41d4-a716-446655440020" + format: uuid + type: string variant_id: description: The ID of the variant. in: path @@ -2804,6 +2813,14 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Conflict + FeatureFlagSuggestionCreated: + content: + application/json: + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: Created - Approval is required. A suggestion was created and the change has not been applied. + FeatureFlagSuggestionCreatedWithoutSchema: + description: Created - Approval is required. A suggestion was created and the change has not been applied. FindingsBadRequestResponse: content: application/json: @@ -15473,6 +15490,37 @@ components: $ref: "#/components/schemas/ApplicationSecurityWafExclusionFilterResource" type: array type: object + ApproveFlagSuggestionAttributes: + description: Approval options for the suggestion. + properties: + apply: + default: true + description: |- + Whether to apply the change immediately. Set to `false` to approve without applying, then + call `ApplyFlagSuggestion` later. + example: false + type: boolean + comment: + description: A comment explaining the approval. + example: Approved for rollout. + type: string + type: object + ApproveFlagSuggestionData: + description: The approval event to create. + properties: + attributes: + $ref: "#/components/schemas/ApproveFlagSuggestionAttributes" + type: + $ref: "#/components/schemas/ReviewFlagSuggestionDataType" + required: [type, attributes] + type: object + ApproveFlagSuggestionRequest: + description: Request to approve a feature flag change suggestion. + properties: + data: + $ref: "#/components/schemas/ApproveFlagSuggestionData" + required: [data] + type: object AppsSortField: description: "The field and direction to sort apps by" enum: @@ -31461,6 +31509,62 @@ components: x-enum-varnames: - ACTIVE - PERMANENT + CreateFlagSuggestionAttributes: + description: Attributes for creating a feature flag change suggestion. + properties: + action: + description: The action proposed by the suggestion. + example: updated + type: string + comment: + description: A comment explaining the proposed change. + example: Restrict this flag to server applications. + type: string + environment_id: + description: |- + The ID of the target environment. Required for `ALLOCATIONS`, `DEFAULT_VARIANT`, and + `OVERRIDE_VARIANT` changes. + example: "550e8400-e29b-41d4-a716-446655440001" + format: uuid + type: string + notification_rule_targets: + description: |- + Handles to notify about the review, without the `@` prefix. For example, an email address + or a Slack channel name. + example: [requester@example.com] + items: + description: A notification handle. + type: string + minItems: 1 + type: array + property: + description: The property to change. The property must require approval for this flag and environment. + example: DISTRIBUTION_CHANNEL + type: string + suggestion: + description: The proposed value as a string. For structured values, supply a JSON-encoded string. + example: SERVER + type: string + suggestion_metadata: + $ref: "#/components/schemas/FeatureFlagSuggestionMetadataRequest" + required: [action, property, notification_rule_targets] + type: object + CreateFlagSuggestionData: + description: The suggestion to create. + properties: + attributes: + $ref: "#/components/schemas/CreateFlagSuggestionAttributes" + type: + $ref: "#/components/schemas/FeatureFlagSuggestionDataType" + required: [type, attributes] + type: object + CreateFlagSuggestionRequest: + description: Request to create a feature flag change suggestion. + properties: + data: + $ref: "#/components/schemas/CreateFlagSuggestionData" + required: [data] + type: object CreateFormData: description: The data for creating a form. properties: @@ -56671,6 +56775,63 @@ components: - type - attributes type: object + FeatureFlagApprovalRequired: + description: A proposed change requiring explicit submission through `CreateFlagSuggestion`. + properties: + attributes: + $ref: "#/components/schemas/FeatureFlagApprovalRequiredAttributes" + id: + description: The ID of the feature flag. This is not a suggestion ID. + example: "550e8400-e29b-41d4-a716-446655440000" + format: uuid + type: string + type: + $ref: "#/components/schemas/FeatureFlagApprovalRequiredDataType" + required: [id, type, attributes] + type: object + FeatureFlagApprovalRequiredAttributes: + description: The change to submit for approval. + properties: + action: + description: The proposed action. + example: updated + type: string + environment_id: + description: The ID of the environment targeted by the change. + example: "550e8400-e29b-41d4-a716-446655440001" + format: uuid + type: string + property: + description: The feature flag property to change. + example: ALLOCATIONS + type: string + suggestion: + description: The proposed value, serialized as a string. Allocation sets are JSON-encoded strings. + example: "[]" + type: string + suggestion_metadata: + $ref: "#/components/schemas/FeatureFlagSuggestionMetadata" + required: [property, action, suggestion] + type: object + FeatureFlagApprovalRequiredDataType: + description: The resource type for an approval-required response. + enum: [approval-required] + example: approval-required + type: string + x-enum-varnames: [APPROVAL_REQUIRED] + FeatureFlagApprovalRequiredResponse: + description: Approval-required response containing a proposed change. No suggestion has been persisted. + properties: + data: + $ref: "#/components/schemas/FeatureFlagApprovalRequired" + required: [data] + type: object + FeatureFlagApprovalsDataType: + description: The resource type for feature flag approval settings. + enum: [feature-flag-approvals] + example: feature-flag-approvals + type: string + x-enum-varnames: [FEATURE_FLAG_APPROVALS] FeatureFlagAttributes: description: Attributes of a feature flag. properties: @@ -56732,7 +56893,11 @@ components: staleness_details: $ref: "#/components/schemas/FeatureFlagStalenessDetails" staleness_status: - description: Indicates the whether a feature flag is stale or not. + deprecated: true + description: |- + Legacy status retained for compatibility. This field is always `ACTIVE`; use + `staleness_details.staleness_status` for the computed status. Do not copy it into an update + request: sending `ACTIVE` makes a `PERMANENT` flag temporary and clears any snooze. example: "ACTIVE" type: string staleness_status_override: @@ -56985,7 +57150,10 @@ components: $ref: "#/components/schemas/FeatureFlagStalenessDetails" staleness_status: deprecated: true - description: Legacy status retained for compatibility. This field is always `ACTIVE`; use `staleness_details.staleness_status` for the computed status. + description: |- + Legacy status retained for compatibility. This field is always `ACTIVE`; use + `staleness_details.staleness_status` for the computed status. Do not copy it into an update + request: sending `ACTIVE` makes a `PERMANENT` flag temporary and clears any snooze. example: "ACTIVE" type: string staleness_status_override: @@ -57141,6 +57309,189 @@ components: x-enum-varnames: - ENABLED - DISABLED + FeatureFlagSuggestion: + description: A proposed feature flag change and its approval lifecycle. + properties: + attributes: + $ref: "#/components/schemas/FeatureFlagSuggestionAttributes" + id: + description: The unique identifier of the suggestion. + example: "550e8400-e29b-41d4-a716-446655440020" + format: uuid + type: string + type: + $ref: "#/components/schemas/FeatureFlagSuggestionDataType" + required: + - id + - type + - attributes + type: object + FeatureFlagSuggestionAttributes: + description: Attributes of a feature flag change suggestion. + properties: + action: + description: The action proposed by the suggestion. + example: updated + type: string + base_flag_history_id: + description: The ID of the flag history entry on which the suggestion is based. + example: "550e8400-e29b-41d4-a716-446655440021" + format: uuid + type: string + comment: + description: The comment supplied by the suggestion's creator. + example: Restrict this flag to server applications. + type: string + created_at: + description: The timestamp when the suggestion was created. + example: "2024-01-01T00:00:00Z" + format: date-time + type: string + created_by: + description: The ID of the user who created the suggestion. + example: "550e8400-e29b-41d4-a716-446655440010" + format: uuid + type: string + current_status: + $ref: "#/components/schemas/FeatureFlagSuggestionAttributesCurrentStatus" + current_value: + description: The value before the proposed change, serialized as a string. + example: ALL + type: string + deleted_at: + description: The timestamp when the suggestion was deleted. + example: "2024-01-02T00:00:00Z" + format: date-time + type: string + deleted_by: + description: The ID of the user who deleted the suggestion. + example: "550e8400-e29b-41d4-a716-446655440011" + format: uuid + type: string + environment_id: + description: The ID of the environment targeted by the change, if the change is environment-specific. + example: "550e8400-e29b-41d4-a716-446655440001" + format: uuid + type: string + feature_flag_id: + description: The ID of the feature flag that the suggestion changes. + example: "550e8400-e29b-41d4-a716-446655440000" + format: uuid + type: string + lifecycle_status: + $ref: "#/components/schemas/FeatureFlagSuggestionAttributesLifecycleStatus" + message: + description: A message explaining why a suggestion was created. + example: This flag requires approval for this change. A suggestion has been created and is pending review. + type: string + property: + description: The feature flag property to update. + example: DISTRIBUTION_CHANNEL + type: string + suggestion: + description: |- + The proposed value, serialized as a string. Structured values, such as variants and allocations, + are JSON-encoded strings. + example: SERVER + type: string + suggestion_metadata: + $ref: "#/components/schemas/FeatureFlagSuggestionMetadata" + updated_at: + description: The timestamp when the suggestion was last updated. + example: "2024-01-02T00:00:00Z" + format: date-time + type: string + updated_by: + description: The ID of the user who last updated the suggestion. + example: "550e8400-e29b-41d4-a716-446655440011" + format: uuid + type: string + required: + - created_at + - created_by + - feature_flag_id + - base_flag_history_id + - current_status + - lifecycle_status + - action + - property + - suggestion + - current_value + type: object + FeatureFlagSuggestionAttributesCurrentStatus: + description: The legacy review status. Use `lifecycle_status` to distinguish approval from application. + enum: [pending, approved, rejected] + example: pending + type: string + x-enum-varnames: [PENDING, APPROVED, REJECTED] + FeatureFlagSuggestionAttributesLifecycleStatus: + description: The lifecycle status of the suggestion. + enum: [pending, approved, applied, rejected, discarded] + example: pending + type: string + x-enum-varnames: [PENDING, APPROVED, APPLIED, REJECTED, DISCARDED] + FeatureFlagSuggestionDataType: + description: The resource type for feature flag suggestions. + enum: + - flag-suggestions + example: flag-suggestions + type: string + x-enum-varnames: + - FLAG_SUGGESTIONS + FeatureFlagSuggestionExperimentAction: + description: Server-generated reference to an experiment action requiring approval. + properties: + action: + description: The proposed experiment action. + example: start + type: string + experiment_id: + description: The ID of the experiment. + example: "550e8400-e29b-41d4-a716-446655440030" + format: uuid + type: string + version: + description: The version of the experiment action reference. + example: 1 + format: int64 + type: integer + required: [experiment_id, action, version] + type: object + FeatureFlagSuggestionMetadata: + description: Metadata associated with a suggestion. Fields other than `variant_id` are set by the server. + properties: + allow_draft_reorder: + description: Whether the server allows this allocation suggestion to reorder persisted drafts. + example: false + type: boolean + experiment_action: + $ref: "#/components/schemas/FeatureFlagSuggestionExperimentAction" + experiment_action_request_fingerprint: + description: Server-generated fingerprint of the experiment action request. + type: string + variant_id: + description: The ID of the variant targeted by the suggestion. + example: "550e8400-e29b-41d4-a716-446655440002" + format: uuid + type: string + type: object + FeatureFlagSuggestionMetadataRequest: + description: Client-settable metadata for a suggestion. + properties: + variant_id: + description: The ID of the variant targeted by the suggestion. + example: "550e8400-e29b-41d4-a716-446655440002" + format: uuid + type: string + type: object + FeatureFlagSuggestionResponse: + description: Response containing a feature flag change suggestion. + properties: + data: + $ref: "#/components/schemas/FeatureFlagSuggestion" + required: + - data + type: object FeatureFlagsPaginationLinks: description: Pagination links. Follow `next` with the same authentication to retrieve the next page. Links use `page[limit]` and `page[offset]` and preserve the filters. Navigation links are omitted when not applicable. properties: @@ -112101,6 +112452,30 @@ components: data: $ref: "#/components/schemas/AppKeyRegistrationData" type: object + RejectFlagSuggestionAttributes: + description: Rejection options for the suggestion. + properties: + comment: + description: A comment explaining the rejection. + example: Keep the existing configuration. + type: string + type: object + RejectFlagSuggestionData: + description: The rejection event to create. + properties: + attributes: + $ref: "#/components/schemas/RejectFlagSuggestionAttributes" + type: + $ref: "#/components/schemas/ReviewFlagSuggestionDataType" + required: [type, attributes] + type: object + RejectFlagSuggestionRequest: + description: Request to reject a feature flag change suggestion. + properties: + data: + $ref: "#/components/schemas/RejectFlagSuggestionData" + required: [data] + type: object RelationAttributes: description: Relation attributes. properties: @@ -114545,6 +114920,12 @@ components: description: Target revision ID to revert to type: string type: object + ReviewFlagSuggestionDataType: + description: The resource type for reviewing feature flag suggestions. + enum: [flag-suggestion-events] + example: flag-suggestion-events + type: string + x-enum-varnames: [FLAG_SUGGESTION_EVENTS] Role: description: Role object returned by the API. properties: @@ -149951,6 +150332,31 @@ components: required: - data type: object + UpdateFeatureFlagApprovalsAttributes: + description: The approval requirement for the flag. + properties: + enabled: + description: Whether approval is required. Disabling requires the Feature Flag Approvals Override permission. + example: true + type: boolean + required: [enabled] + type: object + UpdateFeatureFlagApprovalsData: + description: The feature flag approval setting to update. + properties: + attributes: + $ref: "#/components/schemas/UpdateFeatureFlagApprovalsAttributes" + type: + $ref: "#/components/schemas/FeatureFlagApprovalsDataType" + required: [type, attributes] + type: object + UpdateFeatureFlagApprovalsRequest: + description: Request to change whether a feature flag requires approval. + properties: + data: + $ref: "#/components/schemas/UpdateFeatureFlagApprovalsData" + required: [data] + type: object UpdateFeatureFlagAttributes: description: Attributes for updating a feature flag. properties: @@ -149958,6 +150364,8 @@ components: description: The description of the feature flag. example: "Updated description for feature flag XYZ789" 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"}}}' @@ -149967,6 +150375,8 @@ components: description: The name of the feature flag. example: "Updated Feature Flag XYZ789" type: string + staleness_status: + $ref: "#/components/schemas/UpdateFeatureFlagStalenessStatus" tags: description: |- Tags associated with the feature flag. This field replaces the full set of @@ -150008,6 +150418,20 @@ components: required: - data type: object + UpdateFeatureFlagStalenessStatus: + description: |- + The lifecycle to set. `ACTIVE` makes the flag temporary; `PERMANENT` excludes it from + staleness detection. Either value clears any snooze; omit the field to keep the lifecycle. + Do not copy the top-level `staleness_status` from a response into this field: that legacy + response field is always `ACTIVE`. + enum: + - ACTIVE + - PERMANENT + example: "PERMANENT" + type: string + x-enum-varnames: + - ACTIVE + - PERMANENT UpdateFlakyTestsRequest: description: Request to update the state of multiple flaky tests. properties: @@ -187445,6 +187869,402 @@ paths: operator: AND permissions: - feature_flag_config_write + /api/v2/feature-flags/suggestions/{suggestion_id}: + delete: + description: |- + Deletes a pending suggestion or discards an approved suggestion that has not been + applied. Requires editor access to the flag, or contributor access for the suggestion's + creator. Applied and rejected suggestions return `409 Conflict`. A missing or already + discarded suggestion returns `204 No Content`. + operationId: DeleteFlagSuggestion + parameters: + - $ref: "#/components/parameters/suggestion_id" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - Applied or rejected suggestions cannot be deleted. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Delete or discard a flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read + get: + description: |- + Returns a feature flag change suggestion by ID. Use `lifecycle_status` to distinguish + pending, approved, applied, rejected, and discarded suggestions. An approved suggestion + has not yet been applied; an applied suggestion has changed the flag. + operationId: GetFlagSuggestion + parameters: + - $ref: "#/components/parameters/suggestion_id" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: 550e8400-e29b-41d4-a716-446655440021 + comment: Restrict this flag to server applications. + created_at: "2024-01-01T00:00:00Z" + created_by: 550e8400-e29b-41d4-a716-446655440010 + current_status: pending + current_value: ALL + feature_flag_id: 550e8400-e29b-41d4-a716-446655440000 + lifecycle_status: pending + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + id: 550e8400-e29b-41d4-a716-446655440020 + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Get a flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read + /api/v2/feature-flags/suggestions/{suggestion_id}/apply: + post: + description: |- + Applies a previously approved feature flag change suggestion. Requires contributor or + editor access to the flag. Pending, rejected, or discarded suggestions return `409 Conflict`. + An already applied suggestion also returns `409 Conflict`, except that retrying an applied + experiment action succeeds. This endpoint does not require a request body. + + When an `ALLOCATIONS` suggestion is applied, either by this endpoint or by an approval that applies it, + each exposure schedule with `autostart` set to `true`, no `absolute_start_time`, and no future + `scheduled_start_time` starts at apply time. This includes a schedule that is already running, so a + suggestion that omits its `absolute_start_time` restarts its rollout. If its `selection_interval_ms` is + greater than `0`, every step except the last uses that interval. An `absolute_start_time` in the + suggestion is kept, including one set by the allocations request that built the suggestion, so time spent + waiting for approval counts toward its rollout steps. + Schedules with `apm_retention`, in the suggestion or on the saved schedule, are the exception: apply does + not start them, and they start only through the exposure schedule start endpoint. When the suggestion omits + `apm_retention` or `absolute_start_time` for a saved schedule with `apm_retention`, apply keeps the saved + values, so a running schedule keeps its start, unless the suggestion changes its rollout strategy, which + stops it. + operationId: ApplyFlagSuggestion + parameters: + - $ref: "#/components/parameters/suggestion_id" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: 550e8400-e29b-41d4-a716-446655440021 + comment: Restrict this flag to server applications. + created_at: "2024-01-01T00:00:00Z" + created_by: 550e8400-e29b-41d4-a716-446655440010 + current_status: approved + current_value: ALL + feature_flag_id: 550e8400-e29b-41d4-a716-446655440000 + lifecycle_status: applied + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + updated_at: "2024-01-02T00:00:00Z" + updated_by: 550e8400-e29b-41d4-a716-446655440011 + id: 550e8400-e29b-41d4-a716-446655440020 + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: |- + Conflict - The suggestion is not approved or the proposed change conflicts with current configuration. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Apply an approved flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read + /api/v2/feature-flags/suggestions/{suggestion_id}/approve: + post: + description: |- + Approves a feature flag change suggestion and applies the change immediately by default. + Set `apply` to `false` to approve without applying, then call `ApplyFlagSuggestion` later. + Until it is applied or deleted, an approved suggestion still blocks conflicting changes. + Requires editor access to the flag or the Feature Flag Approvals Override permission. + A creator cannot approve their own suggestion unless they have override permission. + Applied or discarded suggestions return `409 Conflict`. Retrying approval of an already + applied experiment action with `apply` set to `true` succeeds. + operationId: ApproveFlagSuggestion + parameters: + - $ref: "#/components/parameters/suggestion_id" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + apply: false + comment: Approved for rollout. + type: flag-suggestion-events + schema: + $ref: "#/components/schemas/ApproveFlagSuggestionRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: 550e8400-e29b-41d4-a716-446655440021 + comment: Restrict this flag to server applications. + created_at: "2024-01-01T00:00:00Z" + created_by: 550e8400-e29b-41d4-a716-446655440010 + current_status: pending + current_value: ALL + feature_flag_id: 550e8400-e29b-41d4-a716-446655440000 + lifecycle_status: approved + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + updated_at: "2024-01-02T00:00:00Z" + updated_by: 550e8400-e29b-41d4-a716-446655440011 + id: 550e8400-e29b-41d4-a716-446655440020 + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: |- + Conflict - The suggestion is already applied or discarded, or the proposed change conflicts with current configuration. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Approve a flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read + /api/v2/feature-flags/suggestions/{suggestion_id}/reject: + post: + description: |- + Rejects a pending feature flag change suggestion without applying the change. Requires + editor access to the flag or the Feature Flag Approvals Override permission. Rejecting + an already rejected suggestion succeeds. Approved, applied, or discarded suggestions + return `409 Conflict`. + operationId: RejectFlagSuggestion + parameters: + - $ref: "#/components/parameters/suggestion_id" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + comment: Keep the existing configuration. + type: flag-suggestion-events + schema: + $ref: "#/components/schemas/RejectFlagSuggestionRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: 550e8400-e29b-41d4-a716-446655440021 + comment: Restrict this flag to server applications. + created_at: "2024-01-01T00:00:00Z" + created_by: 550e8400-e29b-41d4-a716-446655440010 + current_status: rejected + current_value: ALL + feature_flag_id: 550e8400-e29b-41d4-a716-446655440000 + lifecycle_status: rejected + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + updated_at: "2024-01-02T00:00:00Z" + updated_by: 550e8400-e29b-41d4-a716-446655440011 + id: 550e8400-e29b-41d4-a716-446655440020 + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - The suggestion is already approved, applied, or discarded. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Reject a flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read /api/v2/feature-flags/{feature_flag_id}: get: description: |- @@ -187512,13 +188332,30 @@ paths: - feature_flag_environment_config_read put: description: |- - Updates an existing feature flag's metadata such as - name and description. Does not modify targeting rules or allocations. + Updates an existing feature flag's metadata, including its name, + description, distribution channel, and tags. Does not modify targeting rules or allocations. To change the owning team, update `tags` and include a tag of the form `team:` in the array. `tags` is a full replacement of the existing tag set (including any `team:` tag), so include every tag you want to keep, not just the ones you're adding. + + To change the lifecycle, set `staleness_status` to `ACTIVE` (temporary) or `PERMANENT`. + Either value clears any snooze; omit it to keep the lifecycle. Send `staleness_status` in a + separate request from `distribution_channel`. Do not copy the top-level `staleness_status` + from a response into the request: that legacy response field is always `ACTIVE`, so + copying it makes a `PERMANENT` flag temporary. + + When backend approvals are enabled and a distribution channel change requires approval, + callers without the Feature Flag Approvals Override permission receive `201 Created` + with a suggestion instead of an updated flag. No fields in the request are applied. + The suggestion contains only the distribution channel change. To update other fields, such as + name, description, JSON schema, and tags, send a separate request without `distribution_channel`. + + While backend approvals are enabled, a request that includes `distribution_channel` + returns `409 Conflict` if a distribution channel suggestion for the flag is pending, or + approved but not yet applied. No fields are applied, including for callers with override + permission. operationId: UpdateFeatureFlag parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -187527,14 +188364,22 @@ paths: application/json: examples: default: + summary: Update flag metadata value: data: attributes: description: Updated description for the feature flag - enabled: true name: Updated Feature Flag XYZ789 tags: ["team:feature-flagging"] type: feature-flags + distribution_channel: + description: Creates a suggestion instead of updating the flag when approval is required. + summary: Update the distribution channel + value: + data: + attributes: + distribution_channel: SERVER + type: feature-flags schema: $ref: "#/components/schemas/UpdateFeatureFlagRequest" required: true @@ -187567,6 +188412,32 @@ paths: schema: $ref: "#/components/schemas/FeatureFlagResponse" description: OK + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: "550e8400-e29b-41d4-a716-446655440021" + created_at: "2024-01-01T00:00:00Z" + created_by: "550e8400-e29b-41d4-a716-446655440010" + current_status: pending + current_value: ALL + feature_flag_id: "550e8400-e29b-41d4-a716-446655440000" + lifecycle_status: pending + message: >- + This flag requires approval for this change. A suggestion has been created and is pending review. + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + id: "550e8400-e29b-41d4-a716-446655440020" + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: |- + Created - A distribution channel suggestion was created because approval is required. No flag fields were updated. "400": content: application/json: @@ -187585,6 +188456,13 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: |- + Conflict - A feature flag with this name already exists, a distribution channel suggestion is pending, or a pending experiment request or running approved experiment uses this flag. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187604,8 +188482,17 @@ paths: /api/v2/feature-flags/{feature_flag_id}/archive: post: description: |- - Archives a feature flag. Archived flags are - hidden from the main list but remain accessible and can be unarchived. + Archives a feature flag. Archived flags are hidden from the main list but remain accessible + and can be unarchived. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: ArchiveFeatureFlag parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -187638,6 +188525,8 @@ paths: schema: $ref: "#/components/schemas/FeatureFlagResponse" description: OK + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreated" "400": content: application/json: @@ -187656,6 +188545,12 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - The flag is already archived or a conflicting suggestion is pending. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187675,7 +188570,17 @@ paths: /api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations: post: description: |- - Creates a new targeting rule (allocation) for a specific feature flag in a specific environment. + Creates a new targeting rule (allocation) for a feature flag in an environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `202 Accepted` with an + `approval-required` resource. No allocation is created and no suggestion is persisted. + The resource ID is the flag ID. Submit its `property`, `action`, `suggestion`, and `environment_id` + to `CreateFlagSuggestion`, together with `notification_rule_targets`, to request approval. + The suggestion value contains the complete desired allocation set, including the new rule. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict`, including for callers with + override permission or when approval is no longer required. operationId: CreateAllocationsForFeatureFlagInEnvironment parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -187736,24 +188641,14 @@ paths: value: data: attributes: - created_at: "2024-01-01T00:00:00+00:00" - environment_ids: - - abc-123 - guardrail_metrics: [] - id: 00000000-0000-0000-0000-000000000016 - key: prod-rollout - name: Production Rollout - order_position: 0 - targeting_rules: [] - type: FEATURE_GATE - updated_at: "2024-01-01T00:00:00+00:00" - variant_weights: - - value: 50 - variant_id: abc-123 - id: 00000000-0000-0000-0000-000000000015 - type: allocations + action: updated + environment_id: "550e8400-e29b-41d4-a716-446655440001" + property: ALLOCATIONS + suggestion: '[{"name":"Production Rollout","key":"prod-rollout","type":"FEATURE_GATE","targeting_rules":[],"variant_weights":[{"variant_id":"550e8400-e29b-41d4-a716-446655440002","value":100}],"guardrail_metrics":[]}]' + id: "550e8400-e29b-41d4-a716-446655440000" + type: approval-required schema: - $ref: "#/components/schemas/AllocationResponse" + $ref: "#/components/schemas/FeatureFlagApprovalRequiredResponse" description: Accepted - Approval required for this change "400": content: @@ -187778,7 +188673,7 @@ paths: application/json: schema: $ref: "#/components/schemas/APIErrorResponse" - description: Conflict + description: Conflict - A conflicting suggestion is pending or an allocation with this key already exists. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187795,12 +188690,34 @@ paths: - feature_flag_config_write put: description: |- - Updates targeting rules (allocations) for a specific feature flag in a specific environment. - This operation replaces the existing allocation set with the request payload. + Updates targeting rules (allocations) for a feature flag in an environment. This operation + replaces the existing allocation set with the request payload. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. + + When approval is required, combining allocation replacement with `default_variant_key` + returns `400 Bad Request`. Omit that parameter and submit the default variant change + separately with `CreateFlagSuggestion` using the `DEFAULT_VARIANT` property and the variant ID. operationId: UpdateAllocationsForFeatureFlagInEnvironment parameters: - $ref: "#/components/parameters/feature_flag_id" - $ref: "#/components/parameters/environment_id" + - description: |- + The key of the default variant to set. When approval is required, omit this parameter + and submit a `DEFAULT_VARIANT` suggestion separately. + in: query + name: default_variant_key + required: false + schema: + example: control + type: string requestBody: content: application/json: @@ -187849,16 +188766,8 @@ paths: schema: $ref: "#/components/schemas/ListAllocationsResponse" description: OK - "202": - content: - application/json: - examples: - default: - value: - data: [] - schema: - $ref: "#/components/schemas/ListAllocationsResponse" - description: Accepted - Approval required for this change + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreated" "400": content: application/json: @@ -187882,7 +188791,8 @@ paths: application/json: schema: $ref: "#/components/schemas/APIErrorResponse" - description: Conflict + description: |- + Conflict - A conflicting suggestion is pending or the allocation update conflicts with the current configuration. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187900,7 +188810,17 @@ paths: /api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable: post: description: |- - Disable a feature flag in a specific environment. + Disables a feature flag in a specific environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion, in the same format as the `GetFlagSuggestion` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: DisableFeatureFlagEnvironment parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -187908,8 +188828,14 @@ paths: responses: "200": description: OK - "202": - description: Accepted - Approval required for this change + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreatedWithoutSchema" + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "403": content: application/json: @@ -187922,6 +188848,12 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - A conflicting suggestion is pending for this flag and environment. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187941,7 +188873,17 @@ paths: /api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable: post: description: |- - Enable a feature flag in a specific environment. + Enables a feature flag in a specific environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion, in the same format as the `GetFlagSuggestion` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: EnableFeatureFlagEnvironment parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -187949,8 +188891,14 @@ paths: responses: "200": description: OK - "202": - description: Accepted - Approval required for this change + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreatedWithoutSchema" + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "403": content: application/json: @@ -187963,6 +188911,12 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - A conflicting suggestion is pending for this flag and environment. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -187979,11 +188933,224 @@ paths: permissions: - feature_flag_config_write - feature_flag_environment_config_read + /api/v2/feature-flags/{feature_flag_id}/require-approval: + post: + description: |- + Enables or disables the approval requirement for a feature flag. Requires the Feature + Flag Write permission and contributor or editor access to the flag. Disabling approvals + also requires the Feature Flag Approvals Override permission, even if approvals are already disabled. + This operation updates the setting directly and does not create a suggestion. Changing the setting + returns `409 Conflict` when a pending experiment request or a running approved experiment uses the flag. + operationId: UpdateFeatureFlagApprovals + parameters: + - $ref: "#/components/parameters/feature_flag_id" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + type: feature-flag-approvals + schema: + $ref: "#/components/schemas/UpdateFeatureFlagApprovalsRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: A sample feature flag + key: feature-flag-abc123 + name: Feature Flag ABC 123 + require_approval: true + updated_at: "2024-01-02T00:00:00+00:00" + value_type: BOOLEAN + variants: + - id: 00000000-0000-0000-0000-000000000005 + key: variant-a + name: Variant A + value: "true" + - id: 00000000-0000-0000-0000-000000000006 + key: variant-b + name: Variant B + value: "false" + id: 00000000-0000-0000-0000-000000000004 + type: feature-flags + schema: + $ref: "#/components/schemas/FeatureFlagResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - A pending experiment request or a running approved experiment uses this flag. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + summary: Set the approval requirement for a feature flag + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + /api/v2/feature-flags/{feature_flag_id}/suggestions: + post: + description: |- + Creates a persisted suggestion for a feature flag change that requires approval. + The change is not applied until the suggestion is approved and applied. Requires + contributor or editor access to the flag. The request must contain at least one + `notification_rule_targets` handle for review notifications. + + Use this endpoint to submit the proposed change from the `202 Accepted` approval-required + response of `CreateAllocationsForFeatureFlagInEnvironment`. Other approval-gated mutation endpoints + return `201 Created` with a persisted suggestion. Do not submit those suggestions again. + + An `environment_id` is required for `ALLOCATIONS`, `DEFAULT_VARIANT`, and `OVERRIDE_VARIANT`. + For allocation and variant changes, `suggestion` is a JSON-encoded string, not a nested + JSON object. Conflicting suggestions that are pending, or approved but not yet applied, + return `409 Conflict`. + + The allocations in an `ALLOCATIONS` suggestion are validated with the rules that + `UpdateAllocationsForFeatureFlagInEnvironment` applies to a change that requires approval, including the + rules for request fields, targeting rules and their `ONE_OF` and `NOT_ONE_OF` value limits, variant and + metric references, draft allocations, and exposure schedules. A schedule with `apm_retention` that has not + started must be started with the exposure schedule start endpoint, not with `autostart` or an + `absolute_start_time`. That endpoint's Product Analytics Experiments Write permission checks also apply. + If that endpoint would reject the allocations, this endpoint returns the same error: `400 Bad Request` for + invalid allocations, for example a `UNIFORM_INTERVALS` schedule with a `selection_interval_ms` of `0`, + `403 Forbidden` when the caller lacks the Experiments Write permission the lineup needs, and + `409 Conflict` for a lineup that changes or omits a draft allocation. + operationId: CreateFlagSuggestion + parameters: + - $ref: "#/components/parameters/feature_flag_id" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + comment: Restrict this flag to server applications. + notification_rule_targets: + - requester@example.com + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + type: flag-suggestions + schema: + $ref: "#/components/schemas/CreateFlagSuggestionRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: updated + base_flag_history_id: 550e8400-e29b-41d4-a716-446655440021 + comment: Restrict this flag to server applications. + created_at: "2024-01-01T00:00:00Z" + created_by: 550e8400-e29b-41d4-a716-446655440010 + current_status: pending + current_value: ALL + feature_flag_id: 550e8400-e29b-41d4-a716-446655440000 + lifecycle_status: pending + property: DISTRIBUTION_CHANNEL + suggestion: SERVER + id: 550e8400-e29b-41d4-a716-446655440020 + type: flag-suggestions + schema: + $ref: "#/components/schemas/FeatureFlagSuggestionResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request - Invalid request parameters or body. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - A conflicting suggestion is pending, or the lineup changes or omits a draft allocation. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + - feature_flag_environment_config_read + summary: Create a flag change suggestion + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write + - feature_flag_environment_config_read /api/v2/feature-flags/{feature_flag_id}/unarchive: post: description: |- - Unarchives a previously archived feature flag, - making it visible in the main list again. + Unarchives a previously archived feature flag, making it visible in the main list again. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: UnarchiveFeatureFlag parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -188015,6 +189182,8 @@ paths: schema: $ref: "#/components/schemas/FeatureFlagResponse" description: OK + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreated" "400": content: application/json: @@ -188033,6 +189202,12 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - The flag is not archived or a conflicting suggestion is pending. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -188139,12 +189314,22 @@ paths: description: |- Deletes a variant from a feature flag. - 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`. + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion, in the same format as the `GetFlagSuggestion` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: DeleteVariantFromFeatureFlag parameters: - $ref: "#/components/parameters/feature_flag_id" - $ref: "#/components/parameters/variant_id" responses: + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreatedWithoutSchema" "204": description: No Content "400": @@ -188189,7 +189374,15 @@ paths: description: |- Updates the name and value of an existing variant on a feature flag. - 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`. + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive `201 Created` with a persisted + suggestion, in the same format as the `GetFlagSuggestion` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with `GetFlagSuggestion`, `ApproveFlagSuggestion`, + `RejectFlagSuggestion`, or `DeleteFlagSuggestion`. + + A conflicting suggestion that is pending, or approved but not yet applied, returns `409 Conflict` without applying the change, + including for callers with override permission or when approval is no longer required. operationId: UpdateVariantForFeatureFlag parameters: - $ref: "#/components/parameters/feature_flag_id" @@ -188212,6 +189405,8 @@ paths: responses: "200": description: OK + "201": + $ref: "#/components/responses/FeatureFlagSuggestionCreatedWithoutSchema" "400": content: application/json: @@ -272826,7 +274021,7 @@ tags: - description: |- Manage your Datadog Fastly integration accounts and services directly through the Datadog API. See the [Fastly integration page](https://docs.datadoghq.com/integrations/fastly/) for more information. name: Fastly Integration - - description: Manage feature flags and environments. + - description: Manage feature flags, environments, and approval suggestions. name: Feature Flags - description: |- Manage automated deployments across your fleet of hosts. diff --git a/examples/v2/feature-flags/ApplyFlagSuggestion.py b/examples/v2/feature-flags/ApplyFlagSuggestion.py new file mode 100644 index 0000000000..fe6448e89d --- /dev/null +++ b/examples/v2/feature-flags/ApplyFlagSuggestion.py @@ -0,0 +1,18 @@ +""" +Apply an approved flag change suggestion returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from uuid import UUID + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.apply_flag_suggestion( + suggestion_id=UUID("550e8400-e29b-41d4-a716-446655440020"), + ) + + print(response) diff --git a/examples/v2/feature-flags/ApproveFlagSuggestion.py b/examples/v2/feature-flags/ApproveFlagSuggestion.py new file mode 100644 index 0000000000..0eabe74e00 --- /dev/null +++ b/examples/v2/feature-flags/ApproveFlagSuggestion.py @@ -0,0 +1,32 @@ +""" +Approve a flag change suggestion returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from datadog_api_client.v2.model.approve_flag_suggestion_attributes import ApproveFlagSuggestionAttributes +from datadog_api_client.v2.model.approve_flag_suggestion_data import ApproveFlagSuggestionData +from datadog_api_client.v2.model.approve_flag_suggestion_request import ApproveFlagSuggestionRequest +from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType +from uuid import UUID + +body = ApproveFlagSuggestionRequest( + data=ApproveFlagSuggestionData( + attributes=ApproveFlagSuggestionAttributes( + apply=False, + comment="Approved for rollout.", + ), + type=ReviewFlagSuggestionDataType.FLAG_SUGGESTION_EVENTS, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.approve_flag_suggestion( + suggestion_id=UUID("550e8400-e29b-41d4-a716-446655440020"), body=body + ) + + print(response) diff --git a/examples/v2/feature-flags/CreateFlagSuggestion.py b/examples/v2/feature-flags/CreateFlagSuggestion.py new file mode 100644 index 0000000000..f8d9044839 --- /dev/null +++ b/examples/v2/feature-flags/CreateFlagSuggestion.py @@ -0,0 +1,42 @@ +""" +Create a flag change suggestion returns "Created" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from datadog_api_client.v2.model.create_flag_suggestion_attributes import CreateFlagSuggestionAttributes +from datadog_api_client.v2.model.create_flag_suggestion_data import CreateFlagSuggestionData +from datadog_api_client.v2.model.create_flag_suggestion_request import CreateFlagSuggestionRequest +from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType +from datadog_api_client.v2.model.feature_flag_suggestion_metadata_request import FeatureFlagSuggestionMetadataRequest +from uuid import UUID + +body = CreateFlagSuggestionRequest( + data=CreateFlagSuggestionData( + attributes=CreateFlagSuggestionAttributes( + action="updated", + comment="Restrict this flag to server applications.", + environment_id=UUID("550e8400-e29b-41d4-a716-446655440001"), + notification_rule_targets=[ + "requester@example.com", + ], + _property="DISTRIBUTION_CHANNEL", + suggestion="SERVER", + suggestion_metadata=FeatureFlagSuggestionMetadataRequest( + variant_id=UUID("550e8400-e29b-41d4-a716-446655440002"), + ), + ), + type=FeatureFlagSuggestionDataType.FLAG_SUGGESTIONS, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.create_flag_suggestion( + feature_flag_id=UUID("550e8400-e29b-41d4-a716-446655440000"), body=body + ) + + print(response) diff --git a/examples/v2/feature-flags/DeleteFlagSuggestion.py b/examples/v2/feature-flags/DeleteFlagSuggestion.py new file mode 100644 index 0000000000..5b1f3bd13c --- /dev/null +++ b/examples/v2/feature-flags/DeleteFlagSuggestion.py @@ -0,0 +1,16 @@ +""" +Delete or discard a flag change suggestion returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from uuid import UUID + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + api_instance.delete_flag_suggestion( + suggestion_id=UUID("550e8400-e29b-41d4-a716-446655440020"), + ) diff --git a/examples/v2/feature-flags/GetFlagSuggestion.py b/examples/v2/feature-flags/GetFlagSuggestion.py new file mode 100644 index 0000000000..f7ad11d053 --- /dev/null +++ b/examples/v2/feature-flags/GetFlagSuggestion.py @@ -0,0 +1,18 @@ +""" +Get a flag change suggestion returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from uuid import UUID + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.get_flag_suggestion( + suggestion_id=UUID("550e8400-e29b-41d4-a716-446655440020"), + ) + + print(response) diff --git a/examples/v2/feature-flags/RejectFlagSuggestion.py b/examples/v2/feature-flags/RejectFlagSuggestion.py new file mode 100644 index 0000000000..b62ed79880 --- /dev/null +++ b/examples/v2/feature-flags/RejectFlagSuggestion.py @@ -0,0 +1,31 @@ +""" +Reject a flag change suggestion returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from datadog_api_client.v2.model.reject_flag_suggestion_attributes import RejectFlagSuggestionAttributes +from datadog_api_client.v2.model.reject_flag_suggestion_data import RejectFlagSuggestionData +from datadog_api_client.v2.model.reject_flag_suggestion_request import RejectFlagSuggestionRequest +from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType +from uuid import UUID + +body = RejectFlagSuggestionRequest( + data=RejectFlagSuggestionData( + attributes=RejectFlagSuggestionAttributes( + comment="Keep the existing configuration.", + ), + type=ReviewFlagSuggestionDataType.FLAG_SUGGESTION_EVENTS, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.reject_flag_suggestion( + suggestion_id=UUID("550e8400-e29b-41d4-a716-446655440020"), body=body + ) + + print(response) diff --git a/examples/v2/feature-flags/UpdateFeatureFlagApprovals.py b/examples/v2/feature-flags/UpdateFeatureFlagApprovals.py new file mode 100644 index 0000000000..84a016656d --- /dev/null +++ b/examples/v2/feature-flags/UpdateFeatureFlagApprovals.py @@ -0,0 +1,31 @@ +""" +Set the approval requirement for a feature flag returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.feature_flags_api import FeatureFlagsApi +from datadog_api_client.v2.model.feature_flag_approvals_data_type import FeatureFlagApprovalsDataType +from datadog_api_client.v2.model.update_feature_flag_approvals_attributes import UpdateFeatureFlagApprovalsAttributes +from datadog_api_client.v2.model.update_feature_flag_approvals_data import UpdateFeatureFlagApprovalsData +from datadog_api_client.v2.model.update_feature_flag_approvals_request import UpdateFeatureFlagApprovalsRequest +from uuid import UUID + +body = UpdateFeatureFlagApprovalsRequest( + data=UpdateFeatureFlagApprovalsData( + attributes=UpdateFeatureFlagApprovalsAttributes( + enabled=True, + ), + type=FeatureFlagApprovalsDataType.FEATURE_FLAG_APPROVALS, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.update_feature_flag_approvals( + feature_flag_id=UUID("550e8400-e29b-41d4-a716-446655440000"), body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/feature_flags_api.py b/src/datadog_api_client/v2/api/feature_flags_api.py index bbc988fc3e..a6ac4fe4d7 100644 --- a/src/datadog_api_client/v2/api/feature_flags_api.py +++ b/src/datadog_api_client/v2/api/feature_flags_api.py @@ -26,11 +26,16 @@ from datadog_api_client.v2.model.allocation_exposure_schedule_response import AllocationExposureScheduleResponse from datadog_api_client.v2.model.saved_filter_response import SavedFilterResponse from datadog_api_client.v2.model.patch_saved_filter_request import PatchSavedFilterRequest +from datadog_api_client.v2.model.feature_flag_suggestion_response import FeatureFlagSuggestionResponse +from datadog_api_client.v2.model.approve_flag_suggestion_request import ApproveFlagSuggestionRequest +from datadog_api_client.v2.model.reject_flag_suggestion_request import RejectFlagSuggestionRequest from datadog_api_client.v2.model.update_feature_flag_request import UpdateFeatureFlagRequest from datadog_api_client.v2.model.allocation_response import AllocationResponse from datadog_api_client.v2.model.create_allocations_request import CreateAllocationsRequest from datadog_api_client.v2.model.list_allocations_response import ListAllocationsResponse from datadog_api_client.v2.model.overwrite_allocations_request import OverwriteAllocationsRequest +from datadog_api_client.v2.model.update_feature_flag_approvals_request import UpdateFeatureFlagApprovalsRequest +from datadog_api_client.v2.model.create_flag_suggestion_request import CreateFlagSuggestionRequest from datadog_api_client.v2.model.variant_response import VariantResponse from datadog_api_client.v2.model.create_variant_request import CreateVariantRequest from datadog_api_client.v2.model.update_variant_request import UpdateVariantRequest @@ -38,7 +43,7 @@ class FeatureFlagsApi: """ - Manage feature flags and environments. + Manage feature flags, environments, and approval suggestions. """ def __init__(self, api_client=None): @@ -46,6 +51,55 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._apply_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagSuggestionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/suggestions/{suggestion_id}/apply", + "operation_id": "apply_flag_suggestion", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "suggestion_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "suggestion_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._approve_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagSuggestionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/suggestions/{suggestion_id}/approve", + "operation_id": "approve_flag_suggestion", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "suggestion_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "suggestion_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ApproveFlagSuggestionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._archive_feature_flag_endpoint = _Endpoint( settings={ "response_type": (FeatureFlagResponse,), @@ -141,6 +195,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagSuggestionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/{feature_flag_id}/suggestions", + "operation_id": "create_flag_suggestion", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "feature_flag_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "feature_flag_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateFlagSuggestionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_variant_for_feature_flag_endpoint = _Endpoint( settings={ "response_type": (VariantResponse,), @@ -190,6 +270,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/suggestions/{suggestion_id}", + "operation_id": "delete_flag_suggestion", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "suggestion_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "suggestion_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_variant_from_feature_flag_endpoint = _Endpoint( settings={ "response_type": None, @@ -323,6 +426,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagSuggestionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/suggestions/{suggestion_id}", + "operation_id": "get_flag_suggestion", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "suggestion_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "suggestion_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_saved_filter_endpoint = _Endpoint( settings={ "response_type": (SavedFilterResponse,), @@ -540,6 +666,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._reject_flag_suggestion_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagSuggestionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/suggestions/{suggestion_id}/reject", + "operation_id": "reject_flag_suggestion", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "suggestion_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "suggestion_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RejectFlagSuggestionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._resume_exposure_schedule_endpoint = _Endpoint( settings={ "response_type": (AllocationExposureScheduleResponse,), @@ -654,6 +806,11 @@ def __init__(self, api_client=None): "attribute": "environment_id", "location": "path", }, + "default_variant_key": { + "openapi_types": (str,), + "attribute": "default_variant_key", + "location": "query", + }, "body": { "required": True, "openapi_types": (OverwriteAllocationsRequest,), @@ -690,6 +847,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_feature_flag_approvals_endpoint = _Endpoint( + settings={ + "response_type": (FeatureFlagResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/{feature_flag_id}/require-approval", + "operation_id": "update_feature_flag_approvals", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "feature_flag_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "feature_flag_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateFeatureFlagApprovalsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_feature_flags_environment_endpoint = _Endpoint( settings={ "response_type": (EnvironmentResponse,), @@ -774,14 +957,83 @@ def __init__(self, api_client=None): api_client=api_client, ) + def apply_flag_suggestion( + self, + suggestion_id: UUID, + ) -> FeatureFlagSuggestionResponse: + """Apply an approved flag change suggestion. + + Applies a previously approved feature flag change suggestion. Requires contributor or + editor access to the flag. Pending, rejected, or discarded suggestions return ``409 Conflict``. + An already applied suggestion also returns ``409 Conflict`` , except that retrying an applied + experiment action succeeds. This endpoint does not require a request body. + + When an ``ALLOCATIONS`` suggestion is applied, either by this endpoint or by an approval that applies it, + each exposure schedule with ``autostart`` set to ``true`` , no ``absolute_start_time`` , and no future + ``scheduled_start_time`` starts at apply time. This includes a schedule that is already running, so a + suggestion that omits its ``absolute_start_time`` restarts its rollout. If its ``selection_interval_ms`` is + greater than ``0`` , every step except the last uses that interval. An ``absolute_start_time`` in the + suggestion is kept, including one set by the allocations request that built the suggestion, so time spent + waiting for approval counts toward its rollout steps. + Schedules with ``apm_retention`` , in the suggestion or on the saved schedule, are the exception: apply does + not start them, and they start only through the exposure schedule start endpoint. When the suggestion omits + ``apm_retention`` or ``absolute_start_time`` for a saved schedule with ``apm_retention`` , apply keeps the saved + values, so a running schedule keeps its start, unless the suggestion changes its rollout strategy, which + stops it. + + :param suggestion_id: The ID of the feature flag change suggestion. + :type suggestion_id: UUID + :rtype: FeatureFlagSuggestionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["suggestion_id"] = suggestion_id + + return self._apply_flag_suggestion_endpoint.call_with_http_info(**kwargs) + + def approve_flag_suggestion( + self, + suggestion_id: UUID, + body: ApproveFlagSuggestionRequest, + ) -> FeatureFlagSuggestionResponse: + """Approve a flag change suggestion. + + Approves a feature flag change suggestion and applies the change immediately by default. + Set ``apply`` to ``false`` to approve without applying, then call ``ApplyFlagSuggestion`` later. + Until it is applied or deleted, an approved suggestion still blocks conflicting changes. + Requires editor access to the flag or the Feature Flag Approvals Override permission. + A creator cannot approve their own suggestion unless they have override permission. + Applied or discarded suggestions return ``409 Conflict``. Retrying approval of an already + applied experiment action with ``apply`` set to ``true`` succeeds. + + :param suggestion_id: The ID of the feature flag change suggestion. + :type suggestion_id: UUID + :type body: ApproveFlagSuggestionRequest + :rtype: FeatureFlagSuggestionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["suggestion_id"] = suggestion_id + + kwargs["body"] = body + + return self._approve_flag_suggestion_endpoint.call_with_http_info(**kwargs) + def archive_feature_flag( self, feature_flag_id: UUID, ) -> FeatureFlagResponse: """Archive a feature flag. - Archives a feature flag. Archived flags are - hidden from the main list but remain accessible and can be unarchived. + Archives a feature flag. Archived flags are hidden from the main list but remain accessible + and can be unarchived. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -800,7 +1052,17 @@ def create_allocations_for_feature_flag_in_environment( ) -> AllocationResponse: """Create targeting rules for a flag env. - Creates a new targeting rule (allocation) for a specific feature flag in a specific environment. + Creates a new targeting rule (allocation) for a feature flag in an environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``202 Accepted`` with an + ``approval-required`` resource. No allocation is created and no suggestion is persisted. + The resource ID is the flag ID. Submit its ``property`` , ``action`` , ``suggestion`` , and ``environment_id`` + to ``CreateFlagSuggestion`` , together with ``notification_rule_targets`` , to request approval. + The suggestion value contains the complete desired allocation set, including the new rule. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` , including for callers with + override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -850,6 +1112,50 @@ def create_feature_flags_environment( return self._create_feature_flags_environment_endpoint.call_with_http_info(**kwargs) + def create_flag_suggestion( + self, + feature_flag_id: UUID, + body: CreateFlagSuggestionRequest, + ) -> FeatureFlagSuggestionResponse: + """Create a flag change suggestion. + + Creates a persisted suggestion for a feature flag change that requires approval. + The change is not applied until the suggestion is approved and applied. Requires + contributor or editor access to the flag. The request must contain at least one + ``notification_rule_targets`` handle for review notifications. + + Use this endpoint to submit the proposed change from the ``202 Accepted`` approval-required + response of ``CreateAllocationsForFeatureFlagInEnvironment``. Other approval-gated mutation endpoints + return ``201 Created`` with a persisted suggestion. Do not submit those suggestions again. + + An ``environment_id`` is required for ``ALLOCATIONS`` , ``DEFAULT_VARIANT`` , and ``OVERRIDE_VARIANT``. + For allocation and variant changes, ``suggestion`` is a JSON-encoded string, not a nested + JSON object. Conflicting suggestions that are pending, or approved but not yet applied, + return ``409 Conflict``. + + The allocations in an ``ALLOCATIONS`` suggestion are validated with the rules that + ``UpdateAllocationsForFeatureFlagInEnvironment`` applies to a change that requires approval, including the + rules for request fields, targeting rules and their ``ONE_OF`` and ``NOT_ONE_OF`` value limits, variant and + metric references, draft allocations, and exposure schedules. A schedule with ``apm_retention`` that has not + started must be started with the exposure schedule start endpoint, not with ``autostart`` or an + ``absolute_start_time``. That endpoint's Product Analytics Experiments Write permission checks also apply. + If that endpoint would reject the allocations, this endpoint returns the same error: ``400 Bad Request`` for + invalid allocations, for example a ``UNIFORM_INTERVALS`` schedule with a ``selection_interval_ms`` of ``0`` , + ``403 Forbidden`` when the caller lacks the Experiments Write permission the lineup needs, and + ``409 Conflict`` for a lineup that changes or omits a draft allocation. + + :param feature_flag_id: The ID of the feature flag. + :type feature_flag_id: UUID + :type body: CreateFlagSuggestionRequest + :rtype: FeatureFlagSuggestionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["feature_flag_id"] = feature_flag_id + + kwargs["body"] = body + + return self._create_flag_suggestion_endpoint.call_with_http_info(**kwargs) + def create_variant_for_feature_flag( self, feature_flag_id: UUID, @@ -894,6 +1200,26 @@ def delete_feature_flags_environment( return self._delete_feature_flags_environment_endpoint.call_with_http_info(**kwargs) + def delete_flag_suggestion( + self, + suggestion_id: UUID, + ) -> None: + """Delete or discard a flag change suggestion. + + Deletes a pending suggestion or discards an approved suggestion that has not been + applied. Requires editor access to the flag, or contributor access for the suggestion's + creator. Applied and rejected suggestions return ``409 Conflict``. A missing or already + discarded suggestion returns ``204 No Content``. + + :param suggestion_id: The ID of the feature flag change suggestion. + :type suggestion_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["suggestion_id"] = suggestion_id + + return self._delete_flag_suggestion_endpoint.call_with_http_info(**kwargs) + def delete_variant_from_feature_flag( self, feature_flag_id: UUID, @@ -903,7 +1229,15 @@ def delete_variant_from_feature_flag( Deletes a variant from a feature flag. - 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``. + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion, in the same format as the ``GetFlagSuggestion`` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -925,7 +1259,17 @@ def disable_feature_flag_environment( ) -> None: """Disable a feature flag in an environment. - Disable a feature flag in a specific environment. + Disables a feature flag in a specific environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion, in the same format as the ``GetFlagSuggestion`` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -947,7 +1291,17 @@ def enable_feature_flag_environment( ) -> None: """Enable a feature flag in an environment. - Enable a feature flag in a specific environment. + Enables a feature flag in a specific environment. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion, in the same format as the ``GetFlagSuggestion`` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -997,6 +1351,25 @@ def get_feature_flags_environment( return self._get_feature_flags_environment_endpoint.call_with_http_info(**kwargs) + def get_flag_suggestion( + self, + suggestion_id: UUID, + ) -> FeatureFlagSuggestionResponse: + """Get a flag change suggestion. + + Returns a feature flag change suggestion by ID. Use ``lifecycle_status`` to distinguish + pending, approved, applied, rejected, and discarded suggestions. An approved suggestion + has not yet been applied; an applied suggestion has changed the flag. + + :param suggestion_id: The ID of the feature flag change suggestion. + :type suggestion_id: UUID + :rtype: FeatureFlagSuggestionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["suggestion_id"] = suggestion_id + + return self._get_flag_suggestion_endpoint.call_with_http_info(**kwargs) + def get_saved_filter( self, saved_filter_id: UUID, @@ -1196,6 +1569,30 @@ def pause_exposure_schedule( return self._pause_exposure_schedule_endpoint.call_with_http_info(**kwargs) + def reject_flag_suggestion( + self, + suggestion_id: UUID, + body: RejectFlagSuggestionRequest, + ) -> FeatureFlagSuggestionResponse: + """Reject a flag change suggestion. + + Rejects a pending feature flag change suggestion without applying the change. Requires + editor access to the flag or the Feature Flag Approvals Override permission. Rejecting + an already rejected suggestion succeeds. Approved, applied, or discarded suggestions + return ``409 Conflict``. + + :param suggestion_id: The ID of the feature flag change suggestion. + :type suggestion_id: UUID + :type body: RejectFlagSuggestionRequest + :rtype: FeatureFlagSuggestionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["suggestion_id"] = suggestion_id + + kwargs["body"] = body + + return self._reject_flag_suggestion_endpoint.call_with_http_info(**kwargs) + def resume_exposure_schedule( self, exposure_schedule_id: UUID, @@ -1253,8 +1650,16 @@ def unarchive_feature_flag( ) -> FeatureFlagResponse: """Unarchive a feature flag. - Unarchives a previously archived feature flag, - making it visible in the main list again. + Unarchives a previously archived feature flag, making it visible in the main list again. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID @@ -1270,17 +1675,35 @@ def update_allocations_for_feature_flag_in_environment( feature_flag_id: UUID, environment_id: UUID, body: OverwriteAllocationsRequest, + *, + default_variant_key: Union[str, UnsetType] = unset, ) -> ListAllocationsResponse: """Update targeting rules for a flag. - Updates targeting rules (allocations) for a specific feature flag in a specific environment. - This operation replaces the existing allocation set with the request payload. + Updates targeting rules (allocations) for a feature flag in an environment. This operation + replaces the existing allocation set with the request payload. + + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion. The change is not applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. + + When approval is required, combining allocation replacement with ``default_variant_key`` + returns ``400 Bad Request``. Omit that parameter and submit the default variant change + separately with ``CreateFlagSuggestion`` using the ``DEFAULT_VARIANT`` property and the variant ID. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID :param environment_id: The ID of the environment. :type environment_id: UUID :type body: OverwriteAllocationsRequest + :param default_variant_key: The key of the default variant to set. When approval is required, omit this parameter + and submit a ``DEFAULT_VARIANT`` suggestion separately. + :type default_variant_key: str, optional :rtype: ListAllocationsResponse """ kwargs: Dict[str, Any] = {} @@ -1288,6 +1711,9 @@ def update_allocations_for_feature_flag_in_environment( kwargs["environment_id"] = environment_id + if default_variant_key is not unset: + kwargs["default_variant_key"] = default_variant_key + kwargs["body"] = body return self._update_allocations_for_feature_flag_in_environment_endpoint.call_with_http_info(**kwargs) @@ -1299,14 +1725,31 @@ def update_feature_flag( ) -> FeatureFlagResponse: """Update a feature flag. - Updates an existing feature flag's metadata such as - name and description. Does not modify targeting rules or allocations. + Updates an existing feature flag's metadata, including its name, + description, distribution channel, and tags. Does not modify targeting rules or allocations. To change the owning team, update ``tags`` and include a tag of the form ``team:`` in the array. ``tags`` is a full replacement of the existing tag set (including any ``team:`` tag), so include every tag you want to keep, not just the ones you're adding. + To change the lifecycle, set ``staleness_status`` to ``ACTIVE`` (temporary) or ``PERMANENT``. + Either value clears any snooze; omit it to keep the lifecycle. Send ``staleness_status`` in a + separate request from ``distribution_channel``. Do not copy the top-level ``staleness_status`` + from a response into the request: that legacy response field is always ``ACTIVE`` , so + copying it makes a ``PERMANENT`` flag temporary. + + When backend approvals are enabled and a distribution channel change requires approval, + callers without the Feature Flag Approvals Override permission receive ``201 Created`` + with a suggestion instead of an updated flag. No fields in the request are applied. + The suggestion contains only the distribution channel change. To update other fields, such as + name, description, JSON schema, and tags, send a separate request without ``distribution_channel``. + + While backend approvals are enabled, a request that includes ``distribution_channel`` + returns ``409 Conflict`` if a distribution channel suggestion for the flag is pending, or + approved but not yet applied. No fields are applied, including for callers with override + permission. + :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID :type body: UpdateFeatureFlagRequest @@ -1319,6 +1762,31 @@ def update_feature_flag( return self._update_feature_flag_endpoint.call_with_http_info(**kwargs) + def update_feature_flag_approvals( + self, + feature_flag_id: UUID, + body: UpdateFeatureFlagApprovalsRequest, + ) -> FeatureFlagResponse: + """Set the approval requirement for a feature flag. + + Enables or disables the approval requirement for a feature flag. Requires the Feature + Flag Write permission and contributor or editor access to the flag. Disabling approvals + also requires the Feature Flag Approvals Override permission, even if approvals are already disabled. + This operation updates the setting directly and does not create a suggestion. Changing the setting + returns ``409 Conflict`` when a pending experiment request or a running approved experiment uses the flag. + + :param feature_flag_id: The ID of the feature flag. + :type feature_flag_id: UUID + :type body: UpdateFeatureFlagApprovalsRequest + :rtype: FeatureFlagResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["feature_flag_id"] = feature_flag_id + + kwargs["body"] = body + + return self._update_feature_flag_approvals_endpoint.call_with_http_info(**kwargs) + def update_feature_flags_environment( self, environment_id: UUID, @@ -1379,7 +1847,15 @@ def update_variant_for_feature_flag( Updates the name and value of an existing variant on a feature flag. - 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``. + When backend approvals are enabled and this change requires approval, callers without + the Feature Flag Approvals Override permission receive ``201 Created`` with a persisted + suggestion, in the same format as the ``GetFlagSuggestion`` response. The change is not + applied until the suggestion is approved and applied. + Use the returned suggestion ID with ``GetFlagSuggestion`` , ``ApproveFlagSuggestion`` , + ``RejectFlagSuggestion`` , or ``DeleteFlagSuggestion``. + + A conflicting suggestion that is pending, or approved but not yet applied, returns ``409 Conflict`` without applying the change, + including for callers with override permission or when approval is no longer required. :param feature_flag_id: The ID of the feature flag. :type feature_flag_id: UUID diff --git a/src/datadog_api_client/v2/model/approve_flag_suggestion_attributes.py b/src/datadog_api_client/v2/model/approve_flag_suggestion_attributes.py new file mode 100644 index 0000000000..85abe2b761 --- /dev/null +++ b/src/datadog_api_client/v2/model/approve_flag_suggestion_attributes.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ApproveFlagSuggestionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "apply": (bool,), + "comment": (str,), + } + + attribute_map = { + "apply": "apply", + "comment": "comment", + } + + def __init__(self_, apply: Union[bool, UnsetType] = unset, comment: Union[str, UnsetType] = unset, **kwargs): + """ + Approval options for the suggestion. + + :param apply: Whether to apply the change immediately. Set to ``false`` to approve without applying, then + call ``ApplyFlagSuggestion`` later. + :type apply: bool, optional + + :param comment: A comment explaining the approval. + :type comment: str, optional + """ + if apply is not unset: + kwargs["apply"] = apply + if comment is not unset: + kwargs["comment"] = comment + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/approve_flag_suggestion_data.py b/src/datadog_api_client/v2/model/approve_flag_suggestion_data.py new file mode 100644 index 0000000000..9197aaa494 --- /dev/null +++ b/src/datadog_api_client/v2/model/approve_flag_suggestion_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.approve_flag_suggestion_attributes import ApproveFlagSuggestionAttributes + from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType + + +class ApproveFlagSuggestionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.approve_flag_suggestion_attributes import ApproveFlagSuggestionAttributes + from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType + + return { + "attributes": (ApproveFlagSuggestionAttributes,), + "type": (ReviewFlagSuggestionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ApproveFlagSuggestionAttributes, type: ReviewFlagSuggestionDataType, **kwargs): + """ + The approval event to create. + + :param attributes: Approval options for the suggestion. + :type attributes: ApproveFlagSuggestionAttributes + + :param type: The resource type for reviewing feature flag suggestions. + :type type: ReviewFlagSuggestionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/approve_flag_suggestion_request.py b/src/datadog_api_client/v2/model/approve_flag_suggestion_request.py new file mode 100644 index 0000000000..280a973ec2 --- /dev/null +++ b/src/datadog_api_client/v2/model/approve_flag_suggestion_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.approve_flag_suggestion_data import ApproveFlagSuggestionData + + +class ApproveFlagSuggestionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.approve_flag_suggestion_data import ApproveFlagSuggestionData + + return { + "data": (ApproveFlagSuggestionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ApproveFlagSuggestionData, **kwargs): + """ + Request to approve a feature flag change suggestion. + + :param data: The approval event to create. + :type data: ApproveFlagSuggestionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_flag_suggestion_attributes.py b/src/datadog_api_client/v2/model/create_flag_suggestion_attributes.py new file mode 100644 index 0000000000..ee1b433ff4 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_flag_suggestion_attributes.py @@ -0,0 +1,105 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion_metadata_request import ( + FeatureFlagSuggestionMetadataRequest, + ) + + +class CreateFlagSuggestionAttributes(ModelNormal): + validations = { + "notification_rule_targets": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion_metadata_request import ( + FeatureFlagSuggestionMetadataRequest, + ) + + return { + "action": (str,), + "comment": (str,), + "environment_id": (UUID,), + "notification_rule_targets": ([str],), + "_property": (str,), + "suggestion": (str,), + "suggestion_metadata": (FeatureFlagSuggestionMetadataRequest,), + } + + attribute_map = { + "action": "action", + "comment": "comment", + "environment_id": "environment_id", + "notification_rule_targets": "notification_rule_targets", + "_property": "property", + "suggestion": "suggestion", + "suggestion_metadata": "suggestion_metadata", + } + + def __init__( + self_, + action: str, + notification_rule_targets: List[str], + _property: str, + comment: Union[str, UnsetType] = unset, + environment_id: Union[UUID, UnsetType] = unset, + suggestion: Union[str, UnsetType] = unset, + suggestion_metadata: Union[FeatureFlagSuggestionMetadataRequest, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a feature flag change suggestion. + + :param action: The action proposed by the suggestion. + :type action: str + + :param comment: A comment explaining the proposed change. + :type comment: str, optional + + :param environment_id: The ID of the target environment. Required for ``ALLOCATIONS`` , ``DEFAULT_VARIANT`` , and + ``OVERRIDE_VARIANT`` changes. + :type environment_id: UUID, optional + + :param notification_rule_targets: Handles to notify about the review, without the ``@`` prefix. For example, an email address + or a Slack channel name. + :type notification_rule_targets: [str] + + :param _property: The property to change. The property must require approval for this flag and environment. + :type _property: str + + :param suggestion: The proposed value as a string. For structured values, supply a JSON-encoded string. + :type suggestion: str, optional + + :param suggestion_metadata: Client-settable metadata for a suggestion. + :type suggestion_metadata: FeatureFlagSuggestionMetadataRequest, optional + """ + if comment is not unset: + kwargs["comment"] = comment + if environment_id is not unset: + kwargs["environment_id"] = environment_id + if suggestion is not unset: + kwargs["suggestion"] = suggestion + if suggestion_metadata is not unset: + kwargs["suggestion_metadata"] = suggestion_metadata + super().__init__(kwargs) + + self_.action = action + self_.notification_rule_targets = notification_rule_targets + self_._property = _property diff --git a/src/datadog_api_client/v2/model/create_flag_suggestion_data.py b/src/datadog_api_client/v2/model/create_flag_suggestion_data.py new file mode 100644 index 0000000000..5280cbac51 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_flag_suggestion_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_flag_suggestion_attributes import CreateFlagSuggestionAttributes + from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType + + +class CreateFlagSuggestionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_flag_suggestion_attributes import CreateFlagSuggestionAttributes + from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType + + return { + "attributes": (CreateFlagSuggestionAttributes,), + "type": (FeatureFlagSuggestionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CreateFlagSuggestionAttributes, type: FeatureFlagSuggestionDataType, **kwargs): + """ + The suggestion to create. + + :param attributes: Attributes for creating a feature flag change suggestion. + :type attributes: CreateFlagSuggestionAttributes + + :param type: The resource type for feature flag suggestions. + :type type: FeatureFlagSuggestionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_flag_suggestion_request.py b/src/datadog_api_client/v2/model/create_flag_suggestion_request.py new file mode 100644 index 0000000000..12e055afaf --- /dev/null +++ b/src/datadog_api_client/v2/model/create_flag_suggestion_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_flag_suggestion_data import CreateFlagSuggestionData + + +class CreateFlagSuggestionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_flag_suggestion_data import CreateFlagSuggestionData + + return { + "data": (CreateFlagSuggestionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CreateFlagSuggestionData, **kwargs): + """ + Request to create a feature flag change suggestion. + + :param data: The suggestion to create. + :type data: CreateFlagSuggestionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/feature_flag_approval_required.py b/src/datadog_api_client/v2/model/feature_flag_approval_required.py new file mode 100644 index 0000000000..7d4c731e97 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_approval_required.py @@ -0,0 +1,67 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_approval_required_attributes import ( + FeatureFlagApprovalRequiredAttributes, + ) + from datadog_api_client.v2.model.feature_flag_approval_required_data_type import FeatureFlagApprovalRequiredDataType + + +class FeatureFlagApprovalRequired(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_approval_required_attributes import ( + FeatureFlagApprovalRequiredAttributes, + ) + from datadog_api_client.v2.model.feature_flag_approval_required_data_type import ( + FeatureFlagApprovalRequiredDataType, + ) + + return { + "attributes": (FeatureFlagApprovalRequiredAttributes,), + "id": (UUID,), + "type": (FeatureFlagApprovalRequiredDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: FeatureFlagApprovalRequiredAttributes, + id: UUID, + type: FeatureFlagApprovalRequiredDataType, + **kwargs, + ): + """ + A proposed change requiring explicit submission through ``CreateFlagSuggestion``. + + :param attributes: The change to submit for approval. + :type attributes: FeatureFlagApprovalRequiredAttributes + + :param id: The ID of the feature flag. This is not a suggestion ID. + :type id: UUID + + :param type: The resource type for an approval-required response. + :type type: FeatureFlagApprovalRequiredDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/feature_flag_approval_required_attributes.py b/src/datadog_api_client/v2/model/feature_flag_approval_required_attributes.py new file mode 100644 index 0000000000..9838f2795b --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_approval_required_attributes.py @@ -0,0 +1,77 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion_metadata import FeatureFlagSuggestionMetadata + + +class FeatureFlagApprovalRequiredAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion_metadata import FeatureFlagSuggestionMetadata + + return { + "action": (str,), + "environment_id": (UUID,), + "_property": (str,), + "suggestion": (str,), + "suggestion_metadata": (FeatureFlagSuggestionMetadata,), + } + + attribute_map = { + "action": "action", + "environment_id": "environment_id", + "_property": "property", + "suggestion": "suggestion", + "suggestion_metadata": "suggestion_metadata", + } + + def __init__( + self_, + action: str, + _property: str, + suggestion: str, + environment_id: Union[UUID, UnsetType] = unset, + suggestion_metadata: Union[FeatureFlagSuggestionMetadata, UnsetType] = unset, + **kwargs, + ): + """ + The change to submit for approval. + + :param action: The proposed action. + :type action: str + + :param environment_id: The ID of the environment targeted by the change. + :type environment_id: UUID, optional + + :param _property: The feature flag property to change. + :type _property: str + + :param suggestion: The proposed value, serialized as a string. Allocation sets are JSON-encoded strings. + :type suggestion: str + + :param suggestion_metadata: Metadata associated with a suggestion. Fields other than ``variant_id`` are set by the server. + :type suggestion_metadata: FeatureFlagSuggestionMetadata, optional + """ + if environment_id is not unset: + kwargs["environment_id"] = environment_id + if suggestion_metadata is not unset: + kwargs["suggestion_metadata"] = suggestion_metadata + super().__init__(kwargs) + + self_.action = action + self_._property = _property + self_.suggestion = suggestion diff --git a/src/datadog_api_client/v2/model/feature_flag_approval_required_data_type.py b/src/datadog_api_client/v2/model/feature_flag_approval_required_data_type.py new file mode 100644 index 0000000000..e5e9e817c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_approval_required_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagApprovalRequiredDataType(ModelSimple): + """ + The resource type for an approval-required response. + + :param value: If omitted defaults to "approval-required". Must be one of ["approval-required"]. + :type value: str + """ + + allowed_values = { + "approval-required", + } + APPROVAL_REQUIRED: ClassVar["FeatureFlagApprovalRequiredDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagApprovalRequiredDataType.APPROVAL_REQUIRED = FeatureFlagApprovalRequiredDataType("approval-required") diff --git a/src/datadog_api_client/v2/model/feature_flag_approval_required_response.py b/src/datadog_api_client/v2/model/feature_flag_approval_required_response.py new file mode 100644 index 0000000000..dc7a16d5f3 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_approval_required_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_approval_required import FeatureFlagApprovalRequired + + +class FeatureFlagApprovalRequiredResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_approval_required import FeatureFlagApprovalRequired + + return { + "data": (FeatureFlagApprovalRequired,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FeatureFlagApprovalRequired, **kwargs): + """ + Approval-required response containing a proposed change. No suggestion has been persisted. + + :param data: A proposed change requiring explicit submission through ``CreateFlagSuggestion``. + :type data: FeatureFlagApprovalRequired + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/feature_flag_approvals_data_type.py b/src/datadog_api_client/v2/model/feature_flag_approvals_data_type.py new file mode 100644 index 0000000000..babffb10b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_approvals_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagApprovalsDataType(ModelSimple): + """ + The resource type for feature flag approval settings. + + :param value: If omitted defaults to "feature-flag-approvals". Must be one of ["feature-flag-approvals"]. + :type value: str + """ + + allowed_values = { + "feature-flag-approvals", + } + FEATURE_FLAG_APPROVALS: ClassVar["FeatureFlagApprovalsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagApprovalsDataType.FEATURE_FLAG_APPROVALS = FeatureFlagApprovalsDataType("feature-flag-approvals") diff --git a/src/datadog_api_client/v2/model/feature_flag_attributes.py b/src/datadog_api_client/v2/model/feature_flag_attributes.py index 71af37140b..fcf8bf9fa4 100644 --- a/src/datadog_api_client/v2/model/feature_flag_attributes.py +++ b/src/datadog_api_client/v2/model/feature_flag_attributes.py @@ -144,7 +144,9 @@ def __init__( :param staleness_details: The feature flag's current staleness state and suggested actions. :type staleness_details: FeatureFlagStalenessDetails, optional - :param staleness_status: Indicates the whether a feature flag is stale or not. + :param staleness_status: Legacy status retained for compatibility. This field is always ``ACTIVE`` ; use + ``staleness_details.staleness_status`` for the computed status. Do not copy it into an update + request: sending ``ACTIVE`` makes a ``PERMANENT`` flag temporary and clears any snooze. **Deprecated**. :type staleness_status: str, optional :param staleness_status_override: An explicit staleness status override. Omitted when no override is set. diff --git a/src/datadog_api_client/v2/model/feature_flag_list_item_attributes.py b/src/datadog_api_client/v2/model/feature_flag_list_item_attributes.py index efe9156b1b..4a7171f358 100644 --- a/src/datadog_api_client/v2/model/feature_flag_list_item_attributes.py +++ b/src/datadog_api_client/v2/model/feature_flag_list_item_attributes.py @@ -144,7 +144,9 @@ def __init__( :param staleness_details: The feature flag's current staleness state and suggested actions. :type staleness_details: FeatureFlagStalenessDetails, optional - :param staleness_status: Legacy status retained for compatibility. This field is always ``ACTIVE`` ; use ``staleness_details.staleness_status`` for the computed status. **Deprecated**. + :param staleness_status: Legacy status retained for compatibility. This field is always ``ACTIVE`` ; use + ``staleness_details.staleness_status`` for the computed status. Do not copy it into an update + request: sending ``ACTIVE`` makes a ``PERMANENT`` flag temporary and clears any snooze. **Deprecated**. :type staleness_status: str, optional :param staleness_status_override: An explicit staleness status override. Omitted when no override is set. diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion.py b/src/datadog_api_client/v2/model/feature_flag_suggestion.py new file mode 100644 index 0000000000..dbc382a69a --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion_attributes import FeatureFlagSuggestionAttributes + from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType + + +class FeatureFlagSuggestion(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion_attributes import FeatureFlagSuggestionAttributes + from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType + + return { + "attributes": (FeatureFlagSuggestionAttributes,), + "id": (UUID,), + "type": (FeatureFlagSuggestionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: FeatureFlagSuggestionAttributes, id: UUID, type: FeatureFlagSuggestionDataType, **kwargs + ): + """ + A proposed feature flag change and its approval lifecycle. + + :param attributes: Attributes of a feature flag change suggestion. + :type attributes: FeatureFlagSuggestionAttributes + + :param id: The unique identifier of the suggestion. + :type id: UUID + + :param type: The resource type for feature flag suggestions. + :type type: FeatureFlagSuggestionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes.py new file mode 100644 index 0000000000..b9cb531e6d --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes.py @@ -0,0 +1,188 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion_attributes_current_status import ( + FeatureFlagSuggestionAttributesCurrentStatus, + ) + from datadog_api_client.v2.model.feature_flag_suggestion_attributes_lifecycle_status import ( + FeatureFlagSuggestionAttributesLifecycleStatus, + ) + from datadog_api_client.v2.model.feature_flag_suggestion_metadata import FeatureFlagSuggestionMetadata + + +class FeatureFlagSuggestionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion_attributes_current_status import ( + FeatureFlagSuggestionAttributesCurrentStatus, + ) + from datadog_api_client.v2.model.feature_flag_suggestion_attributes_lifecycle_status import ( + FeatureFlagSuggestionAttributesLifecycleStatus, + ) + from datadog_api_client.v2.model.feature_flag_suggestion_metadata import FeatureFlagSuggestionMetadata + + return { + "action": (str,), + "base_flag_history_id": (UUID,), + "comment": (str,), + "created_at": (datetime,), + "created_by": (UUID,), + "current_status": (FeatureFlagSuggestionAttributesCurrentStatus,), + "current_value": (str,), + "deleted_at": (datetime,), + "deleted_by": (UUID,), + "environment_id": (UUID,), + "feature_flag_id": (UUID,), + "lifecycle_status": (FeatureFlagSuggestionAttributesLifecycleStatus,), + "message": (str,), + "_property": (str,), + "suggestion": (str,), + "suggestion_metadata": (FeatureFlagSuggestionMetadata,), + "updated_at": (datetime,), + "updated_by": (UUID,), + } + + attribute_map = { + "action": "action", + "base_flag_history_id": "base_flag_history_id", + "comment": "comment", + "created_at": "created_at", + "created_by": "created_by", + "current_status": "current_status", + "current_value": "current_value", + "deleted_at": "deleted_at", + "deleted_by": "deleted_by", + "environment_id": "environment_id", + "feature_flag_id": "feature_flag_id", + "lifecycle_status": "lifecycle_status", + "message": "message", + "_property": "property", + "suggestion": "suggestion", + "suggestion_metadata": "suggestion_metadata", + "updated_at": "updated_at", + "updated_by": "updated_by", + } + + def __init__( + self_, + action: str, + base_flag_history_id: UUID, + created_at: datetime, + created_by: UUID, + current_status: FeatureFlagSuggestionAttributesCurrentStatus, + current_value: str, + feature_flag_id: UUID, + lifecycle_status: FeatureFlagSuggestionAttributesLifecycleStatus, + _property: str, + suggestion: str, + comment: Union[str, UnsetType] = unset, + deleted_at: Union[datetime, UnsetType] = unset, + deleted_by: Union[UUID, UnsetType] = unset, + environment_id: Union[UUID, UnsetType] = unset, + message: Union[str, UnsetType] = unset, + suggestion_metadata: Union[FeatureFlagSuggestionMetadata, UnsetType] = unset, + updated_at: Union[datetime, UnsetType] = unset, + updated_by: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a feature flag change suggestion. + + :param action: The action proposed by the suggestion. + :type action: str + + :param base_flag_history_id: The ID of the flag history entry on which the suggestion is based. + :type base_flag_history_id: UUID + + :param comment: The comment supplied by the suggestion's creator. + :type comment: str, optional + + :param created_at: The timestamp when the suggestion was created. + :type created_at: datetime + + :param created_by: The ID of the user who created the suggestion. + :type created_by: UUID + + :param current_status: The legacy review status. Use ``lifecycle_status`` to distinguish approval from application. + :type current_status: FeatureFlagSuggestionAttributesCurrentStatus + + :param current_value: The value before the proposed change, serialized as a string. + :type current_value: str + + :param deleted_at: The timestamp when the suggestion was deleted. + :type deleted_at: datetime, optional + + :param deleted_by: The ID of the user who deleted the suggestion. + :type deleted_by: UUID, optional + + :param environment_id: The ID of the environment targeted by the change, if the change is environment-specific. + :type environment_id: UUID, optional + + :param feature_flag_id: The ID of the feature flag that the suggestion changes. + :type feature_flag_id: UUID + + :param lifecycle_status: The lifecycle status of the suggestion. + :type lifecycle_status: FeatureFlagSuggestionAttributesLifecycleStatus + + :param message: A message explaining why a suggestion was created. + :type message: str, optional + + :param _property: The feature flag property to update. + :type _property: str + + :param suggestion: The proposed value, serialized as a string. Structured values, such as variants and allocations, + are JSON-encoded strings. + :type suggestion: str + + :param suggestion_metadata: Metadata associated with a suggestion. Fields other than ``variant_id`` are set by the server. + :type suggestion_metadata: FeatureFlagSuggestionMetadata, optional + + :param updated_at: The timestamp when the suggestion was last updated. + :type updated_at: datetime, optional + + :param updated_by: The ID of the user who last updated the suggestion. + :type updated_by: UUID, optional + """ + if comment is not unset: + kwargs["comment"] = comment + if deleted_at is not unset: + kwargs["deleted_at"] = deleted_at + if deleted_by is not unset: + kwargs["deleted_by"] = deleted_by + if environment_id is not unset: + kwargs["environment_id"] = environment_id + if message is not unset: + kwargs["message"] = message + if suggestion_metadata is not unset: + kwargs["suggestion_metadata"] = suggestion_metadata + if updated_at is not unset: + kwargs["updated_at"] = updated_at + if updated_by is not unset: + kwargs["updated_by"] = updated_by + super().__init__(kwargs) + + self_.action = action + self_.base_flag_history_id = base_flag_history_id + self_.created_at = created_at + self_.created_by = created_by + self_.current_status = current_status + self_.current_value = current_value + self_.feature_flag_id = feature_flag_id + self_.lifecycle_status = lifecycle_status + self_._property = _property + self_.suggestion = suggestion diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_current_status.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_current_status.py new file mode 100644 index 0000000000..8cdad55d39 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_current_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagSuggestionAttributesCurrentStatus(ModelSimple): + """ + The legacy review status. Use `lifecycle_status` to distinguish approval from application. + + :param value: Must be one of ["pending", "approved", "rejected"]. + :type value: str + """ + + allowed_values = { + "pending", + "approved", + "rejected", + } + PENDING: ClassVar["FeatureFlagSuggestionAttributesCurrentStatus"] + APPROVED: ClassVar["FeatureFlagSuggestionAttributesCurrentStatus"] + REJECTED: ClassVar["FeatureFlagSuggestionAttributesCurrentStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagSuggestionAttributesCurrentStatus.PENDING = FeatureFlagSuggestionAttributesCurrentStatus("pending") +FeatureFlagSuggestionAttributesCurrentStatus.APPROVED = FeatureFlagSuggestionAttributesCurrentStatus("approved") +FeatureFlagSuggestionAttributesCurrentStatus.REJECTED = FeatureFlagSuggestionAttributesCurrentStatus("rejected") diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_lifecycle_status.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_lifecycle_status.py new file mode 100644 index 0000000000..05cd59913c --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_attributes_lifecycle_status.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagSuggestionAttributesLifecycleStatus(ModelSimple): + """ + The lifecycle status of the suggestion. + + :param value: Must be one of ["pending", "approved", "applied", "rejected", "discarded"]. + :type value: str + """ + + allowed_values = { + "pending", + "approved", + "applied", + "rejected", + "discarded", + } + PENDING: ClassVar["FeatureFlagSuggestionAttributesLifecycleStatus"] + APPROVED: ClassVar["FeatureFlagSuggestionAttributesLifecycleStatus"] + APPLIED: ClassVar["FeatureFlagSuggestionAttributesLifecycleStatus"] + REJECTED: ClassVar["FeatureFlagSuggestionAttributesLifecycleStatus"] + DISCARDED: ClassVar["FeatureFlagSuggestionAttributesLifecycleStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagSuggestionAttributesLifecycleStatus.PENDING = FeatureFlagSuggestionAttributesLifecycleStatus("pending") +FeatureFlagSuggestionAttributesLifecycleStatus.APPROVED = FeatureFlagSuggestionAttributesLifecycleStatus("approved") +FeatureFlagSuggestionAttributesLifecycleStatus.APPLIED = FeatureFlagSuggestionAttributesLifecycleStatus("applied") +FeatureFlagSuggestionAttributesLifecycleStatus.REJECTED = FeatureFlagSuggestionAttributesLifecycleStatus("rejected") +FeatureFlagSuggestionAttributesLifecycleStatus.DISCARDED = FeatureFlagSuggestionAttributesLifecycleStatus("discarded") diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_data_type.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_data_type.py new file mode 100644 index 0000000000..d081a5454a --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagSuggestionDataType(ModelSimple): + """ + The resource type for feature flag suggestions. + + :param value: If omitted defaults to "flag-suggestions". Must be one of ["flag-suggestions"]. + :type value: str + """ + + allowed_values = { + "flag-suggestions", + } + FLAG_SUGGESTIONS: ClassVar["FeatureFlagSuggestionDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagSuggestionDataType.FLAG_SUGGESTIONS = FeatureFlagSuggestionDataType("flag-suggestions") diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_experiment_action.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_experiment_action.py new file mode 100644 index 0000000000..cd4fc033c5 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_experiment_action.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class FeatureFlagSuggestionExperimentAction(ModelNormal): + @cached_property + def openapi_types(_): + return { + "action": (str,), + "experiment_id": (UUID,), + "version": (int,), + } + + attribute_map = { + "action": "action", + "experiment_id": "experiment_id", + "version": "version", + } + + def __init__(self_, action: str, experiment_id: UUID, version: int, **kwargs): + """ + Server-generated reference to an experiment action requiring approval. + + :param action: The proposed experiment action. + :type action: str + + :param experiment_id: The ID of the experiment. + :type experiment_id: UUID + + :param version: The version of the experiment action reference. + :type version: int + """ + super().__init__(kwargs) + + self_.action = action + self_.experiment_id = experiment_id + self_.version = version diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata.py new file mode 100644 index 0000000000..e14fb12730 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata.py @@ -0,0 +1,75 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion_experiment_action import ( + FeatureFlagSuggestionExperimentAction, + ) + + +class FeatureFlagSuggestionMetadata(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion_experiment_action import ( + FeatureFlagSuggestionExperimentAction, + ) + + return { + "allow_draft_reorder": (bool,), + "experiment_action": (FeatureFlagSuggestionExperimentAction,), + "experiment_action_request_fingerprint": (str,), + "variant_id": (UUID,), + } + + attribute_map = { + "allow_draft_reorder": "allow_draft_reorder", + "experiment_action": "experiment_action", + "experiment_action_request_fingerprint": "experiment_action_request_fingerprint", + "variant_id": "variant_id", + } + + def __init__( + self_, + allow_draft_reorder: Union[bool, UnsetType] = unset, + experiment_action: Union[FeatureFlagSuggestionExperimentAction, UnsetType] = unset, + experiment_action_request_fingerprint: Union[str, UnsetType] = unset, + variant_id: Union[UUID, UnsetType] = unset, + **kwargs, + ): + """ + Metadata associated with a suggestion. Fields other than ``variant_id`` are set by the server. + + :param allow_draft_reorder: Whether the server allows this allocation suggestion to reorder persisted drafts. + :type allow_draft_reorder: bool, optional + + :param experiment_action: Server-generated reference to an experiment action requiring approval. + :type experiment_action: FeatureFlagSuggestionExperimentAction, optional + + :param experiment_action_request_fingerprint: Server-generated fingerprint of the experiment action request. + :type experiment_action_request_fingerprint: str, optional + + :param variant_id: The ID of the variant targeted by the suggestion. + :type variant_id: UUID, optional + """ + if allow_draft_reorder is not unset: + kwargs["allow_draft_reorder"] = allow_draft_reorder + if experiment_action is not unset: + kwargs["experiment_action"] = experiment_action + if experiment_action_request_fingerprint is not unset: + kwargs["experiment_action_request_fingerprint"] = experiment_action_request_fingerprint + if variant_id is not unset: + kwargs["variant_id"] = variant_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata_request.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata_request.py new file mode 100644 index 0000000000..1aaa60ee2f --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_metadata_request.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +class FeatureFlagSuggestionMetadataRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "variant_id": (UUID,), + } + + attribute_map = { + "variant_id": "variant_id", + } + + def __init__(self_, variant_id: Union[UUID, UnsetType] = unset, **kwargs): + """ + Client-settable metadata for a suggestion. + + :param variant_id: The ID of the variant targeted by the suggestion. + :type variant_id: UUID, optional + """ + if variant_id is not unset: + kwargs["variant_id"] = variant_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/feature_flag_suggestion_response.py b/src/datadog_api_client/v2/model/feature_flag_suggestion_response.py new file mode 100644 index 0000000000..59661ba7a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_suggestion_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_suggestion import FeatureFlagSuggestion + + +class FeatureFlagSuggestionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_suggestion import FeatureFlagSuggestion + + return { + "data": (FeatureFlagSuggestion,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FeatureFlagSuggestion, **kwargs): + """ + Response containing a feature flag change suggestion. + + :param data: A proposed feature flag change and its approval lifecycle. + :type data: FeatureFlagSuggestion + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/reject_flag_suggestion_attributes.py b/src/datadog_api_client/v2/model/reject_flag_suggestion_attributes.py new file mode 100644 index 0000000000..13db45c3b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/reject_flag_suggestion_attributes.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RejectFlagSuggestionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "comment": (str,), + } + + attribute_map = { + "comment": "comment", + } + + def __init__(self_, comment: Union[str, UnsetType] = unset, **kwargs): + """ + Rejection options for the suggestion. + + :param comment: A comment explaining the rejection. + :type comment: str, optional + """ + if comment is not unset: + kwargs["comment"] = comment + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/reject_flag_suggestion_data.py b/src/datadog_api_client/v2/model/reject_flag_suggestion_data.py new file mode 100644 index 0000000000..21837d5b04 --- /dev/null +++ b/src/datadog_api_client/v2/model/reject_flag_suggestion_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.reject_flag_suggestion_attributes import RejectFlagSuggestionAttributes + from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType + + +class RejectFlagSuggestionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.reject_flag_suggestion_attributes import RejectFlagSuggestionAttributes + from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType + + return { + "attributes": (RejectFlagSuggestionAttributes,), + "type": (ReviewFlagSuggestionDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RejectFlagSuggestionAttributes, type: ReviewFlagSuggestionDataType, **kwargs): + """ + The rejection event to create. + + :param attributes: Rejection options for the suggestion. + :type attributes: RejectFlagSuggestionAttributes + + :param type: The resource type for reviewing feature flag suggestions. + :type type: ReviewFlagSuggestionDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/reject_flag_suggestion_request.py b/src/datadog_api_client/v2/model/reject_flag_suggestion_request.py new file mode 100644 index 0000000000..09a080b186 --- /dev/null +++ b/src/datadog_api_client/v2/model/reject_flag_suggestion_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.reject_flag_suggestion_data import RejectFlagSuggestionData + + +class RejectFlagSuggestionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.reject_flag_suggestion_data import RejectFlagSuggestionData + + return { + "data": (RejectFlagSuggestionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RejectFlagSuggestionData, **kwargs): + """ + Request to reject a feature flag change suggestion. + + :param data: The rejection event to create. + :type data: RejectFlagSuggestionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/review_flag_suggestion_data_type.py b/src/datadog_api_client/v2/model/review_flag_suggestion_data_type.py new file mode 100644 index 0000000000..cc3fe5bd3d --- /dev/null +++ b/src/datadog_api_client/v2/model/review_flag_suggestion_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ReviewFlagSuggestionDataType(ModelSimple): + """ + The resource type for reviewing feature flag suggestions. + + :param value: If omitted defaults to "flag-suggestion-events". Must be one of ["flag-suggestion-events"]. + :type value: str + """ + + allowed_values = { + "flag-suggestion-events", + } + FLAG_SUGGESTION_EVENTS: ClassVar["ReviewFlagSuggestionDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ReviewFlagSuggestionDataType.FLAG_SUGGESTION_EVENTS = ReviewFlagSuggestionDataType("flag-suggestion-events") diff --git a/src/datadog_api_client/v2/model/update_feature_flag_approvals_attributes.py b/src/datadog_api_client/v2/model/update_feature_flag_approvals_attributes.py new file mode 100644 index 0000000000..f420f4821d --- /dev/null +++ b/src/datadog_api_client/v2/model/update_feature_flag_approvals_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateFeatureFlagApprovalsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: bool, **kwargs): + """ + The approval requirement for the flag. + + :param enabled: Whether approval is required. Disabling requires the Feature Flag Approvals Override permission. + :type enabled: bool + """ + super().__init__(kwargs) + + self_.enabled = enabled diff --git a/src/datadog_api_client/v2/model/update_feature_flag_approvals_data.py b/src/datadog_api_client/v2/model/update_feature_flag_approvals_data.py new file mode 100644 index 0000000000..a84c9808b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_feature_flag_approvals_data.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_feature_flag_approvals_attributes import ( + UpdateFeatureFlagApprovalsAttributes, + ) + from datadog_api_client.v2.model.feature_flag_approvals_data_type import FeatureFlagApprovalsDataType + + +class UpdateFeatureFlagApprovalsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_feature_flag_approvals_attributes import ( + UpdateFeatureFlagApprovalsAttributes, + ) + from datadog_api_client.v2.model.feature_flag_approvals_data_type import FeatureFlagApprovalsDataType + + return { + "attributes": (UpdateFeatureFlagApprovalsAttributes,), + "type": (FeatureFlagApprovalsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: UpdateFeatureFlagApprovalsAttributes, type: FeatureFlagApprovalsDataType, **kwargs): + """ + The feature flag approval setting to update. + + :param attributes: The approval requirement for the flag. + :type attributes: UpdateFeatureFlagApprovalsAttributes + + :param type: The resource type for feature flag approval settings. + :type type: FeatureFlagApprovalsDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_feature_flag_approvals_request.py b/src/datadog_api_client/v2/model/update_feature_flag_approvals_request.py new file mode 100644 index 0000000000..4c728864c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_feature_flag_approvals_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_feature_flag_approvals_data import UpdateFeatureFlagApprovalsData + + +class UpdateFeatureFlagApprovalsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_feature_flag_approvals_data import UpdateFeatureFlagApprovalsData + + return { + "data": (UpdateFeatureFlagApprovalsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpdateFeatureFlagApprovalsData, **kwargs): + """ + Request to change whether a feature flag requires approval. + + :param data: The feature flag approval setting to update. + :type data: UpdateFeatureFlagApprovalsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_feature_flag_attributes.py b/src/datadog_api_client/v2/model/update_feature_flag_attributes.py index 1537b9aa81..4b7f53735d 100644 --- a/src/datadog_api_client/v2/model/update_feature_flag_attributes.py +++ b/src/datadog_api_client/v2/model/update_feature_flag_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -14,6 +14,11 @@ ) +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel + from datadog_api_client.v2.model.update_feature_flag_staleness_status import UpdateFeatureFlagStalenessStatus + + class UpdateFeatureFlagAttributes(ModelNormal): validations = { "tags": { @@ -23,25 +28,34 @@ class UpdateFeatureFlagAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel + from datadog_api_client.v2.model.update_feature_flag_staleness_status import UpdateFeatureFlagStalenessStatus + return { "description": (str,), + "distribution_channel": (FeatureFlagDistributionChannel,), "json_schema": (str, none_type), "name": (str,), + "staleness_status": (UpdateFeatureFlagStalenessStatus,), "tags": ([str],), } attribute_map = { "description": "description", + "distribution_channel": "distribution_channel", "json_schema": "json_schema", "name": "name", + "staleness_status": "staleness_status", "tags": "tags", } def __init__( self_, description: Union[str, UnsetType] = unset, + distribution_channel: Union[FeatureFlagDistributionChannel, UnsetType] = unset, json_schema: Union[str, none_type, UnsetType] = unset, name: Union[str, UnsetType] = unset, + staleness_status: Union[UpdateFeatureFlagStalenessStatus, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, **kwargs, ): @@ -51,12 +65,21 @@ def __init__( :param description: The description of the feature flag. :type description: str, optional + :param distribution_channel: The distribution channel for the feature flag. + :type distribution_channel: FeatureFlagDistributionChannel, optional + :param json_schema: JSON schema for validation when value_type is JSON. :type json_schema: str, none_type, optional :param name: The name of the feature flag. :type name: str, optional + :param staleness_status: The lifecycle to set. ``ACTIVE`` makes the flag temporary; ``PERMANENT`` excludes it from + staleness detection. Either value clears any snooze; omit the field to keep the lifecycle. + Do not copy the top-level ``staleness_status`` from a response into this field: that legacy + response field is always ``ACTIVE``. + :type staleness_status: UpdateFeatureFlagStalenessStatus, optional + :param tags: Tags associated with the feature flag. This field replaces the full set of existing tags; omit it to leave tags unchanged, or pass an empty array to clear all tags. The owning team is set by including a tag of the form @@ -65,10 +88,14 @@ def __init__( """ if description is not unset: kwargs["description"] = description + if distribution_channel is not unset: + kwargs["distribution_channel"] = distribution_channel if json_schema is not unset: kwargs["json_schema"] = json_schema if name is not unset: kwargs["name"] = name + if staleness_status is not unset: + kwargs["staleness_status"] = staleness_status if tags is not unset: kwargs["tags"] = tags super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_feature_flag_staleness_status.py b/src/datadog_api_client/v2/model/update_feature_flag_staleness_status.py new file mode 100644 index 0000000000..c14b4a67fe --- /dev/null +++ b/src/datadog_api_client/v2/model/update_feature_flag_staleness_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpdateFeatureFlagStalenessStatus(ModelSimple): + """ + The lifecycle to set. `ACTIVE` makes the flag temporary; `PERMANENT` excludes it from + staleness detection. Either value clears any snooze; omit the field to keep the lifecycle. + Do not copy the top-level `staleness_status` from a response into this field: that legacy + response field is always `ACTIVE`. + + :param value: Must be one of ["ACTIVE", "PERMANENT"]. + :type value: str + """ + + allowed_values = { + "ACTIVE", + "PERMANENT", + } + ACTIVE: ClassVar["UpdateFeatureFlagStalenessStatus"] + PERMANENT: ClassVar["UpdateFeatureFlagStalenessStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateFeatureFlagStalenessStatus.ACTIVE = UpdateFeatureFlagStalenessStatus("ACTIVE") +UpdateFeatureFlagStalenessStatus.PERMANENT = UpdateFeatureFlagStalenessStatus("PERMANENT") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 96db396e60..b2c6fe9cb8 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -928,6 +928,9 @@ from datadog_api_client.v2.model.application_security_waf_exclusion_filters_response import ( ApplicationSecurityWafExclusionFiltersResponse, ) +from datadog_api_client.v2.model.approve_flag_suggestion_attributes import ApproveFlagSuggestionAttributes +from datadog_api_client.v2.model.approve_flag_suggestion_data import ApproveFlagSuggestionData +from datadog_api_client.v2.model.approve_flag_suggestion_request import ApproveFlagSuggestionRequest from datadog_api_client.v2.model.apps_sort_field import AppsSortField from datadog_api_client.v2.model.arbitrary_cost_upsert_request import ArbitraryCostUpsertRequest from datadog_api_client.v2.model.arbitrary_cost_upsert_request_data import ArbitraryCostUpsertRequestData @@ -2235,6 +2238,9 @@ from datadog_api_client.v2.model.create_feature_flag_data_type import CreateFeatureFlagDataType from datadog_api_client.v2.model.create_feature_flag_request import CreateFeatureFlagRequest from datadog_api_client.v2.model.create_feature_flag_staleness_status import CreateFeatureFlagStalenessStatus +from datadog_api_client.v2.model.create_flag_suggestion_attributes import CreateFlagSuggestionAttributes +from datadog_api_client.v2.model.create_flag_suggestion_data import CreateFlagSuggestionData +from datadog_api_client.v2.model.create_flag_suggestion_request import CreateFlagSuggestionRequest from datadog_api_client.v2.model.create_form_data import CreateFormData from datadog_api_client.v2.model.create_form_data_attributes import CreateFormDataAttributes from datadog_api_client.v2.model.create_form_request import CreateFormRequest @@ -4458,6 +4464,11 @@ from datadog_api_client.v2.model.fastly_service_type import FastlyServiceType from datadog_api_client.v2.model.fastly_services_response import FastlyServicesResponse from datadog_api_client.v2.model.feature_flag import FeatureFlag +from datadog_api_client.v2.model.feature_flag_approval_required import FeatureFlagApprovalRequired +from datadog_api_client.v2.model.feature_flag_approval_required_attributes import FeatureFlagApprovalRequiredAttributes +from datadog_api_client.v2.model.feature_flag_approval_required_data_type import FeatureFlagApprovalRequiredDataType +from datadog_api_client.v2.model.feature_flag_approval_required_response import FeatureFlagApprovalRequiredResponse +from datadog_api_client.v2.model.feature_flag_approvals_data_type import FeatureFlagApprovalsDataType from datadog_api_client.v2.model.feature_flag_attributes import FeatureFlagAttributes from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel from datadog_api_client.v2.model.feature_flag_environment import FeatureFlagEnvironment @@ -4472,6 +4483,19 @@ from datadog_api_client.v2.model.feature_flag_staleness_status import FeatureFlagStalenessStatus from datadog_api_client.v2.model.feature_flag_staleness_status_override import FeatureFlagStalenessStatusOverride from datadog_api_client.v2.model.feature_flag_status import FeatureFlagStatus +from datadog_api_client.v2.model.feature_flag_suggestion import FeatureFlagSuggestion +from datadog_api_client.v2.model.feature_flag_suggestion_attributes import FeatureFlagSuggestionAttributes +from datadog_api_client.v2.model.feature_flag_suggestion_attributes_current_status import ( + FeatureFlagSuggestionAttributesCurrentStatus, +) +from datadog_api_client.v2.model.feature_flag_suggestion_attributes_lifecycle_status import ( + FeatureFlagSuggestionAttributesLifecycleStatus, +) +from datadog_api_client.v2.model.feature_flag_suggestion_data_type import FeatureFlagSuggestionDataType +from datadog_api_client.v2.model.feature_flag_suggestion_experiment_action import FeatureFlagSuggestionExperimentAction +from datadog_api_client.v2.model.feature_flag_suggestion_metadata import FeatureFlagSuggestionMetadata +from datadog_api_client.v2.model.feature_flag_suggestion_metadata_request import FeatureFlagSuggestionMetadataRequest +from datadog_api_client.v2.model.feature_flag_suggestion_response import FeatureFlagSuggestionResponse from datadog_api_client.v2.model.feature_flags_pagination_links import FeatureFlagsPaginationLinks from datadog_api_client.v2.model.feature_flags_pagination_meta import FeatureFlagsPaginationMeta from datadog_api_client.v2.model.feature_flags_pagination_meta_page import FeatureFlagsPaginationMetaPage @@ -9744,6 +9768,9 @@ from datadog_api_client.v2.model.reference_table_sort_type import ReferenceTableSortType from datadog_api_client.v2.model.reference_table_source_type import ReferenceTableSourceType from datadog_api_client.v2.model.register_app_key_response import RegisterAppKeyResponse +from datadog_api_client.v2.model.reject_flag_suggestion_attributes import RejectFlagSuggestionAttributes +from datadog_api_client.v2.model.reject_flag_suggestion_data import RejectFlagSuggestionData +from datadog_api_client.v2.model.reject_flag_suggestion_request import RejectFlagSuggestionRequest from datadog_api_client.v2.model.relation_attributes import RelationAttributes from datadog_api_client.v2.model.relation_entity import RelationEntity from datadog_api_client.v2.model.relation_include_type import RelationIncludeType @@ -9965,6 +9992,7 @@ from datadog_api_client.v2.model.revert_custom_rule_revision_request_data_attributes import ( RevertCustomRuleRevisionRequestDataAttributes, ) +from datadog_api_client.v2.model.review_flag_suggestion_data_type import ReviewFlagSuggestionDataType from datadog_api_client.v2.model.role import Role from datadog_api_client.v2.model.role_attributes import RoleAttributes from datadog_api_client.v2.model.role_clone import RoleClone @@ -13467,10 +13495,14 @@ from datadog_api_client.v2.model.update_environment_data import UpdateEnvironmentData from datadog_api_client.v2.model.update_environment_data_type import UpdateEnvironmentDataType from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest +from datadog_api_client.v2.model.update_feature_flag_approvals_attributes import UpdateFeatureFlagApprovalsAttributes +from datadog_api_client.v2.model.update_feature_flag_approvals_data import UpdateFeatureFlagApprovalsData +from datadog_api_client.v2.model.update_feature_flag_approvals_request import UpdateFeatureFlagApprovalsRequest from datadog_api_client.v2.model.update_feature_flag_attributes import UpdateFeatureFlagAttributes from datadog_api_client.v2.model.update_feature_flag_data import UpdateFeatureFlagData from datadog_api_client.v2.model.update_feature_flag_data_type import UpdateFeatureFlagDataType from datadog_api_client.v2.model.update_feature_flag_request import UpdateFeatureFlagRequest +from datadog_api_client.v2.model.update_feature_flag_staleness_status import UpdateFeatureFlagStalenessStatus from datadog_api_client.v2.model.update_flaky_tests_request import UpdateFlakyTestsRequest from datadog_api_client.v2.model.update_flaky_tests_request_attributes import UpdateFlakyTestsRequestAttributes from datadog_api_client.v2.model.update_flaky_tests_request_data import UpdateFlakyTestsRequestData @@ -14612,6 +14644,9 @@ "ApplicationSecurityWafExclusionFilterUpdateData", "ApplicationSecurityWafExclusionFilterUpdateRequest", "ApplicationSecurityWafExclusionFiltersResponse", + "ApproveFlagSuggestionAttributes", + "ApproveFlagSuggestionData", + "ApproveFlagSuggestionRequest", "AppsSortField", "ArbitraryCostUpsertRequest", "ArbitraryCostUpsertRequestData", @@ -15615,6 +15650,9 @@ "CreateFeatureFlagDataType", "CreateFeatureFlagRequest", "CreateFeatureFlagStalenessStatus", + "CreateFlagSuggestionAttributes", + "CreateFlagSuggestionData", + "CreateFlagSuggestionRequest", "CreateFormData", "CreateFormDataAttributes", "CreateFormRequest", @@ -16952,6 +16990,11 @@ "FastlyServiceType", "FastlyServicesResponse", "FeatureFlag", + "FeatureFlagApprovalRequired", + "FeatureFlagApprovalRequiredAttributes", + "FeatureFlagApprovalRequiredDataType", + "FeatureFlagApprovalRequiredResponse", + "FeatureFlagApprovalsDataType", "FeatureFlagAttributes", "FeatureFlagDistributionChannel", "FeatureFlagEnvironment", @@ -16966,6 +17009,15 @@ "FeatureFlagStalenessStatus", "FeatureFlagStalenessStatusOverride", "FeatureFlagStatus", + "FeatureFlagSuggestion", + "FeatureFlagSuggestionAttributes", + "FeatureFlagSuggestionAttributesCurrentStatus", + "FeatureFlagSuggestionAttributesLifecycleStatus", + "FeatureFlagSuggestionDataType", + "FeatureFlagSuggestionExperimentAction", + "FeatureFlagSuggestionMetadata", + "FeatureFlagSuggestionMetadataRequest", + "FeatureFlagSuggestionResponse", "FeatureFlagsPaginationLinks", "FeatureFlagsPaginationMeta", "FeatureFlagsPaginationMetaPage", @@ -20446,6 +20498,9 @@ "ReferenceTableSortType", "ReferenceTableSourceType", "RegisterAppKeyResponse", + "RejectFlagSuggestionAttributes", + "RejectFlagSuggestionData", + "RejectFlagSuggestionRequest", "RelationAttributes", "RelationEntity", "RelationIncludeType", @@ -20621,6 +20676,7 @@ "RevertCustomRuleRevisionRequest", "RevertCustomRuleRevisionRequestData", "RevertCustomRuleRevisionRequestDataAttributes", + "ReviewFlagSuggestionDataType", "Role", "RoleAttributes", "RoleClone", @@ -22833,10 +22889,14 @@ "UpdateEnvironmentData", "UpdateEnvironmentDataType", "UpdateEnvironmentRequest", + "UpdateFeatureFlagApprovalsAttributes", + "UpdateFeatureFlagApprovalsData", + "UpdateFeatureFlagApprovalsRequest", "UpdateFeatureFlagAttributes", "UpdateFeatureFlagData", "UpdateFeatureFlagDataType", "UpdateFeatureFlagRequest", + "UpdateFeatureFlagStalenessStatus", "UpdateFlakyTestsRequest", "UpdateFlakyTestsRequestAttributes", "UpdateFlakyTestsRequestData", diff --git a/tests/v2/features/feature_flags.feature b/tests/v2/features/feature_flags.feature index 98d3aa2f7d..95f2267e66 100644 --- a/tests/v2/features/feature_flags.feature +++ b/tests/v2/features/feature_flags.feature @@ -1,6 +1,6 @@ @endpoint(feature-flags) @endpoint(feature-flags-v2) Feature: Feature Flags - Manage feature flags and environments. + Manage feature flags, environments, and approval suggestions. Background: Given a valid "apiKeyAuth" key in the system @@ -39,6 +39,66 @@ Feature: Feature Flags When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/feature-flags + Scenario: Apply an approved flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "ApplyFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Apply an approved flag change suggestion returns "Conflict - The suggestion is not approved or the proposed change conflicts with current configuration." response + Given new "ApplyFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - The suggestion is not approved or the proposed change conflicts with current configuration. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Apply an approved flag change suggestion returns "Not Found" response + Given new "ApplyFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Apply an approved flag change suggestion returns "OK" response + Given new "ApplyFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/feature-flags + Scenario: Approve a flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "ApproveFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"apply": false, "comment": "Approved for rollout."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Approve a flag change suggestion returns "Conflict - The suggestion is already applied or discarded, or the proposed change conflicts with current configuration." response + Given new "ApproveFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"apply": false, "comment": "Approved for rollout."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 409 Conflict - The suggestion is already applied or discarded, or the proposed change conflicts with current configuration. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Approve a flag change suggestion returns "Not Found" response + Given new "ApproveFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"apply": false, "comment": "Approved for rollout."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Approve a flag change suggestion returns "OK" response + Given new "ApproveFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"apply": false, "comment": "Approved for rollout."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 200 OK + @skip @team:ddoghq/feature-flags Scenario: Archive a feature flag returns "Bad Request" response Given new "ArchiveFeatureFlag" request @@ -46,6 +106,20 @@ Feature: Feature Flags When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:ddoghq/feature-flags + Scenario: Archive a feature flag returns "Conflict - The flag is already archived or a conflicting suggestion is pending." response + Given new "ArchiveFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - The flag is already archived or a conflicting suggestion is pending. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Archive a feature flag returns "Created - Approval is required. A suggestion was created and the change has not been applied." response + Given new "ArchiveFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. + @skip @team:ddoghq/feature-flags Scenario: Archive a feature flag returns "Not Found" response Given new "ArchiveFeatureFlag" request @@ -89,6 +163,38 @@ Feature: Feature Flags And the response "data.attributes.tags" is equal to ["env:api-client-test"] And the response "data.attributes.value_type" is equal to "BOOLEAN" + @generated @skip @team:ddoghq/feature-flags + Scenario: Create a flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "CreateFlagSuggestion" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "updated", "comment": "Restrict this flag to server applications.", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["requester@example.com"], "property": "DISTRIBUTION_CHANNEL", "suggestion": "SERVER", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440002"}}, "type": "flag-suggestions"}} + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Create a flag change suggestion returns "Conflict - A conflicting suggestion is pending, or the lineup changes or omits a draft allocation." response + Given new "CreateFlagSuggestion" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "updated", "comment": "Restrict this flag to server applications.", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["requester@example.com"], "property": "DISTRIBUTION_CHANNEL", "suggestion": "SERVER", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440002"}}, "type": "flag-suggestions"}} + When the request is sent + Then the response status is 409 Conflict - A conflicting suggestion is pending, or the lineup changes or omits a draft allocation. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Create a flag change suggestion returns "Created" response + Given new "CreateFlagSuggestion" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "updated", "comment": "Restrict this flag to server applications.", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["requester@example.com"], "property": "DISTRIBUTION_CHANNEL", "suggestion": "SERVER", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440002"}}, "type": "flag-suggestions"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:ddoghq/feature-flags + Scenario: Create a flag change suggestion returns "Not Found" response + Given new "CreateFlagSuggestion" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "updated", "comment": "Restrict this flag to server applications.", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["requester@example.com"], "property": "DISTRIBUTION_CHANNEL", "suggestion": "SERVER", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440002"}}, "type": "flag-suggestions"}} + When the request is sent + Then the response status is 404 Not Found + @team:ddoghq/feature-flags Scenario: Create allocation for a flag in an environment returns "Created" response Given there is a valid "feature_flag" in the system @@ -121,7 +227,7 @@ Feature: Feature Flags When the request is sent Then the response status is 201 Created - @generated @skip @team:ddoghq/feature-flags + @skip @team:ddoghq/feature-flags Scenario: Create targeting rules for a flag env returns "Accepted - Approval required for this change" response Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" @@ -129,6 +235,9 @@ Feature: Feature Flags And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 202 Accepted - Approval required for this change + And the response "data.type" is equal to "approval-required" + And the response "data.attributes.property" is equal to "ALLOCATIONS" + And the response "data.attributes.action" is equal to "updated" @generated @skip @team:ddoghq/feature-flags Scenario: Create targeting rules for a flag env returns "Bad Request" response @@ -140,13 +249,13 @@ Feature: Feature Flags Then the response status is 400 Bad Request @generated @skip @team:ddoghq/feature-flags - Scenario: Create targeting rules for a flag env returns "Conflict" response + Scenario: Create targeting rules for a flag env returns "Conflict - A conflicting suggestion is pending or an allocation with this key already exists." response Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent - Then the response status is 409 Conflict + Then the response status is 409 Conflict - A conflicting suggestion is pending or an allocation with this key already exists. @generated @skip @team:ddoghq/feature-flags Scenario: Create targeting rules for a flag env returns "Created" response @@ -182,6 +291,14 @@ Feature: Feature Flags When the request is sent Then the response status is 409 Conflict - A pending suggestion already exists for this property. + @generated @skip @team:ddoghq/feature-flags + Scenario: Delete a variant returns "Created - Approval is required. A suggestion was created and the change has not been applied." response + Given new "DeleteVariantFromFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "variant_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. + @generated @skip @team:ddoghq/feature-flags Scenario: Delete a variant returns "No Content" response Given new "DeleteVariantFromFeatureFlag" request @@ -213,15 +330,59 @@ Feature: Feature Flags When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/feature-flags + Scenario: Delete or discard a flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "DeleteFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Delete or discard a flag change suggestion returns "Conflict - Applied or rejected suggestions cannot be deleted." response + Given new "DeleteFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - Applied or rejected suggestions cannot be deleted. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Delete or discard a flag change suggestion returns "No Content" response + Given new "DeleteFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/feature-flags + Scenario: Delete or discard a flag change suggestion returns "Not Found" response + Given new "DeleteFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Disable a feature flag in an environment returns "Bad Request" response + Given new "DisableFeatureFlagEnvironment" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "environment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/feature-flags + Scenario: Disable a feature flag in an environment returns "Conflict - A conflicting suggestion is pending for this flag and environment." response + Given new "DisableFeatureFlagEnvironment" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "environment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - A conflicting suggestion is pending for this flag and environment. + @skip @team:ddoghq/feature-flags - Scenario: Disable a feature flag in an environment returns "Accepted - Approval required for this change" response + Scenario: Disable a feature flag in an environment returns "Created - Approval is required. A suggestion was created and the change has not been applied." response Given there is a valid "feature_flag" in the system And there is a valid "environment" in the system And new "DisableFeatureFlagEnvironment" request And request contains "feature_flag_id" parameter from "feature_flag.data.id" And request contains "environment_id" parameter from "environment.data.id" When the request is sent - Then the response status is 202 Accepted - Approval required for this change + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. @skip @team:ddoghq/feature-flags Scenario: Disable a feature flag in an environment returns "Not Found" response @@ -241,15 +402,31 @@ Feature: Feature Flags When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags + Scenario: Enable a feature flag in an environment returns "Bad Request" response + Given new "EnableFeatureFlagEnvironment" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "environment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/feature-flags + Scenario: Enable a feature flag in an environment returns "Conflict - A conflicting suggestion is pending for this flag and environment." response + Given new "EnableFeatureFlagEnvironment" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "environment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - A conflicting suggestion is pending for this flag and environment. + @skip @team:ddoghq/feature-flags - Scenario: Enable a feature flag in an environment returns "Accepted - Approval required for this change" response + Scenario: Enable a feature flag in an environment returns "Created - Approval is required. A suggestion was created and the change has not been applied." response Given there is a valid "feature_flag" in the system And there is a valid "environment" in the system And new "EnableFeatureFlagEnvironment" request And request contains "feature_flag_id" parameter from "feature_flag.data.id" And request contains "environment_id" parameter from "environment.data.id" When the request is sent - Then the response status is 202 Accepted - Approval required for this change + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. @skip @team:ddoghq/feature-flags Scenario: Enable a feature flag in an environment returns "Not Found" response @@ -287,6 +464,27 @@ Feature: Feature Flags And the response "data.attributes.name" has the same value as "feature_flag.data.attributes.name" And the response "data.attributes.value_type" has the same value as "feature_flag.data.attributes.value_type" + @generated @skip @team:ddoghq/feature-flags + Scenario: Get a flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "GetFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Get a flag change suggestion returns "Not Found" response + Given new "GetFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Get a flag change suggestion returns "OK" response + Given new "GetFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags Scenario: Get a saved filter returns "Bad Request" response Given new "GetSavedFilter" request @@ -954,6 +1152,38 @@ Feature: Feature Flags When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags + Scenario: Reject a flag change suggestion returns "Bad Request - Invalid request parameters or body." response + Given new "RejectFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Keep the existing configuration."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Reject a flag change suggestion returns "Conflict - The suggestion is already approved, applied, or discarded." response + Given new "RejectFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Keep the existing configuration."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 409 Conflict - The suggestion is already approved, applied, or discarded. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Reject a flag change suggestion returns "Not Found" response + Given new "RejectFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Keep the existing configuration."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Reject a flag change suggestion returns "OK" response + Given new "RejectFlagSuggestion" request + And request contains "suggestion_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Keep the existing configuration."}, "type": "flag-suggestion-events"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags Scenario: Resume a progressive rollout returns "Bad Request" response Given new "ResumeExposureSchedule" request @@ -982,6 +1212,38 @@ Feature: Feature Flags When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags + Scenario: Set the approval requirement for a feature flag returns "Bad Request - Invalid request parameters or body." response + Given new "UpdateFeatureFlagApprovals" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "type": "feature-flag-approvals"}} + When the request is sent + Then the response status is 400 Bad Request - Invalid request parameters or body. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Set the approval requirement for a feature flag returns "Conflict - A pending experiment request or a running approved experiment uses this flag." response + Given new "UpdateFeatureFlagApprovals" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "type": "feature-flag-approvals"}} + When the request is sent + Then the response status is 409 Conflict - A pending experiment request or a running approved experiment uses this flag. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Set the approval requirement for a feature flag returns "Not Found" response + Given new "UpdateFeatureFlagApprovals" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "type": "feature-flag-approvals"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/feature-flags + Scenario: Set the approval requirement for a feature flag returns "OK" response + Given new "UpdateFeatureFlagApprovals" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "type": "feature-flag-approvals"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags Scenario: Start a progressive rollout returns "Bad Request" response Given new "StartExposureSchedule" request @@ -1045,6 +1307,20 @@ Feature: Feature Flags When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:ddoghq/feature-flags + Scenario: Unarchive a feature flag returns "Conflict - The flag is not archived or a conflicting suggestion is pending." response + Given new "UnarchiveFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict - The flag is not archived or a conflicting suggestion is pending. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Unarchive a feature flag returns "Created - Approval is required. A suggestion was created and the change has not been applied." response + Given new "UnarchiveFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. + @skip @team:ddoghq/feature-flags Scenario: Unarchive a feature flag returns "Not Found" response Given new "UnarchiveFeatureFlag" request @@ -1068,6 +1344,22 @@ Feature: Feature Flags When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:ddoghq/feature-flags + Scenario: Update a feature flag returns "Conflict - A feature flag with this name already exists, a distribution channel suggestion is pending, or a pending experiment request or running approved experiment uses this flag." response + Given new "UpdateFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description for feature flag XYZ789", "distribution_channel": "ALL", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "name": "Updated Feature Flag XYZ789", "staleness_status": "PERMANENT", "tags": ["team:feature-flagging"]}, "type": "feature-flags"}} + When the request is sent + Then the response status is 409 Conflict - A feature flag with this name already exists, a distribution channel suggestion is pending, or a pending experiment request or running approved experiment uses this flag. + + @generated @skip @team:ddoghq/feature-flags + Scenario: Update a feature flag returns "Created - A distribution channel suggestion was created because approval is required. No flag fields were updated." response + Given new "UpdateFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description for feature flag XYZ789", "distribution_channel": "ALL", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "name": "Updated Feature Flag XYZ789", "staleness_status": "PERMANENT", "tags": ["team:feature-flagging"]}, "type": "feature-flags"}} + When the request is sent + Then the response status is 201 Created - A distribution channel suggestion was created because approval is required. No flag fields were updated. + @skip @team:ddoghq/feature-flags Scenario: Update a feature flag returns "Not Found" response Given new "UpdateFeatureFlag" request @@ -1105,6 +1397,15 @@ Feature: Feature Flags When the request is sent Then the response status is 409 Conflict - A pending suggestion already exists for this property. + @generated @skip @team:ddoghq/feature-flags + Scenario: Update a variant returns "Created - Approval is required. A suggestion was created and the change has not been applied." response + Given new "UpdateVariantForFeatureFlag" request + And request contains "feature_flag_id" parameter from "REPLACE.ME" + And request contains "variant_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Variant ABC123 Updated", "value": "new_value"}, "id": "550e8400-e29b-41d4-a716-446655440002", "type": "variants"}} + When the request is sent + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. + @generated @skip @team:ddoghq/feature-flags Scenario: Update a variant returns "Not Found" response Given new "UpdateVariantForFeatureFlag" request @@ -1160,31 +1461,33 @@ Feature: Feature Flags Then the response status is 200 OK @generated @skip @team:ddoghq/feature-flags - Scenario: Update targeting rules for a flag returns "Accepted - Approval required for this change" response + Scenario: Update targeting rules for a flag returns "Bad Request" response Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent - Then the response status is 202 Accepted - Approval required for this change + Then the response status is 400 Bad Request @generated @skip @team:ddoghq/feature-flags - Scenario: Update targeting rules for a flag returns "Bad Request" response + Scenario: Update targeting rules for a flag returns "Conflict - A conflicting suggestion is pending or the allocation update conflicts with the current configuration." response Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent - Then the response status is 400 Bad Request + Then the response status is 409 Conflict - A conflicting suggestion is pending or the allocation update conflicts with the current configuration. - @generated @skip @team:ddoghq/feature-flags - Scenario: Update targeting rules for a flag returns "Conflict" response + @skip @team:ddoghq/feature-flags + Scenario: Update targeting rules for a flag returns "Created - Approval is required. A suggestion was created and the change has not been applied." response Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent - Then the response status is 409 Conflict + Then the response status is 201 Created - Approval is required. A suggestion was created and the change has not been applied. + And the response "data.type" is equal to "flag-suggestions" + And the response "data.attributes.lifecycle_status" is equal to "pending" @generated @skip @team:ddoghq/feature-flags Scenario: Update targeting rules for a flag returns "Not Found" response diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index d92af14e39..ae4fa97c5c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3312,6 +3312,36 @@ "type": "idempotent" } }, + "DeleteFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "type": "idempotent" + } + }, + "GetFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "type": "safe" + } + }, + "ApplyFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "type": "unsafe" + } + }, + "ApproveFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "type": "unsafe" + } + }, + "RejectFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "type": "unsafe" + } + }, "GetFeatureFlag": { "tag": "Feature Flags", "undo": { @@ -3361,6 +3391,25 @@ "type": "idempotent" } }, + "UpdateFeatureFlagApprovals": { + "tag": "Feature Flags", + "undo": { + "type": "idempotent" + } + }, + "CreateFlagSuggestion": { + "tag": "Feature Flags", + "undo": { + "operationId": "DeleteFlagSuggestion", + "parameters": [ + { + "name": "suggestion_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "UnarchiveFeatureFlag": { "tag": "Feature Flags", "undo": {