From d9f2245a54a655aafb6dd54f1fe35fe007549b29 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 29 Oct 2026 01:36:05 +0000 Subject: [PATCH] Regenerate client from commit db7a996 of spec repo --- .generator/schemas/v2/openapi.yaml | 556 ++++++++++++++++++ .../feature-flags/ExportFeatureFlagHistory.py | 13 + .../feature-flags/ListFeatureFlagHistory.py | 15 + .../v2/api/feature_flags_api.py | 259 ++++++++ .../v2/model/feature_flag_change_event.py | 57 ++ .../model/feature_flag_change_event_action.py | 62 ++ .../feature_flag_change_event_attributes.py | 160 +++++ ...ature_flag_change_event_creation_source.py | 40 ++ .../feature_flag_change_event_environment.py | 48 ++ .../model/feature_flag_change_event_flag.py | 46 ++ .../feature_flag_change_event_property.py | 80 +++ ...hange_event_suggestion_lifecycle_status.py | 47 ++ ...ure_flag_change_event_suggestion_review.py | 89 +++ ...ure_flag_change_event_suggestion_status.py | 41 ++ .../model/feature_flag_change_event_type.py | 35 ++ .../feature_flag_history_pagination_meta.py | 46 ++ ...ature_flag_history_pagination_meta_page.py | 98 +++ .../list_feature_flag_history_response.py | 66 +++ src/datadog_api_client/v2/models/__init__.py | 34 ++ tests/v2/features/feature_flags.feature | 24 + tests/v2/features/undo.json | 12 + 21 files changed, 1828 insertions(+) create mode 100644 examples/v2/feature-flags/ExportFeatureFlagHistory.py create mode 100644 examples/v2/feature-flags/ListFeatureFlagHistory.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_action.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_attributes.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_creation_source.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_environment.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_flag.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_property.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_lifecycle_status.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_review.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_status.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_change_event_type.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_history_pagination_meta.py create mode 100644 src/datadog_api_client/v2/model/feature_flag_history_pagination_meta_page.py create mode 100644 src/datadog_api_client/v2/model/list_feature_flag_history_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bf9ea4d591..2de34ce5d2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2348,6 +2348,82 @@ components: example: "550e8400-e29b-41d4-a716-446655440010" format: uuid type: string + feature_flag_history_end_date: + description: Only include changes made before this time, for example `2026-02-01T00:00:00Z`. Omit for no upper bound. Must be after `start_date` when both are set. + in: query + name: end_date + required: false + schema: + example: "2026-02-01T00:00:00Z" + format: date-time + type: string + feature_flag_history_environment_id: + description: Only include changes to this environment. Changes to the flag itself, which have no environment, are always included. + in: query + name: environment_id + required: false + schema: + example: "550e8400-e29b-41d4-a716-446655440001" + format: uuid + type: string + feature_flag_history_feature_flag_id: + description: Only include changes to this feature flag. + in: query + name: feature_flag_id + required: false + schema: + example: "550e8400-e29b-41d4-a716-446655440000" + format: uuid + type: string + feature_flag_history_include_suggestion_events: + description: |- + Also include review events for change requests that needed approval: rejected requests and requests still pending review. Applies only to organizations with flag approvals enabled. + in: query + name: include_suggestion_events + required: false + schema: + default: false + example: false + type: boolean + feature_flag_history_start_date: + description: Only include changes made after this time, for example `2026-01-01T00:00:00Z`. Omit for no lower bound. + in: query + name: start_date + required: false + schema: + example: "2026-01-01T00:00:00Z" + format: date-time + type: string + feature_flag_history_tags: + description: |- + Only include changes to flags that have all of these exact tags, as repeated parameters, such as `tags=env:prod&tags=tier:1`. Values of the form `team:` match any selected team and are combined with `teams`. Empty values are ignored. + example: + - env:prod + - tier:1 + explode: true + in: query + name: tags + required: false + schema: + items: + type: string + type: array + style: form + feature_flag_history_teams: + description: |- + Only include changes to flags that belong to at least one of these teams. Use team handles without the `team:` prefix, as repeated parameters, such as `teams=checkout&teams=payments`. Handles from `teams` and `team:` values from `tags` are treated as one set. Handles that are empty, have surrounding white space, or include the `team:` prefix return a `400 Bad Request` error. + example: + - checkout + - payments + explode: true + in: query + name: teams + required: false + schema: + items: + type: string + type: array + style: form feature_flag_id: description: The ID of the feature flag. in: path @@ -50411,6 +50487,259 @@ components: - value_type - variants type: object + FeatureFlagChangeEvent: + description: A change made to a feature flag. + properties: + attributes: + $ref: "#/components/schemas/FeatureFlagChangeEventAttributes" + id: + description: The ID of the change event. + example: "550e8400-e29b-41d4-a716-446655440005" + format: uuid + type: string + type: + $ref: "#/components/schemas/FeatureFlagChangeEventType" + required: + - id + - type + - attributes + type: object + FeatureFlagChangeEventAction: + description: The kind of change. + enum: + - created + - updated + - deleted + - archived + - unarchived + - scheduled + - started + - paused + - unpaused + - stopped + example: "updated" + type: string + x-enum-varnames: + - CREATED + - UPDATED + - DELETED + - ARCHIVED + - UNARCHIVED + - SCHEDULED + - STARTED + - PAUSED + - UNPAUSED + - STOPPED + FeatureFlagChangeEventAttributes: + description: Attributes of a feature flag change event. + properties: + action: + $ref: "#/components/schemas/FeatureFlagChangeEventAction" + change_metadata: + description: Additional details about the change, as a JSON-encoded string. + example: '{"variant_key": "control"}' + nullable: true + type: string + creation_source: + $ref: "#/components/schemas/FeatureFlagChangeEventCreationSource" + description: + description: A readable sentence describing the change, as shown on the flag history page and in the Action column of the CSV export. + example: 'Changed flag name from "Mobile Feature Rollout" to "Mobile Feature Toggle".' + type: string + environment: + $ref: "#/components/schemas/FeatureFlagChangeEventEnvironment" + feature_flag: + $ref: "#/components/schemas/FeatureFlagChangeEventFlag" + new_value: + description: The value after the change, serialized as a string. + example: "Mobile Feature Toggle" + nullable: true + type: string + previous_value: + description: The value before the change, serialized as a string. + example: "Mobile Feature Rollout" + nullable: true + type: string + property: + $ref: "#/components/schemas/FeatureFlagChangeEventProperty" + suggestion_review: + $ref: "#/components/schemas/FeatureFlagChangeEventSuggestionReview" + timestamp: + description: When the change was made. + example: "2023-10-02T14:30:00Z" + format: date-time + type: string + user_id: + description: The ID of the user who made the change. Null when no user made the change. + example: "00000000-0000-0000-0000-000000000001" + nullable: true + type: string + version_number: + description: The version of the feature flag the change produced. + example: 3 + format: int64 + type: integer + required: + - action + - property + - timestamp + - version_number + - feature_flag + type: object + FeatureFlagChangeEventCreationSource: + description: "Where the change was made: `UI` for the Datadog app, or `MCP` for a Model Context Protocol (MCP) client." + enum: + - UI + - MCP + example: "UI" + nullable: true + type: string + x-enum-varnames: + - UI + - MCP + FeatureFlagChangeEventEnvironment: + description: The environment the change applies to. Null for a change to the flag itself rather than to one environment. + nullable: true + properties: + id: + description: The ID of the environment. + example: "550e8400-e29b-41d4-a716-446655440001" + format: uuid + type: string + is_production: + description: Whether the environment is a production environment. + example: true + type: boolean + name: + description: The name of the environment. + example: "Production" + type: string + required: + - id + - name + - is_production + type: object + FeatureFlagChangeEventFlag: + description: The feature flag the change applies to. + properties: + id: + description: The ID of the feature flag. + example: "550e8400-e29b-41d4-a716-446655440000" + format: uuid + type: string + key: + description: The key of the feature flag. + example: "mobile-feature-toggle" + type: string + name: + description: The name of the feature flag. + example: "Mobile Feature Toggle" + type: string + required: + - id + - name + - key + type: object + FeatureFlagChangeEventProperty: + description: The part of the feature flag the change applies to. + enum: + - FLAG + - FLAG_NAME + - FLAG_DESCRIPTION + - JSON_SCHEMA + - DISTRIBUTION_CHANNEL + - REQUIRE_APPROVAL + - VARIANT + - VARIANT_NAME + - VARIANT_VALUE + - ALLOCATIONS + - ROLLOUT + - ENVIRONMENT_STATUS + - DEFAULT_VARIANT + - OVERRIDE_VARIANT + - STALENESS_STATUS + - SAVED_FILTER + example: "FLAG_NAME" + type: string + x-enum-varnames: + - FLAG + - FLAG_NAME + - FLAG_DESCRIPTION + - JSON_SCHEMA + - DISTRIBUTION_CHANNEL + - REQUIRE_APPROVAL + - VARIANT + - VARIANT_NAME + - VARIANT_VALUE + - ALLOCATIONS + - ROLLOUT + - ENVIRONMENT_STATUS + - DEFAULT_VARIANT + - OVERRIDE_VARIANT + - STALENESS_STATUS + - SAVED_FILTER + FeatureFlagChangeEventSuggestionLifecycleStatus: + description: Where the change request is in its lifecycle. + enum: + - pending + - approved + - applied + - rejected + - discarded + example: "rejected" + type: string + x-enum-varnames: + - PENDING + - APPROVED + - APPLIED + - REJECTED + - DISCARDED + FeatureFlagChangeEventSuggestionReview: + description: |- + Review details of a change request that needed approval. + Present on review events, which `include_suggestion_events` adds. + Also present on a change that an approved change request applied, even when `include_suggestion_events` is `false`. + properties: + lifecycle_status: + $ref: "#/components/schemas/FeatureFlagChangeEventSuggestionLifecycleStatus" + requester_comment: + description: The comment left by the person who requested the change. + example: "Ready for production." + type: string + reviewer_comment: + description: The comment left by the reviewer. + example: "Roll out to staging first." + type: string + status: + $ref: "#/components/schemas/FeatureFlagChangeEventSuggestionStatus" + suggestion_created_by: + description: The ID of the user who requested the change. + example: "00000000-0000-0000-0000-000000000001" + type: string + required: + - status + - lifecycle_status + type: object + FeatureFlagChangeEventSuggestionStatus: + description: The review status of the change request. + enum: + - pending + - approved + - rejected + example: "rejected" + type: string + x-enum-varnames: + - PENDING + - APPROVED + - REJECTED + FeatureFlagChangeEventType: + description: The resource type. + enum: + - "change-events" + example: "change-events" + type: string + x-enum-varnames: + - CHANGE_EVENTS FeatureFlagDistributionChannel: description: The distribution channel for the feature flag. enum: @@ -50554,6 +50883,60 @@ components: - environment_id - status type: object + FeatureFlagHistoryPaginationMeta: + description: Pagination metadata for feature flag change history. + properties: + page: + $ref: "#/components/schemas/FeatureFlagHistoryPaginationMetaPage" + type: object + FeatureFlagHistoryPaginationMetaPage: + description: Pagination metadata for feature flag change history responses. + properties: + first_offset: + description: Offset of the first page. + example: 0 + format: int64 + type: integer + last_offset: + description: Offset of the last page. + example: 75 + format: int64 + nullable: true + type: integer + limit: + description: Maximum number of events returned on this page. + example: 25 + format: int64 + type: integer + next_offset: + description: Offset of the next page, or null when there is no next page. + example: 25 + format: int64 + nullable: true + type: integer + offset: + description: Number of matching events skipped before this page. + example: 0 + format: int64 + type: integer + prev_offset: + description: Offset of the previous page, or null when there is no previous page. + example: 0 + format: int64 + nullable: true + type: integer + total: + description: |- + Total number of events matching the filters, independent of the page size. + It counts experiment proposals that you cannot read, which are left out of the pages, so a page can hold fewer events than `limit`. + example: 100 + format: int64 + type: integer + type: + description: The pagination method. Always `offset_limit`. + example: offset_limit + type: string + type: object FeatureFlagListItem: description: A feature flag resource for list responses. properties: @@ -76929,6 +77312,21 @@ components: required: - data type: object + ListFeatureFlagHistoryResponse: + description: Response containing feature flag change events, newest first. + properties: + data: + description: The change events. + items: + $ref: "#/components/schemas/FeatureFlagChangeEvent" + type: array + links: + $ref: "#/components/schemas/FeatureFlagsPaginationLinks" + meta: + $ref: "#/components/schemas/FeatureFlagHistoryPaginationMeta" + required: + - data + type: object ListFeatureFlagsResponse: description: Response containing a list of feature flags. properties: @@ -175910,6 +176308,164 @@ paths: operator: AND permissions: - feature_flag_config_write + /api/v2/feature-flags/history: + get: + description: |- + Returns the organization's feature flag change events, newest first. + Each event includes a readable description of the change. + All filters are optional, and events must match every filter you set. Without a date range, the whole history is listed. + Results are paginated with `page[limit]` and `page[offset]`; follow `links.next` to read further back. + operationId: ListFeatureFlagHistory + parameters: + - $ref: "#/components/parameters/feature_flag_history_start_date" + - $ref: "#/components/parameters/feature_flag_history_end_date" + - $ref: "#/components/parameters/feature_flag_history_teams" + - $ref: "#/components/parameters/feature_flag_history_tags" + - $ref: "#/components/parameters/feature_flag_history_feature_flag_id" + - $ref: "#/components/parameters/feature_flag_history_environment_id" + - $ref: "#/components/parameters/feature_flag_history_include_suggestion_events" + - description: Maximum number of events to return. Defaults to `25`. Values above `50` return `50` events. Non-positive or empty values use the default. A non-integer value returns a `400 Bad Request` error. + example: 25 + in: query + name: page[limit] + schema: + default: 25 + format: int64 + maximum: 50 + minimum: 1 + type: integer + - description: Number of matching events to skip before returning results. Defaults to `0`. Negative or empty values are set to `0`. A non-integer value returns a `400 Bad Request` error. + example: 0 + in: query + name: page[offset] + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: "updated" + change_metadata: + creation_source: "UI" + description: 'Changed flag name from "Mobile Feature Rollout" to "Mobile Feature Toggle".' + environment: + feature_flag: + id: "550e8400-e29b-41d4-a716-446655440000" + key: "mobile-feature-toggle" + name: "Mobile Feature Toggle" + new_value: "Mobile Feature Toggle" + previous_value: "Mobile Feature Rollout" + property: "FLAG_NAME" + timestamp: "2023-10-02T14:30:00Z" + user_id: "00000000-0000-0000-0000-000000000001" + version_number: 3 + id: "550e8400-e29b-41d4-a716-446655440005" + type: "change-events" + links: + first: "https://api.datadoghq.com/api/v2/feature-flags/history?page%5Blimit%5D=25&page%5Boffset%5D=0" + last: "https://api.datadoghq.com/api/v2/feature-flags/history?page%5Blimit%5D=25&page%5Boffset%5D=0" + self: "https://api.datadoghq.com/api/v2/feature-flags/history?page%5Blimit%5D=25&page%5Boffset%5D=0" + meta: + page: + first_offset: 0 + last_offset: 0 + limit: 25 + offset: 0 + total: 1 + type: offset_limit + schema: + $ref: "#/components/schemas/ListFeatureFlagHistoryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_read + summary: List feature flag change history + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_read + /api/v2/feature-flags/history/export: + get: + description: |- + Exports the organization's feature flag change events as a CSV file, newest first, without pagination. + It accepts the same filters as the List feature flag change history endpoint, and its columns match the CSV export on the flag history page: + Flag Version, Flag Name, Flag Key, Flag UUID, Action, User Name, User Email, User Type, Environment, and Timestamp. + + If an export fails before the file starts, the response is a JSON:API error. Large exports stream as they are read. + If an export fails after streaming starts, the connection closes before the file ends, so the download fails instead of + returning a file with missing rows. An export must finish within the 60-second request timeout. If an export times out, + narrow the date range. + operationId: ExportFeatureFlagHistory + parameters: + - $ref: "#/components/parameters/feature_flag_history_start_date" + - $ref: "#/components/parameters/feature_flag_history_end_date" + - $ref: "#/components/parameters/feature_flag_history_teams" + - $ref: "#/components/parameters/feature_flag_history_tags" + - $ref: "#/components/parameters/feature_flag_history_feature_flag_id" + - $ref: "#/components/parameters/feature_flag_history_environment_id" + - $ref: "#/components/parameters/feature_flag_history_include_suggestion_events" + responses: + "200": + content: + text/csv: + examples: + default: + value: "Flag Version,Flag Name,Flag Key,Flag UUID,Action,User Name,User Email,User Type,Environment,Timestamp\n3,Mobile Feature Toggle,mobile-feature-toggle,550e8400-e29b-41d4-a716-446655440000,\"Changed flag name from \"\"Mobile Feature Rollout\"\" to \"\"Mobile Feature Toggle\"\".\",Jane Doe,jane.doe@example.com,User,All,\"Mon, Oct 2, 2023, 2:30:00 pm UTC\"" + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_read + summary: Export feature flag change history + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_read /api/v2/feature-flags/saved-filters/{saved_filter_id}: get: description: |- diff --git a/examples/v2/feature-flags/ExportFeatureFlagHistory.py b/examples/v2/feature-flags/ExportFeatureFlagHistory.py new file mode 100644 index 0000000000..1f1b4d30ba --- /dev/null +++ b/examples/v2/feature-flags/ExportFeatureFlagHistory.py @@ -0,0 +1,13 @@ +""" +Export feature flag change history 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 + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.export_feature_flag_history() diff --git a/examples/v2/feature-flags/ListFeatureFlagHistory.py b/examples/v2/feature-flags/ListFeatureFlagHistory.py new file mode 100644 index 0000000000..9eb2b0671d --- /dev/null +++ b/examples/v2/feature-flags/ListFeatureFlagHistory.py @@ -0,0 +1,15 @@ +""" +List feature flag change history 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 + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = FeatureFlagsApi(api_client) + response = api_instance.list_feature_flag_history() + + 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 6ce4aec7bb..82c6298ddd 100644 --- a/src/datadog_api_client/v2/api/feature_flags_api.py +++ b/src/datadog_api_client/v2/api/feature_flags_api.py @@ -8,6 +8,7 @@ from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration from datadog_api_client.model_utils import ( + datetime, UnsetType, unset, UUID, @@ -24,6 +25,7 @@ from datadog_api_client.v2.model.create_environment_request import CreateEnvironmentRequest from datadog_api_client.v2.model.update_environment_request import UpdateEnvironmentRequest from datadog_api_client.v2.model.allocation_exposure_schedule_response import AllocationExposureScheduleResponse +from datadog_api_client.v2.model.list_feature_flag_history_response import ListFeatureFlagHistoryResponse 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.update_feature_flag_request import UpdateFeatureFlagRequest @@ -277,6 +279,60 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._export_feature_flag_history_endpoint = _Endpoint( + settings={ + "response_type": (str,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/history/export", + "operation_id": "export_feature_flag_history", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "start_date": { + "openapi_types": (datetime,), + "attribute": "start_date", + "location": "query", + }, + "end_date": { + "openapi_types": (datetime,), + "attribute": "end_date", + "location": "query", + }, + "teams": { + "openapi_types": ([str],), + "attribute": "teams", + "location": "query", + "collection_format": "multi", + }, + "tags": { + "openapi_types": ([str],), + "attribute": "tags", + "location": "query", + "collection_format": "multi", + }, + "feature_flag_id": { + "openapi_types": (UUID,), + "attribute": "feature_flag_id", + "location": "query", + }, + "environment_id": { + "openapi_types": (UUID,), + "attribute": "environment_id", + "location": "query", + }, + "include_suggestion_events": { + "openapi_types": (bool,), + "attribute": "include_suggestion_events", + "location": "query", + }, + }, + headers_map={ + "accept": ["text/csv", "application/json"], + }, + api_client=api_client, + ) + self._get_feature_flag_endpoint = _Endpoint( settings={ "response_type": (FeatureFlagResponse,), @@ -346,6 +402,77 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_feature_flag_history_endpoint = _Endpoint( + settings={ + "response_type": (ListFeatureFlagHistoryResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/feature-flags/history", + "operation_id": "list_feature_flag_history", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "start_date": { + "openapi_types": (datetime,), + "attribute": "start_date", + "location": "query", + }, + "end_date": { + "openapi_types": (datetime,), + "attribute": "end_date", + "location": "query", + }, + "teams": { + "openapi_types": ([str],), + "attribute": "teams", + "location": "query", + "collection_format": "multi", + }, + "tags": { + "openapi_types": ([str],), + "attribute": "tags", + "location": "query", + "collection_format": "multi", + }, + "feature_flag_id": { + "openapi_types": (UUID,), + "attribute": "feature_flag_id", + "location": "query", + }, + "environment_id": { + "openapi_types": (UUID,), + "attribute": "environment_id", + "location": "query", + }, + "include_suggestion_events": { + "openapi_types": (bool,), + "attribute": "include_suggestion_events", + "location": "query", + }, + "page_limit": { + "validation": { + "inclusive_maximum": 50, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_offset": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_feature_flags_endpoint = _Endpoint( settings={ "response_type": (ListFeatureFlagsResponse,), @@ -962,6 +1089,68 @@ def enable_feature_flag_environment( return self._enable_feature_flag_environment_endpoint.call_with_http_info(**kwargs) + def export_feature_flag_history( + self, + *, + start_date: Union[datetime, UnsetType] = unset, + end_date: Union[datetime, UnsetType] = unset, + teams: Union[List[str], UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + feature_flag_id: Union[UUID, UnsetType] = unset, + environment_id: Union[UUID, UnsetType] = unset, + include_suggestion_events: Union[bool, UnsetType] = unset, + ) -> str: + """Export feature flag change history. + + Exports the organization's feature flag change events as a CSV file, newest first, without pagination. + It accepts the same filters as the List feature flag change history endpoint, and its columns match the CSV export on the flag history page: + Flag Version, Flag Name, Flag Key, Flag UUID, Action, User Name, User Email, User Type, Environment, and Timestamp. + + If an export fails before the file starts, the response is a JSON:API error. Large exports stream as they are read. + If an export fails after streaming starts, the connection closes before the file ends, so the download fails instead of + returning a file with missing rows. An export must finish within the 60-second request timeout. If an export times out, + narrow the date range. + + :param start_date: Only include changes made after this time, for example ``2026-01-01T00:00:00Z``. Omit for no lower bound. + :type start_date: datetime, optional + :param end_date: Only include changes made before this time, for example ``2026-02-01T00:00:00Z``. Omit for no upper bound. Must be after ``start_date`` when both are set. + :type end_date: datetime, optional + :param teams: Only include changes to flags that belong to at least one of these teams. Use team handles without the ``team:`` prefix, as repeated parameters, such as ``teams=checkout&teams=payments``. Handles from ``teams`` and ``team:`` values from ``tags`` are treated as one set. Handles that are empty, have surrounding white space, or include the ``team:`` prefix return a ``400 Bad Request`` error. + :type teams: [str], optional + :param tags: Only include changes to flags that have all of these exact tags, as repeated parameters, such as ``tags=env:prod&tags=tier:1``. Values of the form ``team:`` match any selected team and are combined with ``teams``. Empty values are ignored. + :type tags: [str], optional + :param feature_flag_id: Only include changes to this feature flag. + :type feature_flag_id: UUID, optional + :param environment_id: Only include changes to this environment. Changes to the flag itself, which have no environment, are always included. + :type environment_id: UUID, optional + :param include_suggestion_events: Also include review events for change requests that needed approval: rejected requests and requests still pending review. Applies only to organizations with flag approvals enabled. + :type include_suggestion_events: bool, optional + :rtype: str + """ + kwargs: Dict[str, Any] = {} + if start_date is not unset: + kwargs["start_date"] = start_date + + if end_date is not unset: + kwargs["end_date"] = end_date + + if teams is not unset: + kwargs["teams"] = teams + + if tags is not unset: + kwargs["tags"] = tags + + if feature_flag_id is not unset: + kwargs["feature_flag_id"] = feature_flag_id + + if environment_id is not unset: + kwargs["environment_id"] = environment_id + + if include_suggestion_events is not unset: + kwargs["include_suggestion_events"] = include_suggestion_events + + return self._export_feature_flag_history_endpoint.call_with_http_info(**kwargs) + def get_feature_flag( self, feature_flag_id: UUID, @@ -1018,6 +1207,76 @@ def get_saved_filter( return self._get_saved_filter_endpoint.call_with_http_info(**kwargs) + def list_feature_flag_history( + self, + *, + start_date: Union[datetime, UnsetType] = unset, + end_date: Union[datetime, UnsetType] = unset, + teams: Union[List[str], UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + feature_flag_id: Union[UUID, UnsetType] = unset, + environment_id: Union[UUID, UnsetType] = unset, + include_suggestion_events: Union[bool, UnsetType] = unset, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + ) -> ListFeatureFlagHistoryResponse: + """List feature flag change history. + + Returns the organization's feature flag change events, newest first. + Each event includes a readable description of the change. + All filters are optional, and events must match every filter you set. Without a date range, the whole history is listed. + Results are paginated with ``page[limit]`` and ``page[offset]`` ; follow ``links.next`` to read further back. + + :param start_date: Only include changes made after this time, for example ``2026-01-01T00:00:00Z``. Omit for no lower bound. + :type start_date: datetime, optional + :param end_date: Only include changes made before this time, for example ``2026-02-01T00:00:00Z``. Omit for no upper bound. Must be after ``start_date`` when both are set. + :type end_date: datetime, optional + :param teams: Only include changes to flags that belong to at least one of these teams. Use team handles without the ``team:`` prefix, as repeated parameters, such as ``teams=checkout&teams=payments``. Handles from ``teams`` and ``team:`` values from ``tags`` are treated as one set. Handles that are empty, have surrounding white space, or include the ``team:`` prefix return a ``400 Bad Request`` error. + :type teams: [str], optional + :param tags: Only include changes to flags that have all of these exact tags, as repeated parameters, such as ``tags=env:prod&tags=tier:1``. Values of the form ``team:`` match any selected team and are combined with ``teams``. Empty values are ignored. + :type tags: [str], optional + :param feature_flag_id: Only include changes to this feature flag. + :type feature_flag_id: UUID, optional + :param environment_id: Only include changes to this environment. Changes to the flag itself, which have no environment, are always included. + :type environment_id: UUID, optional + :param include_suggestion_events: Also include review events for change requests that needed approval: rejected requests and requests still pending review. Applies only to organizations with flag approvals enabled. + :type include_suggestion_events: bool, optional + :param page_limit: Maximum number of events to return. Defaults to ``25``. Values above ``50`` return ``50`` events. Non-positive or empty values use the default. A non-integer value returns a ``400 Bad Request`` error. + :type page_limit: int, optional + :param page_offset: Number of matching events to skip before returning results. Defaults to ``0``. Negative or empty values are set to ``0``. A non-integer value returns a ``400 Bad Request`` error. + :type page_offset: int, optional + :rtype: ListFeatureFlagHistoryResponse + """ + kwargs: Dict[str, Any] = {} + if start_date is not unset: + kwargs["start_date"] = start_date + + if end_date is not unset: + kwargs["end_date"] = end_date + + if teams is not unset: + kwargs["teams"] = teams + + if tags is not unset: + kwargs["tags"] = tags + + if feature_flag_id is not unset: + kwargs["feature_flag_id"] = feature_flag_id + + if environment_id is not unset: + kwargs["environment_id"] = environment_id + + if include_suggestion_events is not unset: + kwargs["include_suggestion_events"] = include_suggestion_events + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + return self._list_feature_flag_history_endpoint.call_with_http_info(**kwargs) + def list_feature_flags( self, *, diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event.py b/src/datadog_api_client/v2/model/feature_flag_change_event.py new file mode 100644 index 0000000000..d9b878cc48 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event.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_change_event_attributes import FeatureFlagChangeEventAttributes + from datadog_api_client.v2.model.feature_flag_change_event_type import FeatureFlagChangeEventType + + +class FeatureFlagChangeEvent(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_change_event_attributes import FeatureFlagChangeEventAttributes + from datadog_api_client.v2.model.feature_flag_change_event_type import FeatureFlagChangeEventType + + return { + "attributes": (FeatureFlagChangeEventAttributes,), + "id": (UUID,), + "type": (FeatureFlagChangeEventType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: FeatureFlagChangeEventAttributes, id: UUID, type: FeatureFlagChangeEventType, **kwargs + ): + """ + A change made to a feature flag. + + :param attributes: Attributes of a feature flag change event. + :type attributes: FeatureFlagChangeEventAttributes + + :param id: The ID of the change event. + :type id: UUID + + :param type: The resource type. + :type type: FeatureFlagChangeEventType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_action.py b/src/datadog_api_client/v2/model/feature_flag_change_event_action.py new file mode 100644 index 0000000000..85c13dd0f1 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_action.py @@ -0,0 +1,62 @@ +# 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 FeatureFlagChangeEventAction(ModelSimple): + """ + The kind of change. + + :param value: Must be one of ["created", "updated", "deleted", "archived", "unarchived", "scheduled", "started", "paused", "unpaused", "stopped"]. + :type value: str + """ + + allowed_values = { + "created", + "updated", + "deleted", + "archived", + "unarchived", + "scheduled", + "started", + "paused", + "unpaused", + "stopped", + } + CREATED: ClassVar["FeatureFlagChangeEventAction"] + UPDATED: ClassVar["FeatureFlagChangeEventAction"] + DELETED: ClassVar["FeatureFlagChangeEventAction"] + ARCHIVED: ClassVar["FeatureFlagChangeEventAction"] + UNARCHIVED: ClassVar["FeatureFlagChangeEventAction"] + SCHEDULED: ClassVar["FeatureFlagChangeEventAction"] + STARTED: ClassVar["FeatureFlagChangeEventAction"] + PAUSED: ClassVar["FeatureFlagChangeEventAction"] + UNPAUSED: ClassVar["FeatureFlagChangeEventAction"] + STOPPED: ClassVar["FeatureFlagChangeEventAction"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventAction.CREATED = FeatureFlagChangeEventAction("created") +FeatureFlagChangeEventAction.UPDATED = FeatureFlagChangeEventAction("updated") +FeatureFlagChangeEventAction.DELETED = FeatureFlagChangeEventAction("deleted") +FeatureFlagChangeEventAction.ARCHIVED = FeatureFlagChangeEventAction("archived") +FeatureFlagChangeEventAction.UNARCHIVED = FeatureFlagChangeEventAction("unarchived") +FeatureFlagChangeEventAction.SCHEDULED = FeatureFlagChangeEventAction("scheduled") +FeatureFlagChangeEventAction.STARTED = FeatureFlagChangeEventAction("started") +FeatureFlagChangeEventAction.PAUSED = FeatureFlagChangeEventAction("paused") +FeatureFlagChangeEventAction.UNPAUSED = FeatureFlagChangeEventAction("unpaused") +FeatureFlagChangeEventAction.STOPPED = FeatureFlagChangeEventAction("stopped") diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_attributes.py b/src/datadog_api_client/v2/model/feature_flag_change_event_attributes.py new file mode 100644 index 0000000000..6b8e08a3c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_attributes.py @@ -0,0 +1,160 @@ +# 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, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_change_event_action import FeatureFlagChangeEventAction + from datadog_api_client.v2.model.feature_flag_change_event_creation_source import ( + FeatureFlagChangeEventCreationSource, + ) + from datadog_api_client.v2.model.feature_flag_change_event_environment import FeatureFlagChangeEventEnvironment + from datadog_api_client.v2.model.feature_flag_change_event_flag import FeatureFlagChangeEventFlag + from datadog_api_client.v2.model.feature_flag_change_event_property import FeatureFlagChangeEventProperty + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_review import ( + FeatureFlagChangeEventSuggestionReview, + ) + + +class FeatureFlagChangeEventAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_change_event_action import FeatureFlagChangeEventAction + from datadog_api_client.v2.model.feature_flag_change_event_creation_source import ( + FeatureFlagChangeEventCreationSource, + ) + from datadog_api_client.v2.model.feature_flag_change_event_environment import FeatureFlagChangeEventEnvironment + from datadog_api_client.v2.model.feature_flag_change_event_flag import FeatureFlagChangeEventFlag + from datadog_api_client.v2.model.feature_flag_change_event_property import FeatureFlagChangeEventProperty + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_review import ( + FeatureFlagChangeEventSuggestionReview, + ) + + return { + "action": (FeatureFlagChangeEventAction,), + "change_metadata": (str, none_type), + "creation_source": (FeatureFlagChangeEventCreationSource,), + "description": (str,), + "environment": (FeatureFlagChangeEventEnvironment,), + "feature_flag": (FeatureFlagChangeEventFlag,), + "new_value": (str, none_type), + "previous_value": (str, none_type), + "_property": (FeatureFlagChangeEventProperty,), + "suggestion_review": (FeatureFlagChangeEventSuggestionReview,), + "timestamp": (datetime,), + "user_id": (str, none_type), + "version_number": (int,), + } + + attribute_map = { + "action": "action", + "change_metadata": "change_metadata", + "creation_source": "creation_source", + "description": "description", + "environment": "environment", + "feature_flag": "feature_flag", + "new_value": "new_value", + "previous_value": "previous_value", + "_property": "property", + "suggestion_review": "suggestion_review", + "timestamp": "timestamp", + "user_id": "user_id", + "version_number": "version_number", + } + + def __init__( + self_, + action: FeatureFlagChangeEventAction, + feature_flag: FeatureFlagChangeEventFlag, + _property: FeatureFlagChangeEventProperty, + timestamp: datetime, + version_number: int, + change_metadata: Union[str, none_type, UnsetType] = unset, + creation_source: Union[FeatureFlagChangeEventCreationSource, none_type, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + environment: Union[FeatureFlagChangeEventEnvironment, none_type, UnsetType] = unset, + new_value: Union[str, none_type, UnsetType] = unset, + previous_value: Union[str, none_type, UnsetType] = unset, + suggestion_review: Union[FeatureFlagChangeEventSuggestionReview, UnsetType] = unset, + user_id: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a feature flag change event. + + :param action: The kind of change. + :type action: FeatureFlagChangeEventAction + + :param change_metadata: Additional details about the change, as a JSON-encoded string. + :type change_metadata: str, none_type, optional + + :param creation_source: Where the change was made: ``UI`` for the Datadog app, or ``MCP`` for a Model Context Protocol (MCP) client. + :type creation_source: FeatureFlagChangeEventCreationSource, none_type, optional + + :param description: A readable sentence describing the change, as shown on the flag history page and in the Action column of the CSV export. + :type description: str, optional + + :param environment: The environment the change applies to. Null for a change to the flag itself rather than to one environment. + :type environment: FeatureFlagChangeEventEnvironment, none_type, optional + + :param feature_flag: The feature flag the change applies to. + :type feature_flag: FeatureFlagChangeEventFlag + + :param new_value: The value after the change, serialized as a string. + :type new_value: str, none_type, optional + + :param previous_value: The value before the change, serialized as a string. + :type previous_value: str, none_type, optional + + :param _property: The part of the feature flag the change applies to. + :type _property: FeatureFlagChangeEventProperty + + :param suggestion_review: Review details of a change request that needed approval. + Present on review events, which ``include_suggestion_events`` adds. + Also present on a change that an approved change request applied, even when ``include_suggestion_events`` is ``false``. + :type suggestion_review: FeatureFlagChangeEventSuggestionReview, optional + + :param timestamp: When the change was made. + :type timestamp: datetime + + :param user_id: The ID of the user who made the change. Null when no user made the change. + :type user_id: str, none_type, optional + + :param version_number: The version of the feature flag the change produced. + :type version_number: int + """ + if change_metadata is not unset: + kwargs["change_metadata"] = change_metadata + if creation_source is not unset: + kwargs["creation_source"] = creation_source + if description is not unset: + kwargs["description"] = description + if environment is not unset: + kwargs["environment"] = environment + if new_value is not unset: + kwargs["new_value"] = new_value + if previous_value is not unset: + kwargs["previous_value"] = previous_value + if suggestion_review is not unset: + kwargs["suggestion_review"] = suggestion_review + if user_id is not unset: + kwargs["user_id"] = user_id + super().__init__(kwargs) + + self_.action = action + self_.feature_flag = feature_flag + self_._property = _property + self_.timestamp = timestamp + self_.version_number = version_number diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_creation_source.py b/src/datadog_api_client/v2/model/feature_flag_change_event_creation_source.py new file mode 100644 index 0000000000..39520f302a --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_creation_source.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FeatureFlagChangeEventCreationSource(ModelSimple): + """ + Where the change was made: `UI` for the Datadog app, or `MCP` for a Model Context Protocol (MCP) client. + + :param value: Must be one of ["UI", "MCP"]. + :type value: str + """ + + allowed_values = { + "UI", + "MCP", + } + UI: ClassVar["FeatureFlagChangeEventCreationSource"] + MCP: ClassVar["FeatureFlagChangeEventCreationSource"] + + _nullable = True + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventCreationSource.UI = FeatureFlagChangeEventCreationSource("UI") +FeatureFlagChangeEventCreationSource.MCP = FeatureFlagChangeEventCreationSource("MCP") diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_environment.py b/src/datadog_api_client/v2/model/feature_flag_change_event_environment.py new file mode 100644 index 0000000000..a89c79c904 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_environment.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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class FeatureFlagChangeEventEnvironment(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + return { + "id": (UUID,), + "is_production": (bool,), + "name": (str,), + } + + attribute_map = { + "id": "id", + "is_production": "is_production", + "name": "name", + } + + def __init__(self_, id: UUID, is_production: bool, name: str, **kwargs): + """ + The environment the change applies to. Null for a change to the flag itself rather than to one environment. + + :param id: The ID of the environment. + :type id: UUID + + :param is_production: Whether the environment is a production environment. + :type is_production: bool + + :param name: The name of the environment. + :type name: str + """ + super().__init__(kwargs) + + self_.id = id + self_.is_production = is_production + self_.name = name diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_flag.py b/src/datadog_api_client/v2/model/feature_flag_change_event_flag.py new file mode 100644 index 0000000000..2a253903d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_flag.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 FeatureFlagChangeEventFlag(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (UUID,), + "key": (str,), + "name": (str,), + } + + attribute_map = { + "id": "id", + "key": "key", + "name": "name", + } + + def __init__(self_, id: UUID, key: str, name: str, **kwargs): + """ + The feature flag the change applies to. + + :param id: The ID of the feature flag. + :type id: UUID + + :param key: The key of the feature flag. + :type key: str + + :param name: The name of the feature flag. + :type name: str + """ + super().__init__(kwargs) + + self_.id = id + self_.key = key + self_.name = name diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_property.py b/src/datadog_api_client/v2/model/feature_flag_change_event_property.py new file mode 100644 index 0000000000..d1f427db95 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_property.py @@ -0,0 +1,80 @@ +# 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 FeatureFlagChangeEventProperty(ModelSimple): + """ + The part of the feature flag the change applies to. + + :param value: Must be one of ["FLAG", "FLAG_NAME", "FLAG_DESCRIPTION", "JSON_SCHEMA", "DISTRIBUTION_CHANNEL", "REQUIRE_APPROVAL", "VARIANT", "VARIANT_NAME", "VARIANT_VALUE", "ALLOCATIONS", "ROLLOUT", "ENVIRONMENT_STATUS", "DEFAULT_VARIANT", "OVERRIDE_VARIANT", "STALENESS_STATUS", "SAVED_FILTER"]. + :type value: str + """ + + allowed_values = { + "FLAG", + "FLAG_NAME", + "FLAG_DESCRIPTION", + "JSON_SCHEMA", + "DISTRIBUTION_CHANNEL", + "REQUIRE_APPROVAL", + "VARIANT", + "VARIANT_NAME", + "VARIANT_VALUE", + "ALLOCATIONS", + "ROLLOUT", + "ENVIRONMENT_STATUS", + "DEFAULT_VARIANT", + "OVERRIDE_VARIANT", + "STALENESS_STATUS", + "SAVED_FILTER", + } + FLAG: ClassVar["FeatureFlagChangeEventProperty"] + FLAG_NAME: ClassVar["FeatureFlagChangeEventProperty"] + FLAG_DESCRIPTION: ClassVar["FeatureFlagChangeEventProperty"] + JSON_SCHEMA: ClassVar["FeatureFlagChangeEventProperty"] + DISTRIBUTION_CHANNEL: ClassVar["FeatureFlagChangeEventProperty"] + REQUIRE_APPROVAL: ClassVar["FeatureFlagChangeEventProperty"] + VARIANT: ClassVar["FeatureFlagChangeEventProperty"] + VARIANT_NAME: ClassVar["FeatureFlagChangeEventProperty"] + VARIANT_VALUE: ClassVar["FeatureFlagChangeEventProperty"] + ALLOCATIONS: ClassVar["FeatureFlagChangeEventProperty"] + ROLLOUT: ClassVar["FeatureFlagChangeEventProperty"] + ENVIRONMENT_STATUS: ClassVar["FeatureFlagChangeEventProperty"] + DEFAULT_VARIANT: ClassVar["FeatureFlagChangeEventProperty"] + OVERRIDE_VARIANT: ClassVar["FeatureFlagChangeEventProperty"] + STALENESS_STATUS: ClassVar["FeatureFlagChangeEventProperty"] + SAVED_FILTER: ClassVar["FeatureFlagChangeEventProperty"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventProperty.FLAG = FeatureFlagChangeEventProperty("FLAG") +FeatureFlagChangeEventProperty.FLAG_NAME = FeatureFlagChangeEventProperty("FLAG_NAME") +FeatureFlagChangeEventProperty.FLAG_DESCRIPTION = FeatureFlagChangeEventProperty("FLAG_DESCRIPTION") +FeatureFlagChangeEventProperty.JSON_SCHEMA = FeatureFlagChangeEventProperty("JSON_SCHEMA") +FeatureFlagChangeEventProperty.DISTRIBUTION_CHANNEL = FeatureFlagChangeEventProperty("DISTRIBUTION_CHANNEL") +FeatureFlagChangeEventProperty.REQUIRE_APPROVAL = FeatureFlagChangeEventProperty("REQUIRE_APPROVAL") +FeatureFlagChangeEventProperty.VARIANT = FeatureFlagChangeEventProperty("VARIANT") +FeatureFlagChangeEventProperty.VARIANT_NAME = FeatureFlagChangeEventProperty("VARIANT_NAME") +FeatureFlagChangeEventProperty.VARIANT_VALUE = FeatureFlagChangeEventProperty("VARIANT_VALUE") +FeatureFlagChangeEventProperty.ALLOCATIONS = FeatureFlagChangeEventProperty("ALLOCATIONS") +FeatureFlagChangeEventProperty.ROLLOUT = FeatureFlagChangeEventProperty("ROLLOUT") +FeatureFlagChangeEventProperty.ENVIRONMENT_STATUS = FeatureFlagChangeEventProperty("ENVIRONMENT_STATUS") +FeatureFlagChangeEventProperty.DEFAULT_VARIANT = FeatureFlagChangeEventProperty("DEFAULT_VARIANT") +FeatureFlagChangeEventProperty.OVERRIDE_VARIANT = FeatureFlagChangeEventProperty("OVERRIDE_VARIANT") +FeatureFlagChangeEventProperty.STALENESS_STATUS = FeatureFlagChangeEventProperty("STALENESS_STATUS") +FeatureFlagChangeEventProperty.SAVED_FILTER = FeatureFlagChangeEventProperty("SAVED_FILTER") diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_lifecycle_status.py b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_lifecycle_status.py new file mode 100644 index 0000000000..ef61d81fa1 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_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 FeatureFlagChangeEventSuggestionLifecycleStatus(ModelSimple): + """ + Where the change request is in its lifecycle. + + :param value: Must be one of ["pending", "approved", "applied", "rejected", "discarded"]. + :type value: str + """ + + allowed_values = { + "pending", + "approved", + "applied", + "rejected", + "discarded", + } + PENDING: ClassVar["FeatureFlagChangeEventSuggestionLifecycleStatus"] + APPROVED: ClassVar["FeatureFlagChangeEventSuggestionLifecycleStatus"] + APPLIED: ClassVar["FeatureFlagChangeEventSuggestionLifecycleStatus"] + REJECTED: ClassVar["FeatureFlagChangeEventSuggestionLifecycleStatus"] + DISCARDED: ClassVar["FeatureFlagChangeEventSuggestionLifecycleStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventSuggestionLifecycleStatus.PENDING = FeatureFlagChangeEventSuggestionLifecycleStatus("pending") +FeatureFlagChangeEventSuggestionLifecycleStatus.APPROVED = FeatureFlagChangeEventSuggestionLifecycleStatus("approved") +FeatureFlagChangeEventSuggestionLifecycleStatus.APPLIED = FeatureFlagChangeEventSuggestionLifecycleStatus("applied") +FeatureFlagChangeEventSuggestionLifecycleStatus.REJECTED = FeatureFlagChangeEventSuggestionLifecycleStatus("rejected") +FeatureFlagChangeEventSuggestionLifecycleStatus.DISCARDED = FeatureFlagChangeEventSuggestionLifecycleStatus("discarded") diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_review.py b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_review.py new file mode 100644 index 0000000000..25c435977d --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_review.py @@ -0,0 +1,89 @@ +# 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, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_lifecycle_status import ( + FeatureFlagChangeEventSuggestionLifecycleStatus, + ) + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_status import ( + FeatureFlagChangeEventSuggestionStatus, + ) + + +class FeatureFlagChangeEventSuggestionReview(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_lifecycle_status import ( + FeatureFlagChangeEventSuggestionLifecycleStatus, + ) + from datadog_api_client.v2.model.feature_flag_change_event_suggestion_status import ( + FeatureFlagChangeEventSuggestionStatus, + ) + + return { + "lifecycle_status": (FeatureFlagChangeEventSuggestionLifecycleStatus,), + "requester_comment": (str,), + "reviewer_comment": (str,), + "status": (FeatureFlagChangeEventSuggestionStatus,), + "suggestion_created_by": (str,), + } + + attribute_map = { + "lifecycle_status": "lifecycle_status", + "requester_comment": "requester_comment", + "reviewer_comment": "reviewer_comment", + "status": "status", + "suggestion_created_by": "suggestion_created_by", + } + + def __init__( + self_, + lifecycle_status: FeatureFlagChangeEventSuggestionLifecycleStatus, + status: FeatureFlagChangeEventSuggestionStatus, + requester_comment: Union[str, UnsetType] = unset, + reviewer_comment: Union[str, UnsetType] = unset, + suggestion_created_by: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Review details of a change request that needed approval. + Present on review events, which ``include_suggestion_events`` adds. + Also present on a change that an approved change request applied, even when ``include_suggestion_events`` is ``false``. + + :param lifecycle_status: Where the change request is in its lifecycle. + :type lifecycle_status: FeatureFlagChangeEventSuggestionLifecycleStatus + + :param requester_comment: The comment left by the person who requested the change. + :type requester_comment: str, optional + + :param reviewer_comment: The comment left by the reviewer. + :type reviewer_comment: str, optional + + :param status: The review status of the change request. + :type status: FeatureFlagChangeEventSuggestionStatus + + :param suggestion_created_by: The ID of the user who requested the change. + :type suggestion_created_by: str, optional + """ + if requester_comment is not unset: + kwargs["requester_comment"] = requester_comment + if reviewer_comment is not unset: + kwargs["reviewer_comment"] = reviewer_comment + if suggestion_created_by is not unset: + kwargs["suggestion_created_by"] = suggestion_created_by + super().__init__(kwargs) + + self_.lifecycle_status = lifecycle_status + self_.status = status diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_status.py b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_status.py new file mode 100644 index 0000000000..58b590e925 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_suggestion_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 FeatureFlagChangeEventSuggestionStatus(ModelSimple): + """ + The review status of the change request. + + :param value: Must be one of ["pending", "approved", "rejected"]. + :type value: str + """ + + allowed_values = { + "pending", + "approved", + "rejected", + } + PENDING: ClassVar["FeatureFlagChangeEventSuggestionStatus"] + APPROVED: ClassVar["FeatureFlagChangeEventSuggestionStatus"] + REJECTED: ClassVar["FeatureFlagChangeEventSuggestionStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventSuggestionStatus.PENDING = FeatureFlagChangeEventSuggestionStatus("pending") +FeatureFlagChangeEventSuggestionStatus.APPROVED = FeatureFlagChangeEventSuggestionStatus("approved") +FeatureFlagChangeEventSuggestionStatus.REJECTED = FeatureFlagChangeEventSuggestionStatus("rejected") diff --git a/src/datadog_api_client/v2/model/feature_flag_change_event_type.py b/src/datadog_api_client/v2/model/feature_flag_change_event_type.py new file mode 100644 index 0000000000..05180636c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_change_event_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 FeatureFlagChangeEventType(ModelSimple): + """ + The resource type. + + :param value: If omitted defaults to "change-events". Must be one of ["change-events"]. + :type value: str + """ + + allowed_values = { + "change-events", + } + CHANGE_EVENTS: ClassVar["FeatureFlagChangeEventType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FeatureFlagChangeEventType.CHANGE_EVENTS = FeatureFlagChangeEventType("change-events") diff --git a/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta.py b/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta.py new file mode 100644 index 0000000000..3c8856e65b --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta.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 typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_history_pagination_meta_page import ( + FeatureFlagHistoryPaginationMetaPage, + ) + + +class FeatureFlagHistoryPaginationMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_history_pagination_meta_page import ( + FeatureFlagHistoryPaginationMetaPage, + ) + + return { + "page": (FeatureFlagHistoryPaginationMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[FeatureFlagHistoryPaginationMetaPage, UnsetType] = unset, **kwargs): + """ + Pagination metadata for feature flag change history. + + :param page: Pagination metadata for feature flag change history responses. + :type page: FeatureFlagHistoryPaginationMetaPage, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta_page.py b/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta_page.py new file mode 100644 index 0000000000..2fe45d86fa --- /dev/null +++ b/src/datadog_api_client/v2/model/feature_flag_history_pagination_meta_page.py @@ -0,0 +1,98 @@ +# 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, + none_type, + unset, + UnsetType, +) + + +class FeatureFlagHistoryPaginationMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first_offset": (int,), + "last_offset": (int, none_type), + "limit": (int,), + "next_offset": (int, none_type), + "offset": (int,), + "prev_offset": (int, none_type), + "total": (int,), + "type": (str,), + } + + attribute_map = { + "first_offset": "first_offset", + "last_offset": "last_offset", + "limit": "limit", + "next_offset": "next_offset", + "offset": "offset", + "prev_offset": "prev_offset", + "total": "total", + "type": "type", + } + + def __init__( + self_, + first_offset: Union[int, UnsetType] = unset, + last_offset: Union[int, none_type, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + next_offset: Union[int, none_type, UnsetType] = unset, + offset: Union[int, UnsetType] = unset, + prev_offset: Union[int, none_type, UnsetType] = unset, + total: Union[int, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Pagination metadata for feature flag change history responses. + + :param first_offset: Offset of the first page. + :type first_offset: int, optional + + :param last_offset: Offset of the last page. + :type last_offset: int, none_type, optional + + :param limit: Maximum number of events returned on this page. + :type limit: int, optional + + :param next_offset: Offset of the next page, or null when there is no next page. + :type next_offset: int, none_type, optional + + :param offset: Number of matching events skipped before this page. + :type offset: int, optional + + :param prev_offset: Offset of the previous page, or null when there is no previous page. + :type prev_offset: int, none_type, optional + + :param total: Total number of events matching the filters, independent of the page size. + It counts experiment proposals that you cannot read, which are left out of the pages, so a page can hold fewer events than ``limit``. + :type total: int, optional + + :param type: The pagination method. Always ``offset_limit``. + :type type: str, optional + """ + if first_offset is not unset: + kwargs["first_offset"] = first_offset + if last_offset is not unset: + kwargs["last_offset"] = last_offset + if limit is not unset: + kwargs["limit"] = limit + if next_offset is not unset: + kwargs["next_offset"] = next_offset + if offset is not unset: + kwargs["offset"] = offset + if prev_offset is not unset: + kwargs["prev_offset"] = prev_offset + if total is not unset: + kwargs["total"] = total + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_feature_flag_history_response.py b/src/datadog_api_client/v2/model/list_feature_flag_history_response.py new file mode 100644 index 0000000000..4b2d6c7dd3 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_feature_flag_history_response.py @@ -0,0 +1,66 @@ +# 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, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.feature_flag_change_event import FeatureFlagChangeEvent + from datadog_api_client.v2.model.feature_flags_pagination_links import FeatureFlagsPaginationLinks + from datadog_api_client.v2.model.feature_flag_history_pagination_meta import FeatureFlagHistoryPaginationMeta + + +class ListFeatureFlagHistoryResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.feature_flag_change_event import FeatureFlagChangeEvent + from datadog_api_client.v2.model.feature_flags_pagination_links import FeatureFlagsPaginationLinks + from datadog_api_client.v2.model.feature_flag_history_pagination_meta import FeatureFlagHistoryPaginationMeta + + return { + "data": ([FeatureFlagChangeEvent],), + "links": (FeatureFlagsPaginationLinks,), + "meta": (FeatureFlagHistoryPaginationMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[FeatureFlagChangeEvent], + links: Union[FeatureFlagsPaginationLinks, UnsetType] = unset, + meta: Union[FeatureFlagHistoryPaginationMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response containing feature flag change events, newest first. + + :param data: The change events. + :type data: [FeatureFlagChangeEvent] + + :param links: 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. + :type links: FeatureFlagsPaginationLinks, optional + + :param meta: Pagination metadata for feature flag change history. + :type meta: FeatureFlagHistoryPaginationMeta, optional + """ + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 5ab9014f0b..0fc9b426a0 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4016,9 +4016,28 @@ 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_attributes import FeatureFlagAttributes +from datadog_api_client.v2.model.feature_flag_change_event import FeatureFlagChangeEvent +from datadog_api_client.v2.model.feature_flag_change_event_action import FeatureFlagChangeEventAction +from datadog_api_client.v2.model.feature_flag_change_event_attributes import FeatureFlagChangeEventAttributes +from datadog_api_client.v2.model.feature_flag_change_event_creation_source import FeatureFlagChangeEventCreationSource +from datadog_api_client.v2.model.feature_flag_change_event_environment import FeatureFlagChangeEventEnvironment +from datadog_api_client.v2.model.feature_flag_change_event_flag import FeatureFlagChangeEventFlag +from datadog_api_client.v2.model.feature_flag_change_event_property import FeatureFlagChangeEventProperty +from datadog_api_client.v2.model.feature_flag_change_event_suggestion_lifecycle_status import ( + FeatureFlagChangeEventSuggestionLifecycleStatus, +) +from datadog_api_client.v2.model.feature_flag_change_event_suggestion_review import ( + FeatureFlagChangeEventSuggestionReview, +) +from datadog_api_client.v2.model.feature_flag_change_event_suggestion_status import ( + FeatureFlagChangeEventSuggestionStatus, +) +from datadog_api_client.v2.model.feature_flag_change_event_type import FeatureFlagChangeEventType from datadog_api_client.v2.model.feature_flag_distribution_channel import FeatureFlagDistributionChannel from datadog_api_client.v2.model.feature_flag_environment import FeatureFlagEnvironment from datadog_api_client.v2.model.feature_flag_environment_list_item import FeatureFlagEnvironmentListItem +from datadog_api_client.v2.model.feature_flag_history_pagination_meta import FeatureFlagHistoryPaginationMeta +from datadog_api_client.v2.model.feature_flag_history_pagination_meta_page import FeatureFlagHistoryPaginationMetaPage from datadog_api_client.v2.model.feature_flag_list_item import FeatureFlagListItem from datadog_api_client.v2.model.feature_flag_list_item_attributes import FeatureFlagListItemAttributes from datadog_api_client.v2.model.feature_flag_production_status import FeatureFlagProductionStatus @@ -6142,6 +6161,7 @@ from datadog_api_client.v2.model.list_entity_catalog_response_included_item import ListEntityCatalogResponseIncludedItem from datadog_api_client.v2.model.list_entity_catalog_response_links import ListEntityCatalogResponseLinks from datadog_api_client.v2.model.list_environments_response import ListEnvironmentsResponse +from datadog_api_client.v2.model.list_feature_flag_history_response import ListFeatureFlagHistoryResponse from datadog_api_client.v2.model.list_feature_flags_response import ListFeatureFlagsResponse from datadog_api_client.v2.model.list_findings_meta import ListFindingsMeta from datadog_api_client.v2.model.list_findings_page import ListFindingsPage @@ -15764,9 +15784,22 @@ "FastlyServicesResponse", "FeatureFlag", "FeatureFlagAttributes", + "FeatureFlagChangeEvent", + "FeatureFlagChangeEventAction", + "FeatureFlagChangeEventAttributes", + "FeatureFlagChangeEventCreationSource", + "FeatureFlagChangeEventEnvironment", + "FeatureFlagChangeEventFlag", + "FeatureFlagChangeEventProperty", + "FeatureFlagChangeEventSuggestionLifecycleStatus", + "FeatureFlagChangeEventSuggestionReview", + "FeatureFlagChangeEventSuggestionStatus", + "FeatureFlagChangeEventType", "FeatureFlagDistributionChannel", "FeatureFlagEnvironment", "FeatureFlagEnvironmentListItem", + "FeatureFlagHistoryPaginationMeta", + "FeatureFlagHistoryPaginationMetaPage", "FeatureFlagListItem", "FeatureFlagListItemAttributes", "FeatureFlagProductionStatus", @@ -17340,6 +17373,7 @@ "ListEntityCatalogResponseIncludedItem", "ListEntityCatalogResponseLinks", "ListEnvironmentsResponse", + "ListFeatureFlagHistoryResponse", "ListFeatureFlagsResponse", "ListFindingsMeta", "ListFindingsPage", diff --git a/tests/v2/features/feature_flags.feature b/tests/v2/features/feature_flags.feature index c2a82ad284..c8ac74f56a 100644 --- a/tests/v2/features/feature_flags.feature +++ b/tests/v2/features/feature_flags.feature @@ -269,6 +269,18 @@ Feature: Feature Flags When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags + Scenario: Export feature flag change history returns "Bad Request" response + Given new "ExportFeatureFlagHistory" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/feature-flags + Scenario: Export feature flag change history returns "OK" response + Given new "ExportFeatureFlagHistory" request + When the request is sent + Then the response status is 200 OK + @skip @team:ddoghq/feature-flags Scenario: Get a feature flag returns "Not Found" response Given new "GetFeatureFlag" request @@ -360,6 +372,18 @@ Feature: Feature Flags When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/feature-flags + Scenario: List feature flag change history returns "Bad Request" response + Given new "ListFeatureFlagHistory" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/feature-flags + Scenario: List feature flag change history returns "OK" response + Given new "ListFeatureFlagHistory" request + When the request is sent + Then the response status is 200 OK + @team:ddoghq/feature-flags Scenario: List feature flags applies default pagination Given new "ListFeatureFlags" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 559ffe28c2..89bfd970d0 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3221,6 +3221,18 @@ "type": "idempotent" } }, + "ListFeatureFlagHistory": { + "tag": "Feature Flags", + "undo": { + "type": "safe" + } + }, + "ExportFeatureFlagHistory": { + "tag": "Feature Flags", + "undo": { + "type": "safe" + } + }, "GetSavedFilter": { "tag": "Feature Flags", "undo": {