diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3cabe03bba..34d3e3e88f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1759,6 +1759,20 @@ components: required: true schema: type: string + RumExclusionFilterApplicationIDParameter: + description: RUM application ID. + in: path + name: app_id + required: true + schema: + type: string + RumExclusionFilterIDParameter: + description: Exclusion filter ID. + in: path + name: ef_id + required: true + schema: + type: string RumMetricIDParameter: description: The name of the RUM-based metric. in: path @@ -2214,6 +2228,12 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Failed Precondition + RumExclusionFilterMethodNotAllowedResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Method Not Allowed SpansBadRequestResponse: content: application/json: @@ -89526,6 +89546,185 @@ components: minimum: 0 type: number type: object + RumExclusionFilterAttributes: + description: The attributes of an exclusion filter. + properties: + enabled: + $ref: "#/components/schemas/RumExclusionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + type: object + RumExclusionFilterCreateAttributes: + description: The attributes of an exclusion filter to create. + properties: + enabled: + description: Whether the exclusion filter is active. Defaults to `true`. + example: true + type: boolean + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + required: + - name + type: object + RumExclusionFilterCreateData: + description: The new exclusion filter properties to create. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterCreateAttributes" + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - type + - attributes + type: object + RumExclusionFilterCreateRequest: + description: The exclusion filter body to create. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterCreateData" + required: + - data + type: object + RumExclusionFilterData: + description: An exclusion filter. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterAttributes" + id: + description: The ID of the exclusion filter. + example: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: string + meta: + $ref: "#/components/schemas/RumExclusionFilterMeta" + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - id + - type + type: object + RumExclusionFilterEnabled: + description: Whether the exclusion filter is active. + example: true + type: boolean + RumExclusionFilterEventType: + description: The type of RUM events to filter on. + enum: + - session + - view + - action + - error + - resource + - long_task + - vital + example: error + type: string + x-enum-varnames: + - SESSION + - VIEW + - ACTION + - ERROR + - RESOURCE + - LONG_TASK + - VITAL + RumExclusionFilterMeta: + description: Metadata about the exclusion filter. + properties: + enabled_at: + description: Unix epoch (in milliseconds) when the exclusion filter was last enabled. + example: 1735689600000 + format: int64 + type: integer + 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 exclusion filter. + example: jane.doe@example.com + type: string + type: object + RumExclusionFilterName: + description: The name of the exclusion filter. + example: Exclude noisy browser extension errors + type: string + RumExclusionFilterQuery: + description: |- + Additional query used to further restrict which RUM events are excluded. + Combined with `event_type` when both are provided. + example: "@error.message:*extension*" + type: string + RumExclusionFilterResponse: + description: An exclusion filter response body. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterData" + type: object + RumExclusionFilterType: + default: exclusion_filters + description: The resource type. The value must be `exclusion_filters`. + enum: + - exclusion_filters + example: exclusion_filters + type: string + x-enum-varnames: + - EXCLUSION_FILTERS + RumExclusionFilterUpdateAttributes: + description: |- + The attributes of an exclusion filter that can be updated. + For the built-in Error Tracking exclusion filter, only `enabled` can be set; + `name`, `event_type`, and `query` must be omitted. + properties: + enabled: + $ref: "#/components/schemas/RumExclusionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + type: object + RumExclusionFilterUpdateData: + description: The exclusion filter properties to update. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterUpdateAttributes" + id: + description: The ID of the exclusion filter. Must match the `ef_id` path parameter. + example: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: string + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - id + - type + - attributes + type: object + RumExclusionFilterUpdateRequest: + description: The exclusion filter body to update. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterUpdateData" + required: + - data + type: object + RumExclusionFiltersResponse: + description: All exclusion filters for a RUM application. + properties: + data: + description: A list of exclusion filters. + items: + $ref: "#/components/schemas/RumExclusionFilterData" + type: array + type: object RumMetricCompute: description: The compute rule to compute the RUM-based metric. properties: @@ -182640,6 +182839,233 @@ paths: tags: - Rum Retention Filters x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/exclusion: + get: + description: |- + Get the list of exclusion filters for a RUM application. + The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) is always returned first. + operationId: ListExclusionFilters + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + enabled: true + name: Ignored / Excluded errors from Error Tracking + id: error_tracking_exclusion_filter + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + - attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all RUM exclusion filters + tags: + - Rum Retention Filters + post: + description: |- + Create an exclusion filter for a RUM application. + Returns the created exclusion filter when the request is successful. + operationId: CreateExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterCreateRequest" + description: The definition of the new RUM exclusion filter. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a RUM exclusion filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}: + delete: + description: |- + Delete an exclusion filter for a RUM application. + The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) cannot be deleted; + attempting to do so returns a `405 Method Not Allowed` response. + operationId: DeleteExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "405": + $ref: "#/components/responses/RumExclusionFilterMethodNotAllowedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a RUM exclusion filter + tags: + - Rum Retention Filters + get: + description: Get a single exclusion filter for a RUM application. + operationId: GetExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a RUM exclusion filter + tags: + - Rum Retention Filters + patch: + description: |- + Update an exclusion filter for a RUM application. + For the built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`), only `enabled` can be + updated; `name`, `event_type`, and `query` must be omitted. + Returns the updated exclusion filter when the request is successful. + operationId: UpdateExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterUpdateRequest" + description: New definition of the RUM exclusion filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a RUM exclusion filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/retention_filters/permanent: get: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index c2a5e5aa47..f8062052f5 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -37797,6 +37797,97 @@ datadog\_api\_client.v2.model.rum\_events\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_create\_attributes module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_create\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_create\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_event\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_event_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_meta module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_update\_attributes module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_update\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filter\_update\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filter_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_exclusion\_filters\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_exclusion_filters_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_group\_by module --------------------------------------------------- diff --git a/examples/v2/rum-retention-filters/CreateExclusionFilter.py b/examples/v2/rum-retention-filters/CreateExclusionFilter.py new file mode 100644 index 0000000000..35ffb109e2 --- /dev/null +++ b/examples/v2/rum-retention-filters/CreateExclusionFilter.py @@ -0,0 +1,30 @@ +""" +Create a RUM exclusion filter returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi +from datadog_api_client.v2.model.rum_exclusion_filter_create_attributes import RumExclusionFilterCreateAttributes +from datadog_api_client.v2.model.rum_exclusion_filter_create_data import RumExclusionFilterCreateData +from datadog_api_client.v2.model.rum_exclusion_filter_create_request import RumExclusionFilterCreateRequest +from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType +from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + +body = RumExclusionFilterCreateRequest( + data=RumExclusionFilterCreateData( + attributes=RumExclusionFilterCreateAttributes( + enabled=True, + event_type=RumExclusionFilterEventType.ERROR, + name="Exclude noisy browser extension errors", + query="@error.message:*extension*", + ), + type=RumExclusionFilterType.EXCLUSION_FILTERS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersApi(api_client) + response = api_instance.create_exclusion_filter(app_id="app_id", body=body) + + print(response) diff --git a/examples/v2/rum-retention-filters/DeleteExclusionFilter.py b/examples/v2/rum-retention-filters/DeleteExclusionFilter.py new file mode 100644 index 0000000000..88ee7da659 --- /dev/null +++ b/examples/v2/rum-retention-filters/DeleteExclusionFilter.py @@ -0,0 +1,14 @@ +""" +Delete a RUM exclusion filter returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersApi(api_client) + api_instance.delete_exclusion_filter( + app_id="app_id", + ef_id="ef_id", + ) diff --git a/examples/v2/rum-retention-filters/GetExclusionFilter.py b/examples/v2/rum-retention-filters/GetExclusionFilter.py new file mode 100644 index 0000000000..058bf7d99c --- /dev/null +++ b/examples/v2/rum-retention-filters/GetExclusionFilter.py @@ -0,0 +1,16 @@ +""" +Get a RUM exclusion filter returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersApi(api_client) + response = api_instance.get_exclusion_filter( + app_id="app_id", + ef_id="ef_id", + ) + + print(response) diff --git a/examples/v2/rum-retention-filters/ListExclusionFilters.py b/examples/v2/rum-retention-filters/ListExclusionFilters.py new file mode 100644 index 0000000000..7733e764b0 --- /dev/null +++ b/examples/v2/rum-retention-filters/ListExclusionFilters.py @@ -0,0 +1,15 @@ +""" +Get all RUM exclusion filters returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersApi(api_client) + response = api_instance.list_exclusion_filters( + app_id="app_id", + ) + + print(response) diff --git a/examples/v2/rum-retention-filters/UpdateExclusionFilter.py b/examples/v2/rum-retention-filters/UpdateExclusionFilter.py new file mode 100644 index 0000000000..1edccf3c44 --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdateExclusionFilter.py @@ -0,0 +1,31 @@ +""" +Update a RUM exclusion filter returns "Updated" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi +from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType +from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType +from datadog_api_client.v2.model.rum_exclusion_filter_update_attributes import RumExclusionFilterUpdateAttributes +from datadog_api_client.v2.model.rum_exclusion_filter_update_data import RumExclusionFilterUpdateData +from datadog_api_client.v2.model.rum_exclusion_filter_update_request import RumExclusionFilterUpdateRequest + +body = RumExclusionFilterUpdateRequest( + data=RumExclusionFilterUpdateData( + attributes=RumExclusionFilterUpdateAttributes( + enabled=True, + event_type=RumExclusionFilterEventType.ERROR, + name="Exclude noisy browser extension errors", + query="@error.message:*extension*", + ), + id="051601eb-54a0-abc0-03f9-cc02efa18892", + type=RumExclusionFilterType.EXCLUSION_FILTERS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = RumRetentionFiltersApi(api_client) + response = api_instance.update_exclusion_filter(app_id="app_id", ef_id="ef_id", body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/rum_retention_filters_api.py b/src/datadog_api_client/v2/api/rum_retention_filters_api.py index dbf0c74b6b..6c5b3ceeca 100644 --- a/src/datadog_api_client/v2/api/rum_retention_filters_api.py +++ b/src/datadog_api_client/v2/api/rum_retention_filters_api.py @@ -12,6 +12,10 @@ from datadog_api_client.v2.model.rum_retention_filters_response import RumRetentionFiltersResponse from datadog_api_client.v2.model.rum_retention_filter_response import RumRetentionFilterResponse from datadog_api_client.v2.model.rum_retention_filter_create_request import RumRetentionFilterCreateRequest +from datadog_api_client.v2.model.rum_exclusion_filters_response import RumExclusionFiltersResponse +from datadog_api_client.v2.model.rum_exclusion_filter_response import RumExclusionFilterResponse +from datadog_api_client.v2.model.rum_exclusion_filter_create_request import RumExclusionFilterCreateRequest +from datadog_api_client.v2.model.rum_exclusion_filter_update_request import RumExclusionFilterUpdateRequest 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_id import RumPermanentRetentionFilterID @@ -31,6 +35,32 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_exclusion_filter_endpoint = _Endpoint( + settings={ + "response_type": (RumExclusionFilterResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/retention_filters/exclusion", + "operation_id": "create_exclusion_filter", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RumExclusionFilterCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_retention_filter_endpoint = _Endpoint( settings={ "response_type": (RumRetentionFilterResponse,), @@ -57,6 +87,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_exclusion_filter_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}", + "operation_id": "delete_exclusion_filter", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "ef_id": { + "required": True, + "openapi_types": (str,), + "attribute": "ef_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_retention_filter_endpoint = _Endpoint( settings={ "response_type": None, @@ -86,6 +145,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_exclusion_filter_endpoint = _Endpoint( + settings={ + "response_type": (RumExclusionFilterResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}", + "operation_id": "get_exclusion_filter", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "ef_id": { + "required": True, + "openapi_types": (str,), + "attribute": "ef_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_permanent_retention_filter_endpoint = _Endpoint( settings={ "response_type": (RumPermanentRetentionFilterResponse,), @@ -144,6 +232,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_exclusion_filters_endpoint = _Endpoint( + settings={ + "response_type": (RumExclusionFiltersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/retention_filters/exclusion", + "operation_id": "list_exclusion_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._list_permanent_retention_filters_endpoint = _Endpoint( settings={ "response_type": (RumPermanentRetentionFiltersResponse,), @@ -216,6 +327,38 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_exclusion_filter_endpoint = _Endpoint( + settings={ + "response_type": (RumExclusionFilterResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}", + "operation_id": "update_exclusion_filter", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "app_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_id", + "location": "path", + }, + "ef_id": { + "required": True, + "openapi_types": (str,), + "attribute": "ef_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RumExclusionFilterUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_permanent_retention_filter_endpoint = _Endpoint( settings={ "response_type": (RumPermanentRetentionFilterResponse,), @@ -280,6 +423,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + def create_exclusion_filter( + self, + app_id: str, + body: RumExclusionFilterCreateRequest, + ) -> RumExclusionFilterResponse: + """Create a RUM exclusion filter. + + Create an exclusion filter for a RUM application. + Returns the created exclusion filter when the request is successful. + + :param app_id: RUM application ID. + :type app_id: str + :param body: The definition of the new RUM exclusion filter. + :type body: RumExclusionFilterCreateRequest + :rtype: RumExclusionFilterResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["body"] = body + + return self._create_exclusion_filter_endpoint.call_with_http_info(**kwargs) + def create_retention_filter( self, app_id: str, @@ -303,6 +469,30 @@ def create_retention_filter( return self._create_retention_filter_endpoint.call_with_http_info(**kwargs) + def delete_exclusion_filter( + self, + app_id: str, + ef_id: str, + ) -> None: + """Delete a RUM exclusion filter. + + Delete an exclusion filter for a RUM application. + The built-in Error Tracking exclusion filter ( ``error_tracking_exclusion_filter`` ) cannot be deleted; + attempting to do so returns a ``405 Method Not Allowed`` response. + + :param app_id: RUM application ID. + :type app_id: str + :param ef_id: Exclusion filter ID. + :type ef_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["ef_id"] = ef_id + + return self._delete_exclusion_filter_endpoint.call_with_http_info(**kwargs) + def delete_retention_filter( self, app_id: str, @@ -325,6 +515,28 @@ def delete_retention_filter( return self._delete_retention_filter_endpoint.call_with_http_info(**kwargs) + def get_exclusion_filter( + self, + app_id: str, + ef_id: str, + ) -> RumExclusionFilterResponse: + """Get a RUM exclusion filter. + + Get a single exclusion filter for a RUM application. + + :param app_id: RUM application ID. + :type app_id: str + :param ef_id: Exclusion filter ID. + :type ef_id: str + :rtype: RumExclusionFilterResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["ef_id"] = ef_id + + return self._get_exclusion_filter_endpoint.call_with_http_info(**kwargs) + def get_permanent_retention_filter( self, app_id: str, @@ -369,6 +581,24 @@ def get_retention_filter( return self._get_retention_filter_endpoint.call_with_http_info(**kwargs) + def list_exclusion_filters( + self, + app_id: str, + ) -> RumExclusionFiltersResponse: + """Get all RUM exclusion filters. + + Get the list of exclusion filters for a RUM application. + The built-in Error Tracking exclusion filter ( ``error_tracking_exclusion_filter`` ) is always returned first. + + :param app_id: RUM application ID. + :type app_id: str + :rtype: RumExclusionFiltersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + return self._list_exclusion_filters_endpoint.call_with_http_info(**kwargs) + def list_permanent_retention_filters( self, app_id: str, @@ -428,6 +658,36 @@ def order_retention_filters( return self._order_retention_filters_endpoint.call_with_http_info(**kwargs) + def update_exclusion_filter( + self, + app_id: str, + ef_id: str, + body: RumExclusionFilterUpdateRequest, + ) -> RumExclusionFilterResponse: + """Update a RUM exclusion filter. + + Update an exclusion filter for a RUM application. + For the built-in Error Tracking exclusion filter ( ``error_tracking_exclusion_filter`` ), only ``enabled`` can be + updated; ``name`` , ``event_type`` , and ``query`` must be omitted. + Returns the updated exclusion filter when the request is successful. + + :param app_id: RUM application ID. + :type app_id: str + :param ef_id: Exclusion filter ID. + :type ef_id: str + :param body: New definition of the RUM exclusion filter. + :type body: RumExclusionFilterUpdateRequest + :rtype: RumExclusionFilterResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_id"] = app_id + + kwargs["ef_id"] = ef_id + + kwargs["body"] = body + + return self._update_exclusion_filter_endpoint.call_with_http_info(**kwargs) + def update_permanent_retention_filter( self, app_id: str, diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_attributes.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_attributes.py new file mode 100644 index 0000000000..262a92d819 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_attributes.py @@ -0,0 +1,71 @@ +# 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_exclusion_filter_event_type import RumExclusionFilterEventType + + +class RumExclusionFilterAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType + + return { + "enabled": (bool,), + "event_type": (RumExclusionFilterEventType,), + "name": (str,), + "query": (str,), + } + + attribute_map = { + "enabled": "enabled", + "event_type": "event_type", + "name": "name", + "query": "query", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + event_type: Union[RumExclusionFilterEventType, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of an exclusion filter. + + :param enabled: Whether the exclusion filter is active. + :type enabled: bool, optional + + :param event_type: The type of RUM events to filter on. + :type event_type: RumExclusionFilterEventType, optional + + :param name: The name of the exclusion filter. + :type name: str, optional + + :param query: Additional query used to further restrict which RUM events are excluded. + Combined with ``event_type`` when both are provided. + :type query: str, optional + """ + 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 + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_create_attributes.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_attributes.py new file mode 100644 index 0000000000..1f507b27ab --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_attributes.py @@ -0,0 +1,71 @@ +# 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_exclusion_filter_event_type import RumExclusionFilterEventType + + +class RumExclusionFilterCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType + + return { + "enabled": (bool,), + "event_type": (RumExclusionFilterEventType,), + "name": (str,), + "query": (str,), + } + + attribute_map = { + "enabled": "enabled", + "event_type": "event_type", + "name": "name", + "query": "query", + } + + def __init__( + self_, + name: str, + enabled: Union[bool, UnsetType] = unset, + event_type: Union[RumExclusionFilterEventType, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of an exclusion filter to create. + + :param enabled: Whether the exclusion filter is active. Defaults to ``true``. + :type enabled: bool, optional + + :param event_type: The type of RUM events to filter on. + :type event_type: RumExclusionFilterEventType, optional + + :param name: The name of the exclusion filter. + :type name: str + + :param query: Additional query used to further restrict which RUM events are excluded. + Combined with ``event_type`` when both are provided. + :type query: str, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + if event_type is not unset: + kwargs["event_type"] = event_type + if query is not unset: + kwargs["query"] = query + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_create_data.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_data.py new file mode 100644 index 0000000000..1c1271784c --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_data.py @@ -0,0 +1,50 @@ +# 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_exclusion_filter_create_attributes import RumExclusionFilterCreateAttributes + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + +class RumExclusionFilterCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_create_attributes import ( + RumExclusionFilterCreateAttributes, + ) + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + return { + "attributes": (RumExclusionFilterCreateAttributes,), + "type": (RumExclusionFilterType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RumExclusionFilterCreateAttributes, type: RumExclusionFilterType, **kwargs): + """ + The new exclusion filter properties to create. + + :param attributes: The attributes of an exclusion filter to create. + :type attributes: RumExclusionFilterCreateAttributes + + :param type: The resource type. The value must be ``exclusion_filters``. + :type type: RumExclusionFilterType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_create_request.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_request.py new file mode 100644 index 0000000000..28121c7589 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_exclusion_filter_create_data import RumExclusionFilterCreateData + + +class RumExclusionFilterCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_create_data import RumExclusionFilterCreateData + + return { + "data": (RumExclusionFilterCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumExclusionFilterCreateData, **kwargs): + """ + The exclusion filter body to create. + + :param data: The new exclusion filter properties to create. + :type data: RumExclusionFilterCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_data.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_data.py new file mode 100644 index 0000000000..6429a867c7 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_data.py @@ -0,0 +1,73 @@ +# 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_exclusion_filter_attributes import RumExclusionFilterAttributes + from datadog_api_client.v2.model.rum_exclusion_filter_meta import RumExclusionFilterMeta + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + +class RumExclusionFilterData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_attributes import RumExclusionFilterAttributes + from datadog_api_client.v2.model.rum_exclusion_filter_meta import RumExclusionFilterMeta + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + return { + "attributes": (RumExclusionFilterAttributes,), + "id": (str,), + "meta": (RumExclusionFilterMeta,), + "type": (RumExclusionFilterType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "meta": "meta", + "type": "type", + } + + def __init__( + self_, + id: str, + type: RumExclusionFilterType, + attributes: Union[RumExclusionFilterAttributes, UnsetType] = unset, + meta: Union[RumExclusionFilterMeta, UnsetType] = unset, + **kwargs, + ): + """ + An exclusion filter. + + :param attributes: The attributes of an exclusion filter. + :type attributes: RumExclusionFilterAttributes, optional + + :param id: The ID of the exclusion filter. + :type id: str + + :param meta: Metadata about the exclusion filter. + :type meta: RumExclusionFilterMeta, optional + + :param type: The resource type. The value must be ``exclusion_filters``. + :type type: RumExclusionFilterType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_event_type.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_event_type.py new file mode 100644 index 0000000000..b48b1e4090 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_event_type.py @@ -0,0 +1,53 @@ +# 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 RumExclusionFilterEventType(ModelSimple): + """ + The type of RUM events to filter on. + + :param value: Must be one of ["session", "view", "action", "error", "resource", "long_task", "vital"]. + :type value: str + """ + + allowed_values = { + "session", + "view", + "action", + "error", + "resource", + "long_task", + "vital", + } + SESSION: ClassVar["RumExclusionFilterEventType"] + VIEW: ClassVar["RumExclusionFilterEventType"] + ACTION: ClassVar["RumExclusionFilterEventType"] + ERROR: ClassVar["RumExclusionFilterEventType"] + RESOURCE: ClassVar["RumExclusionFilterEventType"] + LONG_TASK: ClassVar["RumExclusionFilterEventType"] + VITAL: ClassVar["RumExclusionFilterEventType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumExclusionFilterEventType.SESSION = RumExclusionFilterEventType("session") +RumExclusionFilterEventType.VIEW = RumExclusionFilterEventType("view") +RumExclusionFilterEventType.ACTION = RumExclusionFilterEventType("action") +RumExclusionFilterEventType.ERROR = RumExclusionFilterEventType("error") +RumExclusionFilterEventType.RESOURCE = RumExclusionFilterEventType("resource") +RumExclusionFilterEventType.LONG_TASK = RumExclusionFilterEventType("long_task") +RumExclusionFilterEventType.VITAL = RumExclusionFilterEventType("vital") diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_meta.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_meta.py new file mode 100644 index 0000000000..2f75a1e80d --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_meta.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 typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RumExclusionFilterMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled_at": (int,), + "updated_at": (int,), + "updated_by_handle": (str,), + } + + attribute_map = { + "enabled_at": "enabled_at", + "updated_at": "updated_at", + "updated_by_handle": "updated_by_handle", + } + + def __init__( + self_, + enabled_at: Union[int, UnsetType] = unset, + updated_at: Union[int, UnsetType] = unset, + updated_by_handle: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Metadata about the exclusion filter. + + :param enabled_at: Unix epoch (in milliseconds) when the exclusion filter was last enabled. + :type enabled_at: int, 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 exclusion filter. + :type updated_by_handle: str, optional + """ + if enabled_at is not unset: + kwargs["enabled_at"] = enabled_at + 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_exclusion_filter_response.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_response.py new file mode 100644 index 0000000000..ad857706ee --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_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_exclusion_filter_data import RumExclusionFilterData + + +class RumExclusionFilterResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_data import RumExclusionFilterData + + return { + "data": (RumExclusionFilterData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RumExclusionFilterData, UnsetType] = unset, **kwargs): + """ + An exclusion filter response body. + + :param data: An exclusion filter. + :type data: RumExclusionFilterData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_type.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_type.py new file mode 100644 index 0000000000..3a41186150 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_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 RumExclusionFilterType(ModelSimple): + """ + The resource type. The value must be `exclusion_filters`. + + :param value: If omitted defaults to "exclusion_filters". Must be one of ["exclusion_filters"]. + :type value: str + """ + + allowed_values = { + "exclusion_filters", + } + EXCLUSION_FILTERS: ClassVar["RumExclusionFilterType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumExclusionFilterType.EXCLUSION_FILTERS = RumExclusionFilterType("exclusion_filters") diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_update_attributes.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_attributes.py new file mode 100644 index 0000000000..8a5f0d5fbd --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_attributes.py @@ -0,0 +1,73 @@ +# 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_exclusion_filter_event_type import RumExclusionFilterEventType + + +class RumExclusionFilterUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType + + return { + "enabled": (bool,), + "event_type": (RumExclusionFilterEventType,), + "name": (str,), + "query": (str,), + } + + attribute_map = { + "enabled": "enabled", + "event_type": "event_type", + "name": "name", + "query": "query", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + event_type: Union[RumExclusionFilterEventType, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of an exclusion filter that can be updated. + For the built-in Error Tracking exclusion filter, only ``enabled`` can be set; + ``name`` , ``event_type`` , and ``query`` must be omitted. + + :param enabled: Whether the exclusion filter is active. + :type enabled: bool, optional + + :param event_type: The type of RUM events to filter on. + :type event_type: RumExclusionFilterEventType, optional + + :param name: The name of the exclusion filter. + :type name: str, optional + + :param query: Additional query used to further restrict which RUM events are excluded. + Combined with ``event_type`` when both are provided. + :type query: str, optional + """ + 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 + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_update_data.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_data.py new file mode 100644 index 0000000000..7db017d7f7 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_data.py @@ -0,0 +1,60 @@ +# 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_exclusion_filter_update_attributes import RumExclusionFilterUpdateAttributes + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + +class RumExclusionFilterUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_update_attributes import ( + RumExclusionFilterUpdateAttributes, + ) + from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType + + return { + "attributes": (RumExclusionFilterUpdateAttributes,), + "id": (str,), + "type": (RumExclusionFilterType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: RumExclusionFilterUpdateAttributes, id: str, type: RumExclusionFilterType, **kwargs + ): + """ + The exclusion filter properties to update. + + :param attributes: The attributes of an exclusion filter that can be updated. + For the built-in Error Tracking exclusion filter, only ``enabled`` can be set; + ``name`` , ``event_type`` , and ``query`` must be omitted. + :type attributes: RumExclusionFilterUpdateAttributes + + :param id: The ID of the exclusion filter. Must match the ``ef_id`` path parameter. + :type id: str + + :param type: The resource type. The value must be ``exclusion_filters``. + :type type: RumExclusionFilterType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filter_update_request.py b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_request.py new file mode 100644 index 0000000000..9587003c73 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_filter_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_exclusion_filter_update_data import RumExclusionFilterUpdateData + + +class RumExclusionFilterUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_update_data import RumExclusionFilterUpdateData + + return { + "data": (RumExclusionFilterUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumExclusionFilterUpdateData, **kwargs): + """ + The exclusion filter body to update. + + :param data: The exclusion filter properties to update. + :type data: RumExclusionFilterUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_exclusion_filters_response.py b/src/datadog_api_client/v2/model/rum_exclusion_filters_response.py new file mode 100644 index 0000000000..f2444fd28f --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_exclusion_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_exclusion_filter_data import RumExclusionFilterData + + +class RumExclusionFiltersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_exclusion_filter_data import RumExclusionFilterData + + return { + "data": ([RumExclusionFilterData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[RumExclusionFilterData], UnsetType] = unset, **kwargs): + """ + All exclusion filters for a RUM application. + + :param data: A list of exclusion filters. + :type data: [RumExclusionFilterData], 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 7200f76674..d562e671c8 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7681,6 +7681,19 @@ from datadog_api_client.v2.model.rum_cross_product_sampling import RumCrossProductSampling from datadog_api_client.v2.model.rum_cross_product_sampling_create import RumCrossProductSamplingCreate from datadog_api_client.v2.model.rum_cross_product_sampling_update import RumCrossProductSamplingUpdate +from datadog_api_client.v2.model.rum_exclusion_filter_attributes import RumExclusionFilterAttributes +from datadog_api_client.v2.model.rum_exclusion_filter_create_attributes import RumExclusionFilterCreateAttributes +from datadog_api_client.v2.model.rum_exclusion_filter_create_data import RumExclusionFilterCreateData +from datadog_api_client.v2.model.rum_exclusion_filter_create_request import RumExclusionFilterCreateRequest +from datadog_api_client.v2.model.rum_exclusion_filter_data import RumExclusionFilterData +from datadog_api_client.v2.model.rum_exclusion_filter_event_type import RumExclusionFilterEventType +from datadog_api_client.v2.model.rum_exclusion_filter_meta import RumExclusionFilterMeta +from datadog_api_client.v2.model.rum_exclusion_filter_response import RumExclusionFilterResponse +from datadog_api_client.v2.model.rum_exclusion_filter_type import RumExclusionFilterType +from datadog_api_client.v2.model.rum_exclusion_filter_update_attributes import RumExclusionFilterUpdateAttributes +from datadog_api_client.v2.model.rum_exclusion_filter_update_data import RumExclusionFilterUpdateData +from datadog_api_client.v2.model.rum_exclusion_filter_update_request import RumExclusionFilterUpdateRequest +from datadog_api_client.v2.model.rum_exclusion_filters_response import RumExclusionFiltersResponse from datadog_api_client.v2.model.rum_metric_compute import RumMetricCompute from datadog_api_client.v2.model.rum_metric_compute_aggregation_type import RumMetricComputeAggregationType from datadog_api_client.v2.model.rum_metric_create_attributes import RumMetricCreateAttributes @@ -16049,6 +16062,19 @@ "RumCrossProductSampling", "RumCrossProductSamplingCreate", "RumCrossProductSamplingUpdate", + "RumExclusionFilterAttributes", + "RumExclusionFilterCreateAttributes", + "RumExclusionFilterCreateData", + "RumExclusionFilterCreateRequest", + "RumExclusionFilterData", + "RumExclusionFilterEventType", + "RumExclusionFilterMeta", + "RumExclusionFilterResponse", + "RumExclusionFilterType", + "RumExclusionFilterUpdateAttributes", + "RumExclusionFilterUpdateData", + "RumExclusionFilterUpdateRequest", + "RumExclusionFiltersResponse", "RumMetricCompute", "RumMetricComputeAggregationType", "RumMetricCreateAttributes", diff --git a/tests/v2/features/rum_retention_filters.feature b/tests/v2/features/rum_retention_filters.feature index 9c41dcedc0..9abef85a77 100644 --- a/tests/v2/features/rum_retention_filters.feature +++ b/tests/v2/features/rum_retention_filters.feature @@ -9,6 +9,22 @@ Feature: Rum Retention Filters And a valid "appKeyAuth" key in the system And an instance of "RumRetentionFilters" API + @generated @skip @team:DataDog/rum-backend + Scenario: Create a RUM exclusion filter returns "Bad Request" response + Given new "CreateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "type": "exclusion_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a RUM exclusion filter returns "Created" response + Given new "CreateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "type": "exclusion_filters"}} + When the request is sent + Then the response status is 201 Created + @team:DataDog/rum-backend Scenario: Create a RUM retention filter returns "Bad Request" response Given new "CreateRetentionFilter" request @@ -31,6 +47,30 @@ Feature: Rum Retention Filters And the response "data.attributes.query" is equal to "custom_query" And the response "data.attributes.sample_rate" is equal to 50 + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "Method Not Allowed" response + Given new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 405 Method Not Allowed + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "No Content" response + Given new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "Not Found" response + Given new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @replay-only @team:DataDog/rum-backend Scenario: Delete a RUM retention filter returns "No Content" response Given new "DeleteRetentionFilter" request @@ -47,6 +87,22 @@ Feature: Rum Retention Filters When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM exclusion filter returns "Not Found" response + Given new "GetExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM exclusion filter returns "OK" response + Given new "GetExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/rum-backend Scenario: Get a RUM retention filter returns "Not Found" response Given new "GetRetentionFilter" request @@ -86,6 +142,13 @@ Feature: Rum Retention Filters When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/rum-backend + Scenario: Get all RUM exclusion filters returns "OK" response + Given new "ListExclusionFilters" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/rum-backend Scenario: Get all RUM retention filters returns "OK" response Given new "ListRetentionFilters" request @@ -120,6 +183,42 @@ Feature: Rum Retention Filters And the response "data[1].id" is equal to "42d89430-5b80-426e-a44b-ba3b417ece25" And the response "data[2].id" is equal to "bff0bc34-99e9-4c16-adce-f47e71948c23" + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Bad Request" response + Given new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Conflict" response + Given new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Not Found" response + Given new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Updated" response + Given new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 200 Updated + @team:DataDog/rum-backend Scenario: Update a RUM retention filter returns "Bad Request" response Given new "UpdateRetentionFilter" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index df961ee10c..7a1e7eab77 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6948,6 +6948,36 @@ "type": "safe" } }, + "ListExclusionFilters": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "CreateExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "DeleteExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, + "GetExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "UpdateExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, "ListPermanentRetentionFilters": { "tag": "Rum Retention Filters", "undo": {