Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 387 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,13 @@ datadog\_api\_client.v2.api.rum\_retention\_filters\_api module
:members:
:show-inheritance:

datadog\_api\_client.v2.api.rum\_retention\_quota\_api module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.api.rum_retention_quota_api
:members:
:show-inheritance:

datadog\_api\_client.v2.api.salesforce\_integration\_api module
---------------------------------------------------------------

Expand Down
91 changes: 91 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38588,6 +38588,97 @@ datadog\_api\_client.v2.model.rum\_retention\_filters\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_adaptive\_config module
----------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_adaptive_config
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_attributes module
------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_data module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_response module
----------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_type module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_update\_attributes module
--------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_update_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_update\_data module
--------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_update_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_config\_update\_request module
-----------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_config_update_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_custom\_config module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_custom_config
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_mode module
----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_mode
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_reached\_action module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_reached_action
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_scope\_type module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_scope_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_retention\_quota\_window\_type module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.rum_retention_quota_window_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.rum\_sdk\_config\_attributes module
-----------------------------------------------------------------

Expand Down
15 changes: 15 additions & 0 deletions examples/v2/rum-retention-quota/DeleteRumQuotaConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Delete a RUM retention quota configuration returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_retention_quota_api import RUMRetentionQuotaApi
from datadog_api_client.v2.model.rum_retention_quota_scope_type import RumRetentionQuotaScopeType

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = RUMRetentionQuotaApi(api_client)
api_instance.delete_rum_quota_config(
scope_type=RumRetentionQuotaScopeType.APPLICATION,
scope_id="ced16651-97b6-4e67-8590-8caec3af0695",
)
17 changes: 17 additions & 0 deletions examples/v2/rum-retention-quota/GetRumQuotaConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Get a RUM retention quota configuration returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_retention_quota_api import RUMRetentionQuotaApi
from datadog_api_client.v2.model.rum_retention_quota_scope_type import RumRetentionQuotaScopeType

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = RUMRetentionQuotaApi(api_client)
response = api_instance.get_rum_quota_config(
scope_type=RumRetentionQuotaScopeType.APPLICATION,
scope_id="ced16651-97b6-4e67-8590-8caec3af0695",
)

print(response)
47 changes: 47 additions & 0 deletions examples/v2/rum-retention-quota/UpsertRumQuotaConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Create or update a RUM retention quota config returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_retention_quota_api import RUMRetentionQuotaApi
from datadog_api_client.v2.model.rum_retention_quota_adaptive_config import RumRetentionQuotaAdaptiveConfig
from datadog_api_client.v2.model.rum_retention_quota_config_type import RumRetentionQuotaConfigType
from datadog_api_client.v2.model.rum_retention_quota_config_update_attributes import (
RumRetentionQuotaConfigUpdateAttributes,
)
from datadog_api_client.v2.model.rum_retention_quota_config_update_data import RumRetentionQuotaConfigUpdateData
from datadog_api_client.v2.model.rum_retention_quota_config_update_request import RumRetentionQuotaConfigUpdateRequest
from datadog_api_client.v2.model.rum_retention_quota_custom_config import RumRetentionQuotaCustomConfig
from datadog_api_client.v2.model.rum_retention_quota_mode import RumRetentionQuotaMode
from datadog_api_client.v2.model.rum_retention_quota_reached_action import RumRetentionQuotaReachedAction
from datadog_api_client.v2.model.rum_retention_quota_scope_type import RumRetentionQuotaScopeType
from datadog_api_client.v2.model.rum_retention_quota_window_type import RumRetentionQuotaWindowType

body = RumRetentionQuotaConfigUpdateRequest(
data=RumRetentionQuotaConfigUpdateData(
attributes=RumRetentionQuotaConfigUpdateAttributes(
adaptive=RumRetentionQuotaAdaptiveConfig(
max_retention_rate=0.5,
),
custom=RumRetentionQuotaCustomConfig(
daily_reset_time="08:00",
daily_reset_timezone="+09:00",
quota_reached_action=RumRetentionQuotaReachedAction.STOP,
session_limit=1000000,
window_type=RumRetentionQuotaWindowType.DAILY,
),
mode=RumRetentionQuotaMode.CUSTOM,
),
id="ced16651-97b6-4e67-8590-8caec3af0695",
type=RumRetentionQuotaConfigType.RUM_QUOTA_CONFIG,
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = RUMRetentionQuotaApi(api_client)
response = api_instance.upsert_rum_quota_config(
scope_type=RumRetentionQuotaScopeType.APPLICATION, scope_id="ced16651-97b6-4e67-8590-8caec3af0695", body=body
)

print(response)
188 changes: 188 additions & 0 deletions src/datadog_api_client/v2/api/rum_retention_quota_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import 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_retention_quota_scope_type import RumRetentionQuotaScopeType
from datadog_api_client.v2.model.rum_retention_quota_config_response import RumRetentionQuotaConfigResponse
from datadog_api_client.v2.model.rum_retention_quota_config_update_request import RumRetentionQuotaConfigUpdateRequest


class RUMRetentionQuotaApi:
"""
Manage RUM retention quota configurations for your organization's RUM applications.
"""

def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient(Configuration())
self.api_client = api_client

self._delete_rum_quota_config_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/rum/config/retention-quota/{scope_type}/{scope_id}",
"operation_id": "delete_rum_quota_config",
"http_method": "DELETE",
"version": "v2",
},
params_map={
"scope_type": {
"required": True,
"openapi_types": (RumRetentionQuotaScopeType,),
"attribute": "scope_type",
"location": "path",
},
"scope_id": {
"required": True,
"openapi_types": (str,),
"attribute": "scope_id",
"location": "path",
},
},
headers_map={
"accept": ["*/*"],
},
api_client=api_client,
)

