diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index acd63e70a6..63a5832b9f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -31063,9 +31063,17 @@ components: type: string values: description: |- - Column values in row order. The element type matches the column's `type`; - for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries - Unix-millisecond integers. `null` is allowed for missing values. + Column values in row order, one entry per result row. The element type + follows the column's `type`. The following serialization rules should be + taken into account: + + - `BIGINT` values are encoded as JSON numbers in the signed 64-bit integer range. + - `DECIMAL` values are encoded as JSON numbers with 64-bit double precision. + - `TIMESTAMP` and `DATE` values are encoded as Unix-millisecond integers; a + `DATE` resolves to midnight UTC. + - `JSON` values are returned as a JSON-encoded string. + + `null` is allowed for any column type where a value is missing. example: - web-store - checkout @@ -84510,6 +84518,144 @@ components: type: string x-enum-varnames: - RULESET_STATUS + RumConfigAttributes: + description: Attributes of the RUM configuration. + properties: + disabled: + description: Whether the RUM configuration is disabled for the organization. + example: false + type: boolean + enforced_application_tags: + description: Whether application tags are enforced for the RUM applications in the organization. + example: true + type: boolean + enforced_application_tags_updated_at: + description: Timestamp of when the enforced application tags setting was last updated. + example: "2024-01-15T09:30:00.000Z" + format: date-time + type: string + enforced_application_tags_updated_by: + description: Handle of the user who last updated the enforced application tags setting. + example: "user@example.com" + type: string + ootb_metrics_version: + description: Version of the out-of-the-box metrics installed for the organization. + example: 5 + format: int64 + type: integer + ootb_metrics_version_installed_at: + description: Timestamp of when the out-of-the-box metrics version was installed. + example: "2024-01-15T09:30:00.000Z" + format: date-time + type: string + retention_filters_enabled: + description: Whether retention filters are enabled for the organization. + example: true + type: boolean + retention_filters_enabled_updated_at: + description: Timestamp of when the retention filters setting was last updated. + example: "2024-01-15T09:30:00.000Z" + format: date-time + type: string + retention_filters_enabled_updated_by: + description: Handle of the user or job who last updated the retention filters setting. + example: "contract-update-job" + type: string + required: + - enforced_application_tags + - retention_filters_enabled + type: object + RumConfigCreateAttributes: + description: Attributes of the RUM configuration to create. + properties: + enforced_application_tags: + description: Whether application tags are enforced for the RUM applications in the organization. + example: true + type: boolean + required: + - enforced_application_tags + type: object + RumConfigCreateData: + description: Object describing the RUM configuration to create. + properties: + attributes: + $ref: "#/components/schemas/RumConfigCreateAttributes" + type: + $ref: "#/components/schemas/RumConfigType" + required: + - type + - attributes + type: object + RumConfigCreateRequest: + description: Request body for creating the RUM configuration. + properties: + data: + $ref: "#/components/schemas/RumConfigCreateData" + required: + - data + type: object + RumConfigData: + description: The RUM configuration data. + properties: + attributes: + $ref: "#/components/schemas/RumConfigAttributes" + id: + description: The organization ID associated with the RUM configuration. + example: "1234" + type: string + type: + $ref: "#/components/schemas/RumConfigType" + required: + - id + - type + - attributes + type: object + RumConfigResponse: + description: The RUM configuration object. + properties: + data: + $ref: "#/components/schemas/RumConfigData" + required: + - data + type: object + RumConfigType: + default: rum_config + description: The type of the resource. The value should always be `rum_config`. + enum: + - rum_config + example: rum_config + type: string + x-enum-varnames: + - RUM_CONFIG + RumConfigUpdateAttributes: + description: Attributes of the RUM configuration to update. + properties: + enforced_application_tags: + description: Whether application tags are enforced for the RUM applications in the organization. + example: true + type: boolean + required: + - enforced_application_tags + type: object + RumConfigUpdateData: + description: Object describing the RUM configuration to update. + properties: + attributes: + $ref: "#/components/schemas/RumConfigUpdateAttributes" + type: + $ref: "#/components/schemas/RumConfigType" + required: + - type + - attributes + type: object + RumConfigUpdateRequest: + description: Request body for updating the RUM configuration. + properties: + data: + $ref: "#/components/schemas/RumConfigUpdateData" + required: + - data + type: object RumCrossProductSampling: description: The configuration for cross-product retention filters. properties: @@ -135602,9 +135748,6 @@ paths: summary: Execute a tabular DDSQL query tags: - DDSQL - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ddsql/query/tabular/fetch: post: description: |- @@ -135713,9 +135856,6 @@ paths: summary: Fetch the result of a DDSQL query tags: - DDSQL - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/deletion/data/{product}: post: description: Creates a data deletion request by providing a query and a timeframe targeting the proper data. @@ -175342,6 +175482,153 @@ paths: operator: OR permissions: - rum_apps_write + /api/v2/rum/config: + get: + description: Get the RUM configuration for your organization. + operationId: GetRumConfig + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: false + enforced_application_tags: true + enforced_application_tags_updated_at: "2024-01-15T09:30:00.000Z" + enforced_application_tags_updated_by: "user@example.com" + ootb_metrics_version: 5 + ootb_metrics_version_installed_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled: true + retention_filters_enabled_updated_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled_updated_by: "contract-update-job" + id: "1234" + type: rum_config + schema: + $ref: "#/components/schemas/RumConfigResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the RUM configuration + tags: + - RUM Config + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: |- + Update the RUM configuration for your organization. + Returns the RUM configuration object from the request body when the request is successful. + operationId: UpdateRumConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enforced_application_tags: false + type: rum_config + schema: + $ref: "#/components/schemas/RumConfigUpdateRequest" + description: New definition of the RUM configuration. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: false + enforced_application_tags: false + enforced_application_tags_updated_at: "2024-01-15T09:30:00.000Z" + enforced_application_tags_updated_by: "user@example.com" + ootb_metrics_version: 5 + ootb_metrics_version_installed_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled: true + retention_filters_enabled_updated_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled_updated_by: "contract-update-job" + id: "1234" + type: rum_config + schema: + $ref: "#/components/schemas/RumConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update the RUM configuration + tags: + - RUM Config + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create the RUM configuration for your organization. + Returns the RUM configuration object from the request body when the request is successful. + operationId: CreateRumConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enforced_application_tags: true + type: rum_config + schema: + $ref: "#/components/schemas/RumConfigCreateRequest" + description: The definition of the RUM configuration to create. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: false + enforced_application_tags: true + enforced_application_tags_updated_at: "2024-01-15T09:30:00.000Z" + enforced_application_tags_updated_by: "user@example.com" + ootb_metrics_version: 5 + ootb_metrics_version_installed_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled: true + retention_filters_enabled_updated_at: "2024-01-15T09:30:00.000Z" + retention_filters_enabled_updated_by: "contract-update-job" + id: "1234" + type: rum_config + schema: + $ref: "#/components/schemas/RumConfigResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create the RUM configuration + tags: + - RUM Config + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rum/config/metrics: get: description: Get the list of configured RUM-based metrics with their definitions. @@ -204785,6 +205072,13 @@ tags: - description: |- Manage your Real User Monitoring (RUM) applications, and search or aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM + - description: |- + Manage the [Real User Monitoring (RUM)](https://docs.datadoghq.com/real_user_monitoring/) + configuration for your organization. + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/real_user_monitoring/ + name: RUM Config - description: |- Get insights into the performance of your Real User Monitoring (RUM) applications over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM Insights diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 6a00bda396..8df11782ac 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -704,6 +704,13 @@ datadog\_api\_client.v2.api.rum\_audience\_management\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.rum\_config\_api module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.rum_config_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.rum\_insights\_api module ----------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 23d3cc34b8..30af62829e 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -35613,6 +35613,76 @@ datadog\_api\_client.v2.model.rum\_compute\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.rum\_config\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_config_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_create\_attributes module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_create\_data module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_create\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_data module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_config_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_config_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_update\_attributes module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_update\_data module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_config\_update\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_config_update_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_cross\_product\_sampling module ------------------------------------------------------------------ diff --git a/examples/v2/rum-config/CreateRumConfig.py b/examples/v2/rum-config/CreateRumConfig.py new file mode 100644 index 0000000000..d03903a301 --- /dev/null +++ b/examples/v2/rum-config/CreateRumConfig.py @@ -0,0 +1,27 @@ +""" +Create the RUM configuration returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_config_api import RUMConfigApi +from datadog_api_client.v2.model.rum_config_create_attributes import RumConfigCreateAttributes +from datadog_api_client.v2.model.rum_config_create_data import RumConfigCreateData +from datadog_api_client.v2.model.rum_config_create_request import RumConfigCreateRequest +from datadog_api_client.v2.model.rum_config_type import RumConfigType + +body = RumConfigCreateRequest( + data=RumConfigCreateData( + attributes=RumConfigCreateAttributes( + enforced_application_tags=True, + ), + type=RumConfigType.RUM_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_rum_config"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMConfigApi(api_client) + response = api_instance.create_rum_config(body=body) + + print(response) diff --git a/examples/v2/rum-config/GetRumConfig.py b/examples/v2/rum-config/GetRumConfig.py new file mode 100644 index 0000000000..5ea3126e3a --- /dev/null +++ b/examples/v2/rum-config/GetRumConfig.py @@ -0,0 +1,14 @@ +""" +Get the RUM configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_config_api import RUMConfigApi + +configuration = Configuration() +configuration.unstable_operations["get_rum_config"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMConfigApi(api_client) + response = api_instance.get_rum_config() + + print(response) diff --git a/examples/v2/rum-config/UpdateRumConfig.py b/examples/v2/rum-config/UpdateRumConfig.py new file mode 100644 index 0000000000..d67146c7d3 --- /dev/null +++ b/examples/v2/rum-config/UpdateRumConfig.py @@ -0,0 +1,27 @@ +""" +Update the RUM configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_config_api import RUMConfigApi +from datadog_api_client.v2.model.rum_config_type import RumConfigType +from datadog_api_client.v2.model.rum_config_update_attributes import RumConfigUpdateAttributes +from datadog_api_client.v2.model.rum_config_update_data import RumConfigUpdateData +from datadog_api_client.v2.model.rum_config_update_request import RumConfigUpdateRequest + +body = RumConfigUpdateRequest( + data=RumConfigUpdateData( + attributes=RumConfigUpdateAttributes( + enforced_application_tags=True, + ), + type=RumConfigType.RUM_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_rum_config"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMConfigApi(api_client) + response = api_instance.update_rum_config(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 19b8d3d76f..a06d652ce2 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -490,8 +490,6 @@ def __init__( "v2.get_all_datasets": False, "v2.get_dataset": False, "v2.update_dataset": False, - "v2.execute_ddsql_tabular_query": False, - "v2.fetch_ddsql_tabular_query": False, "v2.cancel_data_deletion_request": False, "v2.create_data_deletion_request": False, "v2.get_data_deletion_requests": False, @@ -696,6 +694,9 @@ def __init__( "v2.get_sourcemaps": False, "v2.list_sourcemaps": False, "v2.restore_sourcemaps": False, + "v2.create_rum_config": False, + "v2.get_rum_config": False, + "v2.update_rum_config": False, "v2.delete_rum_rate_limit_config": False, "v2.get_rum_rate_limit_config": False, "v2.update_rum_rate_limit_config": False, diff --git a/src/datadog_api_client/v2/api/rum_config_api.py b/src/datadog_api_client/v2/api/rum_config_api.py new file mode 100644 index 0000000000..f36d2f2063 --- /dev/null +++ b/src/datadog_api_client/v2/api/rum_config_api.py @@ -0,0 +1,128 @@ +# 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_config_response import RumConfigResponse +from datadog_api_client.v2.model.rum_config_update_request import RumConfigUpdateRequest +from datadog_api_client.v2.model.rum_config_create_request import RumConfigCreateRequest + + +class RUMConfigApi: + """ + Manage the `Real User Monitoring (RUM) `_ + configuration for your organization. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_rum_config_endpoint = _Endpoint( + settings={ + "response_type": (RumConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/config", + "operation_id": "create_rum_config", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (RumConfigCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_rum_config_endpoint = _Endpoint( + settings={ + "response_type": (RumConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/config", + "operation_id": "get_rum_config", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_rum_config_endpoint = _Endpoint( + settings={ + "response_type": (RumConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/config", + "operation_id": "update_rum_config", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (RumConfigUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_rum_config( + self, + body: RumConfigCreateRequest, + ) -> RumConfigResponse: + """Create the RUM configuration. + + Create the RUM configuration for your organization. + Returns the RUM configuration object from the request body when the request is successful. + + :param body: The definition of the RUM configuration to create. + :type body: RumConfigCreateRequest + :rtype: RumConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_rum_config_endpoint.call_with_http_info(**kwargs) + + def get_rum_config( + self, + ) -> RumConfigResponse: + """Get the RUM configuration. + + Get the RUM configuration for your organization. + + :rtype: RumConfigResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_rum_config_endpoint.call_with_http_info(**kwargs) + + def update_rum_config( + self, + body: RumConfigUpdateRequest, + ) -> RumConfigResponse: + """Update the RUM configuration. + + Update the RUM configuration for your organization. + Returns the RUM configuration object from the request body when the request is successful. + + :param body: New definition of the RUM configuration. + :type body: RumConfigUpdateRequest + :rtype: RumConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._update_rum_config_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 52e811b35a..61af5106dd 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -92,6 +92,7 @@ from datadog_api_client.v2.api.processes_api import ProcessesApi from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi from datadog_api_client.v2.api.rum_api import RUMApi +from datadog_api_client.v2.api.rum_config_api import RUMConfigApi from datadog_api_client.v2.api.rum_insights_api import RUMInsightsApi from datadog_api_client.v2.api.rum_remote_config_api import RUMRemoteConfigApi from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi @@ -234,6 +235,7 @@ "ProcessesApi", "ProductAnalyticsApi", "RUMApi", + "RUMConfigApi", "RUMInsightsApi", "RUMRemoteConfigApi", "ReferenceTablesApi", diff --git a/src/datadog_api_client/v2/model/ddsql_tabular_query_column.py b/src/datadog_api_client/v2/model/ddsql_tabular_query_column.py index ab778d989d..4fe462f5db 100644 --- a/src/datadog_api_client/v2/model/ddsql_tabular_query_column.py +++ b/src/datadog_api_client/v2/model/ddsql_tabular_query_column.py @@ -44,9 +44,17 @@ def __init__(self_, name: str, type: str, values: List[Any], **kwargs): for the full, up-to-date list. :type type: str - :param values: Column values in row order. The element type matches the column's ``type`` ; - for example a ``VARCHAR`` column carries strings, a ``TIMESTAMP`` column carries - Unix-millisecond integers. ``null`` is allowed for missing values. + :param values: Column values in row order, one entry per result row. The element type + follows the column's ``type``. The following serialization rules should be + taken into account: + + * ``BIGINT`` values are encoded as JSON numbers in the signed 64-bit integer range. + * ``DECIMAL`` values are encoded as JSON numbers with 64-bit double precision. + * ``TIMESTAMP`` and ``DATE`` values are encoded as Unix-millisecond integers; a + ``DATE`` resolves to midnight UTC. + * ``JSON`` values are returned as a JSON-encoded string. + + ``null`` is allowed for any column type where a value is missing. :type values: [bool, date, datetime, dict, float, int, list, str, UUID, none_type] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_config_attributes.py b/src/datadog_api_client/v2/model/rum_config_attributes.py new file mode 100644 index 0000000000..dfe99e602d --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_attributes.py @@ -0,0 +1,104 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +class RumConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "disabled": (bool,), + "enforced_application_tags": (bool,), + "enforced_application_tags_updated_at": (datetime,), + "enforced_application_tags_updated_by": (str,), + "ootb_metrics_version": (int,), + "ootb_metrics_version_installed_at": (datetime,), + "retention_filters_enabled": (bool,), + "retention_filters_enabled_updated_at": (datetime,), + "retention_filters_enabled_updated_by": (str,), + } + + attribute_map = { + "disabled": "disabled", + "enforced_application_tags": "enforced_application_tags", + "enforced_application_tags_updated_at": "enforced_application_tags_updated_at", + "enforced_application_tags_updated_by": "enforced_application_tags_updated_by", + "ootb_metrics_version": "ootb_metrics_version", + "ootb_metrics_version_installed_at": "ootb_metrics_version_installed_at", + "retention_filters_enabled": "retention_filters_enabled", + "retention_filters_enabled_updated_at": "retention_filters_enabled_updated_at", + "retention_filters_enabled_updated_by": "retention_filters_enabled_updated_by", + } + + def __init__( + self_, + enforced_application_tags: bool, + retention_filters_enabled: bool, + disabled: Union[bool, UnsetType] = unset, + enforced_application_tags_updated_at: Union[datetime, UnsetType] = unset, + enforced_application_tags_updated_by: Union[str, UnsetType] = unset, + ootb_metrics_version: Union[int, UnsetType] = unset, + ootb_metrics_version_installed_at: Union[datetime, UnsetType] = unset, + retention_filters_enabled_updated_at: Union[datetime, UnsetType] = unset, + retention_filters_enabled_updated_by: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the RUM configuration. + + :param disabled: Whether the RUM configuration is disabled for the organization. + :type disabled: bool, optional + + :param enforced_application_tags: Whether application tags are enforced for the RUM applications in the organization. + :type enforced_application_tags: bool + + :param enforced_application_tags_updated_at: Timestamp of when the enforced application tags setting was last updated. + :type enforced_application_tags_updated_at: datetime, optional + + :param enforced_application_tags_updated_by: Handle of the user who last updated the enforced application tags setting. + :type enforced_application_tags_updated_by: str, optional + + :param ootb_metrics_version: Version of the out-of-the-box metrics installed for the organization. + :type ootb_metrics_version: int, optional + + :param ootb_metrics_version_installed_at: Timestamp of when the out-of-the-box metrics version was installed. + :type ootb_metrics_version_installed_at: datetime, optional + + :param retention_filters_enabled: Whether retention filters are enabled for the organization. + :type retention_filters_enabled: bool + + :param retention_filters_enabled_updated_at: Timestamp of when the retention filters setting was last updated. + :type retention_filters_enabled_updated_at: datetime, optional + + :param retention_filters_enabled_updated_by: Handle of the user or job who last updated the retention filters setting. + :type retention_filters_enabled_updated_by: str, optional + """ + if disabled is not unset: + kwargs["disabled"] = disabled + if enforced_application_tags_updated_at is not unset: + kwargs["enforced_application_tags_updated_at"] = enforced_application_tags_updated_at + if enforced_application_tags_updated_by is not unset: + kwargs["enforced_application_tags_updated_by"] = enforced_application_tags_updated_by + if ootb_metrics_version is not unset: + kwargs["ootb_metrics_version"] = ootb_metrics_version + if ootb_metrics_version_installed_at is not unset: + kwargs["ootb_metrics_version_installed_at"] = ootb_metrics_version_installed_at + if retention_filters_enabled_updated_at is not unset: + kwargs["retention_filters_enabled_updated_at"] = retention_filters_enabled_updated_at + if retention_filters_enabled_updated_by is not unset: + kwargs["retention_filters_enabled_updated_by"] = retention_filters_enabled_updated_by + super().__init__(kwargs) + + self_.enforced_application_tags = enforced_application_tags + self_.retention_filters_enabled = retention_filters_enabled diff --git a/src/datadog_api_client/v2/model/rum_config_create_attributes.py b/src/datadog_api_client/v2/model/rum_config_create_attributes.py new file mode 100644 index 0000000000..9a94a999c3 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_create_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumConfigCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enforced_application_tags": (bool,), + } + + attribute_map = { + "enforced_application_tags": "enforced_application_tags", + } + + def __init__(self_, enforced_application_tags: bool, **kwargs): + """ + Attributes of the RUM configuration to create. + + :param enforced_application_tags: Whether application tags are enforced for the RUM applications in the organization. + :type enforced_application_tags: bool + """ + super().__init__(kwargs) + + self_.enforced_application_tags = enforced_application_tags diff --git a/src/datadog_api_client/v2/model/rum_config_create_data.py b/src/datadog_api_client/v2/model/rum_config_create_data.py new file mode 100644 index 0000000000..a4bbed8f40 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_create_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_config_create_attributes import RumConfigCreateAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + +class RumConfigCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_create_attributes import RumConfigCreateAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + return { + "attributes": (RumConfigCreateAttributes,), + "type": (RumConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RumConfigCreateAttributes, type: RumConfigType, **kwargs): + """ + Object describing the RUM configuration to create. + + :param attributes: Attributes of the RUM configuration to create. + :type attributes: RumConfigCreateAttributes + + :param type: The type of the resource. The value should always be ``rum_config``. + :type type: RumConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_config_create_request.py b/src/datadog_api_client/v2/model/rum_config_create_request.py new file mode 100644 index 0000000000..2c85d61d1c --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_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_config_create_data import RumConfigCreateData + + +class RumConfigCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_create_data import RumConfigCreateData + + return { + "data": (RumConfigCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumConfigCreateData, **kwargs): + """ + Request body for creating the RUM configuration. + + :param data: Object describing the RUM configuration to create. + :type data: RumConfigCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_config_data.py b/src/datadog_api_client/v2/model/rum_config_data.py new file mode 100644 index 0000000000..63c0fb4722 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_data.py @@ -0,0 +1,54 @@ +# 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_config_attributes import RumConfigAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + +class RumConfigData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_attributes import RumConfigAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + return { + "attributes": (RumConfigAttributes,), + "id": (str,), + "type": (RumConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: RumConfigAttributes, id: str, type: RumConfigType, **kwargs): + """ + The RUM configuration data. + + :param attributes: Attributes of the RUM configuration. + :type attributes: RumConfigAttributes + + :param id: The organization ID associated with the RUM configuration. + :type id: str + + :param type: The type of the resource. The value should always be ``rum_config``. + :type type: RumConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_config_response.py b/src/datadog_api_client/v2/model/rum_config_response.py new file mode 100644 index 0000000000..195d90b458 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_config_data import RumConfigData + + +class RumConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_data import RumConfigData + + return { + "data": (RumConfigData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumConfigData, **kwargs): + """ + The RUM configuration object. + + :param data: The RUM configuration data. + :type data: RumConfigData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_config_type.py b/src/datadog_api_client/v2/model/rum_config_type.py new file mode 100644 index 0000000000..f80828b747 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_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 RumConfigType(ModelSimple): + """ + The type of the resource. The value should always be `rum_config`. + + :param value: If omitted defaults to "rum_config". Must be one of ["rum_config"]. + :type value: str + """ + + allowed_values = { + "rum_config", + } + RUM_CONFIG: ClassVar["RumConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumConfigType.RUM_CONFIG = RumConfigType("rum_config") diff --git a/src/datadog_api_client/v2/model/rum_config_update_attributes.py b/src/datadog_api_client/v2/model/rum_config_update_attributes.py new file mode 100644 index 0000000000..14252ca81b --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_update_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumConfigUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enforced_application_tags": (bool,), + } + + attribute_map = { + "enforced_application_tags": "enforced_application_tags", + } + + def __init__(self_, enforced_application_tags: bool, **kwargs): + """ + Attributes of the RUM configuration to update. + + :param enforced_application_tags: Whether application tags are enforced for the RUM applications in the organization. + :type enforced_application_tags: bool + """ + super().__init__(kwargs) + + self_.enforced_application_tags = enforced_application_tags diff --git a/src/datadog_api_client/v2/model/rum_config_update_data.py b/src/datadog_api_client/v2/model/rum_config_update_data.py new file mode 100644 index 0000000000..875542ac37 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_update_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_config_update_attributes import RumConfigUpdateAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + +class RumConfigUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_update_attributes import RumConfigUpdateAttributes + from datadog_api_client.v2.model.rum_config_type import RumConfigType + + return { + "attributes": (RumConfigUpdateAttributes,), + "type": (RumConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RumConfigUpdateAttributes, type: RumConfigType, **kwargs): + """ + Object describing the RUM configuration to update. + + :param attributes: Attributes of the RUM configuration to update. + :type attributes: RumConfigUpdateAttributes + + :param type: The type of the resource. The value should always be ``rum_config``. + :type type: RumConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_config_update_request.py b/src/datadog_api_client/v2/model/rum_config_update_request.py new file mode 100644 index 0000000000..0a98470a2d --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_config_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_config_update_data import RumConfigUpdateData + + +class RumConfigUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_config_update_data import RumConfigUpdateData + + return { + "data": (RumConfigUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumConfigUpdateData, **kwargs): + """ + Request body for updating the RUM configuration. + + :param data: Object describing the RUM configuration to update. + :type data: RumConfigUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 8a861f6dd6..48d20f1165 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7089,6 +7089,16 @@ from datadog_api_client.v2.model.ruleset_status_resp_data import RulesetStatusRespData from datadog_api_client.v2.model.ruleset_status_resp_data_attributes import RulesetStatusRespDataAttributes from datadog_api_client.v2.model.ruleset_status_resp_data_type import RulesetStatusRespDataType +from datadog_api_client.v2.model.rum_config_attributes import RumConfigAttributes +from datadog_api_client.v2.model.rum_config_create_attributes import RumConfigCreateAttributes +from datadog_api_client.v2.model.rum_config_create_data import RumConfigCreateData +from datadog_api_client.v2.model.rum_config_create_request import RumConfigCreateRequest +from datadog_api_client.v2.model.rum_config_data import RumConfigData +from datadog_api_client.v2.model.rum_config_response import RumConfigResponse +from datadog_api_client.v2.model.rum_config_type import RumConfigType +from datadog_api_client.v2.model.rum_config_update_attributes import RumConfigUpdateAttributes +from datadog_api_client.v2.model.rum_config_update_data import RumConfigUpdateData +from datadog_api_client.v2.model.rum_config_update_request import RumConfigUpdateRequest 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 @@ -15133,6 +15143,16 @@ "RulesetStatusRespData", "RulesetStatusRespDataAttributes", "RulesetStatusRespDataType", + "RumConfigAttributes", + "RumConfigCreateAttributes", + "RumConfigCreateData", + "RumConfigCreateRequest", + "RumConfigData", + "RumConfigResponse", + "RumConfigType", + "RumConfigUpdateAttributes", + "RumConfigUpdateData", + "RumConfigUpdateRequest", "RumCrossProductSampling", "RumCrossProductSamplingCreate", "RumCrossProductSamplingUpdate", diff --git a/tests/v2/features/rum_config.feature b/tests/v2/features/rum_config.feature new file mode 100644 index 0000000000..8d9cc7dd05 --- /dev/null +++ b/tests/v2/features/rum_config.feature @@ -0,0 +1,49 @@ +@endpoint(rum-config) @endpoint(rum-config-v2) +Feature: RUM Config + Manage the [Real User Monitoring + (RUM)](https://docs.datadoghq.com/real_user_monitoring/) configuration for + your organization. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RUMConfig" API + + @generated @skip @team:DataDog/rum-backend + Scenario: Create the RUM configuration returns "Bad Request" response + Given operation "CreateRumConfig" enabled + And new "CreateRumConfig" request + And body with value {"data": {"attributes": {"enforced_application_tags": true}, "type": "rum_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create the RUM configuration returns "Created" response + Given operation "CreateRumConfig" enabled + And new "CreateRumConfig" request + And body with value {"data": {"attributes": {"enforced_application_tags": true}, "type": "rum_config"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/rum-backend + Scenario: Get the RUM configuration returns "OK" response + Given operation "GetRumConfig" enabled + And new "GetRumConfig" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Update the RUM configuration returns "Bad Request" response + Given operation "UpdateRumConfig" enabled + And new "UpdateRumConfig" request + And body with value {"data": {"attributes": {"enforced_application_tags": true}, "type": "rum_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update the RUM configuration returns "OK" response + Given operation "UpdateRumConfig" enabled + And new "UpdateRumConfig" request + And body with value {"data": {"attributes": {"enforced_application_tags": true}, "type": "rum_config"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 2a7fb64a0a..033b6e8ad4 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6899,6 +6899,24 @@ "type": "idempotent" } }, + "GetRumConfig": { + "tag": "RUM Config", + "undo": { + "type": "safe" + } + }, + "UpdateRumConfig": { + "tag": "RUM Config", + "undo": { + "type": "idempotent" + } + }, + "CreateRumConfig": { + "tag": "RUM Config", + "undo": { + "type": "idempotent" + } + }, "ListRumMetrics": { "tag": "Rum Metrics", "undo": {