From c777ff6616e9b47f365f125d1ef95c5023753135 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 26 Oct 2026 09:50:15 +0000 Subject: [PATCH] Regenerate client from commit 88781db of spec repo --- .generator/schemas/v2/openapi.yaml | 311 +++++++++++++++++- .../v2/error-tracking/GetIssue_1133452323.py | 28 ++ .../v2/api/error_tracking_api.py | 17 +- .../get_issue_include_query_parameter_item.py | 5 +- .../v2/model/issue_included.py | 2 + .../v2/model/issue_relationships.py | 10 + .../v2/model/issue_response.py | 3 +- .../v2/model/issue_sample.py | 54 +++ .../v2/model/issue_sample_attributes.py | 263 +++++++++++++++ .../v2/model/issue_sample_bias.py | 50 +++ .../v2/model/issue_sample_code_snippet.py | 43 +++ .../v2/model/issue_sample_data_source.py | 50 +++ .../v2/model/issue_sample_error_stack.py | 54 +++ .../v2/model/issue_sample_event.py | 17 + .../v2/model/issue_sample_frame_link.py | 46 +++ .../model/issue_sample_git_file_location.py | 80 +++++ .../v2/model/issue_sample_reference.py | 46 +++ .../v2/model/issue_sample_stack_frame.py | 64 ++++ .../v2/model/issue_sample_type.py | 35 ++ .../v2/model/issue_samples_relationship.py | 40 +++ src/datadog_api_client/v2/models/__init__.py | 26 ++ .../test-runner-data/manifest.json | 7 + ...ssue-with-samples-returns-ok-response.json | 81 +++++ .../test-server-data/v2/error-tracking.json | 73 ++++ tests/v2/features/error_tracking.feature | 12 + 25 files changed, 1413 insertions(+), 4 deletions(-) create mode 100644 examples/v2/error-tracking/GetIssue_1133452323.py create mode 100644 src/datadog_api_client/v2/model/issue_sample.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_bias.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_code_snippet.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_data_source.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_error_stack.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_event.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_frame_link.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_git_file_location.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_reference.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_stack_frame.py create mode 100644 src/datadog_api_client/v2/model/issue_sample_type.py create mode 100644 src/datadog_api_client/v2/model/issue_samples_relationship.py create mode 100644 tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-samples-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c892a380ec..d5a829c7c8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -649,7 +649,9 @@ components: schema: type: string GetIssueIncludeQueryParameter: - description: Comma-separated list of relationship objects that should be included in the response. Possible values are `assignee`, `case`, and `team_owners`. + description: |- + Comma-separated list of relationship objects that should be included in the response. + Possible values are `assignee`, `case`, `team_owners`, and `samples`. explode: false in: query name: include @@ -658,6 +660,18 @@ components: items: $ref: "#/components/schemas/GetIssueIncludeQueryParameterItem" type: array + GetIssueSamplesBiasesFilterParameter: + description: |- + Comma-separated list of biases used to pick the samples returned with `include=samples`. + Requires `include=samples`. Defaults to all biases. + explode: false + in: query + name: filter[samples.biases] + required: false + schema: + items: + $ref: "#/components/schemas/IssueSampleBias" + type: array GoogleChatHandleIdPathParameter: description: Your organization handle ID. in: path @@ -55200,12 +55214,14 @@ components: - assignee - case - team_owners + - samples example: "case" type: string x-enum-varnames: - ASSIGNEE - CASE - TEAM_OWNERS + - SAMPLES GetMappingResponse: description: Response containing the entity attribute mapping configuration including all available attributes and their properties. example: @@ -65789,6 +65805,7 @@ components: - $ref: "#/components/schemas/IssueCase" - $ref: "#/components/schemas/IssueUser" - $ref: "#/components/schemas/IssueTeam" + - $ref: "#/components/schemas/IssueSample" IssueLanguage: description: Programming language associated with the issue. enum: @@ -65912,6 +65929,8 @@ components: $ref: "#/components/schemas/IssueAssigneeRelationship" case: $ref: "#/components/schemas/IssueCaseRelationship" + samples: + $ref: "#/components/schemas/IssueSamplesRelationship" team_owners: $ref: "#/components/schemas/IssueTeamOwnersRelationship" type: object @@ -65926,6 +65945,295 @@ components: $ref: "#/components/schemas/IssueIncluded" type: array type: object + IssueSample: + description: An error event of the issue, picked because it satisfies one or more sample biases. + properties: + attributes: + $ref: "#/components/schemas/IssueSampleAttributes" + id: + description: Sample identifier. + example: "AwAAAZPHnBVMDCSmFgAAABhBWlBIbkJWTUFBRDVnUkhKTmY0WmhRQUEAAAAkMDE5M2M3OWMtMTg1OC00ZTE1LWFhMmItOTQ1N2ZkOGVlMzQyAAAAAA" + type: string + type: + $ref: "#/components/schemas/IssueSampleType" + required: + - id + - type + - attributes + type: object + IssueSampleAttributes: + description: Object containing the information of a sample. + properties: + application_id: + description: RUM application identifier of the error. + example: "40d8ca4b-2ac0-481f-b16e-f110699ecff6" + type: string + biases: + description: Biases the sample satisfies. A single error can satisfy several biases. + example: ["latest", "git_metadata"] + items: + $ref: "#/components/schemas/IssueSampleBias" + type: array + build_id: + description: Build identifier of the mobile application. + example: "a1b2c3" + type: string + bundle_version: + description: Bundle version of the mobile application. + example: "42" + type: string + data_source: + $ref: "#/components/schemas/IssueSampleDataSource" + debug_id: + description: Debug identifier used to resolve the stack trace of the error to source code. + example: "9d8c7b6a-5f4e-3d2c-1b0a-9f8e7d6c5b4a" + type: string + debug_info_captured: + description: Whether an Exception Replay snapshot was captured for the error. + example: false + type: boolean + error_source_type: + description: |- + Source type set by the SDK or tracer that reported the error, such as `browser` for RUM browser errors + or `Crashtracking` for backend crash reports. Usually not set for APM and logs errors. + example: "browser" + type: string + error_stack: + $ref: "#/components/schemas/IssueSampleErrorStack" + event: + $ref: "#/components/schemas/IssueSampleEvent" + git_commit_sha: + description: Git commit SHA of the service version. + example: "b6199f80b6199f80b6199f80b6199f80b6199f80" + type: string + git_repository_id: + description: Git repository identifier of the service. + example: "github.com/company/email-api-py" + type: string + git_repository_url: + description: Git repository URL of the service. + example: "https://github.com/company/email-api-py" + type: string + has_session_replay: + description: Whether a RUM session replay is available for the error. + example: true + type: boolean + language: + description: Programming language of the service. + example: "python" + type: string + links: + description: Source code locations of the stack frames that resolve to a repository file. + items: + $ref: "#/components/schemas/IssueSampleFrameLink" + type: array + os_name: + description: Operating system of the device that reported the error. + example: "iOS" + type: string + service: + description: Service name. + example: "email-api-py" + type: string + session_id: + description: RUM session identifier of the error. + example: "72d11fa0-7f59-408a-95ff-9af7d4f8d7db" + type: string + session_replay_url: + description: URL of the RUM session replay of the error. + example: "https://app.datadoghq.com/rum/replay/sessions/72d11fa0-7f59-408a-95ff-9af7d4f8d7db" + type: string + snapshot_id: + description: Identifier of the Exception Replay snapshot of the error. + example: "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d" + type: string + span_id: + description: APM span identifier of the error. + example: "3906394766563720946" + type: string + timestamp: + description: Timestamp of the error. + example: "2024-01-01T10:00:00Z" + format: date-time + type: string + trace_id: + description: APM trace identifier of the error. + example: "6730183925457637287" + type: string + variant: + description: Build variant of the mobile application. + example: "release" + type: string + version: + description: Version of the service. + example: "1.2.3" + type: string + view_id: + description: RUM view identifier of the error. + example: "c5c02423-c03a-400a-993f-731bebf1732b" + type: string + required: + - timestamp + - error_stack + type: object + IssueSampleBias: + description: |- + Criterion used to pick a sample. `latest` picks the most recent error. `git_metadata` picks the most + recent error with source code metadata, whose stack trace is parsed. `trace` picks the most recent error + with an APM trace. `session_replay` picks the most recent error with a RUM session replay. + `exception_replay` picks the most recent error with an Exception Replay snapshot. + enum: + - latest + - git_metadata + - trace + - session_replay + - exception_replay + example: "latest" + type: string + x-enum-varnames: + - LATEST + - GIT_METADATA + - TRACE + - SESSION_REPLAY + - EXCEPTION_REPLAY + IssueSampleCodeSnippet: + description: Source code around a stack frame. Empty when the source code is unavailable. + properties: + lines: + description: Lines of source code. + example: ["def filter_forbidden_tags(tags):", " return len(tags)"] + items: + type: string + type: array + offset: + description: Line number of the first line of the snippet, starting at 1. + example: 37 + format: int64 + type: integer + type: object + IssueSampleDataSource: + description: Product that reported the error. The value is `NONE` when the error has no known origin. + enum: + - APM + - LOGS + - RUM + - LLMOBS + - SYNTHETICS + - NONE + example: "APM" + type: string + x-enum-varnames: + - APM + - LOGS + - RUM + - LLMOBS + - SYNTHETICS + - NONE + IssueSampleErrorStack: + description: Parsed stack trace of the error. Only the sample picked by the `git_metadata` bias has frames. + properties: + frames: + description: Stack frames, from the top of the stack. + items: + $ref: "#/components/schemas/IssueSampleStackFrame" + type: array + language: + description: Programming language used to parse the stack trace. + example: "go" + type: string + type: object + IssueSampleEvent: + additionalProperties: {} + description: Raw error event, as stored by its data source. Its fields differ between APM, logs, and RUM. + type: object + IssueSampleFrameLink: + description: Source code location of a stack frame. + properties: + code_location: + $ref: "#/components/schemas/IssueSampleGitFileLocation" + frame_id: + description: Index of the frame in the stack trace, starting at 0. + example: 1 + format: int64 + type: integer + required: + - frame_id + - code_location + type: object + IssueSampleGitFileLocation: + description: Location of a stack frame in a repository file. Empty when the source code is unavailable. + properties: + column: + description: Column of the location, starting at 1. + example: 13 + format: int64 + type: integer + filepath: + description: Path of the file in the repository. + example: "conduit/apps/core/utils.py" + type: string + first_line: + description: First line of the location, starting at 1. + example: 42 + format: int64 + type: integer + last_line: + description: Last line of the location, starting at 1. + example: 42 + format: int64 + type: integer + ref: + description: Git reference of the file, usually a commit SHA. + example: "b6199f80b6199f80b6199f80b6199f80b6199f80" + type: string + repo_id: + description: Repository identifier. + example: "github.com/company/email-api-py" + type: string + type: object + IssueSampleReference: + description: A curated error sample of the issue. + properties: + id: + description: Sample identifier. + example: "AwAAAZPHnBVMDCSmFgAAABhBWlBIbkJWTUFBRDVnUkhKTmY0WmhRQUEAAAAkMDE5M2M3OWMtMTg1OC00ZTE1LWFhMmItOTQ1N2ZkOGVlMzQyAAAAAA" + type: string + type: + $ref: "#/components/schemas/IssueSampleType" + required: + - id + - type + type: object + IssueSampleStackFrame: + description: A stack frame. + properties: + code_snippet: + $ref: "#/components/schemas/IssueSampleCodeSnippet" + git_file_location: + $ref: "#/components/schemas/IssueSampleGitFileLocation" + text: + description: Text of the frame, as it appears in the stack trace. + example: "main.handler(0xc000123456)\n\t/go/src/app/main.go:42 +0x1d" + type: string + type: object + IssueSampleType: + description: Type of the object. + enum: ["error_tracking_issue_sample"] + example: "error_tracking_issue_sample" + type: string + x-enum-varnames: + - ERROR_TRACKING_ISSUE_SAMPLE + IssueSamplesRelationship: + description: Relationship between the issue and its curated error samples. + properties: + data: + description: Array of curated error samples of the issue. + items: + $ref: "#/components/schemas/IssueSampleReference" + type: array + required: + - data + type: object IssueState: description: State of the issue enum: @@ -167425,6 +167733,7 @@ paths: parameters: - $ref: "#/components/parameters/IssueIDPathParameter" - $ref: "#/components/parameters/GetIssueIncludeQueryParameter" + - $ref: "#/components/parameters/GetIssueSamplesBiasesFilterParameter" responses: "200": content: diff --git a/examples/v2/error-tracking/GetIssue_1133452323.py b/examples/v2/error-tracking/GetIssue_1133452323.py new file mode 100644 index 0000000000..c09a4ddf65 --- /dev/null +++ b/examples/v2/error-tracking/GetIssue_1133452323.py @@ -0,0 +1,28 @@ +""" +Get the details of an error tracking issue with samples returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi +from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem +from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias + +# there is a valid "issue" in the system +ISSUE_ID = environ["ISSUE_ID"] + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.get_issue( + issue_id=ISSUE_ID, + include=[ + GetIssueIncludeQueryParameterItem.SAMPLES, + ], + filter_samples_biases=[ + IssueSampleBias.LATEST, + ], + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/error_tracking_api.py b/src/datadog_api_client/v2/api/error_tracking_api.py index 0bb0169026..4c4e07f6eb 100644 --- a/src/datadog_api_client/v2/api/error_tracking_api.py +++ b/src/datadog_api_client/v2/api/error_tracking_api.py @@ -16,6 +16,7 @@ from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest from datadog_api_client.v2.model.issue_response import IssueResponse from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem +from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias from datadog_api_client.v2.model.issue_update_assignee_request import IssueUpdateAssigneeRequest from datadog_api_client.v2.model.issue_update_state_request import IssueUpdateStateRequest @@ -75,6 +76,12 @@ def __init__(self, api_client=None): "location": "query", "collection_format": "csv", }, + "filter_samples_biases": { + "openapi_types": ([IssueSampleBias],), + "attribute": "filter[samples.biases]", + "location": "query", + "collection_format": "csv", + }, }, headers_map={ "accept": ["application/json"], @@ -182,6 +189,7 @@ def get_issue( issue_id: str, *, include: Union[List[GetIssueIncludeQueryParameterItem], UnsetType] = unset, + filter_samples_biases: Union[List[IssueSampleBias], UnsetType] = unset, ) -> IssueResponse: """Get the details of an error tracking issue. @@ -189,8 +197,12 @@ def get_issue( :param issue_id: The identifier of the issue. :type issue_id: str - :param include: Comma-separated list of relationship objects that should be included in the response. Possible values are ``assignee`` , ``case`` , and ``team_owners``. + :param include: Comma-separated list of relationship objects that should be included in the response. + Possible values are ``assignee`` , ``case`` , ``team_owners`` , and ``samples``. :type include: [GetIssueIncludeQueryParameterItem], optional + :param filter_samples_biases: Comma-separated list of biases used to pick the samples returned with ``include=samples``. + Requires ``include=samples``. Defaults to all biases. + :type filter_samples_biases: [IssueSampleBias], optional :rtype: IssueResponse """ kwargs: Dict[str, Any] = {} @@ -199,6 +211,9 @@ def get_issue( if include is not unset: kwargs["include"] = include + if filter_samples_biases is not unset: + kwargs["filter_samples_biases"] = filter_samples_biases + return self._get_issue_endpoint.call_with_http_info(**kwargs) def search_issues( diff --git a/src/datadog_api_client/v2/model/get_issue_include_query_parameter_item.py b/src/datadog_api_client/v2/model/get_issue_include_query_parameter_item.py index 0f3acc55c1..879c5014d4 100644 --- a/src/datadog_api_client/v2/model/get_issue_include_query_parameter_item.py +++ b/src/datadog_api_client/v2/model/get_issue_include_query_parameter_item.py @@ -16,7 +16,7 @@ class GetIssueIncludeQueryParameterItem(ModelSimple): """ Relationship object that should be included in the response. - :param value: Must be one of ["assignee", "case", "team_owners"]. + :param value: Must be one of ["assignee", "case", "team_owners", "samples"]. :type value: str """ @@ -24,10 +24,12 @@ class GetIssueIncludeQueryParameterItem(ModelSimple): "assignee", "case", "team_owners", + "samples", } ASSIGNEE: ClassVar["GetIssueIncludeQueryParameterItem"] CASE: ClassVar["GetIssueIncludeQueryParameterItem"] TEAM_OWNERS: ClassVar["GetIssueIncludeQueryParameterItem"] + SAMPLES: ClassVar["GetIssueIncludeQueryParameterItem"] @cached_property def openapi_types(_): @@ -39,3 +41,4 @@ def openapi_types(_): GetIssueIncludeQueryParameterItem.ASSIGNEE = GetIssueIncludeQueryParameterItem("assignee") GetIssueIncludeQueryParameterItem.CASE = GetIssueIncludeQueryParameterItem("case") GetIssueIncludeQueryParameterItem.TEAM_OWNERS = GetIssueIncludeQueryParameterItem("team_owners") +GetIssueIncludeQueryParameterItem.SAMPLES = GetIssueIncludeQueryParameterItem("samples") diff --git a/src/datadog_api_client/v2/model/issue_included.py b/src/datadog_api_client/v2/model/issue_included.py index ccbb0386ad..816e79f44b 100644 --- a/src/datadog_api_client/v2/model/issue_included.py +++ b/src/datadog_api_client/v2/model/issue_included.py @@ -41,11 +41,13 @@ def _composed_schemas(_): from datadog_api_client.v2.model.issue_case import IssueCase from datadog_api_client.v2.model.issue_user import IssueUser from datadog_api_client.v2.model.issue_team import IssueTeam + from datadog_api_client.v2.model.issue_sample import IssueSample return { "oneOf": [ IssueCase, IssueUser, IssueTeam, + IssueSample, ], } diff --git a/src/datadog_api_client/v2/model/issue_relationships.py b/src/datadog_api_client/v2/model/issue_relationships.py index cd3f22cbc6..3f8f182808 100644 --- a/src/datadog_api_client/v2/model/issue_relationships.py +++ b/src/datadog_api_client/v2/model/issue_relationships.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship + from datadog_api_client.v2.model.issue_samples_relationship import IssueSamplesRelationship from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship @@ -24,17 +25,20 @@ class IssueRelationships(ModelNormal): def openapi_types(_): from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship + from datadog_api_client.v2.model.issue_samples_relationship import IssueSamplesRelationship from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship return { "assignee": (IssueAssigneeRelationship,), "case": (IssueCaseRelationship,), + "samples": (IssueSamplesRelationship,), "team_owners": (IssueTeamOwnersRelationship,), } attribute_map = { "assignee": "assignee", "case": "case", + "samples": "samples", "team_owners": "team_owners", } @@ -42,6 +46,7 @@ def __init__( self_, assignee: Union[IssueAssigneeRelationship, UnsetType] = unset, case: Union[IssueCaseRelationship, UnsetType] = unset, + samples: Union[IssueSamplesRelationship, UnsetType] = unset, team_owners: Union[IssueTeamOwnersRelationship, UnsetType] = unset, **kwargs, ): @@ -54,6 +59,9 @@ def __init__( :param case: Relationship between the issue and case. :type case: IssueCaseRelationship, optional + :param samples: Relationship between the issue and its curated error samples. + :type samples: IssueSamplesRelationship, optional + :param team_owners: Relationship between the issue and teams. :type team_owners: IssueTeamOwnersRelationship, optional """ @@ -61,6 +69,8 @@ def __init__( kwargs["assignee"] = assignee if case is not unset: kwargs["case"] = case + if samples is not unset: + kwargs["samples"] = samples if team_owners is not unset: kwargs["team_owners"] = team_owners super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_response.py b/src/datadog_api_client/v2/model/issue_response.py index 2450ef7994..621a2c907e 100644 --- a/src/datadog_api_client/v2/model/issue_response.py +++ b/src/datadog_api_client/v2/model/issue_response.py @@ -19,6 +19,7 @@ from datadog_api_client.v2.model.issue_case import IssueCase from datadog_api_client.v2.model.issue_user import IssueUser from datadog_api_client.v2.model.issue_team import IssueTeam + from datadog_api_client.v2.model.issue_sample import IssueSample class IssueResponse(ModelNormal): @@ -40,7 +41,7 @@ def openapi_types(_): def __init__( self_, data: Union[Issue, UnsetType] = unset, - included: Union[List[Union[IssueIncluded, IssueCase, IssueUser, IssueTeam]], UnsetType] = unset, + included: Union[List[Union[IssueIncluded, IssueCase, IssueUser, IssueTeam, IssueSample]], UnsetType] = unset, **kwargs, ): """ diff --git a/src/datadog_api_client/v2/model/issue_sample.py b/src/datadog_api_client/v2/model/issue_sample.py new file mode 100644 index 0000000000..937dd1ef7c --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample.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.issue_sample_attributes import IssueSampleAttributes + from datadog_api_client.v2.model.issue_sample_type import IssueSampleType + + +class IssueSample(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_attributes import IssueSampleAttributes + from datadog_api_client.v2.model.issue_sample_type import IssueSampleType + + return { + "attributes": (IssueSampleAttributes,), + "id": (str,), + "type": (IssueSampleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IssueSampleAttributes, id: str, type: IssueSampleType, **kwargs): + """ + An error event of the issue, picked because it satisfies one or more sample biases. + + :param attributes: Object containing the information of a sample. + :type attributes: IssueSampleAttributes + + :param id: Sample identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueSampleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_sample_attributes.py b/src/datadog_api_client/v2/model/issue_sample_attributes.py new file mode 100644 index 0000000000..a774095a14 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_attributes.py @@ -0,0 +1,263 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias + from datadog_api_client.v2.model.issue_sample_data_source import IssueSampleDataSource + from datadog_api_client.v2.model.issue_sample_error_stack import IssueSampleErrorStack + from datadog_api_client.v2.model.issue_sample_event import IssueSampleEvent + from datadog_api_client.v2.model.issue_sample_frame_link import IssueSampleFrameLink + + +class IssueSampleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias + from datadog_api_client.v2.model.issue_sample_data_source import IssueSampleDataSource + from datadog_api_client.v2.model.issue_sample_error_stack import IssueSampleErrorStack + from datadog_api_client.v2.model.issue_sample_event import IssueSampleEvent + from datadog_api_client.v2.model.issue_sample_frame_link import IssueSampleFrameLink + + return { + "application_id": (str,), + "biases": ([IssueSampleBias],), + "build_id": (str,), + "bundle_version": (str,), + "data_source": (IssueSampleDataSource,), + "debug_id": (str,), + "debug_info_captured": (bool,), + "error_source_type": (str,), + "error_stack": (IssueSampleErrorStack,), + "event": (IssueSampleEvent,), + "git_commit_sha": (str,), + "git_repository_id": (str,), + "git_repository_url": (str,), + "has_session_replay": (bool,), + "language": (str,), + "links": ([IssueSampleFrameLink],), + "os_name": (str,), + "service": (str,), + "session_id": (str,), + "session_replay_url": (str,), + "snapshot_id": (str,), + "span_id": (str,), + "timestamp": (datetime,), + "trace_id": (str,), + "variant": (str,), + "version": (str,), + "view_id": (str,), + } + + attribute_map = { + "application_id": "application_id", + "biases": "biases", + "build_id": "build_id", + "bundle_version": "bundle_version", + "data_source": "data_source", + "debug_id": "debug_id", + "debug_info_captured": "debug_info_captured", + "error_source_type": "error_source_type", + "error_stack": "error_stack", + "event": "event", + "git_commit_sha": "git_commit_sha", + "git_repository_id": "git_repository_id", + "git_repository_url": "git_repository_url", + "has_session_replay": "has_session_replay", + "language": "language", + "links": "links", + "os_name": "os_name", + "service": "service", + "session_id": "session_id", + "session_replay_url": "session_replay_url", + "snapshot_id": "snapshot_id", + "span_id": "span_id", + "timestamp": "timestamp", + "trace_id": "trace_id", + "variant": "variant", + "version": "version", + "view_id": "view_id", + } + + def __init__( + self_, + error_stack: IssueSampleErrorStack, + timestamp: datetime, + application_id: Union[str, UnsetType] = unset, + biases: Union[List[IssueSampleBias], UnsetType] = unset, + build_id: Union[str, UnsetType] = unset, + bundle_version: Union[str, UnsetType] = unset, + data_source: Union[IssueSampleDataSource, UnsetType] = unset, + debug_id: Union[str, UnsetType] = unset, + debug_info_captured: Union[bool, UnsetType] = unset, + error_source_type: Union[str, UnsetType] = unset, + event: Union[IssueSampleEvent, UnsetType] = unset, + git_commit_sha: Union[str, UnsetType] = unset, + git_repository_id: Union[str, UnsetType] = unset, + git_repository_url: Union[str, UnsetType] = unset, + has_session_replay: Union[bool, UnsetType] = unset, + language: Union[str, UnsetType] = unset, + links: Union[List[IssueSampleFrameLink], UnsetType] = unset, + os_name: Union[str, UnsetType] = unset, + service: Union[str, UnsetType] = unset, + session_id: Union[str, UnsetType] = unset, + session_replay_url: Union[str, UnsetType] = unset, + snapshot_id: Union[str, UnsetType] = unset, + span_id: Union[str, UnsetType] = unset, + trace_id: Union[str, UnsetType] = unset, + variant: Union[str, UnsetType] = unset, + version: Union[str, UnsetType] = unset, + view_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the information of a sample. + + :param application_id: RUM application identifier of the error. + :type application_id: str, optional + + :param biases: Biases the sample satisfies. A single error can satisfy several biases. + :type biases: [IssueSampleBias], optional + + :param build_id: Build identifier of the mobile application. + :type build_id: str, optional + + :param bundle_version: Bundle version of the mobile application. + :type bundle_version: str, optional + + :param data_source: Product that reported the error. The value is ``NONE`` when the error has no known origin. + :type data_source: IssueSampleDataSource, optional + + :param debug_id: Debug identifier used to resolve the stack trace of the error to source code. + :type debug_id: str, optional + + :param debug_info_captured: Whether an Exception Replay snapshot was captured for the error. + :type debug_info_captured: bool, optional + + :param error_source_type: Source type set by the SDK or tracer that reported the error, such as ``browser`` for RUM browser errors + or ``Crashtracking`` for backend crash reports. Usually not set for APM and logs errors. + :type error_source_type: str, optional + + :param error_stack: Parsed stack trace of the error. Only the sample picked by the ``git_metadata`` bias has frames. + :type error_stack: IssueSampleErrorStack + + :param event: Raw error event, as stored by its data source. Its fields differ between APM, logs, and RUM. + :type event: IssueSampleEvent, optional + + :param git_commit_sha: Git commit SHA of the service version. + :type git_commit_sha: str, optional + + :param git_repository_id: Git repository identifier of the service. + :type git_repository_id: str, optional + + :param git_repository_url: Git repository URL of the service. + :type git_repository_url: str, optional + + :param has_session_replay: Whether a RUM session replay is available for the error. + :type has_session_replay: bool, optional + + :param language: Programming language of the service. + :type language: str, optional + + :param links: Source code locations of the stack frames that resolve to a repository file. + :type links: [IssueSampleFrameLink], optional + + :param os_name: Operating system of the device that reported the error. + :type os_name: str, optional + + :param service: Service name. + :type service: str, optional + + :param session_id: RUM session identifier of the error. + :type session_id: str, optional + + :param session_replay_url: URL of the RUM session replay of the error. + :type session_replay_url: str, optional + + :param snapshot_id: Identifier of the Exception Replay snapshot of the error. + :type snapshot_id: str, optional + + :param span_id: APM span identifier of the error. + :type span_id: str, optional + + :param timestamp: Timestamp of the error. + :type timestamp: datetime + + :param trace_id: APM trace identifier of the error. + :type trace_id: str, optional + + :param variant: Build variant of the mobile application. + :type variant: str, optional + + :param version: Version of the service. + :type version: str, optional + + :param view_id: RUM view identifier of the error. + :type view_id: str, optional + """ + if application_id is not unset: + kwargs["application_id"] = application_id + if biases is not unset: + kwargs["biases"] = biases + if build_id is not unset: + kwargs["build_id"] = build_id + if bundle_version is not unset: + kwargs["bundle_version"] = bundle_version + if data_source is not unset: + kwargs["data_source"] = data_source + if debug_id is not unset: + kwargs["debug_id"] = debug_id + if debug_info_captured is not unset: + kwargs["debug_info_captured"] = debug_info_captured + if error_source_type is not unset: + kwargs["error_source_type"] = error_source_type + if event is not unset: + kwargs["event"] = event + if git_commit_sha is not unset: + kwargs["git_commit_sha"] = git_commit_sha + if git_repository_id is not unset: + kwargs["git_repository_id"] = git_repository_id + if git_repository_url is not unset: + kwargs["git_repository_url"] = git_repository_url + if has_session_replay is not unset: + kwargs["has_session_replay"] = has_session_replay + if language is not unset: + kwargs["language"] = language + if links is not unset: + kwargs["links"] = links + if os_name is not unset: + kwargs["os_name"] = os_name + if service is not unset: + kwargs["service"] = service + if session_id is not unset: + kwargs["session_id"] = session_id + if session_replay_url is not unset: + kwargs["session_replay_url"] = session_replay_url + if snapshot_id is not unset: + kwargs["snapshot_id"] = snapshot_id + if span_id is not unset: + kwargs["span_id"] = span_id + if trace_id is not unset: + kwargs["trace_id"] = trace_id + if variant is not unset: + kwargs["variant"] = variant + if version is not unset: + kwargs["version"] = version + if view_id is not unset: + kwargs["view_id"] = view_id + super().__init__(kwargs) + + self_.error_stack = error_stack + self_.timestamp = timestamp diff --git a/src/datadog_api_client/v2/model/issue_sample_bias.py b/src/datadog_api_client/v2/model/issue_sample_bias.py new file mode 100644 index 0000000000..56cbfc53be --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_bias.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IssueSampleBias(ModelSimple): + """ + Criterion used to pick a sample. `latest` picks the most recent error. `git_metadata` picks the most + recent error with source code metadata, whose stack trace is parsed. `trace` picks the most recent error + with an APM trace. `session_replay` picks the most recent error with a RUM session replay. + `exception_replay` picks the most recent error with an Exception Replay snapshot. + + :param value: Must be one of ["latest", "git_metadata", "trace", "session_replay", "exception_replay"]. + :type value: str + """ + + allowed_values = { + "latest", + "git_metadata", + "trace", + "session_replay", + "exception_replay", + } + LATEST: ClassVar["IssueSampleBias"] + GIT_METADATA: ClassVar["IssueSampleBias"] + TRACE: ClassVar["IssueSampleBias"] + SESSION_REPLAY: ClassVar["IssueSampleBias"] + EXCEPTION_REPLAY: ClassVar["IssueSampleBias"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueSampleBias.LATEST = IssueSampleBias("latest") +IssueSampleBias.GIT_METADATA = IssueSampleBias("git_metadata") +IssueSampleBias.TRACE = IssueSampleBias("trace") +IssueSampleBias.SESSION_REPLAY = IssueSampleBias("session_replay") +IssueSampleBias.EXCEPTION_REPLAY = IssueSampleBias("exception_replay") diff --git a/src/datadog_api_client/v2/model/issue_sample_code_snippet.py b/src/datadog_api_client/v2/model/issue_sample_code_snippet.py new file mode 100644 index 0000000000..26dfee59d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_code_snippet.py @@ -0,0 +1,43 @@ +# 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 IssueSampleCodeSnippet(ModelNormal): + @cached_property + def openapi_types(_): + return { + "lines": ([str],), + "offset": (int,), + } + + attribute_map = { + "lines": "lines", + "offset": "offset", + } + + def __init__(self_, lines: Union[List[str], UnsetType] = unset, offset: Union[int, UnsetType] = unset, **kwargs): + """ + Source code around a stack frame. Empty when the source code is unavailable. + + :param lines: Lines of source code. + :type lines: [str], optional + + :param offset: Line number of the first line of the snippet, starting at 1. + :type offset: int, optional + """ + if lines is not unset: + kwargs["lines"] = lines + if offset is not unset: + kwargs["offset"] = offset + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_sample_data_source.py b/src/datadog_api_client/v2/model/issue_sample_data_source.py new file mode 100644 index 0000000000..8b1106f867 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_data_source.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IssueSampleDataSource(ModelSimple): + """ + Product that reported the error. The value is `NONE` when the error has no known origin. + + :param value: Must be one of ["APM", "LOGS", "RUM", "LLMOBS", "SYNTHETICS", "NONE"]. + :type value: str + """ + + allowed_values = { + "APM", + "LOGS", + "RUM", + "LLMOBS", + "SYNTHETICS", + "NONE", + } + APM: ClassVar["IssueSampleDataSource"] + LOGS: ClassVar["IssueSampleDataSource"] + RUM: ClassVar["IssueSampleDataSource"] + LLMOBS: ClassVar["IssueSampleDataSource"] + SYNTHETICS: ClassVar["IssueSampleDataSource"] + NONE: ClassVar["IssueSampleDataSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueSampleDataSource.APM = IssueSampleDataSource("APM") +IssueSampleDataSource.LOGS = IssueSampleDataSource("LOGS") +IssueSampleDataSource.RUM = IssueSampleDataSource("RUM") +IssueSampleDataSource.LLMOBS = IssueSampleDataSource("LLMOBS") +IssueSampleDataSource.SYNTHETICS = IssueSampleDataSource("SYNTHETICS") +IssueSampleDataSource.NONE = IssueSampleDataSource("NONE") diff --git a/src/datadog_api_client/v2/model/issue_sample_error_stack.py b/src/datadog_api_client/v2/model/issue_sample_error_stack.py new file mode 100644 index 0000000000..1e310a685b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_error_stack.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 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.issue_sample_stack_frame import IssueSampleStackFrame + + +class IssueSampleErrorStack(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_stack_frame import IssueSampleStackFrame + + return { + "frames": ([IssueSampleStackFrame],), + "language": (str,), + } + + attribute_map = { + "frames": "frames", + "language": "language", + } + + def __init__( + self_, + frames: Union[List[IssueSampleStackFrame], UnsetType] = unset, + language: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Parsed stack trace of the error. Only the sample picked by the ``git_metadata`` bias has frames. + + :param frames: Stack frames, from the top of the stack. + :type frames: [IssueSampleStackFrame], optional + + :param language: Programming language used to parse the stack trace. + :type language: str, optional + """ + if frames is not unset: + kwargs["frames"] = frames + if language is not unset: + kwargs["language"] = language + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_sample_event.py b/src/datadog_api_client/v2/model/issue_sample_event.py new file mode 100644 index 0000000000..60f682b2cb --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_event.py @@ -0,0 +1,17 @@ +# 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, +) + + +class IssueSampleEvent(ModelNormal): + def __init__(self_, **kwargs): + """ + Raw error event, as stored by its data source. Its fields differ between APM, logs, and RUM. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_sample_frame_link.py b/src/datadog_api_client/v2/model/issue_sample_frame_link.py new file mode 100644 index 0000000000..e790f5f30f --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_frame_link.py @@ -0,0 +1,46 @@ +# 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.issue_sample_git_file_location import IssueSampleGitFileLocation + + +class IssueSampleFrameLink(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_git_file_location import IssueSampleGitFileLocation + + return { + "code_location": (IssueSampleGitFileLocation,), + "frame_id": (int,), + } + + attribute_map = { + "code_location": "code_location", + "frame_id": "frame_id", + } + + def __init__(self_, code_location: IssueSampleGitFileLocation, frame_id: int, **kwargs): + """ + Source code location of a stack frame. + + :param code_location: Location of a stack frame in a repository file. Empty when the source code is unavailable. + :type code_location: IssueSampleGitFileLocation + + :param frame_id: Index of the frame in the stack trace, starting at 0. + :type frame_id: int + """ + super().__init__(kwargs) + + self_.code_location = code_location + self_.frame_id = frame_id diff --git a/src/datadog_api_client/v2/model/issue_sample_git_file_location.py b/src/datadog_api_client/v2/model/issue_sample_git_file_location.py new file mode 100644 index 0000000000..9e559beacf --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_git_file_location.py @@ -0,0 +1,80 @@ +# 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 IssueSampleGitFileLocation(ModelNormal): + @cached_property + def openapi_types(_): + return { + "column": (int,), + "filepath": (str,), + "first_line": (int,), + "last_line": (int,), + "ref": (str,), + "repo_id": (str,), + } + + attribute_map = { + "column": "column", + "filepath": "filepath", + "first_line": "first_line", + "last_line": "last_line", + "ref": "ref", + "repo_id": "repo_id", + } + + def __init__( + self_, + column: Union[int, UnsetType] = unset, + filepath: Union[str, UnsetType] = unset, + first_line: Union[int, UnsetType] = unset, + last_line: Union[int, UnsetType] = unset, + ref: Union[str, UnsetType] = unset, + repo_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Location of a stack frame in a repository file. Empty when the source code is unavailable. + + :param column: Column of the location, starting at 1. + :type column: int, optional + + :param filepath: Path of the file in the repository. + :type filepath: str, optional + + :param first_line: First line of the location, starting at 1. + :type first_line: int, optional + + :param last_line: Last line of the location, starting at 1. + :type last_line: int, optional + + :param ref: Git reference of the file, usually a commit SHA. + :type ref: str, optional + + :param repo_id: Repository identifier. + :type repo_id: str, optional + """ + if column is not unset: + kwargs["column"] = column + if filepath is not unset: + kwargs["filepath"] = filepath + if first_line is not unset: + kwargs["first_line"] = first_line + if last_line is not unset: + kwargs["last_line"] = last_line + if ref is not unset: + kwargs["ref"] = ref + if repo_id is not unset: + kwargs["repo_id"] = repo_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_sample_reference.py b/src/datadog_api_client/v2/model/issue_sample_reference.py new file mode 100644 index 0000000000..99af728445 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_reference.py @@ -0,0 +1,46 @@ +# 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.issue_sample_type import IssueSampleType + + +class IssueSampleReference(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_type import IssueSampleType + + return { + "id": (str,), + "type": (IssueSampleType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: IssueSampleType, **kwargs): + """ + A curated error sample of the issue. + + :param id: Sample identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueSampleType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_sample_stack_frame.py b/src/datadog_api_client/v2/model/issue_sample_stack_frame.py new file mode 100644 index 0000000000..df3a8e12e4 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_stack_frame.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_sample_code_snippet import IssueSampleCodeSnippet + from datadog_api_client.v2.model.issue_sample_git_file_location import IssueSampleGitFileLocation + + +class IssueSampleStackFrame(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_code_snippet import IssueSampleCodeSnippet + from datadog_api_client.v2.model.issue_sample_git_file_location import IssueSampleGitFileLocation + + return { + "code_snippet": (IssueSampleCodeSnippet,), + "git_file_location": (IssueSampleGitFileLocation,), + "text": (str,), + } + + attribute_map = { + "code_snippet": "code_snippet", + "git_file_location": "git_file_location", + "text": "text", + } + + def __init__( + self_, + code_snippet: Union[IssueSampleCodeSnippet, UnsetType] = unset, + git_file_location: Union[IssueSampleGitFileLocation, UnsetType] = unset, + text: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A stack frame. + + :param code_snippet: Source code around a stack frame. Empty when the source code is unavailable. + :type code_snippet: IssueSampleCodeSnippet, optional + + :param git_file_location: Location of a stack frame in a repository file. Empty when the source code is unavailable. + :type git_file_location: IssueSampleGitFileLocation, optional + + :param text: Text of the frame, as it appears in the stack trace. + :type text: str, optional + """ + if code_snippet is not unset: + kwargs["code_snippet"] = code_snippet + if git_file_location is not unset: + kwargs["git_file_location"] = git_file_location + if text is not unset: + kwargs["text"] = text + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_sample_type.py b/src/datadog_api_client/v2/model/issue_sample_type.py new file mode 100644 index 0000000000..d738b6da06 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_sample_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 IssueSampleType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "error_tracking_issue_sample". Must be one of ["error_tracking_issue_sample"]. + :type value: str + """ + + allowed_values = { + "error_tracking_issue_sample", + } + ERROR_TRACKING_ISSUE_SAMPLE: ClassVar["IssueSampleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueSampleType.ERROR_TRACKING_ISSUE_SAMPLE = IssueSampleType("error_tracking_issue_sample") diff --git a/src/datadog_api_client/v2/model/issue_samples_relationship.py b/src/datadog_api_client/v2/model/issue_samples_relationship.py new file mode 100644 index 0000000000..720adcd39d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_samples_relationship.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_sample_reference import IssueSampleReference + + +class IssueSamplesRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_sample_reference import IssueSampleReference + + return { + "data": ([IssueSampleReference],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[IssueSampleReference], **kwargs): + """ + Relationship between the issue and its curated error samples. + + :param data: Array of curated error samples of the issue. + :type data: [IssueSampleReference] + """ + 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 61e3c17457..7026caaf22 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -5267,6 +5267,19 @@ from datadog_api_client.v2.model.issue_regression import IssueRegression from datadog_api_client.v2.model.issue_relationships import IssueRelationships from datadog_api_client.v2.model.issue_response import IssueResponse +from datadog_api_client.v2.model.issue_sample import IssueSample +from datadog_api_client.v2.model.issue_sample_attributes import IssueSampleAttributes +from datadog_api_client.v2.model.issue_sample_bias import IssueSampleBias +from datadog_api_client.v2.model.issue_sample_code_snippet import IssueSampleCodeSnippet +from datadog_api_client.v2.model.issue_sample_data_source import IssueSampleDataSource +from datadog_api_client.v2.model.issue_sample_error_stack import IssueSampleErrorStack +from datadog_api_client.v2.model.issue_sample_event import IssueSampleEvent +from datadog_api_client.v2.model.issue_sample_frame_link import IssueSampleFrameLink +from datadog_api_client.v2.model.issue_sample_git_file_location import IssueSampleGitFileLocation +from datadog_api_client.v2.model.issue_sample_reference import IssueSampleReference +from datadog_api_client.v2.model.issue_sample_stack_frame import IssueSampleStackFrame +from datadog_api_client.v2.model.issue_sample_type import IssueSampleType +from datadog_api_client.v2.model.issue_samples_relationship import IssueSamplesRelationship from datadog_api_client.v2.model.issue_state import IssueState from datadog_api_client.v2.model.issue_team import IssueTeam from datadog_api_client.v2.model.issue_team_attributes import IssueTeamAttributes @@ -16580,6 +16593,19 @@ "IssueRegression", "IssueRelationships", "IssueResponse", + "IssueSample", + "IssueSampleAttributes", + "IssueSampleBias", + "IssueSampleCodeSnippet", + "IssueSampleDataSource", + "IssueSampleErrorStack", + "IssueSampleEvent", + "IssueSampleFrameLink", + "IssueSampleGitFileLocation", + "IssueSampleReference", + "IssueSampleStackFrame", + "IssueSampleType", + "IssueSamplesRelationship", "IssueState", "IssueTeam", "IssueTeamAttributes", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 87e859588b..ca233d6609 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -5369,6 +5369,13 @@ "scenario": "Get the details of an error tracking issue returns \"OK\" response", "version": "v2" }, + { + "feature": "Error Tracking", + "feature_file": "../../v2/features/error_tracking.feature", + "file": "v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-samples-returns-ok-response.json", + "scenario": "Get the details of an error tracking issue with samples returns \"OK\" response", + "version": "v2" + }, { "feature": "Error Tracking", "feature_file": "../../v2/features/error_tracking.feature", diff --git a/tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-samples-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-samples-returns-ok-response.json new file mode 100644 index 0000000000..df4a9018b2 --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-samples-returns-ok-response.json @@ -0,0 +1,81 @@ +{ + "api": "ErrorTracking", + "expected_status": 200, + "feature": "Error Tracking", + "id": "v2/Error Tracking/Get the details of an error tracking issue with samples returns \"OK\" response", + "operation_id": "GetIssue", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "issue_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "issue.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": false, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "items": { + "format": null, + "ref": "GetIssueIncludeQueryParameterItem", + "type": "string" + }, + "ref": null, + "type": "array" + }, + "source": { + "type": "literal", + "value": [ + "samples" + ] + }, + "style": null + }, + { + "explode": false, + "in": "query", + "name": "filter[samples.biases]", + "required": false, + "schema": { + "format": null, + "items": { + "format": null, + "ref": "IssueSampleBias", + "type": "string" + }, + "ref": null, + "type": "array" + }, + "source": { + "type": "literal", + "value": [ + "latest" + ] + }, + "style": null + } + ], + "path": "/api/v2/error-tracking/issues/{issue_id}" + }, + "scenario": "Get the details of an error tracking issue with samples returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-server-data/v2/error-tracking.json b/tests/generated-test/test-server-data/v2/error-tracking.json index 454afa0475..2dcd5024c5 100644 --- a/tests/generated-test/test-server-data/v2/error-tracking.json +++ b/tests/generated-test/test-server-data/v2/error-tracking.json @@ -160,6 +160,79 @@ "scenario": "Get the details of an error tracking issue returns \"OK\" response", "version": "v2" }, + { + "feature": "Error Tracking", + "frozen_at": "2026-10-22T13:29:57.649Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "from": 1791379797000, + "query": "service:synthetics-browser", + "to": 1792675797000, + "track": "rum" + }, + "type": "search_request" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"d3ab59c6-84ee-11f0-87bb-da7ad0900002\",\"type\":\"error_tracking_search_result\",\"attributes\":{\"impacted_sessions\":4439,\"impacted_users\":4307,\"total_count\":8644},\"relationships\":{\"issue\":{\"data\":{\"id\":\"d3ab59c6-84ee-11f0-87bb-da7ad0900002\",\"type\":\"issue\"}}}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/error-tracking/issues/d3ab59c6-84ee-11f0-87bb-da7ad0900002", + "query": [ + [ + "filter[samples.biases]", + "latest" + ], + [ + "include", + "samples" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"d3ab59c6-84ee-11f0-87bb-da7ad0900002\",\"type\":\"issue\",\"attributes\":{\"error_message\":\"Expected unhandled error\",\"error_type\":\"Error\",\"file_path\":\"\",\"first_seen\":1756482172021,\"first_seen_version\":\"1.2.4\",\"function_name\":\"\",\"is_crash\":false,\"languages\":[\"JAVASCRIPT\"],\"last_seen\":1792675673414,\"last_seen_version\":\"1.2.4\",\"platform\":\"BROWSER\",\"service\":\"synthetics-browser\",\"state\":\"RESOLVED\"},\"relationships\":{\"case\":{\"data\":{\"id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"type\":\"case\"}},\"samples\":{\"data\":[{\"id\":\"AwAAAaFjy_VGe8BwpwAAABhBYUZqeV9ldEFBRENrVFVtSDhUeXh5LWgAAAAkZjFhMTYzY2ItZmE4Ni00NTJkLWFhYTktY2NiNTdiNDFlMWMzAAAAAA\",\"type\":\"error_tracking_issue_sample\"}]}}},\"included\":[{\"id\":\"AwAAAaFjy_VGe8BwpwAAABhBYUZqeV9ldEFBRENrVFVtSDhUeXh5LWgAAAAkZjFhMTYzY2ItZmE4Ni00NTJkLWFhYTktY2NiNTdiNDFlMWMzAAAAAA\",\"type\":\"error_tracking_issue_sample\",\"attributes\":{\"application_id\":\"ce9843b0-7a45-453c-a831-55dd15f85141\",\"biases\":[\"latest\"],\"data_source\":\"RUM\",\"error_source_type\":\"browser\",\"error_stack\":{},\"event\":{\"service\":\"synthetics-browser\",\"source\":\"browser\",\"error\":{\"type\":\"Error\",\"message\":\"Expected unhandled error\",\"source_type\":\"browser\"}},\"has_session_replay\":true,\"os_name\":\"Linux\",\"service\":\"synthetics-browser\",\"session_id\":\"2a1174ab-a9b7-4b82-babc-f9040c7a79a6\",\"timestamp\":\"2026-10-22T13:27:53.414Z\",\"version\":\"1.2.4\",\"view_id\":\"4c7fc22e-6946-4f7f-acfe-e6734dc423a5\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get the details of an error tracking issue with samples returns \"OK\" response", + "version": "v2" + }, { "feature": "Error Tracking", "frozen_at": "2025-10-17T14:43:40.022Z", diff --git a/tests/v2/features/error_tracking.feature b/tests/v2/features/error_tracking.feature index 1c8756fde5..55bfe924ff 100644 --- a/tests/v2/features/error_tracking.feature +++ b/tests/v2/features/error_tracking.feature @@ -32,6 +32,18 @@ Feature: Error Tracking Then the response status is 200 OK And the response "data.id" is equal to "{{ issue.id }}" + @replay-only @team:ddoghq/error-tracking + Scenario: Get the details of an error tracking issue with samples returns "OK" response + Given new "GetIssue" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And request contains "include" parameter with value ["samples"] + And request contains "filter[samples.biases]" parameter with value ["latest"] + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ issue.id }}" + And the response "data.relationships" has field "samples" + @generated @skip @team:ddoghq/error-tracking Scenario: Remove the assignee of an issue returns "Bad Request" response Given new "DeleteIssueAssignee" request