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

Filter by extension

Filter by extension

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

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions examples/v2/error-tracking/GetIssue_2099584222.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Get the details of an error tracking issue with lifecycle 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

# 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.LIFECYCLE,
],
)

print(response)
4 changes: 3 additions & 1 deletion src/datadog_api_client/v2/api/error_tracking_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ 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`` , ``bits_investigation`` , ``case`` , ``pull_requests`` , ``samples`` , ``team_owners`` , and ``watches``.
:param include: Comma-separated list of relationship objects that should be included in the response.
Possible values are ``assignee`` , ``bits_investigation`` , ``case`` , ``lifecycle`` , ``pull_requests`` , ``samples`` ,
``team_owners`` , and ``watches``.
Values must not contain spaces. ``case`` and ``assignee`` return nothing, without an error, if the caller lacks the ``cases_read`` permission.
:type include: [GetIssueIncludeQueryParameterItem], optional
:param filter_samples_biases: Comma-separated list of biases used to pick the samples returned with ``include=samples``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ class GetIssueIncludeQueryParameterItem(ModelSimple):
"""
Relationship object that should be included in the response.

:param value: Must be one of ["assignee", "bits_investigation", "case", "pull_requests", "samples", "team_owners", "watches"].
:param value: Must be one of ["assignee", "bits_investigation", "case", "lifecycle", "pull_requests", "samples", "team_owners", "watches"].
:type value: str
"""

allowed_values = {
"assignee",
"bits_investigation",
"case",
"lifecycle",
"pull_requests",
"samples",
"team_owners",
Expand All @@ -32,6 +33,7 @@ class GetIssueIncludeQueryParameterItem(ModelSimple):
ASSIGNEE: ClassVar["GetIssueIncludeQueryParameterItem"]
BITS_INVESTIGATION: ClassVar["GetIssueIncludeQueryParameterItem"]
CASE: ClassVar["GetIssueIncludeQueryParameterItem"]
LIFECYCLE: ClassVar["GetIssueIncludeQueryParameterItem"]
PULL_REQUESTS: ClassVar["GetIssueIncludeQueryParameterItem"]
SAMPLES: ClassVar["GetIssueIncludeQueryParameterItem"]
TEAM_OWNERS: ClassVar["GetIssueIncludeQueryParameterItem"]
Expand All @@ -47,6 +49,7 @@ def openapi_types(_):
GetIssueIncludeQueryParameterItem.ASSIGNEE = GetIssueIncludeQueryParameterItem("assignee")
GetIssueIncludeQueryParameterItem.BITS_INVESTIGATION = GetIssueIncludeQueryParameterItem("bits_investigation")
GetIssueIncludeQueryParameterItem.CASE = GetIssueIncludeQueryParameterItem("case")
GetIssueIncludeQueryParameterItem.LIFECYCLE = GetIssueIncludeQueryParameterItem("lifecycle")
GetIssueIncludeQueryParameterItem.PULL_REQUESTS = GetIssueIncludeQueryParameterItem("pull_requests")
GetIssueIncludeQueryParameterItem.SAMPLES = GetIssueIncludeQueryParameterItem("samples")
GetIssueIncludeQueryParameterItem.TEAM_OWNERS = GetIssueIncludeQueryParameterItem("team_owners")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self_, data: IssueUserReference, **kwargs):
"""
Relationship between the issue and assignee.

:param data: The user the issue is assigned to.
:param data: A reference to a user, such as the user the issue is assigned to.
:type data: IssueUserReference
"""
super().__init__(kwargs)
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/model/issue_included.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def _composed_schemas(_):
from datadog_api_client.v2.model.issue_pull_request import IssuePullRequest
from datadog_api_client.v2.model.issue_watch import IssueWatch
from datadog_api_client.v2.model.issue_sample import IssueSample
from datadog_api_client.v2.model.issue_state_change import IssueStateChange

return {
"oneOf": [
Expand All @@ -53,5 +54,6 @@ def _composed_schemas(_):
IssuePullRequest,
IssueWatch,
IssueSample,
IssueStateChange,
],
}
Original file line number Diff line number Diff line change
@@ -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_lifecycle_event_type import IssueLifecycleEventType


