diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e2256f32bd..5634715028 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48417,6 +48417,19 @@ components: type: type: string type: object + ProductAnalyticsJoinKeys: + description: Join key configuration for correlating events. + properties: + primary: + description: The primary join key facet. + example: '@session.id' + type: string + secondary: + description: Secondary join key facets. + items: + type: string + type: array + type: object ProductAnalyticsOccurrenceFilter: description: Filter for occurrence-based queries. properties: @@ -48484,6 +48497,273 @@ components: - DONE - RUNNING - TIMEOUT + ProductAnalyticsSampling: + description: Sampling configuration. + properties: + enabled: + default: false + description: Whether sampling is enabled. + type: boolean + type: object + ProductAnalyticsSankeyAggregatedNode: + description: A node aggregated into an "other" node. + properties: + id: + type: string + incoming_value: + format: int64 + type: integer + name: + type: string + outgoing_value: + format: int64 + type: integer + type: + $ref: '#/components/schemas/ProductAnalyticsSankeyAggregatedNodeType' + value: + format: int64 + type: integer + type: object + ProductAnalyticsSankeyAggregatedNodeType: + enum: + - aggregated + type: string + x-enum-varnames: + - AGGREGATED + ProductAnalyticsSankeyDefinition: + description: 'Sankey visualization definition. Set either `source` or `target`, + not both. + + Use `source` for forward flow (where do users go after this page?) or + + `target` for backward flow (where did users come from?).' + properties: + entries_per_step: + default: 5 + description: Number of page entries per step. Default 5, max 10. + example: 5 + format: int64 + maximum: 10 + type: integer + number_of_steps: + default: 5 + description: Number of steps in the flow. Default 5, max 10. + example: 5 + format: int64 + maximum: 10 + type: integer + source: + description: The source page for forward flow analysis. Use "*" for all + pages. + example: /logs + type: string + target: + description: The target page for backward flow analysis. + type: string + type: object + ProductAnalyticsSankeyLink: + description: A link between two nodes in the Sankey diagram. + properties: + column: + description: The step column of the source node. + format: int64 + type: integer + id: + type: string + source: + description: The source node ID. + type: string + target: + description: The target node ID. + type: string + value: + description: The number of sessions through this link. + format: int64 + type: integer + type: object + ProductAnalyticsSankeyNode: + description: A node in the Sankey diagram representing a page or aggregation. + properties: + aggregated_nodes: + description: Nodes aggregated into this node (for "other" type). + items: + $ref: '#/components/schemas/ProductAnalyticsSankeyAggregatedNode' + type: array + column: + description: The step column (0-indexed). + format: int64 + type: integer + dropoff_value: + format: int64 + type: integer + id: + type: string + incoming_value: + format: int64 + type: integer + name: + description: The page name. + example: /logs + type: string + outgoing_value: + format: int64 + type: integer + type: + $ref: '#/components/schemas/ProductAnalyticsSankeyNodeType' + value: + description: The number of sessions through this node. + format: int64 + type: integer + type: object + ProductAnalyticsSankeyNodeType: + description: Node type. + enum: + - regular + - other + - dropoff + type: string + x-enum-varnames: + - REGULAR + - OTHER + - DROPOFF + ProductAnalyticsSankeyRequest: + description: Request for computing a Sankey flow analysis. + example: + data: + attributes: + data_source: product_analytics + definition: + entries_per_step: 5 + number_of_steps: 5 + source: /logs + target: '' + search: + join_keys: + primary: '@session.id' + query: '@type:view' + time: + from: 1771232048460 + to: 1771836848262 + type: sankey_request + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsSankeyRequestData' + required: + - data + type: object + ProductAnalyticsSankeyRequestAttributes: + description: Attributes for a Sankey request. + properties: + data_source: + description: The data source for the Sankey query. + example: product_analytics + type: string + definition: + $ref: '#/components/schemas/ProductAnalyticsSankeyDefinition' + enforced_execution_type: + $ref: '#/components/schemas/ProductAnalyticsExecutionType' + request_id: + type: string + sampling: + $ref: '#/components/schemas/ProductAnalyticsSampling' + search: + $ref: '#/components/schemas/ProductAnalyticsSankeySearch' + time: + $ref: '#/components/schemas/ProductAnalyticsSankeyTime' + required: + - time + - search + - definition + - data_source + type: object + ProductAnalyticsSankeyRequestData: + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsSankeyRequestAttributes' + type: + $ref: '#/components/schemas/ProductAnalyticsSankeyRequestType' + required: + - type + - attributes + type: object + ProductAnalyticsSankeyRequestType: + enum: + - sankey_request + example: sankey_request + type: string + x-enum-varnames: + - SANKEY_REQUEST + ProductAnalyticsSankeyResponse: + description: Response for a Sankey flow analysis. + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsSankeyResponseData' + meta: + $ref: '#/components/schemas/ProductAnalyticsResponseMeta' + type: object + ProductAnalyticsSankeyResponseAttributes: + properties: + links: + description: The links (flows) between nodes. + items: + $ref: '#/components/schemas/ProductAnalyticsSankeyLink' + type: array + nodes: + description: The nodes (pages) in the Sankey diagram. + items: + $ref: '#/components/schemas/ProductAnalyticsSankeyNode' + type: array + type: object + ProductAnalyticsSankeyResponseData: + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsSankeyResponseAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsSankeyResponseType' + type: object + ProductAnalyticsSankeyResponseType: + enum: + - sankey_response + type: string + x-enum-varnames: + - SANKEY_RESPONSE + ProductAnalyticsSankeySearch: + description: Search parameters for a Sankey query. + properties: + audience_filters: + $ref: '#/components/schemas/ProductAnalyticsAudienceFilters' + join_keys: + $ref: '#/components/schemas/ProductAnalyticsJoinKeys' + occurrences: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceFilter' + query: + description: The search query. Cannot be empty. + example: '@type:view' + type: string + subquery_id: + type: string + required: + - query + type: object + ProductAnalyticsSankeyTime: + description: Time range for the Sankey query. + properties: + from: + description: Start time in epoch milliseconds. + example: 0 + format: int64 + type: integer + to: + description: End time in epoch milliseconds. + example: 0 + format: int64 + type: integer + required: + - from + - to + type: object ProductAnalyticsScalarColumn: description: A column in a scalar response. properties: @@ -93205,6 +93485,43 @@ paths: operator: OR permissions: - rum_apps_read + /api/v2/product-analytics/sankey: + post: + description: 'Compute a Sankey flow analysis showing how users navigate between + pages. + + Specify either a `source` page (forward flow) or `target` page (backward flow), + but not both. + + Maximum 10 steps and 10 entries per step.' + operationId: QueryProductAnalyticsSankey + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsSankeyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsSankeyResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Compute Sankey flow analysis + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read /api/v2/product-analytics/users/event_filtered_query: post: description: Query users filtered by both user properties and event platform diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index deb71c283a..d97cfe4d15 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -20955,6 +20955,13 @@ datadog\_api\_client.v2.model.product\_analytics\_interval module :members: :show-inheritance: +datadog\_api\_client.v2.model.product\_analytics\_join\_keys module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_join_keys + :members: + :show-inheritance: + datadog\_api\_client.v2.model.product\_analytics\_occurrence\_filter module --------------------------------------------------------------------------- @@ -20997,6 +21004,125 @@ datadog\_api\_client.v2.model.product\_analytics\_response\_meta\_status module :members: :show-inheritance: +datadog\_api\_client.v2.model.product\_analytics\_sampling module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sampling + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_aggregated\_node module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_aggregated_node + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_aggregated\_node\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_aggregated_node_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_definition module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_definition + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_link module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_link + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_node module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_node + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_node\_type module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_node_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_request\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_request\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_request\_type module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_response\_attributes module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_response\_data module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_response\_type module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_response_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_search module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_search + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.product\_analytics\_sankey\_time module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.product_analytics_sankey_time + :members: + :show-inheritance: + datadog\_api\_client.v2.model.product\_analytics\_scalar\_column module ----------------------------------------------------------------------- diff --git a/examples/v2/product-analytics/QueryProductAnalyticsSankey.py b/examples/v2/product-analytics/QueryProductAnalyticsSankey.py new file mode 100644 index 0000000000..9b07f3e7c8 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsSankey.py @@ -0,0 +1,48 @@ +""" +Compute Sankey flow analysis returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_join_keys import ProductAnalyticsJoinKeys +from datadog_api_client.v2.model.product_analytics_sankey_definition import ProductAnalyticsSankeyDefinition +from datadog_api_client.v2.model.product_analytics_sankey_request import ProductAnalyticsSankeyRequest +from datadog_api_client.v2.model.product_analytics_sankey_request_attributes import ( + ProductAnalyticsSankeyRequestAttributes, +) +from datadog_api_client.v2.model.product_analytics_sankey_request_data import ProductAnalyticsSankeyRequestData +from datadog_api_client.v2.model.product_analytics_sankey_request_type import ProductAnalyticsSankeyRequestType +from datadog_api_client.v2.model.product_analytics_sankey_search import ProductAnalyticsSankeySearch +from datadog_api_client.v2.model.product_analytics_sankey_time import ProductAnalyticsSankeyTime + +body = ProductAnalyticsSankeyRequest( + data=ProductAnalyticsSankeyRequestData( + attributes=ProductAnalyticsSankeyRequestAttributes( + data_source="product_analytics", + definition=ProductAnalyticsSankeyDefinition( + entries_per_step=5, + number_of_steps=5, + source="/logs", + target="", + ), + search=ProductAnalyticsSankeySearch( + join_keys=ProductAnalyticsJoinKeys( + primary="@session.id", + ), + query="@type:view", + ), + time=ProductAnalyticsSankeyTime( + _from=1771232048460, + to=1771836848262, + ), + ), + type=ProductAnalyticsSankeyRequestType.SANKEY_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.query_product_analytics_sankey(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/product_analytics_api.py b/src/datadog_api_client/v2/api/product_analytics_api.py index a3ad76ce34..33f13335e0 100644 --- a/src/datadog_api_client/v2/api/product_analytics_api.py +++ b/src/datadog_api_client/v2/api/product_analytics_api.py @@ -11,6 +11,8 @@ from datadog_api_client.v2.model.product_analytics_scalar_response import ProductAnalyticsScalarResponse from datadog_api_client.v2.model.product_analytics_analytics_request import ProductAnalyticsAnalyticsRequest from datadog_api_client.v2.model.product_analytics_timeseries_response import ProductAnalyticsTimeseriesResponse +from datadog_api_client.v2.model.product_analytics_sankey_response import ProductAnalyticsSankeyResponse +from datadog_api_client.v2.model.product_analytics_sankey_request import ProductAnalyticsSankeyRequest class ProductAnalyticsApi: @@ -26,6 +28,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._query_product_analytics_sankey_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsSankeyResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/sankey", + "operation_id": "query_product_analytics_sankey", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ProductAnalyticsSankeyRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._query_product_analytics_scalar_endpoint = _Endpoint( settings={ "response_type": (ProductAnalyticsScalarResponse,), @@ -135,6 +157,24 @@ def __init__(self, api_client=None): api_client=api_client, ) + def query_product_analytics_sankey( + self, + body: ProductAnalyticsSankeyRequest, + ) -> ProductAnalyticsSankeyResponse: + """Compute Sankey flow analysis. + + Compute a Sankey flow analysis showing how users navigate between pages. + Specify either a ``source`` page (forward flow) or ``target`` page (backward flow), but not both. + Maximum 10 steps and 10 entries per step. + + :type body: ProductAnalyticsSankeyRequest + :rtype: ProductAnalyticsSankeyResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._query_product_analytics_sankey_endpoint.call_with_http_info(**kwargs) + def query_product_analytics_scalar( self, body: ProductAnalyticsAnalyticsRequest, diff --git a/src/datadog_api_client/v2/model/product_analytics_join_keys.py b/src/datadog_api_client/v2/model/product_analytics_join_keys.py new file mode 100644 index 0000000000..ebf002b571 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_join_keys.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsJoinKeys(ModelNormal): + @cached_property + def openapi_types(_): + return { + "primary": (str,), + "secondary": ([str],), + } + + attribute_map = { + "primary": "primary", + "secondary": "secondary", + } + + def __init__( + self_, primary: Union[str, UnsetType] = unset, secondary: Union[List[str], UnsetType] = unset, **kwargs + ): + """ + Join key configuration for correlating events. + + :param primary: The primary join key facet. + :type primary: str, optional + + :param secondary: Secondary join key facets. + :type secondary: [str], optional + """ + if primary is not unset: + kwargs["primary"] = primary + if secondary is not unset: + kwargs["secondary"] = secondary + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sampling.py b/src/datadog_api_client/v2/model/product_analytics_sampling.py new file mode 100644 index 0000000000..5db78f3488 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sampling.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsSampling(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: Union[bool, UnsetType] = unset, **kwargs): + """ + Sampling configuration. + + :param enabled: Whether sampling is enabled. + :type enabled: bool, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node.py b/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node.py new file mode 100644 index 0000000000..91c080c89c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node.py @@ -0,0 +1,90 @@ +# 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.product_analytics_sankey_aggregated_node_type import ( + ProductAnalyticsSankeyAggregatedNodeType, + ) + + +class ProductAnalyticsSankeyAggregatedNode(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_aggregated_node_type import ( + ProductAnalyticsSankeyAggregatedNodeType, + ) + + return { + "id": (str,), + "incoming_value": (int,), + "name": (str,), + "outgoing_value": (int,), + "type": (ProductAnalyticsSankeyAggregatedNodeType,), + "value": (int,), + } + + attribute_map = { + "id": "id", + "incoming_value": "incoming_value", + "name": "name", + "outgoing_value": "outgoing_value", + "type": "type", + "value": "value", + } + + def __init__( + self_, + id: Union[str, UnsetType] = unset, + incoming_value: Union[int, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + outgoing_value: Union[int, UnsetType] = unset, + type: Union[ProductAnalyticsSankeyAggregatedNodeType, UnsetType] = unset, + value: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A node aggregated into an "other" node. + + :param id: + :type id: str, optional + + :param incoming_value: + :type incoming_value: int, optional + + :param name: + :type name: str, optional + + :param outgoing_value: + :type outgoing_value: int, optional + + :param type: + :type type: ProductAnalyticsSankeyAggregatedNodeType, optional + + :param value: + :type value: int, optional + """ + if id is not unset: + kwargs["id"] = id + if incoming_value is not unset: + kwargs["incoming_value"] = incoming_value + if name is not unset: + kwargs["name"] = name + if outgoing_value is not unset: + kwargs["outgoing_value"] = outgoing_value + if type is not unset: + kwargs["type"] = type + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node_type.py b/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node_type.py new file mode 100644 index 0000000000..84fa53d240 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_aggregated_node_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 ProductAnalyticsSankeyAggregatedNodeType(ModelSimple): + """ + + + :param value: If omitted defaults to "aggregated". Must be one of ["aggregated"]. + :type value: str + """ + + allowed_values = { + "aggregated", + } + AGGREGATED: ClassVar["ProductAnalyticsSankeyAggregatedNodeType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsSankeyAggregatedNodeType.AGGREGATED = ProductAnalyticsSankeyAggregatedNodeType("aggregated") diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_definition.py b/src/datadog_api_client/v2/model/product_analytics_sankey_definition.py new file mode 100644 index 0000000000..4404d9ca7c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_definition.py @@ -0,0 +1,75 @@ +# 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 ProductAnalyticsSankeyDefinition(ModelNormal): + validations = { + "entries_per_step": { + "inclusive_maximum": 10, + }, + "number_of_steps": { + "inclusive_maximum": 10, + }, + } + + @cached_property + def openapi_types(_): + return { + "entries_per_step": (int,), + "number_of_steps": (int,), + "source": (str,), + "target": (str,), + } + + attribute_map = { + "entries_per_step": "entries_per_step", + "number_of_steps": "number_of_steps", + "source": "source", + "target": "target", + } + + def __init__( + self_, + entries_per_step: Union[int, UnsetType] = unset, + number_of_steps: Union[int, UnsetType] = unset, + source: Union[str, UnsetType] = unset, + target: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Sankey visualization definition. Set either ``source`` or ``target`` , not both. + Use ``source`` for forward flow (where do users go after this page?) or + ``target`` for backward flow (where did users come from?). + + :param entries_per_step: Number of page entries per step. Default 5, max 10. + :type entries_per_step: int, optional + + :param number_of_steps: Number of steps in the flow. Default 5, max 10. + :type number_of_steps: int, optional + + :param source: The source page for forward flow analysis. Use "*" for all pages. + :type source: str, optional + + :param target: The target page for backward flow analysis. + :type target: str, optional + """ + if entries_per_step is not unset: + kwargs["entries_per_step"] = entries_per_step + if number_of_steps is not unset: + kwargs["number_of_steps"] = number_of_steps + if source is not unset: + kwargs["source"] = source + if target is not unset: + kwargs["target"] = target + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_link.py b/src/datadog_api_client/v2/model/product_analytics_sankey_link.py new file mode 100644 index 0000000000..c18df37556 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_link.py @@ -0,0 +1,72 @@ +# 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 ProductAnalyticsSankeyLink(ModelNormal): + @cached_property + def openapi_types(_): + return { + "column": (int,), + "id": (str,), + "source": (str,), + "target": (str,), + "value": (int,), + } + + attribute_map = { + "column": "column", + "id": "id", + "source": "source", + "target": "target", + "value": "value", + } + + def __init__( + self_, + column: Union[int, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + source: Union[str, UnsetType] = unset, + target: Union[str, UnsetType] = unset, + value: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A link between two nodes in the Sankey diagram. + + :param column: The step column of the source node. + :type column: int, optional + + :param id: + :type id: str, optional + + :param source: The source node ID. + :type source: str, optional + + :param target: The target node ID. + :type target: str, optional + + :param value: The number of sessions through this link. + :type value: int, optional + """ + if column is not unset: + kwargs["column"] = column + if id is not unset: + kwargs["id"] = id + if source is not unset: + kwargs["source"] = source + if target is not unset: + kwargs["target"] = target + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_node.py b/src/datadog_api_client/v2/model/product_analytics_sankey_node.py new file mode 100644 index 0000000000..cd4fc5586a --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_node.py @@ -0,0 +1,116 @@ +# 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.product_analytics_sankey_aggregated_node import ( + ProductAnalyticsSankeyAggregatedNode, + ) + from datadog_api_client.v2.model.product_analytics_sankey_node_type import ProductAnalyticsSankeyNodeType + + +class ProductAnalyticsSankeyNode(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_aggregated_node import ( + ProductAnalyticsSankeyAggregatedNode, + ) + from datadog_api_client.v2.model.product_analytics_sankey_node_type import ProductAnalyticsSankeyNodeType + + return { + "aggregated_nodes": ([ProductAnalyticsSankeyAggregatedNode],), + "column": (int,), + "dropoff_value": (int,), + "id": (str,), + "incoming_value": (int,), + "name": (str,), + "outgoing_value": (int,), + "type": (ProductAnalyticsSankeyNodeType,), + "value": (int,), + } + + attribute_map = { + "aggregated_nodes": "aggregated_nodes", + "column": "column", + "dropoff_value": "dropoff_value", + "id": "id", + "incoming_value": "incoming_value", + "name": "name", + "outgoing_value": "outgoing_value", + "type": "type", + "value": "value", + } + + def __init__( + self_, + aggregated_nodes: Union[List[ProductAnalyticsSankeyAggregatedNode], UnsetType] = unset, + column: Union[int, UnsetType] = unset, + dropoff_value: Union[int, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + incoming_value: Union[int, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + outgoing_value: Union[int, UnsetType] = unset, + type: Union[ProductAnalyticsSankeyNodeType, UnsetType] = unset, + value: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A node in the Sankey diagram representing a page or aggregation. + + :param aggregated_nodes: Nodes aggregated into this node (for "other" type). + :type aggregated_nodes: [ProductAnalyticsSankeyAggregatedNode], optional + + :param column: The step column (0-indexed). + :type column: int, optional + + :param dropoff_value: + :type dropoff_value: int, optional + + :param id: + :type id: str, optional + + :param incoming_value: + :type incoming_value: int, optional + + :param name: The page name. + :type name: str, optional + + :param outgoing_value: + :type outgoing_value: int, optional + + :param type: Node type. + :type type: ProductAnalyticsSankeyNodeType, optional + + :param value: The number of sessions through this node. + :type value: int, optional + """ + if aggregated_nodes is not unset: + kwargs["aggregated_nodes"] = aggregated_nodes + if column is not unset: + kwargs["column"] = column + if dropoff_value is not unset: + kwargs["dropoff_value"] = dropoff_value + if id is not unset: + kwargs["id"] = id + if incoming_value is not unset: + kwargs["incoming_value"] = incoming_value + if name is not unset: + kwargs["name"] = name + if outgoing_value is not unset: + kwargs["outgoing_value"] = outgoing_value + if type is not unset: + kwargs["type"] = type + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_node_type.py b/src/datadog_api_client/v2/model/product_analytics_sankey_node_type.py new file mode 100644 index 0000000000..4b7a9fb7a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_node_type.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsSankeyNodeType(ModelSimple): + """ + Node type. + + :param value: Must be one of ["regular", "other", "dropoff"]. + :type value: str + """ + + allowed_values = { + "regular", + "other", + "dropoff", + } + REGULAR: ClassVar["ProductAnalyticsSankeyNodeType"] + OTHER: ClassVar["ProductAnalyticsSankeyNodeType"] + DROPOFF: ClassVar["ProductAnalyticsSankeyNodeType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsSankeyNodeType.REGULAR = ProductAnalyticsSankeyNodeType("regular") +ProductAnalyticsSankeyNodeType.OTHER = ProductAnalyticsSankeyNodeType("other") +ProductAnalyticsSankeyNodeType.DROPOFF = ProductAnalyticsSankeyNodeType("dropoff") diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_request.py b/src/datadog_api_client/v2/model/product_analytics_sankey_request.py new file mode 100644 index 0000000000..4739b48405 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_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.product_analytics_sankey_request_data import ProductAnalyticsSankeyRequestData + + +class ProductAnalyticsSankeyRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_request_data import ProductAnalyticsSankeyRequestData + + return { + "data": (ProductAnalyticsSankeyRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsSankeyRequestData, **kwargs): + """ + Request for computing a Sankey flow analysis. + + :param data: + :type data: ProductAnalyticsSankeyRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_request_attributes.py b/src/datadog_api_client/v2/model/product_analytics_sankey_request_attributes.py new file mode 100644 index 0000000000..44b18ef0dc --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_request_attributes.py @@ -0,0 +1,101 @@ +# 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.product_analytics_sankey_definition import ProductAnalyticsSankeyDefinition + from datadog_api_client.v2.model.product_analytics_execution_type import ProductAnalyticsExecutionType + from datadog_api_client.v2.model.product_analytics_sampling import ProductAnalyticsSampling + from datadog_api_client.v2.model.product_analytics_sankey_search import ProductAnalyticsSankeySearch + from datadog_api_client.v2.model.product_analytics_sankey_time import ProductAnalyticsSankeyTime + + +class ProductAnalyticsSankeyRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_definition import ProductAnalyticsSankeyDefinition + from datadog_api_client.v2.model.product_analytics_execution_type import ProductAnalyticsExecutionType + from datadog_api_client.v2.model.product_analytics_sampling import ProductAnalyticsSampling + from datadog_api_client.v2.model.product_analytics_sankey_search import ProductAnalyticsSankeySearch + from datadog_api_client.v2.model.product_analytics_sankey_time import ProductAnalyticsSankeyTime + + return { + "data_source": (str,), + "definition": (ProductAnalyticsSankeyDefinition,), + "enforced_execution_type": (ProductAnalyticsExecutionType,), + "request_id": (str,), + "sampling": (ProductAnalyticsSampling,), + "search": (ProductAnalyticsSankeySearch,), + "time": (ProductAnalyticsSankeyTime,), + } + + attribute_map = { + "data_source": "data_source", + "definition": "definition", + "enforced_execution_type": "enforced_execution_type", + "request_id": "request_id", + "sampling": "sampling", + "search": "search", + "time": "time", + } + + def __init__( + self_, + data_source: str, + definition: ProductAnalyticsSankeyDefinition, + search: ProductAnalyticsSankeySearch, + time: ProductAnalyticsSankeyTime, + enforced_execution_type: Union[ProductAnalyticsExecutionType, UnsetType] = unset, + request_id: Union[str, UnsetType] = unset, + sampling: Union[ProductAnalyticsSampling, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for a Sankey request. + + :param data_source: The data source for the Sankey query. + :type data_source: str + + :param definition: Sankey visualization definition. Set either ``source`` or ``target`` , not both. + Use ``source`` for forward flow (where do users go after this page?) or + ``target`` for backward flow (where did users come from?). + :type definition: ProductAnalyticsSankeyDefinition + + :param enforced_execution_type: Override the query execution strategy. + :type enforced_execution_type: ProductAnalyticsExecutionType, optional + + :param request_id: + :type request_id: str, optional + + :param sampling: Sampling configuration. + :type sampling: ProductAnalyticsSampling, optional + + :param search: Search parameters for a Sankey query. + :type search: ProductAnalyticsSankeySearch + + :param time: Time range for the Sankey query. + :type time: ProductAnalyticsSankeyTime + """ + if enforced_execution_type is not unset: + kwargs["enforced_execution_type"] = enforced_execution_type + if request_id is not unset: + kwargs["request_id"] = request_id + if sampling is not unset: + kwargs["sampling"] = sampling + super().__init__(kwargs) + + self_.data_source = data_source + self_.definition = definition + self_.search = search + self_.time = time diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_request_data.py b/src/datadog_api_client/v2/model/product_analytics_sankey_request_data.py new file mode 100644 index 0000000000..8d27093427 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_request_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.product_analytics_sankey_request_attributes import ( + ProductAnalyticsSankeyRequestAttributes, + ) + from datadog_api_client.v2.model.product_analytics_sankey_request_type import ProductAnalyticsSankeyRequestType + + +class ProductAnalyticsSankeyRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_request_attributes import ( + ProductAnalyticsSankeyRequestAttributes, + ) + from datadog_api_client.v2.model.product_analytics_sankey_request_type import ProductAnalyticsSankeyRequestType + + return { + "attributes": (ProductAnalyticsSankeyRequestAttributes,), + "type": (ProductAnalyticsSankeyRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsSankeyRequestAttributes, type: ProductAnalyticsSankeyRequestType, **kwargs + ): + """ + + + :param attributes: Attributes for a Sankey request. + :type attributes: ProductAnalyticsSankeyRequestAttributes + + :param type: + :type type: ProductAnalyticsSankeyRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_request_type.py b/src/datadog_api_client/v2/model/product_analytics_sankey_request_type.py new file mode 100644 index 0000000000..b17086b0ea --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_request_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 ProductAnalyticsSankeyRequestType(ModelSimple): + """ + + + :param value: If omitted defaults to "sankey_request". Must be one of ["sankey_request"]. + :type value: str + """ + + allowed_values = { + "sankey_request", + } + SANKEY_REQUEST: ClassVar["ProductAnalyticsSankeyRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsSankeyRequestType.SANKEY_REQUEST = ProductAnalyticsSankeyRequestType("sankey_request") diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_response.py b/src/datadog_api_client/v2/model/product_analytics_sankey_response.py new file mode 100644 index 0000000000..bfd2d78989 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_response.py @@ -0,0 +1,58 @@ +# 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.product_analytics_sankey_response_data import ProductAnalyticsSankeyResponseData + from datadog_api_client.v2.model.product_analytics_response_meta import ProductAnalyticsResponseMeta + + +class ProductAnalyticsSankeyResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_response_data import ( + ProductAnalyticsSankeyResponseData, + ) + from datadog_api_client.v2.model.product_analytics_response_meta import ProductAnalyticsResponseMeta + + return { + "data": (ProductAnalyticsSankeyResponseData,), + "meta": (ProductAnalyticsResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, + data: Union[ProductAnalyticsSankeyResponseData, UnsetType] = unset, + meta: Union[ProductAnalyticsResponseMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response for a Sankey flow analysis. + + :param data: + :type data: ProductAnalyticsSankeyResponseData, optional + + :param meta: Metadata for a Product Analytics query response. + :type meta: ProductAnalyticsResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_response_attributes.py b/src/datadog_api_client/v2/model/product_analytics_sankey_response_attributes.py new file mode 100644 index 0000000000..308626b001 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_response_attributes.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 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.product_analytics_sankey_link import ProductAnalyticsSankeyLink + from datadog_api_client.v2.model.product_analytics_sankey_node import ProductAnalyticsSankeyNode + + +class ProductAnalyticsSankeyResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_link import ProductAnalyticsSankeyLink + from datadog_api_client.v2.model.product_analytics_sankey_node import ProductAnalyticsSankeyNode + + return { + "links": ([ProductAnalyticsSankeyLink],), + "nodes": ([ProductAnalyticsSankeyNode],), + } + + attribute_map = { + "links": "links", + "nodes": "nodes", + } + + def __init__( + self_, + links: Union[List[ProductAnalyticsSankeyLink], UnsetType] = unset, + nodes: Union[List[ProductAnalyticsSankeyNode], UnsetType] = unset, + **kwargs, + ): + """ + + + :param links: The links (flows) between nodes. + :type links: [ProductAnalyticsSankeyLink], optional + + :param nodes: The nodes (pages) in the Sankey diagram. + :type nodes: [ProductAnalyticsSankeyNode], optional + """ + if links is not unset: + kwargs["links"] = links + if nodes is not unset: + kwargs["nodes"] = nodes + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_response_data.py b/src/datadog_api_client/v2/model/product_analytics_sankey_response_data.py new file mode 100644 index 0000000000..35128d2619 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_response_data.py @@ -0,0 +1,70 @@ +# 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.product_analytics_sankey_response_attributes import ( + ProductAnalyticsSankeyResponseAttributes, + ) + from datadog_api_client.v2.model.product_analytics_sankey_response_type import ProductAnalyticsSankeyResponseType + + +class ProductAnalyticsSankeyResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_sankey_response_attributes import ( + ProductAnalyticsSankeyResponseAttributes, + ) + from datadog_api_client.v2.model.product_analytics_sankey_response_type import ( + ProductAnalyticsSankeyResponseType, + ) + + return { + "attributes": (ProductAnalyticsSankeyResponseAttributes,), + "id": (str,), + "type": (ProductAnalyticsSankeyResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[ProductAnalyticsSankeyResponseAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[ProductAnalyticsSankeyResponseType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: ProductAnalyticsSankeyResponseAttributes, optional + + :param id: + :type id: str, optional + + :param type: + :type type: ProductAnalyticsSankeyResponseType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_response_type.py b/src/datadog_api_client/v2/model/product_analytics_sankey_response_type.py new file mode 100644 index 0000000000..90428d1f25 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_response_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 ProductAnalyticsSankeyResponseType(ModelSimple): + """ + + + :param value: If omitted defaults to "sankey_response". Must be one of ["sankey_response"]. + :type value: str + """ + + allowed_values = { + "sankey_response", + } + SANKEY_RESPONSE: ClassVar["ProductAnalyticsSankeyResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsSankeyResponseType.SANKEY_RESPONSE = ProductAnalyticsSankeyResponseType("sankey_response") diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_search.py b/src/datadog_api_client/v2/model/product_analytics_sankey_search.py new file mode 100644 index 0000000000..967c8a3919 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_search.py @@ -0,0 +1,82 @@ +# 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.product_analytics_audience_filters import ProductAnalyticsAudienceFilters + from datadog_api_client.v2.model.product_analytics_join_keys import ProductAnalyticsJoinKeys + from datadog_api_client.v2.model.product_analytics_occurrence_filter import ProductAnalyticsOccurrenceFilter + + +class ProductAnalyticsSankeySearch(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_audience_filters import ProductAnalyticsAudienceFilters + from datadog_api_client.v2.model.product_analytics_join_keys import ProductAnalyticsJoinKeys + from datadog_api_client.v2.model.product_analytics_occurrence_filter import ProductAnalyticsOccurrenceFilter + + return { + "audience_filters": (ProductAnalyticsAudienceFilters,), + "join_keys": (ProductAnalyticsJoinKeys,), + "occurrences": (ProductAnalyticsOccurrenceFilter,), + "query": (str,), + "subquery_id": (str,), + } + + attribute_map = { + "audience_filters": "audience_filters", + "join_keys": "join_keys", + "occurrences": "occurrences", + "query": "query", + "subquery_id": "subquery_id", + } + + def __init__( + self_, + query: str, + audience_filters: Union[ProductAnalyticsAudienceFilters, UnsetType] = unset, + join_keys: Union[ProductAnalyticsJoinKeys, UnsetType] = unset, + occurrences: Union[ProductAnalyticsOccurrenceFilter, UnsetType] = unset, + subquery_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Search parameters for a Sankey query. + + :param audience_filters: Audience filter definitions for targeting specific user segments. + :type audience_filters: ProductAnalyticsAudienceFilters, optional + + :param join_keys: Join key configuration for correlating events. + :type join_keys: ProductAnalyticsJoinKeys, optional + + :param occurrences: Filter for occurrence-based queries. + :type occurrences: ProductAnalyticsOccurrenceFilter, optional + + :param query: The search query. Cannot be empty. + :type query: str + + :param subquery_id: + :type subquery_id: str, optional + """ + if audience_filters is not unset: + kwargs["audience_filters"] = audience_filters + if join_keys is not unset: + kwargs["join_keys"] = join_keys + if occurrences is not unset: + kwargs["occurrences"] = occurrences + if subquery_id is not unset: + kwargs["subquery_id"] = subquery_id + super().__init__(kwargs) + + self_.query = query diff --git a/src/datadog_api_client/v2/model/product_analytics_sankey_time.py b/src/datadog_api_client/v2/model/product_analytics_sankey_time.py new file mode 100644 index 0000000000..4b283e4825 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_sankey_time.py @@ -0,0 +1,39 @@ +# 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 ProductAnalyticsSankeyTime(ModelNormal): + @cached_property + def openapi_types(_): + return { + "_from": (int,), + "to": (int,), + } + + attribute_map = { + "_from": "from", + "to": "to", + } + + def __init__(self_, _from: int, to: int, **kwargs): + """ + Time range for the Sankey query. + + :param _from: Start time in epoch milliseconds. + :type _from: int + + :param to: End time in epoch milliseconds. + :type to: int + """ + super().__init__(kwargs) + + self_._from = _from + self_.to = to diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index f96bb1ec98..48cb4c5115 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4279,6 +4279,7 @@ from datadog_api_client.v2.model.product_analytics_group_by import ProductAnalyticsGroupBy from datadog_api_client.v2.model.product_analytics_group_by_sort import ProductAnalyticsGroupBySort from datadog_api_client.v2.model.product_analytics_interval import ProductAnalyticsInterval +from datadog_api_client.v2.model.product_analytics_join_keys import ProductAnalyticsJoinKeys from datadog_api_client.v2.model.product_analytics_occurrence_filter import ProductAnalyticsOccurrenceFilter from datadog_api_client.v2.model.product_analytics_occurrence_query import ProductAnalyticsOccurrenceQuery from datadog_api_client.v2.model.product_analytics_occurrence_query_data_source import ( @@ -4287,6 +4288,29 @@ from datadog_api_client.v2.model.product_analytics_occurrence_search import ProductAnalyticsOccurrenceSearch from datadog_api_client.v2.model.product_analytics_response_meta import ProductAnalyticsResponseMeta from datadog_api_client.v2.model.product_analytics_response_meta_status import ProductAnalyticsResponseMetaStatus +from datadog_api_client.v2.model.product_analytics_sampling import ProductAnalyticsSampling +from datadog_api_client.v2.model.product_analytics_sankey_aggregated_node import ProductAnalyticsSankeyAggregatedNode +from datadog_api_client.v2.model.product_analytics_sankey_aggregated_node_type import ( + ProductAnalyticsSankeyAggregatedNodeType, +) +from datadog_api_client.v2.model.product_analytics_sankey_definition import ProductAnalyticsSankeyDefinition +from datadog_api_client.v2.model.product_analytics_sankey_link import ProductAnalyticsSankeyLink +from datadog_api_client.v2.model.product_analytics_sankey_node import ProductAnalyticsSankeyNode +from datadog_api_client.v2.model.product_analytics_sankey_node_type import ProductAnalyticsSankeyNodeType +from datadog_api_client.v2.model.product_analytics_sankey_request import ProductAnalyticsSankeyRequest +from datadog_api_client.v2.model.product_analytics_sankey_request_attributes import ( + ProductAnalyticsSankeyRequestAttributes, +) +from datadog_api_client.v2.model.product_analytics_sankey_request_data import ProductAnalyticsSankeyRequestData +from datadog_api_client.v2.model.product_analytics_sankey_request_type import ProductAnalyticsSankeyRequestType +from datadog_api_client.v2.model.product_analytics_sankey_response import ProductAnalyticsSankeyResponse +from datadog_api_client.v2.model.product_analytics_sankey_response_attributes import ( + ProductAnalyticsSankeyResponseAttributes, +) +from datadog_api_client.v2.model.product_analytics_sankey_response_data import ProductAnalyticsSankeyResponseData +from datadog_api_client.v2.model.product_analytics_sankey_response_type import ProductAnalyticsSankeyResponseType +from datadog_api_client.v2.model.product_analytics_sankey_search import ProductAnalyticsSankeySearch +from datadog_api_client.v2.model.product_analytics_sankey_time import ProductAnalyticsSankeyTime from datadog_api_client.v2.model.product_analytics_scalar_column import ProductAnalyticsScalarColumn from datadog_api_client.v2.model.product_analytics_scalar_column_meta import ProductAnalyticsScalarColumnMeta from datadog_api_client.v2.model.product_analytics_scalar_column_type import ProductAnalyticsScalarColumnType @@ -9283,12 +9307,30 @@ "ProductAnalyticsGroupBy", "ProductAnalyticsGroupBySort", "ProductAnalyticsInterval", + "ProductAnalyticsJoinKeys", "ProductAnalyticsOccurrenceFilter", "ProductAnalyticsOccurrenceQuery", "ProductAnalyticsOccurrenceQueryDataSource", "ProductAnalyticsOccurrenceSearch", "ProductAnalyticsResponseMeta", "ProductAnalyticsResponseMetaStatus", + "ProductAnalyticsSampling", + "ProductAnalyticsSankeyAggregatedNode", + "ProductAnalyticsSankeyAggregatedNodeType", + "ProductAnalyticsSankeyDefinition", + "ProductAnalyticsSankeyLink", + "ProductAnalyticsSankeyNode", + "ProductAnalyticsSankeyNodeType", + "ProductAnalyticsSankeyRequest", + "ProductAnalyticsSankeyRequestAttributes", + "ProductAnalyticsSankeyRequestData", + "ProductAnalyticsSankeyRequestType", + "ProductAnalyticsSankeyResponse", + "ProductAnalyticsSankeyResponseAttributes", + "ProductAnalyticsSankeyResponseData", + "ProductAnalyticsSankeyResponseType", + "ProductAnalyticsSankeySearch", + "ProductAnalyticsSankeyTime", "ProductAnalyticsScalarColumn", "ProductAnalyticsScalarColumnMeta", "ProductAnalyticsScalarColumnType", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.frozen index 957e037f23..62723cd8d2 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.frozen @@ -1 +1 @@ -2026-02-18T16:57:05.121Z \ No newline at end of file +2026-01-07T12:38:45.716Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.yaml index ee353eaab8..d29e21551c 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_a_test_suite_returns_ok_response.yaml @@ -11,10 +11,10 @@ interactions: uri: https://api.datadoghq.com/api/v2/synthetics/suites response: body: - string: '{"data":{"type":"suites","attributes":{"type":"suite","monitor_id":259845717,"name":"Example - suite name","options":{},"tests":[],"tags":["env:production"],"public_id":"hik-xp5-9q6","created_at":"2026-02-18T16:57:05.583051+00:00","modified_at":"2026-02-18T16:57:05.583051+00:00","created_by":{"name":"Corentin - Girard","email":"corentin.girard@datadoghq.com","handle":"corentin.girard@datadoghq.com"},"message":"Notification - message","org_id":321813,"modified_by":{"name":"Corentin Girard","email":"corentin.girard@datadoghq.com","handle":"corentin.girard@datadoghq.com"}},"id":"hik-xp5-9q6"}} + string: '{"data":{"type":"suites","id":"36n-bb6-njj","attributes":{"tags":["env:production"],"type":"suite","created_by":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"created_at":"2026-01-07T12:38:46.109472+00:00","modified_at":"2026-01-07T12:38:46.109472+00:00","message":"Notification + message","public_id":"36n-bb6-njj","options":{},"modified_by":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"tests":[],"name":"Example suite name","org_id":321813,"monitor_id":249141773}}} ' headers: @@ -24,7 +24,7 @@ interactions: code: 200 message: OK - request: - body: '{"data":{"attributes":{"public_ids":["hik-xp5-9q6"]},"type":"delete_suites_request"}}' + body: '{"data":{"attributes":{"public_ids":["36n-bb6-njj"]},"type":"delete_suites_request"}}' headers: accept: - application/json @@ -34,7 +34,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/synthetics/suites/bulk-delete response: body: - string: '{"data":[{"type":"suites","attributes":{"deleted_at":"2026-02-18 16:57:06.420679","public_id":"hik-xp5-9q6"},"id":"hik-xp5-9q6"}]} + string: '{"data":[{"type":"suites","attributes":{"public_id":"36n-bb6-njj","deleted_at":"2026-01-07 + 12:38:46.679914"},"id":"36n-bb6-njj"}]} ' headers: diff --git a/tests/v2/features/product_analytics.feature b/tests/v2/features/product_analytics.feature index 3b59a3a0f6..3cc0991602 100644 --- a/tests/v2/features/product_analytics.feature +++ b/tests/v2/features/product_analytics.feature @@ -12,6 +12,22 @@ Feature: Product Analytics Given a valid "apiKeyAuth" key in the system And an instance of "ProductAnalytics" API + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute Sankey flow analysis returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsSankey" request + And body with value {"data": {"attributes": {"data_source": "product_analytics", "definition": {"entries_per_step": 5, "number_of_steps": 5, "source": "/logs", "target": ""}, "search": {"join_keys": {"primary": "@session.id"}, "query": "@type:view"}, "time": {"from": 1771232048460, "to": 1771836848262}}, "type": "sankey_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute Sankey flow analysis returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsSankey" request + And body with value {"data": {"attributes": {"data_source": "product_analytics", "definition": {"entries_per_step": 5, "number_of_steps": 5, "source": "/logs", "target": ""}, "search": {"join_keys": {"primary": "@session.id"}, "query": "@type:view"}, "time": {"from": 1771232048460, "to": 1771836848262}}, "type": "sankey_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/product-analytics-backend Scenario: Compute scalar analytics returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 09186eef67..3628ff9e68 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3731,6 +3731,12 @@ "type": "safe" } }, + "QueryProductAnalyticsSankey": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "QueryEventFilteredUsers": { "tag": "Rum Audience Management", "undo": {