From f83b50ca3e73914d8234256274ef525a5cb9de9d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 4 Dec 2026 13:15:42 +0000 Subject: [PATCH] Regenerate client from commit d9569af of spec repo --- .generator/schemas/v2/openapi.yaml | 638 +++++++++++++++++- .../v2/error-tracking/GetIssue_2099584222.py | 24 + .../v2/api/error_tracking_api.py | 4 +- .../get_issue_include_query_parameter_item.py | 5 +- .../v2/model/issue_assignee_relationship.py | 2 +- .../v2/model/issue_included.py | 2 + .../model/issue_lifecycle_event_reference.py | 46 ++ .../v2/model/issue_lifecycle_event_type.py | 35 + .../v2/model/issue_lifecycle_relationship.py | 43 ++ .../v2/model/issue_relationships.py | 13 + .../v2/model/issue_response.py | 14 +- .../v2/model/issue_state_change.py | 127 ++++ .../v2/model/issue_state_change_attributes.py | 116 ++++ .../issue_state_change_author_relationship.py | 42 ++ ...e_state_change_by_assignment_attributes.py | 70 ++ ...issue_state_change_by_assignment_reason.py | 35 + ...change_by_auto_resolve_naive_attributes.py | 91 +++ ...ate_change_by_auto_resolve_naive_reason.py | 37 + ...e_undetected_recommendations_attributes.py | 73 ++ ...solve_undetected_recommendations_reason.py | 37 + ...y_auto_resolve_version_aware_attributes.py | 91 +++ ...ge_by_auto_resolve_version_aware_reason.py | 37 + ...hange_by_bits_error_tracking_attributes.py | 72 ++ ...te_change_by_bits_error_tracking_reason.py | 37 + ...tate_change_by_case_creation_attributes.py | 72 ++ ...ue_state_change_by_case_creation_reason.py | 35 + ...ue_state_change_by_case_sync_attributes.py | 68 ++ .../issue_state_change_by_case_sync_reason.py | 35 + ..._state_change_by_issue_watch_attributes.py | 83 +++ ...ssue_state_change_by_issue_watch_reason.py | 35 + ...e_state_change_by_public_api_attributes.py | 70 ++ ...issue_state_change_by_public_api_reason.py | 35 + ..._change_by_pull_request_link_attributes.py | 84 +++ ...tate_change_by_pull_request_link_reason.py | 35 + ...e_change_by_regression_naive_attributes.py | 84 +++ ...state_change_by_regression_naive_reason.py | 35 + ..._by_regression_version_aware_attributes.py | 85 +++ ...ange_by_regression_version_aware_reason.py | 37 + ...ssue_state_change_by_unknown_attributes.py | 68 ++ .../issue_state_change_by_unknown_reason.py | 35 + .../issue_state_change_by_user_attributes.py | 68 ++ .../issue_state_change_by_user_reason.py | 35 + .../model/issue_state_change_pull_request.py | 52 ++ .../issue_state_change_pull_request_event.py | 47 ++ .../v2/model/issue_state_change_regression.py | 57 ++ .../model/issue_state_change_relationships.py | 46 ++ .../v2/model/issue_state_change_type.py | 35 + .../issue_state_change_watch_condition.py | 90 +++ ...issue_state_change_watch_condition_kind.py | 41 ++ .../v2/model/issue_user_reference.py | 2 +- src/datadog_api_client/v2/models/__init__.py | 118 ++++ .../test-runner-data/manifest.json | 7 + ...ue-with-lifecycle-returns-ok-response.json | 58 ++ .../test-server-data/v2/error-tracking.json | 69 ++ tests/v2/features/error_tracking.feature | 11 + 55 files changed, 3316 insertions(+), 7 deletions(-) create mode 100644 examples/v2/error-tracking/GetIssue_2099584222.py create mode 100644 src/datadog_api_client/v2/model/issue_lifecycle_event_reference.py create mode 100644 src/datadog_api_client/v2/model/issue_lifecycle_event_type.py create mode 100644 src/datadog_api_client/v2/model/issue_lifecycle_relationship.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_author_relationship.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_assignment_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_assignment_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_case_creation_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_case_creation_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_case_sync_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_case_sync_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_public_api_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_public_api_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_unknown_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_unknown_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_user_attributes.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_by_user_reason.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_pull_request.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_pull_request_event.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_regression.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_relationships.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_type.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_watch_condition.py create mode 100644 src/datadog_api_client/v2/model/issue_state_change_watch_condition_kind.py create mode 100644 tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-lifecycle-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b359a63d90..ded1cb6b19 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -961,7 +961,9 @@ components: type: integer GetIssueIncludeQueryParameter: description: |- - 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`. + 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. explode: false in: query @@ -67996,6 +67998,7 @@ components: - assignee - bits_investigation - case + - lifecycle - pull_requests - samples - team_owners @@ -68006,6 +68009,7 @@ components: - ASSIGNEE - BITS_INVESTIGATION - CASE + - LIFECYCLE - PULL_REQUESTS - SAMPLES - TEAM_OWNERS @@ -79701,6 +79705,7 @@ components: - $ref: "#/components/schemas/IssuePullRequest" - $ref: "#/components/schemas/IssueWatch" - $ref: "#/components/schemas/IssueSample" + - $ref: "#/components/schemas/IssueStateChange" IssueLanguage: description: Programming language associated with the issue. enum: @@ -79763,6 +79768,41 @@ components: - TF - TYPESCRIPT - UNKNOWN + IssueLifecycleEventReference: + description: An event in the issue's life cycle. + properties: + id: + description: Event identifier. + example: "0b8f3c52-9a1d-4c3e-b2f1-6a7e5d4c3b2a" + type: string + type: + $ref: "#/components/schemas/IssueLifecycleEventType" + required: + - id + - type + type: object + IssueLifecycleEventType: + description: Type of the life cycle event. + enum: ["error_tracking_issue_state_change"] + example: "error_tracking_issue_state_change" + type: string + x-enum-varnames: + - ERROR_TRACKING_ISSUE_STATE_CHANGE + IssueLifecycleRelationship: + description: |- + 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. + properties: + data: + description: Events in the issue's life cycle, newest first. + items: + $ref: "#/components/schemas/IssueLifecycleEventReference" + type: array + required: + - data + type: object IssuePlatform: description: Platform associated with the issue. enum: @@ -79914,6 +79954,8 @@ components: $ref: "#/components/schemas/IssueBitsInvestigationRelationship" case: $ref: "#/components/schemas/IssueCaseRelationship" + lifecycle: + $ref: "#/components/schemas/IssueLifecycleRelationship" pull_requests: $ref: "#/components/schemas/IssuePullRequestsRelationship" samples: @@ -80278,6 +80320,598 @@ components: - RESOLVED - IGNORED - EXCLUDED + IssueStateChange: + description: A change in the issue's state. + properties: + attributes: + $ref: "#/components/schemas/IssueStateChangeAttributes" + id: + description: State change identifier. + example: "0b8f3c52-9a1d-4c3e-b2f1-6a7e5d4c3b2a" + type: string + relationships: + $ref: "#/components/schemas/IssueStateChangeRelationships" + type: + $ref: "#/components/schemas/IssueStateChangeType" + required: + - id + - type + - attributes + type: object + IssueStateChangeAttributes: + description: |- + Object containing the information of a state change. Its `reason` explains why the state changed and + determines which other attributes are present. + oneOf: + - $ref: "#/components/schemas/IssueStateChangeByUnknownAttributes" + - $ref: "#/components/schemas/IssueStateChangeByUserAttributes" + - $ref: "#/components/schemas/IssueStateChangeByPublicApiAttributes" + - $ref: "#/components/schemas/IssueStateChangeByBitsErrorTrackingAttributes" + - $ref: "#/components/schemas/IssueStateChangeByAssignmentAttributes" + - $ref: "#/components/schemas/IssueStateChangeByCaseCreationAttributes" + - $ref: "#/components/schemas/IssueStateChangeByCaseSyncAttributes" + - $ref: "#/components/schemas/IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes" + - $ref: "#/components/schemas/IssueStateChangeByAutoResolveNaiveAttributes" + - $ref: "#/components/schemas/IssueStateChangeByAutoResolveVersionAwareAttributes" + - $ref: "#/components/schemas/IssueStateChangeByRegressionNaiveAttributes" + - $ref: "#/components/schemas/IssueStateChangeByRegressionVersionAwareAttributes" + - $ref: "#/components/schemas/IssueStateChangeByIssueWatchAttributes" + - $ref: "#/components/schemas/IssueStateChangeByPullRequestLinkAttributes" + IssueStateChangeAuthorRelationship: + description: |- + The user who changed the state. Its `user` resource is included when the caller has the `user_access_read` + permission and the user exists. + Absent when Error Tracking changed the state: `reason` says why. + properties: + data: + $ref: "#/components/schemas/IssueUserReference" + required: + - data + type: object + IssueStateChangeByAssignmentAttributes: + description: A state change caused by assigning the issue. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByAssignmentReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByAssignmentReason: + description: Why the issue state changed. + enum: + - ASSIGNMENT + example: "ASSIGNMENT" + type: string + x-enum-varnames: + - ASSIGNMENT + IssueStateChangeByAutoResolveNaiveAttributes: + description: |- + A resolution made by Error Tracking + because the issue stopped occurring, without checking which versions are running. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + issue_last_seen: + description: Timestamp of the last error of the issue before it was resolved. + example: "2024-12-01T00:00:00Z" + format: date-time + type: string + issue_last_seen_version: + description: Version of the last error of the issue before it was resolved. + example: "v1.2.3" + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByAutoResolveNaiveReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByAutoResolveNaiveReason: + description: Why the issue state changed. + enum: + - AUTO_RESOLVE_NAIVE + example: "AUTO_RESOLVE_NAIVE" + type: string + x-enum-varnames: + - AUTO_RESOLVE_NAIVE + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes: + description: |- + A resolution made by Error Tracking + because the recommendation behind the issue is no longer detected. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByAutoResolveUndetectedRecommendationsReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByAutoResolveUndetectedRecommendationsReason: + description: Why the issue state changed. + enum: + - AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS + example: "AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS" + type: string + x-enum-varnames: + - AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS + IssueStateChangeByAutoResolveVersionAwareAttributes: + description: |- + A resolution made by Error Tracking + because the issue stopped occurring and the versions where it was detected no longer run. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + issue_last_seen: + description: Timestamp of the last error of the issue before it was resolved. + example: "2024-12-01T00:00:00Z" + format: date-time + type: string + issue_last_seen_version: + description: Version of the last error of the issue before it was resolved. + example: "v1.2.3" + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByAutoResolveVersionAwareReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByAutoResolveVersionAwareReason: + description: Why the issue state changed. + enum: + - AUTO_RESOLVE_VERSION_AWARE + example: "AUTO_RESOLVE_VERSION_AWARE" + type: string + x-enum-varnames: + - AUTO_RESOLVE_VERSION_AWARE + IssueStateChangeByBitsErrorTrackingAttributes: + description: A state change made by Bits AI on behalf of a user. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByBitsErrorTrackingReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByBitsErrorTrackingReason: + description: Why the issue state changed. + enum: + - BITS_ERROR_TRACKING + example: "BITS_ERROR_TRACKING" + type: string + x-enum-varnames: + - BITS_ERROR_TRACKING + IssueStateChangeByCaseCreationAttributes: + description: A state change caused by creating a case for the issue. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByCaseCreationReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByCaseCreationReason: + description: Why the issue state changed. + enum: + - CASE_CREATION + example: "CASE_CREATION" + type: string + x-enum-varnames: + - CASE_CREATION + IssueStateChangeByCaseSyncAttributes: + description: A state change synced from the status of the case attached to the issue. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByCaseSyncReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByCaseSyncReason: + description: Why the issue state changed. + enum: + - CASE_SYNC + example: "CASE_SYNC" + type: string + x-enum-varnames: + - CASE_SYNC + IssueStateChangeByIssueWatchAttributes: + description: A state change made by a snooze, when the snooze starts or when its conditions are met. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByIssueWatchReason" + watch: + description: |- + Leaf conditions of the watch that were met, flattened out of `ANY` and `ALL`. + Present when the snooze ends and absent when it starts. + items: + $ref: "#/components/schemas/IssueStateChangeWatchCondition" + type: array + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByIssueWatchReason: + description: Why the issue state changed. + enum: + - ISSUE_WATCH + example: "ISSUE_WATCH" + type: string + x-enum-varnames: + - ISSUE_WATCH + IssueStateChangeByPublicApiAttributes: + description: A state change made through the Datadog API. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByPublicApiReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByPublicApiReason: + description: Why the issue state changed. + enum: + - PUBLIC_API + example: "PUBLIC_API" + type: string + x-enum-varnames: + - PUBLIC_API + IssueStateChangeByPullRequestLinkAttributes: + description: A state change caused by a pull request linked to the issue, such as the merge of a fix. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + pull_request: + $ref: "#/components/schemas/IssueStateChangePullRequest" + reason: + $ref: "#/components/schemas/IssueStateChangeByPullRequestLinkReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByPullRequestLinkReason: + description: Why the issue state changed. + enum: + - PULL_REQUEST_LINK + example: "PULL_REQUEST_LINK" + type: string + x-enum-varnames: + - PULL_REQUEST_LINK + IssueStateChangeByRegressionNaiveAttributes: + description: A reopening made by Error Tracking because the resolved issue occurred again. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByRegressionNaiveReason" + regression: + $ref: "#/components/schemas/IssueStateChangeRegression" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByRegressionNaiveReason: + description: Why the issue state changed. + enum: + - REGRESSION_NAIVE + example: "REGRESSION_NAIVE" + type: string + x-enum-varnames: + - REGRESSION_NAIVE + IssueStateChangeByRegressionVersionAwareAttributes: + description: |- + A reopening made by Error Tracking + because the resolved issue occurred again, taking versions into account. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByRegressionVersionAwareReason" + regression: + $ref: "#/components/schemas/IssueStateChangeRegression" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByRegressionVersionAwareReason: + description: Why the issue state changed. + enum: + - REGRESSION_VERSION_AWARE + example: "REGRESSION_VERSION_AWARE" + type: string + x-enum-varnames: + - REGRESSION_VERSION_AWARE + IssueStateChangeByUnknownAttributes: + description: A state change whose reason was not recorded. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByUnknownReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByUnknownReason: + description: Why the issue state changed. + enum: + - UNKNOWN + example: "UNKNOWN" + type: string + x-enum-varnames: + - UNKNOWN + IssueStateChangeByUserAttributes: + description: A state change made by a user in Datadog. + properties: + created_at: + description: Timestamp of the state change. + example: "2025-01-01T00:00:00Z" + format: date-time + type: string + next: + $ref: "#/components/schemas/IssueState" + previous: + $ref: "#/components/schemas/IssueState" + reason: + $ref: "#/components/schemas/IssueStateChangeByUserReason" + required: + - created_at + - previous + - next + - reason + type: object + IssueStateChangeByUserReason: + description: Why the issue state changed. + enum: + - USER + example: "USER" + type: string + x-enum-varnames: + - USER + IssueStateChangePullRequest: + description: The pull request event that changed the state. + properties: + event: + $ref: "#/components/schemas/IssueStateChangePullRequestEvent" + id: + description: Pull request identifier. + example: "a8b0a0e0-0e0a-0e0a-0e0a-0e0a0e0a0e0a" + type: string + url: + description: URL of the pull request. + example: "https://github.com/DataDog/example/pull/123" + type: string + required: + - id + - url + - event + type: object + IssueStateChangePullRequestEvent: + description: What happened to the pull request. + enum: + - linked + - unlinked + - merged + - closed + - reopened + example: "merged" + type: string + x-enum-varnames: + - LINKED + - UNLINKED + - MERGED + - CLOSED + - REOPENED + IssueStateChangeRegression: + description: The regression that reopened the issue. + properties: + regressed_at: + description: Timestamp when the issue regressed. + example: "2024-01-03T08:00:00Z" + format: date-time + type: string + regressed_at_version: + description: Version in which the issue regressed. + example: "v2.0.0" + type: string + resolved_at: + description: Timestamp when the issue was resolved before the regression. + example: "2024-01-01T10:00:00Z" + format: date-time + type: string + type: object + IssueStateChangeRelationships: + description: Relationship between the state change and other resources. + properties: + author: + $ref: "#/components/schemas/IssueStateChangeAuthorRelationship" + type: object + IssueStateChangeType: + description: Type of the object. + enum: ["error_tracking_issue_state_change"] + example: "error_tracking_issue_state_change" + type: string + x-enum-varnames: + - ERROR_TRACKING_ISSUE_STATE_CHANGE + IssueStateChangeWatchCondition: + description: |- + A leaf condition of the watch that was met. Met conditions inside `ANY` and `ALL` are listed flat, + and a composite that was not met contributes none of its conditions. + properties: + deadline: + description: Timestamp when the `ELAPSED_TIME` condition was met. + example: "2025-01-08T00:00:00Z" + format: date-time + type: string + duration: + description: Time that must elapse for the condition to be met, as a Go duration string. + example: "168h0m0s" + type: string + kind: + $ref: "#/components/schemas/IssueStateChangeWatchConditionKind" + observed_count: + description: Count observed when the condition was met, in the same unit as `threshold`. + example: 120 + format: int64 + type: integer + projection: + description: Attributes whose distinct values `CARDINALITY` counts. + items: + description: Attribute path. + example: "@usr.id" + type: string + type: array + threshold: + description: Number of occurrences, or of distinct values for `CARDINALITY`, that triggers the condition. + example: 100 + format: int64 + type: integer + required: + - kind + type: object + IssueStateChangeWatchConditionKind: + description: Kind of the watch condition that was met. + enum: + - OCCURRENCES + - CARDINALITY + - ELAPSED_TIME + example: "OCCURRENCES" + type: string + x-enum-varnames: + - OCCURRENCES + - CARDINALITY + - ELAPSED_TIME IssueTeam: description: A team that owns an issue. properties: @@ -80448,7 +81082,7 @@ components: type: string type: object IssueUserReference: - description: The user the issue is assigned to. + description: A reference to a user, such as the user the issue is assigned to. properties: id: description: User identifier. diff --git a/examples/v2/error-tracking/GetIssue_2099584222.py b/examples/v2/error-tracking/GetIssue_2099584222.py new file mode 100644 index 0000000000..e24000394f --- /dev/null +++ b/examples/v2/error-tracking/GetIssue_2099584222.py @@ -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) 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 f631e17b53..6a543e9b1a 100644 --- a/src/datadog_api_client/v2/api/error_tracking_api.py +++ b/src/datadog_api_client/v2/api/error_tracking_api.py @@ -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``. 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 22dd2d4768..d3a0d4b1e2 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", "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 """ @@ -24,6 +24,7 @@ class GetIssueIncludeQueryParameterItem(ModelSimple): "assignee", "bits_investigation", "case", + "lifecycle", "pull_requests", "samples", "team_owners", @@ -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"] @@ -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") diff --git a/src/datadog_api_client/v2/model/issue_assignee_relationship.py b/src/datadog_api_client/v2/model/issue_assignee_relationship.py index f09bfa24e9..9acf49cc67 100644 --- a/src/datadog_api_client/v2/model/issue_assignee_relationship.py +++ b/src/datadog_api_client/v2/model/issue_assignee_relationship.py @@ -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) diff --git a/src/datadog_api_client/v2/model/issue_included.py b/src/datadog_api_client/v2/model/issue_included.py index 91bf11e852..5e4166fb45 100644 --- a/src/datadog_api_client/v2/model/issue_included.py +++ b/src/datadog_api_client/v2/model/issue_included.py @@ -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": [ @@ -53,5 +54,6 @@ def _composed_schemas(_): IssuePullRequest, IssueWatch, IssueSample, + IssueStateChange, ], } diff --git a/src/datadog_api_client/v2/model/issue_lifecycle_event_reference.py b/src/datadog_api_client/v2/model/issue_lifecycle_event_reference.py new file mode 100644 index 0000000000..ad1f2abb48 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_lifecycle_event_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_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 diff --git a/src/datadog_api_client/v2/model/issue_lifecycle_event_type.py b/src/datadog_api_client/v2/model/issue_lifecycle_event_type.py new file mode 100644 index 0000000000..9c9c962f7d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_lifecycle_event_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 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") diff --git a/src/datadog_api_client/v2/model/issue_lifecycle_relationship.py b/src/datadog_api_client/v2/model/issue_lifecycle_relationship.py new file mode 100644 index 0000000000..4a37668a4c --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_lifecycle_relationship.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, 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 diff --git a/src/datadog_api_client/v2/model/issue_relationships.py b/src/datadog_api_client/v2/model/issue_relationships.py index 51050c258e..2f5b59cf8f 100644 --- a/src/datadog_api_client/v2/model/issue_relationships.py +++ b/src/datadog_api_client/v2/model/issue_relationships.py @@ -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 @@ -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 @@ -38,6 +40,7 @@ def openapi_types(_): "assignee": (IssueAssigneeRelationship,), "bits_investigation": (IssueBitsInvestigationRelationship,), "case": (IssueCaseRelationship,), + "lifecycle": (IssueLifecycleRelationship,), "pull_requests": (IssuePullRequestsRelationship,), "samples": (IssueSamplesRelationship,), "team_owners": (IssueTeamOwnersRelationship,), @@ -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", @@ -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, @@ -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 @@ -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: diff --git a/src/datadog_api_client/v2/model/issue_response.py b/src/datadog_api_client/v2/model/issue_response.py index a2a36923a6..9f5a18a98f 100644 --- a/src/datadog_api_client/v2/model/issue_response.py +++ b/src/datadog_api_client/v2/model/issue_response.py @@ -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): @@ -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, diff --git a/src/datadog_api_client/v2/model/issue_state_change.py b/src/datadog_api_client/v2/model/issue_state_change.py new file mode 100644 index 0000000000..927276962e --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change.py @@ -0,0 +1,127 @@ +# 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_state_change_attributes import IssueStateChangeAttributes + from datadog_api_client.v2.model.issue_state_change_relationships import IssueStateChangeRelationships + from datadog_api_client.v2.model.issue_state_change_type import IssueStateChangeType + from datadog_api_client.v2.model.issue_state_change_by_unknown_attributes import IssueStateChangeByUnknownAttributes + from datadog_api_client.v2.model.issue_state_change_by_user_attributes import IssueStateChangeByUserAttributes + from datadog_api_client.v2.model.issue_state_change_by_public_api_attributes import ( + IssueStateChangeByPublicApiAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_attributes import ( + IssueStateChangeByBitsErrorTrackingAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_assignment_attributes import ( + IssueStateChangeByAssignmentAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_case_creation_attributes import ( + IssueStateChangeByCaseCreationAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_case_sync_attributes import ( + IssueStateChangeByCaseSyncAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_attributes import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_attributes import ( + IssueStateChangeByAutoResolveNaiveAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_attributes import ( + IssueStateChangeByAutoResolveVersionAwareAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_regression_naive_attributes import ( + IssueStateChangeByRegressionNaiveAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_attributes import ( + IssueStateChangeByRegressionVersionAwareAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_issue_watch_attributes import ( + IssueStateChangeByIssueWatchAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_attributes import ( + IssueStateChangeByPullRequestLinkAttributes, + ) + + +class IssueStateChange(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state_change_attributes import IssueStateChangeAttributes + from datadog_api_client.v2.model.issue_state_change_relationships import IssueStateChangeRelationships + from datadog_api_client.v2.model.issue_state_change_type import IssueStateChangeType + + return { + "attributes": (IssueStateChangeAttributes,), + "id": (str,), + "relationships": (IssueStateChangeRelationships,), + "type": (IssueStateChangeType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[ + IssueStateChangeAttributes, + IssueStateChangeByUnknownAttributes, + IssueStateChangeByUserAttributes, + IssueStateChangeByPublicApiAttributes, + IssueStateChangeByBitsErrorTrackingAttributes, + IssueStateChangeByAssignmentAttributes, + IssueStateChangeByCaseCreationAttributes, + IssueStateChangeByCaseSyncAttributes, + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes, + IssueStateChangeByAutoResolveNaiveAttributes, + IssueStateChangeByAutoResolveVersionAwareAttributes, + IssueStateChangeByRegressionNaiveAttributes, + IssueStateChangeByRegressionVersionAwareAttributes, + IssueStateChangeByIssueWatchAttributes, + IssueStateChangeByPullRequestLinkAttributes, + ], + id: str, + type: IssueStateChangeType, + relationships: Union[IssueStateChangeRelationships, UnsetType] = unset, + **kwargs, + ): + """ + A change in the issue's state. + + :param attributes: Object containing the information of a state change. Its ``reason`` explains why the state changed and + determines which other attributes are present. + :type attributes: IssueStateChangeAttributes + + :param id: State change identifier. + :type id: str + + :param relationships: Relationship between the state change and other resources. + :type relationships: IssueStateChangeRelationships, optional + + :param type: Type of the object. + :type type: IssueStateChangeType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_state_change_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_attributes.py new file mode 100644 index 0000000000..06d2b6fe86 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_attributes.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 datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class IssueStateChangeAttributes(ModelComposed): + def __init__(self, **kwargs): + """ + Object containing the information of a state change. Its ``reason`` explains why the state changed and + determines which other attributes are present. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByUnknownReason + + :param issue_last_seen: Timestamp of the last error of the issue before it was resolved. + :type issue_last_seen: datetime, optional + + :param issue_last_seen_version: Version of the last error of the issue before it was resolved. + :type issue_last_seen_version: str, optional + + :param regression: The regression that reopened the issue. + :type regression: IssueStateChangeRegression, optional + + :param watch: Leaf conditions of the watch that were met, flattened out of `ANY` and `ALL`. + Present when the snooze ends and absent when it starts. + :type watch: [IssueStateChangeWatchCondition], optional + + :param pull_request: The pull request event that changed the state. + :type pull_request: IssueStateChangePullRequest, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.issue_state_change_by_unknown_attributes import ( + IssueStateChangeByUnknownAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_user_attributes import IssueStateChangeByUserAttributes + from datadog_api_client.v2.model.issue_state_change_by_public_api_attributes import ( + IssueStateChangeByPublicApiAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_attributes import ( + IssueStateChangeByBitsErrorTrackingAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_assignment_attributes import ( + IssueStateChangeByAssignmentAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_case_creation_attributes import ( + IssueStateChangeByCaseCreationAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_case_sync_attributes import ( + IssueStateChangeByCaseSyncAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_attributes import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_attributes import ( + IssueStateChangeByAutoResolveNaiveAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_attributes import ( + IssueStateChangeByAutoResolveVersionAwareAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_regression_naive_attributes import ( + IssueStateChangeByRegressionNaiveAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_attributes import ( + IssueStateChangeByRegressionVersionAwareAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_issue_watch_attributes import ( + IssueStateChangeByIssueWatchAttributes, + ) + from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_attributes import ( + IssueStateChangeByPullRequestLinkAttributes, + ) + + return { + "oneOf": [ + IssueStateChangeByUnknownAttributes, + IssueStateChangeByUserAttributes, + IssueStateChangeByPublicApiAttributes, + IssueStateChangeByBitsErrorTrackingAttributes, + IssueStateChangeByAssignmentAttributes, + IssueStateChangeByCaseCreationAttributes, + IssueStateChangeByCaseSyncAttributes, + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes, + IssueStateChangeByAutoResolveNaiveAttributes, + IssueStateChangeByAutoResolveVersionAwareAttributes, + IssueStateChangeByRegressionNaiveAttributes, + IssueStateChangeByRegressionVersionAwareAttributes, + IssueStateChangeByIssueWatchAttributes, + IssueStateChangeByPullRequestLinkAttributes, + ], + } diff --git a/src/datadog_api_client/v2/model/issue_state_change_author_relationship.py b/src/datadog_api_client/v2/model/issue_state_change_author_relationship.py new file mode 100644 index 0000000000..59fd96b9dd --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_author_relationship.py @@ -0,0 +1,42 @@ +# 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_user_reference import IssueUserReference + + +class IssueStateChangeAuthorRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_user_reference import IssueUserReference + + return { + "data": (IssueUserReference,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueUserReference, **kwargs): + """ + The user who changed the state. Its ``user`` resource is included when the caller has the ``user_access_read`` + permission and the user exists. + Absent when Error Tracking changed the state: ``reason`` says why. + + :param data: A reference to a user, such as the user the issue is assigned to. + :type data: IssueUserReference + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_assignment_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_assignment_attributes.py new file mode 100644 index 0000000000..e2ac922a76 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_assignment_attributes.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_assignment_reason import IssueStateChangeByAssignmentReason + + +class IssueStateChangeByAssignmentAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_assignment_reason import ( + IssueStateChangeByAssignmentReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByAssignmentReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByAssignmentReason, + **kwargs, + ): + """ + A state change caused by assigning the issue. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByAssignmentReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_assignment_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_assignment_reason.py new file mode 100644 index 0000000000..7f51fed15f --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_assignment_reason.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 IssueStateChangeByAssignmentReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "ASSIGNMENT". Must be one of ["ASSIGNMENT"]. + :type value: str + """ + + allowed_values = { + "ASSIGNMENT", + } + ASSIGNMENT: ClassVar["IssueStateChangeByAssignmentReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByAssignmentReason.ASSIGNMENT = IssueStateChangeByAssignmentReason("ASSIGNMENT") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_attributes.py new file mode 100644 index 0000000000..4c404c2116 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_attributes.py @@ -0,0 +1,91 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_reason import ( + IssueStateChangeByAutoResolveNaiveReason, + ) + + +class IssueStateChangeByAutoResolveNaiveAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_reason import ( + IssueStateChangeByAutoResolveNaiveReason, + ) + + return { + "created_at": (datetime,), + "issue_last_seen": (datetime,), + "issue_last_seen_version": (str,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByAutoResolveNaiveReason,), + } + + attribute_map = { + "created_at": "created_at", + "issue_last_seen": "issue_last_seen", + "issue_last_seen_version": "issue_last_seen_version", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByAutoResolveNaiveReason, + issue_last_seen: Union[datetime, UnsetType] = unset, + issue_last_seen_version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A resolution made by Error Tracking + because the issue stopped occurring, without checking which versions are running. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param issue_last_seen: Timestamp of the last error of the issue before it was resolved. + :type issue_last_seen: datetime, optional + + :param issue_last_seen_version: Version of the last error of the issue before it was resolved. + :type issue_last_seen_version: str, optional + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByAutoResolveNaiveReason + """ + if issue_last_seen is not unset: + kwargs["issue_last_seen"] = issue_last_seen + if issue_last_seen_version is not unset: + kwargs["issue_last_seen_version"] = issue_last_seen_version + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_reason.py new file mode 100644 index 0000000000..3caebffeb9 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_naive_reason.py @@ -0,0 +1,37 @@ +# 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 IssueStateChangeByAutoResolveNaiveReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "AUTO_RESOLVE_NAIVE". Must be one of ["AUTO_RESOLVE_NAIVE"]. + :type value: str + """ + + allowed_values = { + "AUTO_RESOLVE_NAIVE", + } + AUTO_RESOLVE_NAIVE: ClassVar["IssueStateChangeByAutoResolveNaiveReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByAutoResolveNaiveReason.AUTO_RESOLVE_NAIVE = IssueStateChangeByAutoResolveNaiveReason( + "AUTO_RESOLVE_NAIVE" +) diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_attributes.py new file mode 100644 index 0000000000..b53a5050e0 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_attributes.py @@ -0,0 +1,73 @@ +# 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, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_reason import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsReason, + ) + + +class IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_reason import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByAutoResolveUndetectedRecommendationsReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByAutoResolveUndetectedRecommendationsReason, + **kwargs, + ): + """ + A resolution made by Error Tracking + because the recommendation behind the issue is no longer detected. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByAutoResolveUndetectedRecommendationsReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_reason.py new file mode 100644 index 0000000000..ad703b7350 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_undetected_recommendations_reason.py @@ -0,0 +1,37 @@ +# 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 IssueStateChangeByAutoResolveUndetectedRecommendationsReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS". Must be one of ["AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS"]. + :type value: str + """ + + allowed_values = { + "AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS", + } + AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS: ClassVar["IssueStateChangeByAutoResolveUndetectedRecommendationsReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByAutoResolveUndetectedRecommendationsReason.AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS = ( + IssueStateChangeByAutoResolveUndetectedRecommendationsReason("AUTO_RESOLVE_UNDETECTED_RECOMMENDATIONS") +) diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_attributes.py new file mode 100644 index 0000000000..2fda94099e --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_attributes.py @@ -0,0 +1,91 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_reason import ( + IssueStateChangeByAutoResolveVersionAwareReason, + ) + + +class IssueStateChangeByAutoResolveVersionAwareAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_reason import ( + IssueStateChangeByAutoResolveVersionAwareReason, + ) + + return { + "created_at": (datetime,), + "issue_last_seen": (datetime,), + "issue_last_seen_version": (str,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByAutoResolveVersionAwareReason,), + } + + attribute_map = { + "created_at": "created_at", + "issue_last_seen": "issue_last_seen", + "issue_last_seen_version": "issue_last_seen_version", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByAutoResolveVersionAwareReason, + issue_last_seen: Union[datetime, UnsetType] = unset, + issue_last_seen_version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A resolution made by Error Tracking + because the issue stopped occurring and the versions where it was detected no longer run. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param issue_last_seen: Timestamp of the last error of the issue before it was resolved. + :type issue_last_seen: datetime, optional + + :param issue_last_seen_version: Version of the last error of the issue before it was resolved. + :type issue_last_seen_version: str, optional + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByAutoResolveVersionAwareReason + """ + if issue_last_seen is not unset: + kwargs["issue_last_seen"] = issue_last_seen + if issue_last_seen_version is not unset: + kwargs["issue_last_seen_version"] = issue_last_seen_version + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_reason.py new file mode 100644 index 0000000000..f4d2eebd34 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_auto_resolve_version_aware_reason.py @@ -0,0 +1,37 @@ +# 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 IssueStateChangeByAutoResolveVersionAwareReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "AUTO_RESOLVE_VERSION_AWARE". Must be one of ["AUTO_RESOLVE_VERSION_AWARE"]. + :type value: str + """ + + allowed_values = { + "AUTO_RESOLVE_VERSION_AWARE", + } + AUTO_RESOLVE_VERSION_AWARE: ClassVar["IssueStateChangeByAutoResolveVersionAwareReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByAutoResolveVersionAwareReason.AUTO_RESOLVE_VERSION_AWARE = ( + IssueStateChangeByAutoResolveVersionAwareReason("AUTO_RESOLVE_VERSION_AWARE") +) diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_attributes.py new file mode 100644 index 0000000000..4d5a8abde8 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_attributes.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_reason import ( + IssueStateChangeByBitsErrorTrackingReason, + ) + + +class IssueStateChangeByBitsErrorTrackingAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_reason import ( + IssueStateChangeByBitsErrorTrackingReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByBitsErrorTrackingReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByBitsErrorTrackingReason, + **kwargs, + ): + """ + A state change made by Bits AI on behalf of a user. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByBitsErrorTrackingReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_reason.py new file mode 100644 index 0000000000..c36c39e29d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_bits_error_tracking_reason.py @@ -0,0 +1,37 @@ +# 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 IssueStateChangeByBitsErrorTrackingReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "BITS_ERROR_TRACKING". Must be one of ["BITS_ERROR_TRACKING"]. + :type value: str + """ + + allowed_values = { + "BITS_ERROR_TRACKING", + } + BITS_ERROR_TRACKING: ClassVar["IssueStateChangeByBitsErrorTrackingReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByBitsErrorTrackingReason.BITS_ERROR_TRACKING = IssueStateChangeByBitsErrorTrackingReason( + "BITS_ERROR_TRACKING" +) diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_attributes.py new file mode 100644 index 0000000000..664123de6f --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_attributes.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_case_creation_reason import ( + IssueStateChangeByCaseCreationReason, + ) + + +class IssueStateChangeByCaseCreationAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_case_creation_reason import ( + IssueStateChangeByCaseCreationReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByCaseCreationReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByCaseCreationReason, + **kwargs, + ): + """ + A state change caused by creating a case for the issue. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByCaseCreationReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_reason.py new file mode 100644 index 0000000000..365227d149 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_case_creation_reason.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 IssueStateChangeByCaseCreationReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "CASE_CREATION". Must be one of ["CASE_CREATION"]. + :type value: str + """ + + allowed_values = { + "CASE_CREATION", + } + CASE_CREATION: ClassVar["IssueStateChangeByCaseCreationReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByCaseCreationReason.CASE_CREATION = IssueStateChangeByCaseCreationReason("CASE_CREATION") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_attributes.py new file mode 100644 index 0000000000..e039967c6b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_attributes.py @@ -0,0 +1,68 @@ +# 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, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_case_sync_reason import IssueStateChangeByCaseSyncReason + + +class IssueStateChangeByCaseSyncAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_case_sync_reason import IssueStateChangeByCaseSyncReason + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByCaseSyncReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByCaseSyncReason, + **kwargs, + ): + """ + A state change synced from the status of the case attached to the issue. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByCaseSyncReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_reason.py new file mode 100644 index 0000000000..93260ab032 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_case_sync_reason.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 IssueStateChangeByCaseSyncReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "CASE_SYNC". Must be one of ["CASE_SYNC"]. + :type value: str + """ + + allowed_values = { + "CASE_SYNC", + } + CASE_SYNC: ClassVar["IssueStateChangeByCaseSyncReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByCaseSyncReason.CASE_SYNC = IssueStateChangeByCaseSyncReason("CASE_SYNC") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_attributes.py new file mode 100644 index 0000000000..b7b5357fd2 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_attributes.py @@ -0,0 +1,83 @@ +# 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_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_issue_watch_reason import IssueStateChangeByIssueWatchReason + from datadog_api_client.v2.model.issue_state_change_watch_condition import IssueStateChangeWatchCondition + + +class IssueStateChangeByIssueWatchAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_issue_watch_reason import ( + IssueStateChangeByIssueWatchReason, + ) + from datadog_api_client.v2.model.issue_state_change_watch_condition import IssueStateChangeWatchCondition + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByIssueWatchReason,), + "watch": ([IssueStateChangeWatchCondition],), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + "watch": "watch", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByIssueWatchReason, + watch: Union[List[IssueStateChangeWatchCondition], UnsetType] = unset, + **kwargs, + ): + """ + A state change made by a snooze, when the snooze starts or when its conditions are met. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByIssueWatchReason + + :param watch: Leaf conditions of the watch that were met, flattened out of ``ANY`` and ``ALL``. + Present when the snooze ends and absent when it starts. + :type watch: [IssueStateChangeWatchCondition], optional + """ + if watch is not unset: + kwargs["watch"] = watch + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_reason.py new file mode 100644 index 0000000000..401af15037 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_issue_watch_reason.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 IssueStateChangeByIssueWatchReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "ISSUE_WATCH". Must be one of ["ISSUE_WATCH"]. + :type value: str + """ + + allowed_values = { + "ISSUE_WATCH", + } + ISSUE_WATCH: ClassVar["IssueStateChangeByIssueWatchReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByIssueWatchReason.ISSUE_WATCH = IssueStateChangeByIssueWatchReason("ISSUE_WATCH") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_public_api_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_public_api_attributes.py new file mode 100644 index 0000000000..96acd0e3c6 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_public_api_attributes.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_public_api_reason import IssueStateChangeByPublicApiReason + + +class IssueStateChangeByPublicApiAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_public_api_reason import ( + IssueStateChangeByPublicApiReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByPublicApiReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByPublicApiReason, + **kwargs, + ): + """ + A state change made through the Datadog API. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByPublicApiReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_public_api_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_public_api_reason.py new file mode 100644 index 0000000000..fe829e4297 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_public_api_reason.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 IssueStateChangeByPublicApiReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "PUBLIC_API". Must be one of ["PUBLIC_API"]. + :type value: str + """ + + allowed_values = { + "PUBLIC_API", + } + PUBLIC_API: ClassVar["IssueStateChangeByPublicApiReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByPublicApiReason.PUBLIC_API = IssueStateChangeByPublicApiReason("PUBLIC_API") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_attributes.py new file mode 100644 index 0000000000..c333f0c3e2 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_attributes.py @@ -0,0 +1,84 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_pull_request import IssueStateChangePullRequest + from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_reason import ( + IssueStateChangeByPullRequestLinkReason, + ) + + +class IssueStateChangeByPullRequestLinkAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_pull_request import IssueStateChangePullRequest + from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_reason import ( + IssueStateChangeByPullRequestLinkReason, + ) + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "pull_request": (IssueStateChangePullRequest,), + "reason": (IssueStateChangeByPullRequestLinkReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "pull_request": "pull_request", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByPullRequestLinkReason, + pull_request: Union[IssueStateChangePullRequest, UnsetType] = unset, + **kwargs, + ): + """ + A state change caused by a pull request linked to the issue, such as the merge of a fix. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param pull_request: The pull request event that changed the state. + :type pull_request: IssueStateChangePullRequest, optional + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByPullRequestLinkReason + """ + if pull_request is not unset: + kwargs["pull_request"] = pull_request + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_reason.py new file mode 100644 index 0000000000..dc2658fba1 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_pull_request_link_reason.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 IssueStateChangeByPullRequestLinkReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "PULL_REQUEST_LINK". Must be one of ["PULL_REQUEST_LINK"]. + :type value: str + """ + + allowed_values = { + "PULL_REQUEST_LINK", + } + PULL_REQUEST_LINK: ClassVar["IssueStateChangeByPullRequestLinkReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByPullRequestLinkReason.PULL_REQUEST_LINK = IssueStateChangeByPullRequestLinkReason("PULL_REQUEST_LINK") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_attributes.py new file mode 100644 index 0000000000..ccb6606ab1 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_attributes.py @@ -0,0 +1,84 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_regression_naive_reason import ( + IssueStateChangeByRegressionNaiveReason, + ) + from datadog_api_client.v2.model.issue_state_change_regression import IssueStateChangeRegression + + +class IssueStateChangeByRegressionNaiveAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_regression_naive_reason import ( + IssueStateChangeByRegressionNaiveReason, + ) + from datadog_api_client.v2.model.issue_state_change_regression import IssueStateChangeRegression + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByRegressionNaiveReason,), + "regression": (IssueStateChangeRegression,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + "regression": "regression", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByRegressionNaiveReason, + regression: Union[IssueStateChangeRegression, UnsetType] = unset, + **kwargs, + ): + """ + A reopening made by Error Tracking because the resolved issue occurred again. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByRegressionNaiveReason + + :param regression: The regression that reopened the issue. + :type regression: IssueStateChangeRegression, optional + """ + if regression is not unset: + kwargs["regression"] = regression + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_reason.py new file mode 100644 index 0000000000..e4142e9b25 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_regression_naive_reason.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 IssueStateChangeByRegressionNaiveReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "REGRESSION_NAIVE". Must be one of ["REGRESSION_NAIVE"]. + :type value: str + """ + + allowed_values = { + "REGRESSION_NAIVE", + } + REGRESSION_NAIVE: ClassVar["IssueStateChangeByRegressionNaiveReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByRegressionNaiveReason.REGRESSION_NAIVE = IssueStateChangeByRegressionNaiveReason("REGRESSION_NAIVE") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_attributes.py new file mode 100644 index 0000000000..0c393590b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_attributes.py @@ -0,0 +1,85 @@ +# 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, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_reason import ( + IssueStateChangeByRegressionVersionAwareReason, + ) + from datadog_api_client.v2.model.issue_state_change_regression import IssueStateChangeRegression + + +class IssueStateChangeByRegressionVersionAwareAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_reason import ( + IssueStateChangeByRegressionVersionAwareReason, + ) + from datadog_api_client.v2.model.issue_state_change_regression import IssueStateChangeRegression + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByRegressionVersionAwareReason,), + "regression": (IssueStateChangeRegression,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + "regression": "regression", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByRegressionVersionAwareReason, + regression: Union[IssueStateChangeRegression, UnsetType] = unset, + **kwargs, + ): + """ + A reopening made by Error Tracking + because the resolved issue occurred again, taking versions into account. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByRegressionVersionAwareReason + + :param regression: The regression that reopened the issue. + :type regression: IssueStateChangeRegression, optional + """ + if regression is not unset: + kwargs["regression"] = regression + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_reason.py new file mode 100644 index 0000000000..3a6b7e7c74 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_regression_version_aware_reason.py @@ -0,0 +1,37 @@ +# 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 IssueStateChangeByRegressionVersionAwareReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "REGRESSION_VERSION_AWARE". Must be one of ["REGRESSION_VERSION_AWARE"]. + :type value: str + """ + + allowed_values = { + "REGRESSION_VERSION_AWARE", + } + REGRESSION_VERSION_AWARE: ClassVar["IssueStateChangeByRegressionVersionAwareReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByRegressionVersionAwareReason.REGRESSION_VERSION_AWARE = ( + IssueStateChangeByRegressionVersionAwareReason("REGRESSION_VERSION_AWARE") +) diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_unknown_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_unknown_attributes.py new file mode 100644 index 0000000000..be16c5015b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_unknown_attributes.py @@ -0,0 +1,68 @@ +# 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, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_unknown_reason import IssueStateChangeByUnknownReason + + +class IssueStateChangeByUnknownAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_unknown_reason import IssueStateChangeByUnknownReason + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByUnknownReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByUnknownReason, + **kwargs, + ): + """ + A state change whose reason was not recorded. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByUnknownReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_unknown_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_unknown_reason.py new file mode 100644 index 0000000000..7b412b8463 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_unknown_reason.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 IssueStateChangeByUnknownReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "UNKNOWN". Must be one of ["UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "UNKNOWN", + } + UNKNOWN: ClassVar["IssueStateChangeByUnknownReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByUnknownReason.UNKNOWN = IssueStateChangeByUnknownReason("UNKNOWN") diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_user_attributes.py b/src/datadog_api_client/v2/model/issue_state_change_by_user_attributes.py new file mode 100644 index 0000000000..4e62d3ea54 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_user_attributes.py @@ -0,0 +1,68 @@ +# 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, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_user_reason import IssueStateChangeByUserReason + + +class IssueStateChangeByUserAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + from datadog_api_client.v2.model.issue_state_change_by_user_reason import IssueStateChangeByUserReason + + return { + "created_at": (datetime,), + "next": (IssueState,), + "previous": (IssueState,), + "reason": (IssueStateChangeByUserReason,), + } + + attribute_map = { + "created_at": "created_at", + "next": "next", + "previous": "previous", + "reason": "reason", + } + + def __init__( + self_, + created_at: datetime, + next: IssueState, + previous: IssueState, + reason: IssueStateChangeByUserReason, + **kwargs, + ): + """ + A state change made by a user in Datadog. + + :param created_at: Timestamp of the state change. + :type created_at: datetime + + :param next: State of the issue + :type next: IssueState + + :param previous: State of the issue + :type previous: IssueState + + :param reason: Why the issue state changed. + :type reason: IssueStateChangeByUserReason + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.next = next + self_.previous = previous + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/issue_state_change_by_user_reason.py b/src/datadog_api_client/v2/model/issue_state_change_by_user_reason.py new file mode 100644 index 0000000000..f36f58936e --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_by_user_reason.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 IssueStateChangeByUserReason(ModelSimple): + """ + Why the issue state changed. + + :param value: If omitted defaults to "USER". Must be one of ["USER"]. + :type value: str + """ + + allowed_values = { + "USER", + } + USER: ClassVar["IssueStateChangeByUserReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeByUserReason.USER = IssueStateChangeByUserReason("USER") diff --git a/src/datadog_api_client/v2/model/issue_state_change_pull_request.py b/src/datadog_api_client/v2/model/issue_state_change_pull_request.py new file mode 100644 index 0000000000..7451b3da05 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_pull_request.py @@ -0,0 +1,52 @@ +# 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_state_change_pull_request_event import IssueStateChangePullRequestEvent + + +class IssueStateChangePullRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state_change_pull_request_event import IssueStateChangePullRequestEvent + + return { + "event": (IssueStateChangePullRequestEvent,), + "id": (str,), + "url": (str,), + } + + attribute_map = { + "event": "event", + "id": "id", + "url": "url", + } + + def __init__(self_, event: IssueStateChangePullRequestEvent, id: str, url: str, **kwargs): + """ + The pull request event that changed the state. + + :param event: What happened to the pull request. + :type event: IssueStateChangePullRequestEvent + + :param id: Pull request identifier. + :type id: str + + :param url: URL of the pull request. + :type url: str + """ + super().__init__(kwargs) + + self_.event = event + self_.id = id + self_.url = url diff --git a/src/datadog_api_client/v2/model/issue_state_change_pull_request_event.py b/src/datadog_api_client/v2/model/issue_state_change_pull_request_event.py new file mode 100644 index 0000000000..f1e56c398e --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_pull_request_event.py @@ -0,0 +1,47 @@ +# 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 IssueStateChangePullRequestEvent(ModelSimple): + """ + What happened to the pull request. + + :param value: Must be one of ["linked", "unlinked", "merged", "closed", "reopened"]. + :type value: str + """ + + allowed_values = { + "linked", + "unlinked", + "merged", + "closed", + "reopened", + } + LINKED: ClassVar["IssueStateChangePullRequestEvent"] + UNLINKED: ClassVar["IssueStateChangePullRequestEvent"] + MERGED: ClassVar["IssueStateChangePullRequestEvent"] + CLOSED: ClassVar["IssueStateChangePullRequestEvent"] + REOPENED: ClassVar["IssueStateChangePullRequestEvent"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangePullRequestEvent.LINKED = IssueStateChangePullRequestEvent("linked") +IssueStateChangePullRequestEvent.UNLINKED = IssueStateChangePullRequestEvent("unlinked") +IssueStateChangePullRequestEvent.MERGED = IssueStateChangePullRequestEvent("merged") +IssueStateChangePullRequestEvent.CLOSED = IssueStateChangePullRequestEvent("closed") +IssueStateChangePullRequestEvent.REOPENED = IssueStateChangePullRequestEvent("reopened") diff --git a/src/datadog_api_client/v2/model/issue_state_change_regression.py b/src/datadog_api_client/v2/model/issue_state_change_regression.py new file mode 100644 index 0000000000..22ec37921a --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_regression.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +class IssueStateChangeRegression(ModelNormal): + @cached_property + def openapi_types(_): + return { + "regressed_at": (datetime,), + "regressed_at_version": (str,), + "resolved_at": (datetime,), + } + + attribute_map = { + "regressed_at": "regressed_at", + "regressed_at_version": "regressed_at_version", + "resolved_at": "resolved_at", + } + + def __init__( + self_, + regressed_at: Union[datetime, UnsetType] = unset, + regressed_at_version: Union[str, UnsetType] = unset, + resolved_at: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + The regression that reopened the issue. + + :param regressed_at: Timestamp when the issue regressed. + :type regressed_at: datetime, optional + + :param regressed_at_version: Version in which the issue regressed. + :type regressed_at_version: str, optional + + :param resolved_at: Timestamp when the issue was resolved before the regression. + :type resolved_at: datetime, optional + """ + if regressed_at is not unset: + kwargs["regressed_at"] = regressed_at + if regressed_at_version is not unset: + kwargs["regressed_at_version"] = regressed_at_version + if resolved_at is not unset: + kwargs["resolved_at"] = resolved_at + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_state_change_relationships.py b/src/datadog_api_client/v2/model/issue_state_change_relationships.py new file mode 100644 index 0000000000..9c47a9597c --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_relationships.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 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_state_change_author_relationship import IssueStateChangeAuthorRelationship + + +class IssueStateChangeRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state_change_author_relationship import ( + IssueStateChangeAuthorRelationship, + ) + + return { + "author": (IssueStateChangeAuthorRelationship,), + } + + attribute_map = { + "author": "author", + } + + def __init__(self_, author: Union[IssueStateChangeAuthorRelationship, UnsetType] = unset, **kwargs): + """ + Relationship between the state change and other resources. + + :param author: The user who changed the state. Its ``user`` resource is included when the caller has the ``user_access_read`` + permission and the user exists. + Absent when Error Tracking changed the state: ``reason`` says why. + :type author: IssueStateChangeAuthorRelationship, optional + """ + if author is not unset: + kwargs["author"] = author + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_state_change_type.py b/src/datadog_api_client/v2/model/issue_state_change_type.py new file mode 100644 index 0000000000..0acfa386c3 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_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 IssueStateChangeType(ModelSimple): + """ + Type of the object. + + :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["IssueStateChangeType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeType.ERROR_TRACKING_ISSUE_STATE_CHANGE = IssueStateChangeType("error_tracking_issue_state_change") diff --git a/src/datadog_api_client/v2/model/issue_state_change_watch_condition.py b/src/datadog_api_client/v2/model/issue_state_change_watch_condition.py new file mode 100644 index 0000000000..8970c125d5 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_watch_condition.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 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_state_change_watch_condition_kind import IssueStateChangeWatchConditionKind + + +class IssueStateChangeWatchCondition(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state_change_watch_condition_kind import ( + IssueStateChangeWatchConditionKind, + ) + + return { + "deadline": (datetime,), + "duration": (str,), + "kind": (IssueStateChangeWatchConditionKind,), + "observed_count": (int,), + "projection": ([str],), + "threshold": (int,), + } + + attribute_map = { + "deadline": "deadline", + "duration": "duration", + "kind": "kind", + "observed_count": "observed_count", + "projection": "projection", + "threshold": "threshold", + } + + def __init__( + self_, + kind: IssueStateChangeWatchConditionKind, + deadline: Union[datetime, UnsetType] = unset, + duration: Union[str, UnsetType] = unset, + observed_count: Union[int, UnsetType] = unset, + projection: Union[List[str], UnsetType] = unset, + threshold: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A leaf condition of the watch that was met. Met conditions inside ``ANY`` and ``ALL`` are listed flat, + and a composite that was not met contributes none of its conditions. + + :param deadline: Timestamp when the ``ELAPSED_TIME`` condition was met. + :type deadline: datetime, optional + + :param duration: Time that must elapse for the condition to be met, as a Go duration string. + :type duration: str, optional + + :param kind: Kind of the watch condition that was met. + :type kind: IssueStateChangeWatchConditionKind + + :param observed_count: Count observed when the condition was met, in the same unit as ``threshold``. + :type observed_count: int, optional + + :param projection: Attributes whose distinct values ``CARDINALITY`` counts. + :type projection: [str], optional + + :param threshold: Number of occurrences, or of distinct values for ``CARDINALITY`` , that triggers the condition. + :type threshold: int, optional + """ + if deadline is not unset: + kwargs["deadline"] = deadline + if duration is not unset: + kwargs["duration"] = duration + if observed_count is not unset: + kwargs["observed_count"] = observed_count + if projection is not unset: + kwargs["projection"] = projection + if threshold is not unset: + kwargs["threshold"] = threshold + super().__init__(kwargs) + + self_.kind = kind diff --git a/src/datadog_api_client/v2/model/issue_state_change_watch_condition_kind.py b/src/datadog_api_client/v2/model/issue_state_change_watch_condition_kind.py new file mode 100644 index 0000000000..0d891b066b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state_change_watch_condition_kind.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 IssueStateChangeWatchConditionKind(ModelSimple): + """ + Kind of the watch condition that was met. + + :param value: Must be one of ["OCCURRENCES", "CARDINALITY", "ELAPSED_TIME"]. + :type value: str + """ + + allowed_values = { + "OCCURRENCES", + "CARDINALITY", + "ELAPSED_TIME", + } + OCCURRENCES: ClassVar["IssueStateChangeWatchConditionKind"] + CARDINALITY: ClassVar["IssueStateChangeWatchConditionKind"] + ELAPSED_TIME: ClassVar["IssueStateChangeWatchConditionKind"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueStateChangeWatchConditionKind.OCCURRENCES = IssueStateChangeWatchConditionKind("OCCURRENCES") +IssueStateChangeWatchConditionKind.CARDINALITY = IssueStateChangeWatchConditionKind("CARDINALITY") +IssueStateChangeWatchConditionKind.ELAPSED_TIME = IssueStateChangeWatchConditionKind("ELAPSED_TIME") diff --git a/src/datadog_api_client/v2/model/issue_user_reference.py b/src/datadog_api_client/v2/model/issue_user_reference.py index bdb5860d38..7b6d2b2d87 100644 --- a/src/datadog_api_client/v2/model/issue_user_reference.py +++ b/src/datadog_api_client/v2/model/issue_user_reference.py @@ -32,7 +32,7 @@ def openapi_types(_): def __init__(self_, id: str, type: IssueUserType, **kwargs): """ - The user the issue is assigned to. + A reference to a user, such as the user the issue is assigned to. :param id: User identifier. :type id: str diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 53d829ca84..b9c7e4f1ff 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6482,6 +6482,9 @@ from datadog_api_client.v2.model.issue_impact_views import IssueImpactViews from datadog_api_client.v2.model.issue_included import IssueIncluded from datadog_api_client.v2.model.issue_language import IssueLanguage +from datadog_api_client.v2.model.issue_lifecycle_event_reference import IssueLifecycleEventReference +from datadog_api_client.v2.model.issue_lifecycle_event_type import IssueLifecycleEventType +from datadog_api_client.v2.model.issue_lifecycle_relationship import IssueLifecycleRelationship from datadog_api_client.v2.model.issue_platform import IssuePlatform from datadog_api_client.v2.model.issue_pull_request import IssuePullRequest from datadog_api_client.v2.model.issue_pull_request_attributes import IssuePullRequestAttributes @@ -6511,6 +6514,80 @@ from datadog_api_client.v2.model.issue_snooze_request_data_attributes import IssueSnoozeRequestDataAttributes from datadog_api_client.v2.model.issue_snooze_request_data_type import IssueSnoozeRequestDataType from datadog_api_client.v2.model.issue_state import IssueState +from datadog_api_client.v2.model.issue_state_change import IssueStateChange +from datadog_api_client.v2.model.issue_state_change_attributes import IssueStateChangeAttributes +from datadog_api_client.v2.model.issue_state_change_author_relationship import IssueStateChangeAuthorRelationship +from datadog_api_client.v2.model.issue_state_change_by_assignment_attributes import ( + IssueStateChangeByAssignmentAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_assignment_reason import IssueStateChangeByAssignmentReason +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_attributes import ( + IssueStateChangeByAutoResolveNaiveAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_naive_reason import ( + IssueStateChangeByAutoResolveNaiveReason, +) +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_attributes import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_undetected_recommendations_reason import ( + IssueStateChangeByAutoResolveUndetectedRecommendationsReason, +) +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_attributes import ( + IssueStateChangeByAutoResolveVersionAwareAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_auto_resolve_version_aware_reason import ( + IssueStateChangeByAutoResolveVersionAwareReason, +) +from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_attributes import ( + IssueStateChangeByBitsErrorTrackingAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_bits_error_tracking_reason import ( + IssueStateChangeByBitsErrorTrackingReason, +) +from datadog_api_client.v2.model.issue_state_change_by_case_creation_attributes import ( + IssueStateChangeByCaseCreationAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_case_creation_reason import IssueStateChangeByCaseCreationReason +from datadog_api_client.v2.model.issue_state_change_by_case_sync_attributes import IssueStateChangeByCaseSyncAttributes +from datadog_api_client.v2.model.issue_state_change_by_case_sync_reason import IssueStateChangeByCaseSyncReason +from datadog_api_client.v2.model.issue_state_change_by_issue_watch_attributes import ( + IssueStateChangeByIssueWatchAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_issue_watch_reason import IssueStateChangeByIssueWatchReason +from datadog_api_client.v2.model.issue_state_change_by_public_api_attributes import ( + IssueStateChangeByPublicApiAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_public_api_reason import IssueStateChangeByPublicApiReason +from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_attributes import ( + IssueStateChangeByPullRequestLinkAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_pull_request_link_reason import ( + IssueStateChangeByPullRequestLinkReason, +) +from datadog_api_client.v2.model.issue_state_change_by_regression_naive_attributes import ( + IssueStateChangeByRegressionNaiveAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_regression_naive_reason import ( + IssueStateChangeByRegressionNaiveReason, +) +from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_attributes import ( + IssueStateChangeByRegressionVersionAwareAttributes, +) +from datadog_api_client.v2.model.issue_state_change_by_regression_version_aware_reason import ( + IssueStateChangeByRegressionVersionAwareReason, +) +from datadog_api_client.v2.model.issue_state_change_by_unknown_attributes import IssueStateChangeByUnknownAttributes +from datadog_api_client.v2.model.issue_state_change_by_unknown_reason import IssueStateChangeByUnknownReason +from datadog_api_client.v2.model.issue_state_change_by_user_attributes import IssueStateChangeByUserAttributes +from datadog_api_client.v2.model.issue_state_change_by_user_reason import IssueStateChangeByUserReason +from datadog_api_client.v2.model.issue_state_change_pull_request import IssueStateChangePullRequest +from datadog_api_client.v2.model.issue_state_change_pull_request_event import IssueStateChangePullRequestEvent +from datadog_api_client.v2.model.issue_state_change_regression import IssueStateChangeRegression +from datadog_api_client.v2.model.issue_state_change_relationships import IssueStateChangeRelationships +from datadog_api_client.v2.model.issue_state_change_type import IssueStateChangeType +from datadog_api_client.v2.model.issue_state_change_watch_condition import IssueStateChangeWatchCondition +from datadog_api_client.v2.model.issue_state_change_watch_condition_kind import IssueStateChangeWatchConditionKind from datadog_api_client.v2.model.issue_team import IssueTeam from datadog_api_client.v2.model.issue_team_attributes import IssueTeamAttributes from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship @@ -19323,6 +19400,9 @@ "IssueImpactViews", "IssueIncluded", "IssueLanguage", + "IssueLifecycleEventReference", + "IssueLifecycleEventType", + "IssueLifecycleRelationship", "IssuePlatform", "IssuePullRequest", "IssuePullRequestAttributes", @@ -19352,6 +19432,44 @@ "IssueSnoozeRequestDataAttributes", "IssueSnoozeRequestDataType", "IssueState", + "IssueStateChange", + "IssueStateChangeAttributes", + "IssueStateChangeAuthorRelationship", + "IssueStateChangeByAssignmentAttributes", + "IssueStateChangeByAssignmentReason", + "IssueStateChangeByAutoResolveNaiveAttributes", + "IssueStateChangeByAutoResolveNaiveReason", + "IssueStateChangeByAutoResolveUndetectedRecommendationsAttributes", + "IssueStateChangeByAutoResolveUndetectedRecommendationsReason", + "IssueStateChangeByAutoResolveVersionAwareAttributes", + "IssueStateChangeByAutoResolveVersionAwareReason", + "IssueStateChangeByBitsErrorTrackingAttributes", + "IssueStateChangeByBitsErrorTrackingReason", + "IssueStateChangeByCaseCreationAttributes", + "IssueStateChangeByCaseCreationReason", + "IssueStateChangeByCaseSyncAttributes", + "IssueStateChangeByCaseSyncReason", + "IssueStateChangeByIssueWatchAttributes", + "IssueStateChangeByIssueWatchReason", + "IssueStateChangeByPublicApiAttributes", + "IssueStateChangeByPublicApiReason", + "IssueStateChangeByPullRequestLinkAttributes", + "IssueStateChangeByPullRequestLinkReason", + "IssueStateChangeByRegressionNaiveAttributes", + "IssueStateChangeByRegressionNaiveReason", + "IssueStateChangeByRegressionVersionAwareAttributes", + "IssueStateChangeByRegressionVersionAwareReason", + "IssueStateChangeByUnknownAttributes", + "IssueStateChangeByUnknownReason", + "IssueStateChangeByUserAttributes", + "IssueStateChangeByUserReason", + "IssueStateChangePullRequest", + "IssueStateChangePullRequestEvent", + "IssueStateChangeRegression", + "IssueStateChangeRelationships", + "IssueStateChangeType", + "IssueStateChangeWatchCondition", + "IssueStateChangeWatchConditionKind", "IssueTeam", "IssueTeamAttributes", "IssueTeamOwnersRelationship", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index b29bb33b0c..a4d79dc4c5 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -5810,6 +5810,13 @@ "scenario": "Get the details of an error tracking issue with a samples bias filter but no samples include returns \"Bad Request\" 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-lifecycle-returns-ok-response.json", + "scenario": "Get the details of an error tracking issue with lifecycle 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-lifecycle-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-lifecycle-returns-ok-response.json new file mode 100644 index 0000000000..49ca13f0b7 --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/error-tracking/get-the-details-of-an-error-tracking-issue-with-lifecycle-returns-ok-response.json @@ -0,0 +1,58 @@ +{ + "api": "ErrorTracking", + "expected_status": 200, + "feature": "Error Tracking", + "id": "v2/Error Tracking/Get the details of an error tracking issue with lifecycle 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": [ + "lifecycle" + ] + }, + "style": null + } + ], + "path": "/api/v2/error-tracking/issues/{issue_id}" + }, + "scenario": "Get the details of an error tracking issue with lifecycle 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 ae03aee515..55572d62ed 100644 --- a/tests/generated-test/test-server-data/v2/error-tracking.json +++ b/tests/generated-test/test-server-data/v2/error-tracking.json @@ -229,6 +229,75 @@ "scenario": "Get the details of an error tracking issue with a samples bias filter but no samples include returns \"Bad Request\" response", "version": "v2" }, + { + "feature": "Error Tracking", + "frozen_at": "2026-12-02T07:45:07.193Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "from": 1794901507000, + "query": "service:synthetics-browser", + "to": 1796197507000, + "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\":4266,\"impacted_users\":4373,\"total_count\":8618},\"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": [ + [ + "include", + "lifecycle" + ] + ] + }, + "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\":1796197372206,\"last_seen_version\":\"1.2.4\",\"platform\":\"BROWSER\",\"service\":\"synthetics-browser\",\"state\":\"RESOLVED\"},\"relationships\":{\"case\":{\"data\":{\"id\":\"7afc10c8-4096-4af1-9ccf-ec0df3a2f63b\",\"type\":\"case\"}},\"lifecycle\":{\"data\":[{\"id\":\"aab68efa-8804-11f0-a766-da7ad0900002\",\"type\":\"error_tracking_issue_state_change\"}]}}},\"included\":[{\"id\":\"aab68efa-8804-11f0-a766-da7ad0900002\",\"type\":\"error_tracking_issue_state_change\",\"attributes\":{\"created_at\":\"2025-09-02T13:56:47.380792Z\",\"next\":\"RESOLVED\",\"previous\":\"OPEN\",\"reason\":\"USER\"},\"relationships\":{\"author\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}}}},{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"email\":\"frog@datadoghq.com\",\"handle\":\"frog@datadoghq.com\",\"name\":\"frog\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get the details of an error tracking issue with lifecycle returns \"OK\" response", + "version": "v2" + }, { "feature": "Error Tracking", "frozen_at": "2026-10-22T13:29:57.649Z", diff --git a/tests/v2/features/error_tracking.feature b/tests/v2/features/error_tracking.feature index 7722f8e84c..f72ce34841 100644 --- a/tests/v2/features/error_tracking.feature +++ b/tests/v2/features/error_tracking.feature @@ -41,6 +41,17 @@ Feature: Error Tracking When the request is sent Then the response status is 400 Bad Request + @team:ddoghq/error-tracking + Scenario: Get the details of an error tracking issue with lifecycle 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 ["lifecycle"] + 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 "lifecycle" + @replay-only @team:ddoghq/error-tracking Scenario: Get the details of an error tracking issue with samples returns "OK" response Given new "GetIssue" request