class IssueLifecycleEventReference(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.issue_lifecycle_event_type import IssueLifecycleEventType

return {
"id": (str,),
"type": (IssueLifecycleEventType,),
}

attribute_map = {
"id": "id",
"type": "type",
}

def __init__(self_, id: str, type: IssueLifecycleEventType, **kwargs):
"""
An event in the issue's life cycle.

:param id: Event identifier.
:type id: str

:param type: Type of the life cycle event.
:type type: IssueLifecycleEventType
"""
super().__init__(kwargs)

self_.id = id
self_.type = type
35 changes: 35 additions & 0 deletions src/datadog_api_client/v2/model/issue_lifecycle_event_type.py
Original file line number Diff line number Diff line change
@@ -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 IssueLifecycleEventType(ModelSimple):
"""
Type of the life cycle event.

:param value: If omitted defaults to "error_tracking_issue_state_change". Must be one of ["error_tracking_issue_state_change"].
:type value: str
"""

allowed_values = {
"error_tracking_issue_state_change",
}
ERROR_TRACKING_ISSUE_STATE_CHANGE: ClassVar["IssueLifecycleEventType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


IssueLifecycleEventType.ERROR_TRACKING_ISSUE_STATE_CHANGE = IssueLifecycleEventType("error_tracking_issue_state_change")
43 changes: 43 additions & 0 deletions src/datadog_api_client/v2/model/issue_lifecycle_relationship.py
Original file line number Diff line number Diff line change
@@ -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, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.issue_lifecycle_event_reference import IssueLifecycleEventReference


class IssueLifecycleRelationship(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.issue_lifecycle_event_reference import IssueLifecycleEventReference

return {
"data": ([IssueLifecycleEventReference],),
}

attribute_map = {
"data": "data",
}

def __init__(self_, data: List[IssueLifecycleEventReference], **kwargs):
"""
Relationship between the issue and the events Error Tracking recorded on it.
Returned when ``lifecycle`` is included.
Comments and other activity on the issue's case are in the case timeline,
``GET /api/v2/cases/{case_id}/timelines`` , where ``case_id`` is the ID in the ``case`` relationship.

:param data: Events in the issue's life cycle, newest first.
:type data: [IssueLifecycleEventReference]
"""
super().__init__(kwargs)

self_.data = data
13 changes: 13 additions & 0 deletions src/datadog_api_client/v2/model/issue_relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship
from datadog_api_client.v2.model.issue_bits_investigation_relationship import IssueBitsInvestigationRelationship
from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship
from datadog_api_client.v2.model.issue_lifecycle_relationship import IssueLifecycleRelationship
from datadog_api_client.v2.model.issue_pull_requests_relationship import IssuePullRequestsRelationship
from datadog_api_client.v2.model.issue_samples_relationship import IssueSamplesRelationship
from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship
Expand All @@ -29,6 +30,7 @@ def openapi_types(_):
from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship
from datadog_api_client.v2.model.issue_bits_investigation_relationship import IssueBitsInvestigationRelationship
from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship
from datadog_api_client.v2.model.issue_lifecycle_relationship import IssueLifecycleRelationship
from datadog_api_client.v2.model.issue_pull_requests_relationship import IssuePullRequestsRelationship
from datadog_api_client.v2.model.issue_samples_relationship import IssueSamplesRelationship
from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship
Expand All @@ -38,6 +40,7 @@ def openapi_types(_):
"assignee": (IssueAssigneeRelationship,),
"bits_investigation": (IssueBitsInvestigationRelationship,),
"case": (IssueCaseRelationship,),
"lifecycle": (IssueLifecycleRelationship,),
"pull_requests": (IssuePullRequestsRelationship,),
"samples": (IssueSamplesRelationship,),
"team_owners": (IssueTeamOwnersRelationship,),
Expand All @@ -48,6 +51,7 @@ def openapi_types(_):
"assignee": "assignee",
"bits_investigation": "bits_investigation",
"case": "case",
"lifecycle": "lifecycle",
"pull_requests": "pull_requests",
"samples": "samples",
"team_owners": "team_owners",
Expand All @@ -59,6 +63,7 @@ def __init__(
assignee: Union[IssueAssigneeRelationship, UnsetType] = unset,
bits_investigation: Union[IssueBitsInvestigationRelationship, UnsetType] = unset,
case: Union[IssueCaseRelationship, UnsetType] = unset,
lifecycle: Union[IssueLifecycleRelationship, UnsetType] = unset,
pull_requests: Union[IssuePullRequestsRelationship, UnsetType] = unset,
samples: Union[IssueSamplesRelationship, UnsetType] = unset,
team_owners: Union[IssueTeamOwnersRelationship, UnsetType] = unset,
Expand All @@ -78,6 +83,12 @@ def __init__(
:param case: Relationship between the issue and case.
:type case: IssueCaseRelationship, optional

:param lifecycle: Relationship between the issue and the events Error Tracking recorded on it.
Returned when ``lifecycle`` is included.
Comments and other activity on the issue's case are in the case timeline,
``GET /api/v2/cases/{case_id}/timelines`` , where ``case_id`` is the ID in the ``case`` relationship.
:type lifecycle: IssueLifecycleRelationship, optional

:param pull_requests: Relationship between the issue and its linked pull requests. Returned when ``pull_requests`` is included and the issue has linked pull requests.
:type pull_requests: IssuePullRequestsRelationship, optional

Expand All @@ -96,6 +107,8 @@ def __init__(
kwargs["bits_investigation"] = bits_investigation
if case is not unset:
kwargs["case"] = case
if lifecycle is not unset:
kwargs["lifecycle"] = lifecycle
if pull_requests is not unset:
kwargs["pull_requests"] = pull_requests
if samples is not unset:
Expand Down
14 changes: 13 additions & 1 deletion src/datadog_api_client/v2/model/issue_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from datadog_api_client.v2.model.issue_pull_request import IssuePullRequest
from datadog_api_client.v2.model.issue_watch import IssueWatch
from datadog_api_client.v2.model.issue_sample import IssueSample
from datadog_api_client.v2.model.issue_state_change import IssueStateChange


class IssueResponse(ModelNormal):
Expand All @@ -44,7 +45,18 @@ def __init__(
self_,
data: Union[Issue, UnsetType] = unset,
included: Union[
List[Union[IssueIncluded, IssueCase, IssueUser, IssueTeam, IssuePullRequest, IssueWatch, IssueSample]],
List[
Union[
IssueIncluded,
IssueCase,
IssueUser,
IssueTeam,
IssuePullRequest,
IssueWatch,
IssueSample,
IssueStateChange,
]
],
UnsetType,
] = unset,
**kwargs,
Expand Down
Loading
Loading