self._get_rum_quota_config_endpoint = _Endpoint(
settings={
"response_type": (RumRetentionQuotaConfigResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/rum/config/retention-quota/{scope_type}/{scope_id}",
"operation_id": "get_rum_quota_config",
"http_method": "GET",
"version": "v2",
},
params_map={
"scope_type": {
"required": True,
"openapi_types": (RumRetentionQuotaScopeType,),
"attribute": "scope_type",
"location": "path",
},
"scope_id": {
"required": True,
"openapi_types": (str,),
"attribute": "scope_id",
"location": "path",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._upsert_rum_quota_config_endpoint = _Endpoint(
settings={
"response_type": (RumRetentionQuotaConfigResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/rum/config/retention-quota/{scope_type}/{scope_id}",
"operation_id": "upsert_rum_quota_config",
"http_method": "PUT",
"version": "v2",
},
params_map={
"scope_type": {
"required": True,
"openapi_types": (RumRetentionQuotaScopeType,),
"attribute": "scope_type",
"location": "path",
},
"scope_id": {
"required": True,
"openapi_types": (str,),
"attribute": "scope_id",
"location": "path",
},
"body": {
"required": True,
"openapi_types": (RumRetentionQuotaConfigUpdateRequest,),
"location": "body",
},
},
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
api_client=api_client,
)

def delete_rum_quota_config(
self,
scope_type: RumRetentionQuotaScopeType,
scope_id: str,
) -> None:
"""Delete a RUM retention quota configuration.

Delete the RUM retention quota configuration for a given scope.

:param scope_type: The type of scope the retention quota configuration applies to.
:type scope_type: RumRetentionQuotaScopeType
:param scope_id: The identifier of the scope the retention quota configuration applies to.
For the ``application`` scope, this is the RUM application ID.
:type scope_id: str
:rtype: None
"""
kwargs: Dict[str, Any] = {}
kwargs["scope_type"] = scope_type

kwargs["scope_id"] = scope_id

return self._delete_rum_quota_config_endpoint.call_with_http_info(**kwargs)

def get_rum_quota_config(
self,
scope_type: RumRetentionQuotaScopeType,
scope_id: str,
) -> RumRetentionQuotaConfigResponse:
"""Get a RUM retention quota configuration.

Get the RUM retention quota configuration for a given scope.

:param scope_type: The type of scope the retention quota configuration applies to.
:type scope_type: RumRetentionQuotaScopeType
:param scope_id: The identifier of the scope the retention quota configuration applies to.
For the ``application`` scope, this is the RUM application ID.
:type scope_id: str
:rtype: RumRetentionQuotaConfigResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["scope_type"] = scope_type

kwargs["scope_id"] = scope_id

return self._get_rum_quota_config_endpoint.call_with_http_info(**kwargs)

def upsert_rum_quota_config(
self,
scope_type: RumRetentionQuotaScopeType,
scope_id: str,
body: RumRetentionQuotaConfigUpdateRequest,
) -> RumRetentionQuotaConfigResponse:
"""Create or update a RUM retention quota config.

Create or update the RUM retention quota configuration for a given scope.
Returns the retention quota configuration object when the request is successful.

:param scope_type: The type of scope the retention quota configuration applies to.
:type scope_type: RumRetentionQuotaScopeType
:param scope_id: The identifier of the scope the retention quota configuration applies to.
For the ``application`` scope, this is the RUM application ID.
:type scope_id: str
:param body: The definition of the RUM retention quota configuration to create or update.
:type body: RumRetentionQuotaConfigUpdateRequest
:rtype: RumRetentionQuotaConfigResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["scope_type"] = scope_type

kwargs["scope_id"] = scope_id

kwargs["body"] = body

return self._upsert_rum_quota_config_endpoint.call_with_http_info(**kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
from datadog_api_client.v2.api.rum_insights_api import RUMInsightsApi
from datadog_api_client.v2.api.rum_operations_api import RUMOperationsApi
from datadog_api_client.v2.api.rum_remote_config_api import RUMRemoteConfigApi
from datadog_api_client.v2.api.rum_retention_quota_api import RUMRetentionQuotaApi
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
from datadog_api_client.v2.api.report_schedules_api import ReportSchedulesApi
from datadog_api_client.v2.api.reporting_and_sharing_api import ReportingAndSharingApi
Expand Down Expand Up @@ -241,6 +242,7 @@
"RUMInsightsApi",
"RUMOperationsApi",
"RUMRemoteConfigApi",
"RUMRetentionQuotaApi",
"ReferenceTablesApi",
"ReportSchedulesApi",
"ReportingAndSharingApi",
Expand Down
Loading
Loading