From 627f2ea0511dda9441c21c0a54274911d6eba5cb Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 30 Apr 2026 09:19:08 +0000 Subject: [PATCH] Regenerate client from commit 618c06f of spec repo --- .generator/schemas/v2/openapi.yaml | 297 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 98 ++++++ .../GetPermanentRetentionFilter.py | 16 + .../ListPermanentRetentionFilters.py | 15 + .../UpdatePermanentRetentionFilter.py | 38 +++ .../rum_retention_filters_permanent_api.py | 179 +++++++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../rum_permanent_cross_product_sampling.py | 55 ++++ ...nent_cross_product_sampling_editability.py | 36 +++ ...permanent_cross_product_sampling_update.py | 45 +++ ...m_permanent_retention_filter_attributes.py | 113 +++++++ .../rum_permanent_retention_filter_data.py | 78 +++++ ...m_permanent_retention_filter_event_type.py | 56 ++++ .../rum_permanent_retention_filter_meta.py | 66 ++++ ..._permanent_retention_filter_meta_source.py | 41 +++ ...rum_permanent_retention_filter_response.py | 42 +++ .../rum_permanent_retention_filter_type.py | 37 +++ ...nent_retention_filter_update_attributes.py | 49 +++ ..._permanent_retention_filter_update_data.py | 64 ++++ ...rmanent_retention_filter_update_request.py | 44 +++ ...um_permanent_retention_filters_response.py | 42 +++ src/datadog_api_client/v2/models/__init__.py | 36 +++ ...n_filter_returns_not_found_response.frozen | 1 + ...ion_filter_returns_not_found_response.yaml | 20 ++ ...etention_filter_returns_ok_response.frozen | 1 + ..._retention_filter_returns_ok_response.yaml | 19 ++ ...tention_filters_returns_ok_response.frozen | 1 + ...retention_filters_returns_ok_response.yaml | 20 ++ ...filter_returns_bad_request_response.frozen | 1 + ...n_filter_returns_bad_request_response.yaml | 21 ++ ..._request_response_for_unknown_rf_id.frozen | 1 + ...ad_request_response_for_unknown_rf_id.yaml | 20 ++ ...ion_filter_returns_updated_response.frozen | 1 + ...ntion_filter_returns_updated_response.yaml | 21 ++ .../rum_retention_filters_permanent.feature | 73 +++++ tests/v2/features/undo.json | 18 ++ 37 files changed, 1674 insertions(+) create mode 100644 examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.py create mode 100644 examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.py create mode 100644 examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.py create mode 100644 src/datadog_api_client/v2/api/rum_retention_filters_permanent_api.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_editability.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_update.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_attributes.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_data.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_event_type.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta_source.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_response.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_type.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_data.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_request.py create mode 100644 src/datadog_api_client/v2/model/rum_permanent_retention_filters_response.py create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.yaml create mode 100644 tests/v2/features/rum_retention_filters_permanent.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e5175c1dc6..de92d869f2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1350,6 +1350,20 @@ components: required: true schema: type: string + RumPermanentRetentionFilterApplicationIDParameter: + description: RUM application ID. + in: path + name: app_id + required: true + schema: + type: string + RumPermanentRetentionFilterIDParameter: + description: Permanent retention filter ID. + in: path + name: rf_id + required: true + schema: + type: string RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -60288,6 +60302,197 @@ components: $ref: "#/components/schemas/RumMetricResponseData" type: array type: object + RumPermanentCrossProductSampling: + description: Cross-product retention settings for a permanent retention filter. + properties: + trace_enabled: + description: Indicates whether Trace cross-product retention is active. Read-only. + example: true + type: boolean + trace_sample_rate: + description: Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + example: 25.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumPermanentCrossProductSamplingEditability: + description: Flags indicating which `cross_product_sampling` rates can be updated for this filter. Read-only. + properties: + trace_sample_rate: + description: If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. + example: true + type: boolean + type: object + RumPermanentCrossProductSamplingUpdate: + description: |- + Partial update of the cross-product sample rates for a permanent retention filter. + Only rates with a matching `cross_product_sampling_editability` flag set to `true` can be updated. + properties: + trace_sample_rate: + description: |- + Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + Omit to leave unchanged. Rejected if the filter's `cross_product_sampling_editability.trace_sample_rate` is `false`. + example: 25.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumPermanentRetentionFilterAttributes: + description: The attributes of a permanent retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumPermanentCrossProductSampling" + cross_product_sampling_editability: + $ref: "#/components/schemas/RumPermanentCrossProductSamplingEditability" + enabled: + $ref: "#/components/schemas/RumPermanentRetentionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumPermanentRetentionFilterEventType" + name: + $ref: "#/components/schemas/RumPermanentRetentionFilterName" + query: + $ref: "#/components/schemas/RumPermanentRetentionFilterQuery" + sample_rate: + $ref: "#/components/schemas/RumPermanentRetentionFilterSampleRate" + type: object + RumPermanentRetentionFilterData: + description: A permanent retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + meta: + $ref: "#/components/schemas/RumPermanentRetentionFilterMeta" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + type: object + RumPermanentRetentionFilterEnabled: + description: Indicates whether the permanent retention filter is active. Read-only. + example: true + type: boolean + RumPermanentRetentionFilterEventType: + description: The type of RUM events the filter applies to. Read-only. + enum: + - session + - view + - action + - error + - resource + - long_task + - vital + - operation + example: "session" + type: string + x-enum-varnames: + - SESSION + - VIEW + - ACTION + - ERROR + - RESOURCE + - LONG_TASK + - VITAL + - OPERATION + RumPermanentRetentionFilterID: + description: Permanent retention filter ID. + example: "4b95d361-f65d-4515-9824-c9aaeba5ac2a" + type: string + RumPermanentRetentionFilterMeta: + description: Metadata about the permanent retention filter. + properties: + source: + $ref: "#/components/schemas/RumPermanentRetentionFilterMetaSource" + updated_at: + description: Unix epoch (in milliseconds) of the last update. + example: 1735689600000 + format: int64 + type: integer + updated_by_handle: + description: Handle of the user who last updated the filter. + example: "jane.doe@example.com" + type: string + type: object + RumPermanentRetentionFilterMetaSource: + description: The source of the last update to a permanent retention filter. + enum: + - default + - ui + - terraform + example: "default" + type: string + x-enum-varnames: + - DEFAULT + - UI + - TERRAFORM + RumPermanentRetentionFilterName: + description: The name of a permanent retention filter. Read-only. + example: "Preconfigured permanent retention filter" + type: string + RumPermanentRetentionFilterQuery: + description: The query string for a permanent retention filter. Read-only. + example: "@type:session" + type: string + RumPermanentRetentionFilterResponse: + description: A permanent retention filter response body. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: object + RumPermanentRetentionFilterSampleRate: + description: The retention sample rate for a permanent retention filter, from 0 to 100. Read-only. + example: 100.0 + format: double + maximum: 100 + minimum: 0 + type: number + RumPermanentRetentionFilterType: + default: permanent_retention_filters + description: The resource type. The value must be `permanent_retention_filters`. + enum: + - permanent_retention_filters + example: permanent_retention_filters + type: string + x-enum-varnames: ["PERMANENT_RETENTION_FILTERS"] + RumPermanentRetentionFilterUpdateAttributes: + description: The attributes of a permanent retention filter that can be updated. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumPermanentCrossProductSamplingUpdate" + type: object + RumPermanentRetentionFilterUpdateData: + description: The permanent retention filter properties to update. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumPermanentRetentionFilterUpdateRequest: + description: The permanent retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateData" + required: + - data + type: object + RumPermanentRetentionFiltersResponse: + description: All permanent retention filters for a RUM application. + properties: + data: + description: A list of RUM permanent retention filters. + items: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: array + type: object RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -117003,6 +117208,95 @@ paths: operator: OR permissions: - rum_apps_write + /api/v2/rum/applications/{app_id}/permanent_retention_filters: + get: + description: Get the list of permanent retention filters for a RUM application. + operationId: ListPermanentRetentionFilters + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all permanent retention filters + tags: + - Rum Retention Filters Permanent + /api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}: + get: + description: Get a single permanent retention filter for a RUM application. + operationId: GetPermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a permanent retention filter + tags: + - Rum Retention Filters Permanent + patch: + description: |- + Update the cross-product sample rates of a permanent retention filter for a RUM application. + Only `cross_product_sampling.trace_sample_rate` can be updated, + and only when the matching flag in `cross_product_sampling_editability` is `true` on the filter. + Any other field is read-only and cannot be sent in the payload. + Returns the updated permanent retention filter when the request is successful. + operationId: UpdatePermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_sample_rate: 25.0 + id: 4b95d361-f65d-4515-9824-c9aaeba5ac2a + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateRequest" + description: New cross-product sample rates for the permanent retention filter. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a permanent retention filter + tags: + - Rum Retention Filters Permanent + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/relationships/retention_filters: patch: description: |- @@ -135183,6 +135477,9 @@ tags: - description: |- Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters + - description: |- + Manage permanent retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) in RUM for your organization. + name: Rum Retention Filters Permanent - description: |- API to create and update scorecard rules and outcomes. See [Scorecards](https://docs.datadoghq.com/service_catalog/scorecards) for more information. name: Scorecards diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index cbf7b505b3..2562b3528d 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -613,6 +613,13 @@ datadog\_api\_client.v2.api.rum\_retention\_filters\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.rum\_retention\_filters\_permanent\_api module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.rum_retention_filters_permanent_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.scorecards\_api module -------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index bb0817ad6d..cd5cffcf38 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -26814,6 +26814,104 @@ datadog\_api\_client.v2.model.rum\_metrics\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.rum\_permanent\_cross\_product\_sampling module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_cross_product_sampling + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_cross\_product\_sampling\_editability module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_permanent_cross_product_sampling_editability + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_cross\_product\_sampling\_update module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_cross_product_sampling_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_event\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_event_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_meta module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_meta\_source module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_meta_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_response module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_update\_attributes module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_update\_data module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filter\_update\_request module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filter_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_permanent\_retention\_filters\_response module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_permanent_retention_filters_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_product\_analytics\_retention\_scale module ------------------------------------------------------------------------------ diff --git a/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.py b/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.py new file mode 100644 index 0000000000..d3cc6ffced --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.py @@ -0,0 +1,16 @@ +""" +Get a permanent retention filter returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_permanent_api import RumRetentionFiltersPermanentApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersPermanentApi(api_client) + response = api_instance.get_permanent_retention_filter( + app_id="a33671aa-24fd-4dcd-ba4b-5bbdbafe7690", + rf_id="default_synthetics", + ) + + print(response) diff --git a/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.py b/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.py new file mode 100644 index 0000000000..466ca71ae1 --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.py @@ -0,0 +1,15 @@ +""" +Get all permanent retention filters returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_permanent_api import RumRetentionFiltersPermanentApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersPermanentApi(api_client) + response = api_instance.list_permanent_retention_filters( + app_id="1d4b9c34-7ac4-423a-91cf-9902d926e9b3", + ) + + print(response) diff --git a/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.py b/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.py new file mode 100644 index 0000000000..032ebbbc64 --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.py @@ -0,0 +1,38 @@ +""" +Update a permanent retention filter returns "Updated" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_permanent_api import RumRetentionFiltersPermanentApi +from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_update import ( + RumPermanentCrossProductSamplingUpdate, +) +from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_attributes import ( + RumPermanentRetentionFilterUpdateAttributes, +) +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_data import RumPermanentRetentionFilterUpdateData +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_request import ( + RumPermanentRetentionFilterUpdateRequest, +) + +body = RumPermanentRetentionFilterUpdateRequest( + data=RumPermanentRetentionFilterUpdateData( + id="default_replays", + type=RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS, + attributes=RumPermanentRetentionFilterUpdateAttributes( + cross_product_sampling=RumPermanentCrossProductSamplingUpdate( + trace_sample_rate=100.0, + ), + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersPermanentApi(api_client) + response = api_instance.update_permanent_retention_filter( + app_id="a33671aa-24fd-4dcd-ba4b-5bbdbafe7690", rf_id="default_replays", body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/rum_retention_filters_permanent_api.py b/src/datadog_api_client/v2/api/rum_retention_filters_permanent_api.py new file mode 100644 index 0000000000..805ebdce01 --- /dev/null +++ b/src/datadog_api_client/v2/api/rum_retention_filters_permanent_api.py @@ -0,0 +1,179 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.rum_permanent_retention_filters_response import RumPermanentRetentionFiltersResponse +from datadog_api_client.v2.model.rum_permanent_retention_filter_response import RumPermanentRetentionFilterResponse +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_request import ( + RumPermanentRetentionFilterUpdateRequest, +) + + +class RumRetentionFiltersPermanentApi: + """ + Manage permanent retention filters through `Manage Applications `_ in RUM for your organization. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_permanent_retention_filter_endpoint = _Endpoint( + settings={ + "response_type": (RumPermanentRetentionFilterResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}", + "operation_id": "get_permanent_retention_filter", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "rf_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rf_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_permanent_retention_filters_endpoint = _Endpoint( + settings={ + "response_type": (RumPermanentRetentionFiltersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/permanent_retention_filters", + "operation_id": "list_permanent_retention_filters", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_permanent_retention_filter_endpoint = _Endpoint( + settings={ + "response_type": (RumPermanentRetentionFilterResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}", + "operation_id": "update_permanent_retention_filter", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "rf_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rf_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RumPermanentRetentionFilterUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def get_permanent_retention_filter( + self, + app_id: str, + rf_id: str, + ) -> RumPermanentRetentionFilterResponse: + """Get a permanent retention filter. + + Get a single permanent retention filter for a RUM application. + + :param app_id: RUM application ID. + :type app_id: str + :param rf_id: Permanent retention filter ID. + :type rf_id: str + :rtype: RumPermanentRetentionFilterResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["rf_id"] = rf_id + + return self._get_permanent_retention_filter_endpoint.call_with_http_info(**kwargs) + + def list_permanent_retention_filters( + self, + app_id: str, + ) -> RumPermanentRetentionFiltersResponse: + """Get all permanent retention filters. + + Get the list of permanent retention filters for a RUM application. + + :param app_id: RUM application ID. + :type app_id: str + :rtype: RumPermanentRetentionFiltersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + return self._list_permanent_retention_filters_endpoint.call_with_http_info(**kwargs) + + def update_permanent_retention_filter( + self, + app_id: str, + rf_id: str, + body: RumPermanentRetentionFilterUpdateRequest, + ) -> RumPermanentRetentionFilterResponse: + """Update a permanent retention filter. + + Update the cross-product sample rates of a permanent retention filter for a RUM application. + Only ``cross_product_sampling.trace_sample_rate`` can be updated, + and only when the matching flag in ``cross_product_sampling_editability`` is ``true`` on the filter. + Any other field is read-only and cannot be sent in the payload. + Returns the updated permanent retention filter when the request is successful. + + :param app_id: RUM application ID. + :type app_id: str + :param rf_id: Permanent retention filter ID. + :type rf_id: str + :param body: New cross-product sample rates for the permanent retention filter. + :type body: RumPermanentRetentionFilterUpdateRequest + :rtype: RumPermanentRetentionFilterResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["rf_id"] = rf_id + + kwargs["body"] = body + + return self._update_permanent_retention_filter_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 1cdb0b2c63..b66c391cba 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -85,6 +85,7 @@ from datadog_api_client.v2.api.rum_replay_sessions_api import RumReplaySessionsApi from datadog_api_client.v2.api.rum_replay_viewership_api import RumReplayViewershipApi from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi +from datadog_api_client.v2.api.rum_retention_filters_permanent_api import RumRetentionFiltersPermanentApi from datadog_api_client.v2.api.scorecards_api import ScorecardsApi from datadog_api_client.v2.api.seats_api import SeatsApi from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi @@ -196,6 +197,7 @@ "RumReplaySessionsApi", "RumReplayViewershipApi", "RumRetentionFiltersApi", + "RumRetentionFiltersPermanentApi", "ScorecardsApi", "SeatsApi", "SecurityMonitoringApi", diff --git a/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling.py b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling.py new file mode 100644 index 0000000000..38cf694643 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling.py @@ -0,0 +1,55 @@ +# 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 RumPermanentCrossProductSampling(ModelNormal): + validations = { + "trace_sample_rate": { + "inclusive_maximum": 100, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + return { + "trace_enabled": (bool,), + "trace_sample_rate": (float,), + } + + attribute_map = { + "trace_enabled": "trace_enabled", + "trace_sample_rate": "trace_sample_rate", + } + + def __init__( + self_, + trace_enabled: Union[bool, UnsetType] = unset, + trace_sample_rate: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + Cross-product retention settings for a permanent retention filter. + + :param trace_enabled: Indicates whether Trace cross-product retention is active. Read-only. + :type trace_enabled: bool, optional + + :param trace_sample_rate: Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + :type trace_sample_rate: float, optional + """ + if trace_enabled is not unset: + kwargs["trace_enabled"] = trace_enabled + if trace_sample_rate is not unset: + kwargs["trace_sample_rate"] = trace_sample_rate + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_editability.py b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_editability.py new file mode 100644 index 0000000000..28a6275ada --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_editability.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 RumPermanentCrossProductSamplingEditability(ModelNormal): + @cached_property + def openapi_types(_): + return { + "trace_sample_rate": (bool,), + } + + attribute_map = { + "trace_sample_rate": "trace_sample_rate", + } + + def __init__(self_, trace_sample_rate: Union[bool, UnsetType] = unset, **kwargs): + """ + Flags indicating which ``cross_product_sampling`` rates can be updated for this filter. Read-only. + + :param trace_sample_rate: If ``true`` , ``cross_product_sampling.trace_sample_rate`` can be updated on this filter. + :type trace_sample_rate: bool, optional + """ + if trace_sample_rate is not unset: + kwargs["trace_sample_rate"] = trace_sample_rate + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_update.py b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_update.py new file mode 100644 index 0000000000..80edd60820 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_cross_product_sampling_update.py @@ -0,0 +1,45 @@ +# 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 RumPermanentCrossProductSamplingUpdate(ModelNormal): + validations = { + "trace_sample_rate": { + "inclusive_maximum": 100, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + return { + "trace_sample_rate": (float,), + } + + attribute_map = { + "trace_sample_rate": "trace_sample_rate", + } + + def __init__(self_, trace_sample_rate: Union[float, UnsetType] = unset, **kwargs): + """ + Partial update of the cross-product sample rates for a permanent retention filter. + Only rates with a matching ``cross_product_sampling_editability`` flag set to ``true`` can be updated. + + :param trace_sample_rate: Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + Omit to leave unchanged. Rejected if the filter's ``cross_product_sampling_editability.trace_sample_rate`` is ``false``. + :type trace_sample_rate: float, optional + """ + if trace_sample_rate is not unset: + kwargs["trace_sample_rate"] = trace_sample_rate + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_attributes.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_attributes.py new file mode 100644 index 0000000000..eb6399a0f5 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_attributes.py @@ -0,0 +1,113 @@ +# 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.rum_permanent_cross_product_sampling import RumPermanentCrossProductSampling + from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_editability import ( + RumPermanentCrossProductSamplingEditability, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_event_type import ( + RumPermanentRetentionFilterEventType, + ) + + +class RumPermanentRetentionFilterAttributes(ModelNormal): + validations = { + "sample_rate": { + "inclusive_maximum": 100, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_cross_product_sampling import RumPermanentCrossProductSampling + from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_editability import ( + RumPermanentCrossProductSamplingEditability, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_event_type import ( + RumPermanentRetentionFilterEventType, + ) + + return { + "cross_product_sampling": (RumPermanentCrossProductSampling,), + "cross_product_sampling_editability": (RumPermanentCrossProductSamplingEditability,), + "enabled": (bool,), + "event_type": (RumPermanentRetentionFilterEventType,), + "name": (str,), + "query": (str,), + "sample_rate": (float,), + } + + attribute_map = { + "cross_product_sampling": "cross_product_sampling", + "cross_product_sampling_editability": "cross_product_sampling_editability", + "enabled": "enabled", + "event_type": "event_type", + "name": "name", + "query": "query", + "sample_rate": "sample_rate", + } + + def __init__( + self_, + cross_product_sampling: Union[RumPermanentCrossProductSampling, UnsetType] = unset, + cross_product_sampling_editability: Union[RumPermanentCrossProductSamplingEditability, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + event_type: Union[RumPermanentRetentionFilterEventType, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + sample_rate: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of a permanent retention filter. + + :param cross_product_sampling: Cross-product retention settings for a permanent retention filter. + :type cross_product_sampling: RumPermanentCrossProductSampling, optional + + :param cross_product_sampling_editability: Flags indicating which ``cross_product_sampling`` rates can be updated for this filter. Read-only. + :type cross_product_sampling_editability: RumPermanentCrossProductSamplingEditability, optional + + :param enabled: Indicates whether the permanent retention filter is active. Read-only. + :type enabled: bool, optional + + :param event_type: The type of RUM events the filter applies to. Read-only. + :type event_type: RumPermanentRetentionFilterEventType, optional + + :param name: The name of a permanent retention filter. Read-only. + :type name: str, optional + + :param query: The query string for a permanent retention filter. Read-only. + :type query: str, optional + + :param sample_rate: The retention sample rate for a permanent retention filter, from 0 to 100. Read-only. + :type sample_rate: float, optional + """ + if cross_product_sampling is not unset: + kwargs["cross_product_sampling"] = cross_product_sampling + if cross_product_sampling_editability is not unset: + kwargs["cross_product_sampling_editability"] = cross_product_sampling_editability + if enabled is not unset: + kwargs["enabled"] = enabled + if event_type is not unset: + kwargs["event_type"] = event_type + if name is not unset: + kwargs["name"] = name + if query is not unset: + kwargs["query"] = query + if sample_rate is not unset: + kwargs["sample_rate"] = sample_rate + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_data.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_data.py new file mode 100644 index 0000000000..9ffa4d835f --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_data.py @@ -0,0 +1,78 @@ +# 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.rum_permanent_retention_filter_attributes import ( + RumPermanentRetentionFilterAttributes, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_meta import RumPermanentRetentionFilterMeta + from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType + + +class RumPermanentRetentionFilterData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_attributes import ( + RumPermanentRetentionFilterAttributes, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_meta import RumPermanentRetentionFilterMeta + from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType + + return { + "attributes": (RumPermanentRetentionFilterAttributes,), + "id": (str,), + "meta": (RumPermanentRetentionFilterMeta,), + "type": (RumPermanentRetentionFilterType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "meta": "meta", + "type": "type", + } + + def __init__( + self_, + attributes: Union[RumPermanentRetentionFilterAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + meta: Union[RumPermanentRetentionFilterMeta, UnsetType] = unset, + type: Union[RumPermanentRetentionFilterType, UnsetType] = unset, + **kwargs, + ): + """ + A permanent retention filter. + + :param attributes: The attributes of a permanent retention filter. + :type attributes: RumPermanentRetentionFilterAttributes, optional + + :param id: Permanent retention filter ID. + :type id: str, optional + + :param meta: Metadata about the permanent retention filter. + :type meta: RumPermanentRetentionFilterMeta, optional + + :param type: The resource type. The value must be ``permanent_retention_filters``. + :type type: RumPermanentRetentionFilterType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if meta is not unset: + kwargs["meta"] = meta + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_event_type.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_event_type.py new file mode 100644 index 0000000000..79a293a9d9 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_event_type.py @@ -0,0 +1,56 @@ +# 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 RumPermanentRetentionFilterEventType(ModelSimple): + """ + The type of RUM events the filter applies to. Read-only. + + :param value: Must be one of ["session", "view", "action", "error", "resource", "long_task", "vital", "operation"]. + :type value: str + """ + + allowed_values = { + "session", + "view", + "action", + "error", + "resource", + "long_task", + "vital", + "operation", + } + SESSION: ClassVar["RumPermanentRetentionFilterEventType"] + VIEW: ClassVar["RumPermanentRetentionFilterEventType"] + ACTION: ClassVar["RumPermanentRetentionFilterEventType"] + ERROR: ClassVar["RumPermanentRetentionFilterEventType"] + RESOURCE: ClassVar["RumPermanentRetentionFilterEventType"] + LONG_TASK: ClassVar["RumPermanentRetentionFilterEventType"] + VITAL: ClassVar["RumPermanentRetentionFilterEventType"] + OPERATION: ClassVar["RumPermanentRetentionFilterEventType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumPermanentRetentionFilterEventType.SESSION = RumPermanentRetentionFilterEventType("session") +RumPermanentRetentionFilterEventType.VIEW = RumPermanentRetentionFilterEventType("view") +RumPermanentRetentionFilterEventType.ACTION = RumPermanentRetentionFilterEventType("action") +RumPermanentRetentionFilterEventType.ERROR = RumPermanentRetentionFilterEventType("error") +RumPermanentRetentionFilterEventType.RESOURCE = RumPermanentRetentionFilterEventType("resource") +RumPermanentRetentionFilterEventType.LONG_TASK = RumPermanentRetentionFilterEventType("long_task") +RumPermanentRetentionFilterEventType.VITAL = RumPermanentRetentionFilterEventType("vital") +RumPermanentRetentionFilterEventType.OPERATION = RumPermanentRetentionFilterEventType("operation") diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta.py new file mode 100644 index 0000000000..e84337dcde --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_permanent_retention_filter_meta_source import ( + RumPermanentRetentionFilterMetaSource, + ) + + +class RumPermanentRetentionFilterMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_meta_source import ( + RumPermanentRetentionFilterMetaSource, + ) + + return { + "source": (RumPermanentRetentionFilterMetaSource,), + "updated_at": (int,), + "updated_by_handle": (str,), + } + + attribute_map = { + "source": "source", + "updated_at": "updated_at", + "updated_by_handle": "updated_by_handle", + } + + def __init__( + self_, + source: Union[RumPermanentRetentionFilterMetaSource, UnsetType] = unset, + updated_at: Union[int, UnsetType] = unset, + updated_by_handle: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Metadata about the permanent retention filter. + + :param source: The source of the last update to a permanent retention filter. + :type source: RumPermanentRetentionFilterMetaSource, optional + + :param updated_at: Unix epoch (in milliseconds) of the last update. + :type updated_at: int, optional + + :param updated_by_handle: Handle of the user who last updated the filter. + :type updated_by_handle: str, optional + """ + if source is not unset: + kwargs["source"] = source + if updated_at is not unset: + kwargs["updated_at"] = updated_at + if updated_by_handle is not unset: + kwargs["updated_by_handle"] = updated_by_handle + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta_source.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta_source.py new file mode 100644 index 0000000000..0cd8bf4278 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_meta_source.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 RumPermanentRetentionFilterMetaSource(ModelSimple): + """ + The source of the last update to a permanent retention filter. + + :param value: Must be one of ["default", "ui", "terraform"]. + :type value: str + """ + + allowed_values = { + "default", + "ui", + "terraform", + } + DEFAULT: ClassVar["RumPermanentRetentionFilterMetaSource"] + UI: ClassVar["RumPermanentRetentionFilterMetaSource"] + TERRAFORM: ClassVar["RumPermanentRetentionFilterMetaSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumPermanentRetentionFilterMetaSource.DEFAULT = RumPermanentRetentionFilterMetaSource("default") +RumPermanentRetentionFilterMetaSource.UI = RumPermanentRetentionFilterMetaSource("ui") +RumPermanentRetentionFilterMetaSource.TERRAFORM = RumPermanentRetentionFilterMetaSource("terraform") diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_response.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_response.py new file mode 100644 index 0000000000..39fd9cb17f --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_response.py @@ -0,0 +1,42 @@ +# 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.rum_permanent_retention_filter_data import RumPermanentRetentionFilterData + + +class RumPermanentRetentionFilterResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_data import RumPermanentRetentionFilterData + + return { + "data": (RumPermanentRetentionFilterData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RumPermanentRetentionFilterData, UnsetType] = unset, **kwargs): + """ + A permanent retention filter response body. + + :param data: A permanent retention filter. + :type data: RumPermanentRetentionFilterData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_type.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_type.py new file mode 100644 index 0000000000..28f1608e51 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_type.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumPermanentRetentionFilterType(ModelSimple): + """ + The resource type. The value must be `permanent_retention_filters`. + + :param value: If omitted defaults to "permanent_retention_filters". Must be one of ["permanent_retention_filters"]. + :type value: str + """ + + allowed_values = { + "permanent_retention_filters", + } + PERMANENT_RETENTION_FILTERS: ClassVar["RumPermanentRetentionFilterType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS = RumPermanentRetentionFilterType( + "permanent_retention_filters" +) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_attributes.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_attributes.py new file mode 100644 index 0000000000..2bce4b5002 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_attributes.py @@ -0,0 +1,49 @@ +# 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.rum_permanent_cross_product_sampling_update import ( + RumPermanentCrossProductSamplingUpdate, + ) + + +class RumPermanentRetentionFilterUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_update import ( + RumPermanentCrossProductSamplingUpdate, + ) + + return { + "cross_product_sampling": (RumPermanentCrossProductSamplingUpdate,), + } + + attribute_map = { + "cross_product_sampling": "cross_product_sampling", + } + + def __init__( + self_, cross_product_sampling: Union[RumPermanentCrossProductSamplingUpdate, UnsetType] = unset, **kwargs + ): + """ + The attributes of a permanent retention filter that can be updated. + + :param cross_product_sampling: Partial update of the cross-product sample rates for a permanent retention filter. + Only rates with a matching ``cross_product_sampling_editability`` flag set to ``true`` can be updated. + :type cross_product_sampling: RumPermanentCrossProductSamplingUpdate, optional + """ + if cross_product_sampling is not unset: + kwargs["cross_product_sampling"] = cross_product_sampling + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_data.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_data.py new file mode 100644 index 0000000000..a56e075273 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_data.py @@ -0,0 +1,64 @@ +# 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.rum_permanent_retention_filter_update_attributes import ( + RumPermanentRetentionFilterUpdateAttributes, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType + + +class RumPermanentRetentionFilterUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_update_attributes import ( + RumPermanentRetentionFilterUpdateAttributes, + ) + from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType + + return { + "attributes": (RumPermanentRetentionFilterUpdateAttributes,), + "id": (str,), + "type": (RumPermanentRetentionFilterType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: RumPermanentRetentionFilterUpdateAttributes, + id: str, + type: RumPermanentRetentionFilterType, + **kwargs, + ): + """ + The permanent retention filter properties to update. + + :param attributes: The attributes of a permanent retention filter that can be updated. + :type attributes: RumPermanentRetentionFilterUpdateAttributes + + :param id: Permanent retention filter ID. + :type id: str + + :param type: The resource type. The value must be ``permanent_retention_filters``. + :type type: RumPermanentRetentionFilterType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_request.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_request.py new file mode 100644 index 0000000000..05578bf259 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filter_update_request.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_permanent_retention_filter_update_data import ( + RumPermanentRetentionFilterUpdateData, + ) + + +class RumPermanentRetentionFilterUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_update_data import ( + RumPermanentRetentionFilterUpdateData, + ) + + return { + "data": (RumPermanentRetentionFilterUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumPermanentRetentionFilterUpdateData, **kwargs): + """ + The permanent retention filter body to update. + + :param data: The permanent retention filter properties to update. + :type data: RumPermanentRetentionFilterUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_permanent_retention_filters_response.py b/src/datadog_api_client/v2/model/rum_permanent_retention_filters_response.py new file mode 100644 index 0000000000..24818c65dc --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_permanent_retention_filters_response.py @@ -0,0 +1,42 @@ +# 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.rum_permanent_retention_filter_data import RumPermanentRetentionFilterData + + +class RumPermanentRetentionFiltersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_permanent_retention_filter_data import RumPermanentRetentionFilterData + + return { + "data": ([RumPermanentRetentionFilterData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[RumPermanentRetentionFilterData], UnsetType] = unset, **kwargs): + """ + All permanent retention filters for a RUM application. + + :param data: A list of RUM permanent retention filters. + :type data: [RumPermanentRetentionFilterData], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e120b39440..8aa62e7911 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5416,6 +5416,28 @@ from datadog_api_client.v2.model.rum_metric_update_data import RumMetricUpdateData from datadog_api_client.v2.model.rum_metric_update_request import RumMetricUpdateRequest from datadog_api_client.v2.model.rum_metrics_response import RumMetricsResponse +from datadog_api_client.v2.model.rum_permanent_cross_product_sampling import RumPermanentCrossProductSampling +from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_editability import ( + RumPermanentCrossProductSamplingEditability, +) +from datadog_api_client.v2.model.rum_permanent_cross_product_sampling_update import ( + RumPermanentCrossProductSamplingUpdate, +) +from datadog_api_client.v2.model.rum_permanent_retention_filter_attributes import RumPermanentRetentionFilterAttributes +from datadog_api_client.v2.model.rum_permanent_retention_filter_data import RumPermanentRetentionFilterData +from datadog_api_client.v2.model.rum_permanent_retention_filter_event_type import RumPermanentRetentionFilterEventType +from datadog_api_client.v2.model.rum_permanent_retention_filter_meta import RumPermanentRetentionFilterMeta +from datadog_api_client.v2.model.rum_permanent_retention_filter_meta_source import RumPermanentRetentionFilterMetaSource +from datadog_api_client.v2.model.rum_permanent_retention_filter_response import RumPermanentRetentionFilterResponse +from datadog_api_client.v2.model.rum_permanent_retention_filter_type import RumPermanentRetentionFilterType +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_attributes import ( + RumPermanentRetentionFilterUpdateAttributes, +) +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_data import RumPermanentRetentionFilterUpdateData +from datadog_api_client.v2.model.rum_permanent_retention_filter_update_request import ( + RumPermanentRetentionFilterUpdateRequest, +) +from datadog_api_client.v2.model.rum_permanent_retention_filters_response import RumPermanentRetentionFiltersResponse from datadog_api_client.v2.model.rum_retention_filter_attributes import RumRetentionFilterAttributes from datadog_api_client.v2.model.rum_retention_filter_create_attributes import RumRetentionFilterCreateAttributes from datadog_api_client.v2.model.rum_retention_filter_create_data import RumRetentionFilterCreateData @@ -11303,6 +11325,20 @@ "RumMetricUpdateData", "RumMetricUpdateRequest", "RumMetricsResponse", + "RumPermanentCrossProductSampling", + "RumPermanentCrossProductSamplingEditability", + "RumPermanentCrossProductSamplingUpdate", + "RumPermanentRetentionFilterAttributes", + "RumPermanentRetentionFilterData", + "RumPermanentRetentionFilterEventType", + "RumPermanentRetentionFilterMeta", + "RumPermanentRetentionFilterMetaSource", + "RumPermanentRetentionFilterResponse", + "RumPermanentRetentionFilterType", + "RumPermanentRetentionFilterUpdateAttributes", + "RumPermanentRetentionFilterUpdateData", + "RumPermanentRetentionFilterUpdateRequest", + "RumPermanentRetentionFiltersResponse", "RumRetentionFilterAttributes", "RumRetentionFilterCreateAttributes", "RumRetentionFilterCreateData", diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.frozen new file mode 100644 index 0000000000..ab3d12765e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.yaml new file mode 100644 index 0000000000..83d717c3e3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Get_a_permanent_retention_filter_returns_Not_Found_response-1777482270 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rpc error: + code = NotFound desc = NotFound: This hardcoded retention filter does not + exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.frozen new file mode 100644 index 0000000000..ab3d12765e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.yaml new file mode 100644 index 0000000000..6c0ab4ca97 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_permanent_retention_filter_returns_ok_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/default_synthetics + response: + body: + string: '{"data":{"id":"default_synthetics","type":"permanent_retention_filters","attributes":{"name":"Default + Synthetics","event_type":"session","query":"@type:browser","sample_rate":100,"enabled":true,"cross_product_sampling":{"trace_sample_rate":100},"cross_product_sampling_editability":{"trace_sample_rate":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.frozen new file mode 100644 index 0000000000..ab3d12765e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.yaml new file mode 100644 index 0000000000..d08cfc3234 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_permanent_retention_filters_returns_ok_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/rum/applications/1d4b9c34-7ac4-423a-91cf-9902d926e9b3/permanent_retention_filters + response: + body: + string: '{"data":[{"id":"default_synthetics","type":"permanent_retention_filters","attributes":{"name":"Default + Synthetics","event_type":"session","query":"@type:browser","sample_rate":100,"enabled":true,"cross_product_sampling":{"trace_sample_rate":100},"cross_product_sampling_editability":{"trace_sample_rate":true}}},{"id":"default_replays","type":"permanent_retention_filters","attributes":{"name":"Default + Replays","event_type":"session","query":"@has_replay:true","sample_rate":100,"enabled":true,"cross_product_sampling":{"trace_sample_rate":100},"cross_product_sampling_editability":{"trace_sample_rate":true}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.frozen new file mode 100644 index 0000000000..e16b1284f4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:32.471Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4801b70a2c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"cross_product_sampling":{"trace_sample_rate":25}},"id":"Test-Update_a_permanent_retention_filter_returns_Bad_Request_response-1777482272","type":"invalid_type"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Update_a_permanent_retention_filter_returns_Bad_Request_response-1777482272 + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"invalid_type\" expected one of \"permanent_retention_filters\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.frozen new file mode 100644 index 0000000000..cd6c745907 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:32.786Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.yaml new file mode 100644 index 0000000000..71ea937fae --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_bad_request_response_for_unknown_rf_id.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"cross_product_sampling":{"trace_sample_rate":25}},"id":"Test-Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id-1777482272","type":"permanent_retention_filters"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id-1777482272 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.frozen new file mode 100644 index 0000000000..ab3d12765e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.frozen @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.yaml new file mode 100644 index 0000000000..3db6a7ced6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_permanent_retention_filter_returns_updated_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"cross_product_sampling":{"trace_sample_rate":100}},"id":"default_replays","type":"permanent_retention_filters"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/default_replays + response: + body: + string: '{"data":{"id":"default_replays","type":"permanent_retention_filters","attributes":{"name":"Default + Replays","event_type":"session","query":"@has_replay:true","sample_rate":100,"enabled":true,"cross_product_sampling":{"trace_sample_rate":100},"cross_product_sampling_editability":{"trace_sample_rate":true}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/rum_retention_filters_permanent.feature b/tests/v2/features/rum_retention_filters_permanent.feature new file mode 100644 index 0000000000..6f1f90d7e0 --- /dev/null +++ b/tests/v2/features/rum_retention_filters_permanent.feature @@ -0,0 +1,73 @@ +@endpoint(rum-retention-filters-permanent) @endpoint(rum-retention-filters-permanent-v2) +Feature: Rum Retention Filters Permanent + Manage permanent retention filters through [Manage + Applications](https://app.datadoghq.com/rum/list) in RUM for your + organization. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RumRetentionFiltersPermanent" API + + @team:DataDog/rum-backend + Scenario: Get a permanent retention filter returns "Not Found" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/rum-backend + Scenario: Get a permanent retention filter returns "OK" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "default_synthetics" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "default_synthetics" + And the response "data.type" is equal to "permanent_retention_filters" + + @replay-only @team:DataDog/rum-backend + Scenario: Get all permanent retention filters returns "OK" response + Given new "ListPermanentRetentionFilters" request + And request contains "app_id" parameter with value "1d4b9c34-7ac4-423a-91cf-9902d926e9b3" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Bad Request" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data":{"id":"{{ unique }}","type":"invalid_type","attributes":{"cross_product_sampling":{"trace_sample_rate":25}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Bad Request" response for unknown rf_id + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data":{"id":"{{ unique }}","type":"permanent_retention_filters","attributes":{"cross_product_sampling":{"trace_sample_rate":25}}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Not Found" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_sample_rate": 25.0}}, "id": "4b95d361-f65d-4515-9824-c9aaeba5ac2a", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Updated" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "default_replays" + And body with value {"data":{"id":"default_replays","type":"permanent_retention_filters","attributes":{"cross_product_sampling":{"trace_sample_rate":100}}}} + When the request is sent + Then the response status is 200 Updated + And the response "data.id" is equal to "default_replays" + And the response "data.type" is equal to "permanent_retention_filters" diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index f606e4a865..cda95dcc96 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4940,6 +4940,24 @@ "type": "unsafe" } }, + "ListPermanentRetentionFilters": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "safe" + } + }, + "GetPermanentRetentionFilter": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "safe" + } + }, + "UpdatePermanentRetentionFilter": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "idempotent" + } + }, "OrderRetentionFilters": { "tag": "Rum Retention Filters", "undo": {