diff --git a/.generated-info b/.generated-info index 9dd05ea93f..87ec8c4593 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "62a19e4", - "generated": "2025-08-27 15:01:27.781" + "spec_repo_commit": "09b875f", + "generated": "2025-08-27 15:57:21.502" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e09c948047..faebc5966b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -415,6 +415,17 @@ components: required: true schema: type: string + GetIssueIncludeQueryParameter: + description: Comma-separated list of relationship objects that should be included + in the response. + explode: false + in: query + name: include + required: false + schema: + items: + $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' + type: array HistoricalJobID: description: The ID of the job. in: path @@ -579,6 +590,14 @@ components: required: true schema: type: string + IssueIDPathParameter: + description: The identifier of the issue. + example: c1726a66-1f64-11ee-b338-da7ad0900002 + in: path + name: issue_id + required: true + schema: + type: string KindID: description: Entity kind. in: path @@ -824,6 +843,17 @@ components: required: false schema: $ref: '#/components/schemas/ServiceDefinitionSchemaVersions' + SearchIssuesIncludeQueryParameter: + description: Comma-separated list of relationship objects that should be included + in the response. + explode: false + in: query + name: include + required: false + schema: + items: + $ref: '#/components/schemas/SearchIssuesIncludeQueryParameterItem' + type: array SecurityFilterID: description: The ID of the security filter. in: path @@ -18259,6 +18289,18 @@ components: $ref: '#/components/schemas/GetInterfacesData' type: array type: object + GetIssueIncludeQueryParameterItem: + description: Relationship object that should be included in the response. + enum: + - assignee + - case + - team_owners + example: case + type: string + x-enum-varnames: + - ASSIGNEE + - CASE + - TEAM_OWNERS GetResourceEvaluationFiltersResponse: description: The definition of `GetResourceEvaluationFiltersResponse` object. properties: @@ -21379,6 +21421,630 @@ components: - DOWN - WARNING - 'OFF' + Issue: + description: The issue matching the request. + properties: + attributes: + $ref: '#/components/schemas/IssueAttributes' + id: + description: Issue identifier. + example: c1726a66-1f64-11ee-b338-da7ad0900002 + type: string + relationships: + $ref: '#/components/schemas/IssueRelationships' + type: + $ref: '#/components/schemas/IssueType' + required: + - id + - type + - attributes + type: object + IssueAssigneeRelationship: + description: Relationship between the issue and assignee. + properties: + data: + $ref: '#/components/schemas/IssueUserReference' + required: + - data + type: object + IssueAttributes: + description: Object containing the information of an issue. + properties: + error_message: + description: Error message associated with the issue. + example: object of type 'NoneType' has no len() + type: string + error_type: + description: Type of the error that matches the issue. + example: builtins.TypeError + type: string + file_path: + description: Path of the file where the issue occurred. + example: /django-email/conduit/apps/core/utils.py + type: string + first_seen: + description: Timestamp of the first seen error in milliseconds since the + Unix epoch. + example: 1671612804001 + format: int64 + type: integer + first_seen_version: + description: The application version (for example, git commit hash) where + the issue was first observed. + example: aaf65cd0 + type: string + function_name: + description: Name of the function where the issue occurred. + example: filter_forbidden_tags + type: string + is_crash: + description: Error is a crash. + example: false + type: boolean + languages: + description: Array of programming languages associated with the issue. + example: + - python + - go + items: + $ref: '#/components/schemas/IssueLanguage' + type: array + last_seen: + description: Timestamp of the last seen error in milliseconds since the + Unix epoch. + example: 1671620003100 + format: int64 + type: integer + last_seen_version: + description: The application version (for example, git commit hash) where + the issue was last observed. + example: b6199f80 + type: string + platform: + $ref: '#/components/schemas/IssuePlatform' + service: + description: Service name. + example: email-api-py + type: string + state: + $ref: '#/components/schemas/IssueState' + type: object + IssueCaseReference: + description: The case the issue is attached to. + properties: + id: + description: Case identifier. + example: 2841440d-e780-4fe2-96cd-6a8c1d194da5 + type: string + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - id + - type + type: object + IssueCaseRelationship: + description: Relationship between the issue and case. + properties: + data: + $ref: '#/components/schemas/IssueCaseReference' + required: + - data + type: object + IssueIncluded: + description: An array of related resources, returned when the `include` query + parameter is used. + oneOf: + - $ref: '#/components/schemas/Case' + - $ref: '#/components/schemas/IssueUser' + - $ref: '#/components/schemas/IssueTeam' + IssueLanguage: + description: Programming language associated with the issue. + enum: + - BRIGHTSCRIPT + - C + - C_PLUS_PLUS + - C_SHARP + - CLOJURE + - DOT_NET + - ELIXIR + - ERLANG + - GO + - GROOVY + - HASKELL + - HCL + - JAVA + - JAVASCRIPT + - JVM + - KOTLIN + - OBJECTIVE_C + - PERL + - PHP + - PYTHON + - RUBY + - RUST + - SCALA + - SWIFT + - TERRAFORM + - TYPESCRIPT + - UNKNOWN + example: PYTHON + type: string + x-enum-varnames: + - BRIGHTSCRIPT + - C + - C_PLUS_PLUS + - C_SHARP + - CLOJURE + - DOT_NET + - ELIXIR + - ERLANG + - GO + - GROOVY + - HASKELL + - HCL + - JAVA + - JAVASCRIPT + - JVM + - KOTLIN + - OBJECTIVE_C + - PERL + - PHP + - PYTHON + - RUBY + - RUST + - SCALA + - SWIFT + - TERRAFORM + - TYPESCRIPT + - UNKNOWN + IssuePlatform: + description: Platform associated with the issue. + enum: + - ANDROID + - BACKEND + - BROWSER + - FLUTTER + - IOS + - REACT_NATIVE + - ROKU + - UNKNOWN + example: BACKEND + type: string + x-enum-varnames: + - ANDROID + - BACKEND + - BROWSER + - FLUTTER + - IOS + - REACT_NATIVE + - ROKU + - UNKNOWN + IssueReference: + description: The issue the search result corresponds to. + properties: + id: + description: Issue identifier. + example: c1726a66-1f64-11ee-b338-da7ad0900002 + type: string + type: + $ref: '#/components/schemas/IssueType' + required: + - id + - type + type: object + IssueRelationships: + description: Relationship between the issue and an assignee, case and/or teams. + properties: + assignee: + $ref: '#/components/schemas/IssueAssigneeRelationship' + case: + $ref: '#/components/schemas/IssueCaseRelationship' + team_owners: + $ref: '#/components/schemas/IssueTeamOwnersRelationship' + type: object + IssueResponse: + description: Response containing error tracking issue data. + properties: + data: + $ref: '#/components/schemas/Issue' + included: + description: Array of resources related to the issue. + items: + $ref: '#/components/schemas/IssueIncluded' + type: array + type: object + IssueState: + description: State of the issue + enum: + - OPEN + - ACKNOWLEDGED + - RESOLVED + - IGNORED + - EXCLUDED + example: RESOLVED + type: string + x-enum-varnames: + - OPEN + - ACKNOWLEDGED + - RESOLVED + - IGNORED + - EXCLUDED + IssueTeam: + description: A team that owns an issue. + properties: + attributes: + $ref: '#/components/schemas/IssueTeamAttributes' + id: + description: Team identifier. + example: 221b0179-6447-4d03-91c3-3ca98bf60e8a + type: string + type: + $ref: '#/components/schemas/IssueTeamType' + required: + - id + - type + - attributes + type: object + IssueTeamAttributes: + description: Object containing the information of a team. + properties: + handle: + description: The team's identifier. + example: team-handle + type: string + name: + description: The name of the team. + example: Team Name + type: string + summary: + description: A brief summary of the team, derived from its description. + example: This is a team. + type: string + type: object + IssueTeamOwnersRelationship: + description: Relationship between the issue and teams. + properties: + data: + description: Array of teams that are owners of the issue. + items: + $ref: '#/components/schemas/IssueTeamReference' + type: array + required: + - data + type: object + IssueTeamReference: + description: A team that owns the issue. + properties: + id: + description: Team identifier. + example: 221b0179-6447-4d03-91c3-3ca98bf60e8a + type: string + type: + $ref: '#/components/schemas/IssueTeamType' + required: + - id + - type + type: object + IssueTeamType: + description: Type of the object. + enum: + - team + example: team + type: string + x-enum-varnames: + - TEAM + IssueType: + description: Type of the object. + enum: + - issue + example: issue + type: string + x-enum-varnames: + - ISSUE + IssueUpdateAssigneeRequest: + description: Update issue assignee request payload. + properties: + data: + $ref: '#/components/schemas/IssueUpdateAssigneeRequestData' + required: + - data + type: object + IssueUpdateAssigneeRequestData: + description: Update issue assignee request. + properties: + id: + description: User identifier. + example: 87cb11a0-278c-440a-99fe-701223c80296 + type: string + type: + $ref: '#/components/schemas/IssueUpdateAssigneeRequestDataType' + required: + - id + - type + type: object + IssueUpdateAssigneeRequestDataType: + description: Type of the object. + enum: + - assignee + example: assignee + type: string + x-enum-varnames: + - ASSIGNEE + IssueUpdateStateRequest: + description: Update issue state request payload. + properties: + data: + $ref: '#/components/schemas/IssueUpdateStateRequestData' + required: + - data + type: object + IssueUpdateStateRequestData: + description: Update issue state request. + properties: + attributes: + $ref: '#/components/schemas/IssueUpdateStateRequestDataAttributes' + id: + description: Issue identifier. + example: c1726a66-1f64-11ee-b338-da7ad0900002 + type: string + type: + $ref: '#/components/schemas/IssueUpdateStateRequestDataType' + required: + - id + - type + - attributes + type: object + IssueUpdateStateRequestDataAttributes: + description: Object describing an issue state update request. + properties: + state: + $ref: '#/components/schemas/IssueState' + required: + - state + type: object + IssueUpdateStateRequestDataType: + description: Type of the object. + enum: + - error_tracking_issue + example: error_tracking_issue + type: string + x-enum-varnames: + - ERROR_TRACKING_ISSUE + IssueUser: + description: The user to whom the issue is assigned. + properties: + attributes: + $ref: '#/components/schemas/IssueUserAttributes' + id: + description: User identifier. + example: 87cb11a0-278c-440a-99fe-701223c80296 + type: string + type: + $ref: '#/components/schemas/IssueUserType' + required: + - id + - type + - attributes + type: object + IssueUserAttributes: + description: Object containing the information of a user. + properties: + email: + description: Email of the user. + example: user@company.com + type: string + handle: + description: Handle of the user. + example: User Handle + type: string + name: + description: Name of the user. + example: User Name + type: string + type: object + IssueUserReference: + description: The user the issue is assigned to. + properties: + id: + description: User identifier. + example: 87cb11a0-278c-440a-99fe-701223c80296 + type: string + type: + $ref: '#/components/schemas/IssueUserType' + required: + - id + - type + type: object + IssueUserType: + description: Type of the object + enum: + - user + example: user + type: string + x-enum-varnames: + - USER + IssuesSearchRequest: + description: Search issues request payload. + properties: + data: + $ref: '#/components/schemas/IssuesSearchRequestData' + required: + - data + type: object + IssuesSearchRequestData: + description: Search issues request. + properties: + attributes: + $ref: '#/components/schemas/IssuesSearchRequestDataAttributes' + type: + $ref: '#/components/schemas/IssuesSearchRequestDataType' + required: + - type + - attributes + type: object + IssuesSearchRequestDataAttributes: + description: Object describing a search issue request. + properties: + from: + description: Start date (inclusive) of the query in milliseconds since the + Unix epoch. + example: 1671612804000 + format: int64 + type: integer + order_by: + $ref: '#/components/schemas/IssuesSearchRequestDataAttributesOrderBy' + persona: + $ref: '#/components/schemas/IssuesSearchRequestDataAttributesPersona' + query: + description: Search query following the event search syntax. + example: service:orders-* AND @language:go + type: string + to: + description: End date (exclusive) of the query in milliseconds since the + Unix epoch. + example: 1671620004000 + format: int64 + type: integer + track: + $ref: '#/components/schemas/IssuesSearchRequestDataAttributesTrack' + required: + - query + - from + - to + type: object + IssuesSearchRequestDataAttributesOrderBy: + description: The attribute to sort the search results by. + enum: + - TOTAL_COUNT + - FIRST_SEEN + - IMPACTED_SESSIONS + - PRIORITY + example: IMPACTED_SESSIONS + type: string + x-enum-varnames: + - TOTAL_COUNT + - FIRST_SEEN + - IMPACTED_SESSIONS + - PRIORITY + IssuesSearchRequestDataAttributesPersona: + description: Persona for the search. Either track(s) or persona(s) must be specified. + enum: + - all + - browser + - mobile + - backend + example: backend + type: string + x-enum-varnames: + - ALL + - BROWSER + - MOBILE + - BACKEND + IssuesSearchRequestDataAttributesTrack: + description: Track of the events to query. Either track(s) or persona(s) must + be specified. + enum: + - trace + - logs + - rum + example: trace + type: string + x-enum-varnames: + - TRACE + - LOGS + - RUM + IssuesSearchRequestDataType: + description: Type of the object. + enum: + - search_request + example: search_request + type: string + x-enum-varnames: + - SEARCH_REQUEST + IssuesSearchResponse: + description: Search issues response payload. + properties: + data: + description: Array of results matching the search query. + items: + $ref: '#/components/schemas/IssuesSearchResult' + type: array + included: + description: Array of resources related to the search results. + items: + $ref: '#/components/schemas/IssuesSearchResultIncluded' + type: array + type: object + IssuesSearchResult: + description: Result matching the search query. + properties: + attributes: + $ref: '#/components/schemas/IssuesSearchResultAttributes' + id: + description: Search result identifier (matches the nested issue's identifier). + example: c1726a66-1f64-11ee-b338-da7ad0900002 + type: string + relationships: + $ref: '#/components/schemas/IssuesSearchResultRelationships' + type: + $ref: '#/components/schemas/IssuesSearchResultType' + required: + - id + - type + - attributes + type: object + IssuesSearchResultAttributes: + description: Object containing the information of a search result. + properties: + impacted_sessions: + description: Count of sessions impacted by the issue over the queried time + window. + example: 12 + format: int64 + type: integer + impacted_users: + description: Count of users impacted by the issue over the queried time + window. + example: 4 + format: int64 + type: integer + total_count: + description: Total count of errors that match the issue over the queried + time window. + example: 82 + format: int64 + type: integer + type: object + IssuesSearchResultIncluded: + description: An array of related resources, returned when the `include` query + parameter is used. + oneOf: + - $ref: '#/components/schemas/Issue' + - $ref: '#/components/schemas/Case' + - $ref: '#/components/schemas/IssueUser' + - $ref: '#/components/schemas/IssueTeam' + IssuesSearchResultIssueRelationship: + description: Relationship between the search result and the corresponding issue. + properties: + data: + $ref: '#/components/schemas/IssueReference' + required: + - data + type: object + IssuesSearchResultRelationships: + description: Relationships between the search result and other resources. + properties: + issue: + $ref: '#/components/schemas/IssuesSearchResultIssueRelationship' + type: object + IssuesSearchResultType: + description: Type of the object. + enum: + - error_tracking_search_result + example: error_tracking_search_result + type: string + x-enum-varnames: + - ERROR_TRACKING_SEARCH_RESULT JSONAPIErrorItem: description: API error response body properties: @@ -36242,6 +36908,20 @@ components: type: string x-enum-varnames: - SCORECARD + SearchIssuesIncludeQueryParameterItem: + description: Relationship object that should be included in the search response. + enum: + - issue + - issue.assignee + - issue.case + - issue.team_owners + example: issue.case + type: string + x-enum-varnames: + - ISSUE + - ISSUE_ASSIGNEE + - ISSUE_CASE + - ISSUE_TEAM_OWNERS SecurityFilter: description: The security filter's properties. properties: @@ -45649,6 +46329,8 @@ components: data_scanner_write: Edit Data Scanner configurations. embeddable_graphs_share: Generate public links to share embeddable graphs externally. + error_tracking_read: Read Error Tracking data. + error_tracking_write: Edit Error Tracking issues. events_read: Read Events data. hosts_read: List hosts and their attributes. incident_notification_settings_write: Configure Incidents Notification @@ -52026,6 +52708,158 @@ paths: operator: OR permissions: - monitors_downtime + /api/v2/error-tracking/issues/search: + post: + description: Search issues endpoint allows you to programmatically search for + issues within your organization. This endpoint returns a list of issues that + match a given search query, following the event search syntax. The search + results are limited to a maximum of 100 issues. + operationId: SearchIssues + parameters: + - $ref: '#/components/parameters/SearchIssuesIncludeQueryParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IssuesSearchRequest' + description: Search issues request payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IssuesSearchResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - error_tracking_read + summary: Search error tracking issues + tags: + - Error Tracking + /api/v2/error-tracking/issues/{issue_id}: + get: + description: Retrieve the full details for a specific error tracking issue, + including attributes and relationships. + operationId: GetIssue + parameters: + - $ref: '#/components/parameters/IssueIDPathParameter' + - $ref: '#/components/parameters/GetIssueIncludeQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IssueResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - error_tracking_read + summary: Get the details of an error tracking issue + tags: + - Error Tracking + /api/v2/error-tracking/issues/{issue_id}/assignee: + put: + description: Update the assignee of an issue by `issue_id`. + operationId: UpdateIssueAssignee + parameters: + - $ref: '#/components/parameters/IssueIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IssueUpdateAssigneeRequest' + description: Update issue assignee request payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IssueResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - error_tracking_read + - error_tracking_write + - cases_read + - cases_write + summary: Update the assignee of an issue + tags: + - Error Tracking + /api/v2/error-tracking/issues/{issue_id}/state: + put: + description: Update the state of an issue by `issue_id`. + operationId: UpdateIssueState + parameters: + - $ref: '#/components/parameters/IssueIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IssueUpdateStateRequest' + description: Update issue state request payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IssueResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - error_tracking_read + - error_tracking_write + summary: Update the state of an issue + tags: + - Error Tracking /api/v2/events: get: description: 'List endpoint returns events that match an events search query. @@ -69053,6 +69887,9 @@ tags: end times, prevent all alerting related to specified Datadog tags.' name: Downtimes +- description: View and manage issues within Error Tracking. See the [Error Tracking + page](https://docs.datadoghq.com/error_tracking/) for more information. + name: Error Tracking - description: 'The Event Management API allows you to programmatically post events to the Events Explorer and fetch events from the Events Explorer. See the [Event Management page](https://docs.datadoghq.com/service_management/events/) for more diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 503ed65d6b..1bb57d8a4a 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -200,6 +200,13 @@ datadog\_api\_client.v2.api.downtimes\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.error\_tracking\_api module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.error_tracking_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.events\_api module ---------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 2f8c1b79c8..2272adaf5a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -7760,6 +7760,13 @@ datadog\_api\_client.v2.model.get\_interfaces\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.get\_issue\_include\_query\_parameter\_item module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_issue_include_query_parameter_item + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_resource\_evaluation\_filters\_response module --------------------------------------------------------------------------------- @@ -9230,6 +9237,307 @@ datadog\_api\_client.v2.model.ip\_allowlist\_update\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.issue module +------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_assignee\_relationship module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_assignee_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_attributes module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_case\_reference module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_case_reference + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_case\_relationship module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_case_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_included module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_included + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_language module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_language + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_platform module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_platform + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_reference module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_reference + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_relationships module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_response module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_state module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_state + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_team module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_team + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_team\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_team_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_team\_owners\_relationship module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_team_owners_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_team\_reference module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_team_reference + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_team\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_team_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_type module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_assignee\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_update_assignee_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_assignee\_request\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_update_assignee_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_assignee\_request\_data\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_update_assignee_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_state\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_update_state_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_state\_request\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_update_state_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_state\_request\_data\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_update_state_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_update\_state\_request\_data\_type module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_update_state_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_user module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_user\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_user_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_user\_reference module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issue_user_reference + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issue\_user\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_user_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issues_search_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data\_attributes\_order\_by module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data_attributes_order_by + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data\_attributes\_persona module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data_attributes_persona + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data\_attributes\_track module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data_attributes_track + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_request\_data\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issues_search_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_response module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result\_included module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result_included + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result\_issue\_relationship module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result_issue_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result\_relationships module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.issues\_search\_result\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.issues_search_result_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.jira\_integration\_metadata module ---------------------------------------------------------------- @@ -16216,6 +16524,13 @@ datadog\_api\_client.v2.model.scorecard\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.search\_issues\_include\_query\_parameter\_item module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.search_issues_include_query_parameter_item + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_filter module ----------------------------------------------------- diff --git a/examples/v2/error-tracking/GetIssue.py b/examples/v2/error-tracking/GetIssue.py new file mode 100644 index 0000000000..6de01fb042 --- /dev/null +++ b/examples/v2/error-tracking/GetIssue.py @@ -0,0 +1,19 @@ +""" +Get the details of an error tracking issue 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 + +# there is a valid "issue" in the system +ISSUE_ID = environ["ISSUE_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.get_issue( + issue_id=ISSUE_ID, + ) + + print(response) diff --git a/examples/v2/error-tracking/SearchIssues.py b/examples/v2/error-tracking/SearchIssues.py new file mode 100644 index 0000000000..25dcdae0aa --- /dev/null +++ b/examples/v2/error-tracking/SearchIssues.py @@ -0,0 +1,32 @@ +""" +Search error tracking issues returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi +from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest +from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData +from datadog_api_client.v2.model.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes +from datadog_api_client.v2.model.issues_search_request_data_attributes_track import ( + IssuesSearchRequestDataAttributesTrack, +) +from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType + +body = IssuesSearchRequest( + data=IssuesSearchRequestData( + attributes=IssuesSearchRequestDataAttributes( + query="service:orders-* AND @language:go", + _from=1671612804000, + to=1671620004000, + track=IssuesSearchRequestDataAttributesTrack.TRACE, + ), + type=IssuesSearchRequestDataType.SEARCH_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.search_issues(body=body) + + print(response) diff --git a/examples/v2/error-tracking/UpdateIssueAssignee.py b/examples/v2/error-tracking/UpdateIssueAssignee.py new file mode 100644 index 0000000000..f3e2c3641d --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueAssignee.py @@ -0,0 +1,27 @@ +""" +Update the assignee of an issue 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.issue_update_assignee_request import IssueUpdateAssigneeRequest +from datadog_api_client.v2.model.issue_update_assignee_request_data import IssueUpdateAssigneeRequestData +from datadog_api_client.v2.model.issue_update_assignee_request_data_type import IssueUpdateAssigneeRequestDataType + +# there is a valid "issue" in the system +ISSUE_ID = environ["ISSUE_ID"] + +body = IssueUpdateAssigneeRequest( + data=IssueUpdateAssigneeRequestData( + id="87cb11a0-278c-440a-99fe-701223c80296", + type=IssueUpdateAssigneeRequestDataType.ASSIGNEE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.update_issue_assignee(issue_id=ISSUE_ID, body=body) + + print(response) diff --git a/examples/v2/error-tracking/UpdateIssueState.py b/examples/v2/error-tracking/UpdateIssueState.py new file mode 100644 index 0000000000..672f57ae70 --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueState.py @@ -0,0 +1,32 @@ +""" +Update the state of an issue 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.issue_state import IssueState +from datadog_api_client.v2.model.issue_update_state_request import IssueUpdateStateRequest +from datadog_api_client.v2.model.issue_update_state_request_data import IssueUpdateStateRequestData +from datadog_api_client.v2.model.issue_update_state_request_data_attributes import IssueUpdateStateRequestDataAttributes +from datadog_api_client.v2.model.issue_update_state_request_data_type import IssueUpdateStateRequestDataType + +# there is a valid "issue" in the system +ISSUE_ID = environ["ISSUE_ID"] + +body = IssueUpdateStateRequest( + data=IssueUpdateStateRequestData( + attributes=IssueUpdateStateRequestDataAttributes( + state=IssueState.RESOLVED, + ), + id=ISSUE_ID, + type=IssueUpdateStateRequestDataType.ERROR_TRACKING_ISSUE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ErrorTrackingApi(api_client) + response = api_instance.update_issue_state(issue_id=ISSUE_ID, body=body) + + 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 new file mode 100644 index 0000000000..a7f5cc7b16 --- /dev/null +++ b/src/datadog_api_client/v2/api/error_tracking_api.py @@ -0,0 +1,230 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.issues_search_response import IssuesSearchResponse +from datadog_api_client.v2.model.search_issues_include_query_parameter_item import SearchIssuesIncludeQueryParameterItem +from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest +from datadog_api_client.v2.model.issue_response import IssueResponse +from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem +from datadog_api_client.v2.model.issue_update_assignee_request import IssueUpdateAssigneeRequest +from datadog_api_client.v2.model.issue_update_state_request import IssueUpdateStateRequest + + +class ErrorTrackingApi: + """ + View and manage issues within Error Tracking. See the `Error Tracking page `_ for more information. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_issue_endpoint = _Endpoint( + settings={ + "response_type": (IssueResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/error-tracking/issues/{issue_id}", + "operation_id": "get_issue", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "issue_id": { + "required": True, + "openapi_types": (str,), + "attribute": "issue_id", + "location": "path", + }, + "include": { + "openapi_types": ([GetIssueIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._search_issues_endpoint = _Endpoint( + settings={ + "response_type": (IssuesSearchResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/error-tracking/issues/search", + "operation_id": "search_issues", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": ([SearchIssuesIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, + "body": { + "required": True, + "openapi_types": (IssuesSearchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_issue_assignee_endpoint = _Endpoint( + settings={ + "response_type": (IssueResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/error-tracking/issues/{issue_id}/assignee", + "operation_id": "update_issue_assignee", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "issue_id": { + "required": True, + "openapi_types": (str,), + "attribute": "issue_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (IssueUpdateAssigneeRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_issue_state_endpoint = _Endpoint( + settings={ + "response_type": (IssueResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/error-tracking/issues/{issue_id}/state", + "operation_id": "update_issue_state", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "issue_id": { + "required": True, + "openapi_types": (str,), + "attribute": "issue_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (IssueUpdateStateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def get_issue( + self, + issue_id: str, + *, + include: Union[List[GetIssueIncludeQueryParameterItem], UnsetType] = unset, + ) -> IssueResponse: + """Get the details of an error tracking issue. + + Retrieve the full details for a specific error tracking issue, including attributes and relationships. + + :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. + :type include: [GetIssueIncludeQueryParameterItem], optional + :rtype: IssueResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["issue_id"] = issue_id + + if include is not unset: + kwargs["include"] = include + + return self._get_issue_endpoint.call_with_http_info(**kwargs) + + def search_issues( + self, + body: IssuesSearchRequest, + *, + include: Union[List[SearchIssuesIncludeQueryParameterItem], UnsetType] = unset, + ) -> IssuesSearchResponse: + """Search error tracking issues. + + Search issues endpoint allows you to programmatically search for issues within your organization. This endpoint returns a list of issues that match a given search query, following the event search syntax. The search results are limited to a maximum of 100 issues. + + :param body: Search issues request payload. + :type body: IssuesSearchRequest + :param include: Comma-separated list of relationship objects that should be included in the response. + :type include: [SearchIssuesIncludeQueryParameterItem], optional + :rtype: IssuesSearchResponse + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._search_issues_endpoint.call_with_http_info(**kwargs) + + def update_issue_assignee( + self, + issue_id: str, + body: IssueUpdateAssigneeRequest, + ) -> IssueResponse: + """Update the assignee of an issue. + + Update the assignee of an issue by ``issue_id``. + + :param issue_id: The identifier of the issue. + :type issue_id: str + :param body: Update issue assignee request payload. + :type body: IssueUpdateAssigneeRequest + :rtype: IssueResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["issue_id"] = issue_id + + kwargs["body"] = body + + return self._update_issue_assignee_endpoint.call_with_http_info(**kwargs) + + def update_issue_state( + self, + issue_id: str, + body: IssueUpdateStateRequest, + ) -> IssueResponse: + """Update the state of an issue. + + Update the state of an issue by ``issue_id``. + + :param issue_id: The identifier of the issue. + :type issue_id: str + :param body: Update issue state request payload. + :type body: IssueUpdateStateRequest + :rtype: IssueResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["issue_id"] = issue_id + + kwargs["body"] = body + + return self._update_issue_state_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 30a5f51bd2..6cbf0a8227 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -26,6 +26,7 @@ from datadog_api_client.v2.api.datasets_api import DatasetsApi from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi from datadog_api_client.v2.api.downtimes_api import DowntimesApi +from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi from datadog_api_client.v2.api.events_api import EventsApi from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi @@ -101,6 +102,7 @@ "DatasetsApi", "DomainAllowlistApi", "DowntimesApi", + "ErrorTrackingApi", "EventsApi", "FastlyIntegrationApi", "GCPIntegrationApi", 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 new file mode 100644 index 0000000000..0f3acc55c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/get_issue_include_query_parameter_item.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 GetIssueIncludeQueryParameterItem(ModelSimple): + """ + Relationship object that should be included in the response. + + :param value: Must be one of ["assignee", "case", "team_owners"]. + :type value: str + """ + + allowed_values = { + "assignee", + "case", + "team_owners", + } + ASSIGNEE: ClassVar["GetIssueIncludeQueryParameterItem"] + CASE: ClassVar["GetIssueIncludeQueryParameterItem"] + TEAM_OWNERS: ClassVar["GetIssueIncludeQueryParameterItem"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GetIssueIncludeQueryParameterItem.ASSIGNEE = GetIssueIncludeQueryParameterItem("assignee") +GetIssueIncludeQueryParameterItem.CASE = GetIssueIncludeQueryParameterItem("case") +GetIssueIncludeQueryParameterItem.TEAM_OWNERS = GetIssueIncludeQueryParameterItem("team_owners") diff --git a/src/datadog_api_client/v2/model/issue.py b/src/datadog_api_client/v2/model/issue.py new file mode 100644 index 0000000000..ae47f012ea --- /dev/null +++ b/src/datadog_api_client/v2/model/issue.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_attributes import IssueAttributes + from datadog_api_client.v2.model.issue_relationships import IssueRelationships + from datadog_api_client.v2.model.issue_type import IssueType + + +class Issue(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_attributes import IssueAttributes + from datadog_api_client.v2.model.issue_relationships import IssueRelationships + from datadog_api_client.v2.model.issue_type import IssueType + + return { + "attributes": (IssueAttributes,), + "id": (str,), + "relationships": (IssueRelationships,), + "type": (IssueType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IssueAttributes, + id: str, + type: IssueType, + relationships: Union[IssueRelationships, UnsetType] = unset, + **kwargs, + ): + """ + The issue matching the request. + + :param attributes: Object containing the information of an issue. + :type attributes: IssueAttributes + + :param id: Issue identifier. + :type id: str + + :param relationships: Relationship between the issue and an assignee, case and/or teams. + :type relationships: IssueRelationships, optional + + :param type: Type of the object. + :type type: IssueType + """ + 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_assignee_relationship.py b/src/datadog_api_client/v2/model/issue_assignee_relationship.py new file mode 100644 index 0000000000..f09bfa24e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_assignee_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import 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 IssueAssigneeRelationship(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): + """ + Relationship between the issue and assignee. + + :param data: 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_attributes.py b/src/datadog_api_client/v2/model/issue_attributes.py new file mode 100644 index 0000000000..168d38df5d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_attributes.py @@ -0,0 +1,146 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_language import IssueLanguage + from datadog_api_client.v2.model.issue_platform import IssuePlatform + from datadog_api_client.v2.model.issue_state import IssueState + + +class IssueAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_language import IssueLanguage + from datadog_api_client.v2.model.issue_platform import IssuePlatform + from datadog_api_client.v2.model.issue_state import IssueState + + return { + "error_message": (str,), + "error_type": (str,), + "file_path": (str,), + "first_seen": (int,), + "first_seen_version": (str,), + "function_name": (str,), + "is_crash": (bool,), + "languages": ([IssueLanguage],), + "last_seen": (int,), + "last_seen_version": (str,), + "platform": (IssuePlatform,), + "service": (str,), + "state": (IssueState,), + } + + attribute_map = { + "error_message": "error_message", + "error_type": "error_type", + "file_path": "file_path", + "first_seen": "first_seen", + "first_seen_version": "first_seen_version", + "function_name": "function_name", + "is_crash": "is_crash", + "languages": "languages", + "last_seen": "last_seen", + "last_seen_version": "last_seen_version", + "platform": "platform", + "service": "service", + "state": "state", + } + + def __init__( + self_, + error_message: Union[str, UnsetType] = unset, + error_type: Union[str, UnsetType] = unset, + file_path: Union[str, UnsetType] = unset, + first_seen: Union[int, UnsetType] = unset, + first_seen_version: Union[str, UnsetType] = unset, + function_name: Union[str, UnsetType] = unset, + is_crash: Union[bool, UnsetType] = unset, + languages: Union[List[IssueLanguage], UnsetType] = unset, + last_seen: Union[int, UnsetType] = unset, + last_seen_version: Union[str, UnsetType] = unset, + platform: Union[IssuePlatform, UnsetType] = unset, + service: Union[str, UnsetType] = unset, + state: Union[IssueState, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the information of an issue. + + :param error_message: Error message associated with the issue. + :type error_message: str, optional + + :param error_type: Type of the error that matches the issue. + :type error_type: str, optional + + :param file_path: Path of the file where the issue occurred. + :type file_path: str, optional + + :param first_seen: Timestamp of the first seen error in milliseconds since the Unix epoch. + :type first_seen: int, optional + + :param first_seen_version: The application version (for example, git commit hash) where the issue was first observed. + :type first_seen_version: str, optional + + :param function_name: Name of the function where the issue occurred. + :type function_name: str, optional + + :param is_crash: Error is a crash. + :type is_crash: bool, optional + + :param languages: Array of programming languages associated with the issue. + :type languages: [IssueLanguage], optional + + :param last_seen: Timestamp of the last seen error in milliseconds since the Unix epoch. + :type last_seen: int, optional + + :param last_seen_version: The application version (for example, git commit hash) where the issue was last observed. + :type last_seen_version: str, optional + + :param platform: Platform associated with the issue. + :type platform: IssuePlatform, optional + + :param service: Service name. + :type service: str, optional + + :param state: State of the issue + :type state: IssueState, optional + """ + if error_message is not unset: + kwargs["error_message"] = error_message + if error_type is not unset: + kwargs["error_type"] = error_type + if file_path is not unset: + kwargs["file_path"] = file_path + if first_seen is not unset: + kwargs["first_seen"] = first_seen + if first_seen_version is not unset: + kwargs["first_seen_version"] = first_seen_version + if function_name is not unset: + kwargs["function_name"] = function_name + if is_crash is not unset: + kwargs["is_crash"] = is_crash + if languages is not unset: + kwargs["languages"] = languages + if last_seen is not unset: + kwargs["last_seen"] = last_seen + if last_seen_version is not unset: + kwargs["last_seen_version"] = last_seen_version + if platform is not unset: + kwargs["platform"] = platform + if service is not unset: + kwargs["service"] = service + if state is not unset: + kwargs["state"] = state + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_case_reference.py b/src/datadog_api_client/v2/model/issue_case_reference.py new file mode 100644 index 0000000000..162eefe750 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_case_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.case_resource_type import CaseResourceType + + +class IssueCaseReference(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "id": (str,), + "type": (CaseResourceType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: CaseResourceType, **kwargs): + """ + The case the issue is attached to. + + :param id: Case identifier. + :type id: str + + :param type: Case resource type + :type type: CaseResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_case_relationship.py b/src/datadog_api_client/v2/model/issue_case_relationship.py new file mode 100644 index 0000000000..433709e59c --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_case_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_case_reference import IssueCaseReference + + +class IssueCaseRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_case_reference import IssueCaseReference + + return { + "data": (IssueCaseReference,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueCaseReference, **kwargs): + """ + Relationship between the issue and case. + + :param data: The case the issue is attached to. + :type data: IssueCaseReference + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_included.py b/src/datadog_api_client/v2/model/issue_included.py new file mode 100644 index 0000000000..b58503adad --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_included.py @@ -0,0 +1,51 @@ +# 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 IssueIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + An array of related resources, returned when the ``include`` query parameter is used. + + :param attributes: Case resource attributes + :type attributes: CaseAttributes + + :param id: Case's identifier + :type id: str + + :param relationships: Resources related to a case + :type relationships: CaseRelationships, optional + + :param type: Case resource type + :type type: CaseResourceType + """ + 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.case import Case + from datadog_api_client.v2.model.issue_user import IssueUser + from datadog_api_client.v2.model.issue_team import IssueTeam + + return { + "oneOf": [ + Case, + IssueUser, + IssueTeam, + ], + } diff --git a/src/datadog_api_client/v2/model/issue_language.py b/src/datadog_api_client/v2/model/issue_language.py new file mode 100644 index 0000000000..5f0f86d228 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_language.py @@ -0,0 +1,113 @@ +# 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 IssueLanguage(ModelSimple): + """ + Programming language associated with the issue. + + :param value: Must be one of ["BRIGHTSCRIPT", "C", "C_PLUS_PLUS", "C_SHARP", "CLOJURE", "DOT_NET", "ELIXIR", "ERLANG", "GO", "GROOVY", "HASKELL", "HCL", "JAVA", "JAVASCRIPT", "JVM", "KOTLIN", "OBJECTIVE_C", "PERL", "PHP", "PYTHON", "RUBY", "RUST", "SCALA", "SWIFT", "TERRAFORM", "TYPESCRIPT", "UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "BRIGHTSCRIPT", + "C", + "C_PLUS_PLUS", + "C_SHARP", + "CLOJURE", + "DOT_NET", + "ELIXIR", + "ERLANG", + "GO", + "GROOVY", + "HASKELL", + "HCL", + "JAVA", + "JAVASCRIPT", + "JVM", + "KOTLIN", + "OBJECTIVE_C", + "PERL", + "PHP", + "PYTHON", + "RUBY", + "RUST", + "SCALA", + "SWIFT", + "TERRAFORM", + "TYPESCRIPT", + "UNKNOWN", + } + BRIGHTSCRIPT: ClassVar["IssueLanguage"] + C: ClassVar["IssueLanguage"] + C_PLUS_PLUS: ClassVar["IssueLanguage"] + C_SHARP: ClassVar["IssueLanguage"] + CLOJURE: ClassVar["IssueLanguage"] + DOT_NET: ClassVar["IssueLanguage"] + ELIXIR: ClassVar["IssueLanguage"] + ERLANG: ClassVar["IssueLanguage"] + GO: ClassVar["IssueLanguage"] + GROOVY: ClassVar["IssueLanguage"] + HASKELL: ClassVar["IssueLanguage"] + HCL: ClassVar["IssueLanguage"] + JAVA: ClassVar["IssueLanguage"] + JAVASCRIPT: ClassVar["IssueLanguage"] + JVM: ClassVar["IssueLanguage"] + KOTLIN: ClassVar["IssueLanguage"] + OBJECTIVE_C: ClassVar["IssueLanguage"] + PERL: ClassVar["IssueLanguage"] + PHP: ClassVar["IssueLanguage"] + PYTHON: ClassVar["IssueLanguage"] + RUBY: ClassVar["IssueLanguage"] + RUST: ClassVar["IssueLanguage"] + SCALA: ClassVar["IssueLanguage"] + SWIFT: ClassVar["IssueLanguage"] + TERRAFORM: ClassVar["IssueLanguage"] + TYPESCRIPT: ClassVar["IssueLanguage"] + UNKNOWN: ClassVar["IssueLanguage"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueLanguage.BRIGHTSCRIPT = IssueLanguage("BRIGHTSCRIPT") +IssueLanguage.C = IssueLanguage("C") +IssueLanguage.C_PLUS_PLUS = IssueLanguage("C_PLUS_PLUS") +IssueLanguage.C_SHARP = IssueLanguage("C_SHARP") +IssueLanguage.CLOJURE = IssueLanguage("CLOJURE") +IssueLanguage.DOT_NET = IssueLanguage("DOT_NET") +IssueLanguage.ELIXIR = IssueLanguage("ELIXIR") +IssueLanguage.ERLANG = IssueLanguage("ERLANG") +IssueLanguage.GO = IssueLanguage("GO") +IssueLanguage.GROOVY = IssueLanguage("GROOVY") +IssueLanguage.HASKELL = IssueLanguage("HASKELL") +IssueLanguage.HCL = IssueLanguage("HCL") +IssueLanguage.JAVA = IssueLanguage("JAVA") +IssueLanguage.JAVASCRIPT = IssueLanguage("JAVASCRIPT") +IssueLanguage.JVM = IssueLanguage("JVM") +IssueLanguage.KOTLIN = IssueLanguage("KOTLIN") +IssueLanguage.OBJECTIVE_C = IssueLanguage("OBJECTIVE_C") +IssueLanguage.PERL = IssueLanguage("PERL") +IssueLanguage.PHP = IssueLanguage("PHP") +IssueLanguage.PYTHON = IssueLanguage("PYTHON") +IssueLanguage.RUBY = IssueLanguage("RUBY") +IssueLanguage.RUST = IssueLanguage("RUST") +IssueLanguage.SCALA = IssueLanguage("SCALA") +IssueLanguage.SWIFT = IssueLanguage("SWIFT") +IssueLanguage.TERRAFORM = IssueLanguage("TERRAFORM") +IssueLanguage.TYPESCRIPT = IssueLanguage("TYPESCRIPT") +IssueLanguage.UNKNOWN = IssueLanguage("UNKNOWN") diff --git a/src/datadog_api_client/v2/model/issue_platform.py b/src/datadog_api_client/v2/model/issue_platform.py new file mode 100644 index 0000000000..326d7b7ad7 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_platform.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IssuePlatform(ModelSimple): + """ + Platform associated with the issue. + + :param value: Must be one of ["ANDROID", "BACKEND", "BROWSER", "FLUTTER", "IOS", "REACT_NATIVE", "ROKU", "UNKNOWN"]. + :type value: str + """ + + allowed_values = { + "ANDROID", + "BACKEND", + "BROWSER", + "FLUTTER", + "IOS", + "REACT_NATIVE", + "ROKU", + "UNKNOWN", + } + ANDROID: ClassVar["IssuePlatform"] + BACKEND: ClassVar["IssuePlatform"] + BROWSER: ClassVar["IssuePlatform"] + FLUTTER: ClassVar["IssuePlatform"] + IOS: ClassVar["IssuePlatform"] + REACT_NATIVE: ClassVar["IssuePlatform"] + ROKU: ClassVar["IssuePlatform"] + UNKNOWN: ClassVar["IssuePlatform"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuePlatform.ANDROID = IssuePlatform("ANDROID") +IssuePlatform.BACKEND = IssuePlatform("BACKEND") +IssuePlatform.BROWSER = IssuePlatform("BROWSER") +IssuePlatform.FLUTTER = IssuePlatform("FLUTTER") +IssuePlatform.IOS = IssuePlatform("IOS") +IssuePlatform.REACT_NATIVE = IssuePlatform("REACT_NATIVE") +IssuePlatform.ROKU = IssuePlatform("ROKU") +IssuePlatform.UNKNOWN = IssuePlatform("UNKNOWN") diff --git a/src/datadog_api_client/v2/model/issue_reference.py b/src/datadog_api_client/v2/model/issue_reference.py new file mode 100644 index 0000000000..5c5c1672fc --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_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_type import IssueType + + +class IssueReference(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_type import IssueType + + return { + "id": (str,), + "type": (IssueType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: IssueType, **kwargs): + """ + The issue the search result corresponds to. + + :param id: Issue identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_relationships.py b/src/datadog_api_client/v2/model/issue_relationships.py new file mode 100644 index 0000000000..cd3f22cbc6 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_relationships.py @@ -0,0 +1,66 @@ +# 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_assignee_relationship import IssueAssigneeRelationship + from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship + from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship + + +class IssueRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship + from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship + from datadog_api_client.v2.model.issue_team_owners_relationship import IssueTeamOwnersRelationship + + return { + "assignee": (IssueAssigneeRelationship,), + "case": (IssueCaseRelationship,), + "team_owners": (IssueTeamOwnersRelationship,), + } + + attribute_map = { + "assignee": "assignee", + "case": "case", + "team_owners": "team_owners", + } + + def __init__( + self_, + assignee: Union[IssueAssigneeRelationship, UnsetType] = unset, + case: Union[IssueCaseRelationship, UnsetType] = unset, + team_owners: Union[IssueTeamOwnersRelationship, UnsetType] = unset, + **kwargs, + ): + """ + Relationship between the issue and an assignee, case and/or teams. + + :param assignee: Relationship between the issue and assignee. + :type assignee: IssueAssigneeRelationship, optional + + :param case: Relationship between the issue and case. + :type case: IssueCaseRelationship, optional + + :param team_owners: Relationship between the issue and teams. + :type team_owners: IssueTeamOwnersRelationship, optional + """ + if assignee is not unset: + kwargs["assignee"] = assignee + if case is not unset: + kwargs["case"] = case + if team_owners is not unset: + kwargs["team_owners"] = team_owners + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_response.py b/src/datadog_api_client/v2/model/issue_response.py new file mode 100644 index 0000000000..abee2e44cc --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_response.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue import Issue + from datadog_api_client.v2.model.issue_included import IssueIncluded + from datadog_api_client.v2.model.case import Case + from datadog_api_client.v2.model.issue_user import IssueUser + from datadog_api_client.v2.model.issue_team import IssueTeam + + +class IssueResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue import Issue + from datadog_api_client.v2.model.issue_included import IssueIncluded + + return { + "data": (Issue,), + "included": ([IssueIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: Union[Issue, UnsetType] = unset, + included: Union[List[Union[IssueIncluded, Case, IssueUser, IssueTeam]], UnsetType] = unset, + **kwargs, + ): + """ + Response containing error tracking issue data. + + :param data: The issue matching the request. + :type data: Issue, optional + + :param included: Array of resources related to the issue. + :type included: [IssueIncluded], optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_state.py b/src/datadog_api_client/v2/model/issue_state.py new file mode 100644 index 0000000000..63ca2bc7b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_state.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 IssueState(ModelSimple): + """ + State of the issue + + :param value: Must be one of ["OPEN", "ACKNOWLEDGED", "RESOLVED", "IGNORED", "EXCLUDED"]. + :type value: str + """ + + allowed_values = { + "OPEN", + "ACKNOWLEDGED", + "RESOLVED", + "IGNORED", + "EXCLUDED", + } + OPEN: ClassVar["IssueState"] + ACKNOWLEDGED: ClassVar["IssueState"] + RESOLVED: ClassVar["IssueState"] + IGNORED: ClassVar["IssueState"] + EXCLUDED: ClassVar["IssueState"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueState.OPEN = IssueState("OPEN") +IssueState.ACKNOWLEDGED = IssueState("ACKNOWLEDGED") +IssueState.RESOLVED = IssueState("RESOLVED") +IssueState.IGNORED = IssueState("IGNORED") +IssueState.EXCLUDED = IssueState("EXCLUDED") diff --git a/src/datadog_api_client/v2/model/issue_team.py b/src/datadog_api_client/v2/model/issue_team.py new file mode 100644 index 0000000000..2db1443c5d --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_team.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_team_attributes import IssueTeamAttributes + from datadog_api_client.v2.model.issue_team_type import IssueTeamType + + +class IssueTeam(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_team_attributes import IssueTeamAttributes + from datadog_api_client.v2.model.issue_team_type import IssueTeamType + + return { + "attributes": (IssueTeamAttributes,), + "id": (str,), + "type": (IssueTeamType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IssueTeamAttributes, id: str, type: IssueTeamType, **kwargs): + """ + A team that owns an issue. + + :param attributes: Object containing the information of a team. + :type attributes: IssueTeamAttributes + + :param id: Team identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueTeamType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_team_attributes.py b/src/datadog_api_client/v2/model/issue_team_attributes.py new file mode 100644 index 0000000000..2504f01fcc --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_team_attributes.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IssueTeamAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "handle": (str,), + "name": (str,), + "summary": (str,), + } + + attribute_map = { + "handle": "handle", + "name": "name", + "summary": "summary", + } + + def __init__( + self_, + handle: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + summary: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the information of a team. + + :param handle: The team's identifier. + :type handle: str, optional + + :param name: The name of the team. + :type name: str, optional + + :param summary: A brief summary of the team, derived from its description. + :type summary: str, optional + """ + if handle is not unset: + kwargs["handle"] = handle + if name is not unset: + kwargs["name"] = name + if summary is not unset: + kwargs["summary"] = summary + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_team_owners_relationship.py b/src/datadog_api_client/v2/model/issue_team_owners_relationship.py new file mode 100644 index 0000000000..7f8eeb516a --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_team_owners_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_team_reference import IssueTeamReference + + +class IssueTeamOwnersRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_team_reference import IssueTeamReference + + return { + "data": ([IssueTeamReference],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[IssueTeamReference], **kwargs): + """ + Relationship between the issue and teams. + + :param data: Array of teams that are owners of the issue. + :type data: [IssueTeamReference] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_team_reference.py b/src/datadog_api_client/v2/model/issue_team_reference.py new file mode 100644 index 0000000000..5ddff95152 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_team_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_team_type import IssueTeamType + + +class IssueTeamReference(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_team_type import IssueTeamType + + return { + "id": (str,), + "type": (IssueTeamType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: IssueTeamType, **kwargs): + """ + A team that owns the issue. + + :param id: Team identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueTeamType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_team_type.py b/src/datadog_api_client/v2/model/issue_team_type.py new file mode 100644 index 0000000000..064c9886ca --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_team_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 IssueTeamType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "team". Must be one of ["team"]. + :type value: str + """ + + allowed_values = { + "team", + } + TEAM: ClassVar["IssueTeamType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueTeamType.TEAM = IssueTeamType("team") diff --git a/src/datadog_api_client/v2/model/issue_type.py b/src/datadog_api_client/v2/model/issue_type.py new file mode 100644 index 0000000000..e22b6a629a --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_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 IssueType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "issue". Must be one of ["issue"]. + :type value: str + """ + + allowed_values = { + "issue", + } + ISSUE: ClassVar["IssueType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueType.ISSUE = IssueType("issue") diff --git a/src/datadog_api_client/v2/model/issue_update_assignee_request.py b/src/datadog_api_client/v2/model/issue_update_assignee_request.py new file mode 100644 index 0000000000..7b938867a3 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_assignee_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_update_assignee_request_data import IssueUpdateAssigneeRequestData + + +class IssueUpdateAssigneeRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_update_assignee_request_data import IssueUpdateAssigneeRequestData + + return { + "data": (IssueUpdateAssigneeRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueUpdateAssigneeRequestData, **kwargs): + """ + Update issue assignee request payload. + + :param data: Update issue assignee request. + :type data: IssueUpdateAssigneeRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_update_assignee_request_data.py b/src/datadog_api_client/v2/model/issue_update_assignee_request_data.py new file mode 100644 index 0000000000..88de880b86 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_assignee_request_data.py @@ -0,0 +1,48 @@ +# 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_update_assignee_request_data_type import IssueUpdateAssigneeRequestDataType + + +class IssueUpdateAssigneeRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_update_assignee_request_data_type import ( + IssueUpdateAssigneeRequestDataType, + ) + + return { + "id": (str,), + "type": (IssueUpdateAssigneeRequestDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: IssueUpdateAssigneeRequestDataType, **kwargs): + """ + Update issue assignee request. + + :param id: User identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueUpdateAssigneeRequestDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_update_assignee_request_data_type.py b/src/datadog_api_client/v2/model/issue_update_assignee_request_data_type.py new file mode 100644 index 0000000000..bbe07efce8 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_assignee_request_data_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 IssueUpdateAssigneeRequestDataType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "assignee". Must be one of ["assignee"]. + :type value: str + """ + + allowed_values = { + "assignee", + } + ASSIGNEE: ClassVar["IssueUpdateAssigneeRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueUpdateAssigneeRequestDataType.ASSIGNEE = IssueUpdateAssigneeRequestDataType("assignee") diff --git a/src/datadog_api_client/v2/model/issue_update_state_request.py b/src/datadog_api_client/v2/model/issue_update_state_request.py new file mode 100644 index 0000000000..f153701de9 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_state_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_update_state_request_data import IssueUpdateStateRequestData + + +class IssueUpdateStateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_update_state_request_data import IssueUpdateStateRequestData + + return { + "data": (IssueUpdateStateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueUpdateStateRequestData, **kwargs): + """ + Update issue state request payload. + + :param data: Update issue state request. + :type data: IssueUpdateStateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issue_update_state_request_data.py b/src/datadog_api_client/v2/model/issue_update_state_request_data.py new file mode 100644 index 0000000000..383a60c103 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_state_request_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_update_state_request_data_attributes import ( + IssueUpdateStateRequestDataAttributes, + ) + from datadog_api_client.v2.model.issue_update_state_request_data_type import IssueUpdateStateRequestDataType + + +class IssueUpdateStateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_update_state_request_data_attributes import ( + IssueUpdateStateRequestDataAttributes, + ) + from datadog_api_client.v2.model.issue_update_state_request_data_type import IssueUpdateStateRequestDataType + + return { + "attributes": (IssueUpdateStateRequestDataAttributes,), + "id": (str,), + "type": (IssueUpdateStateRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: IssueUpdateStateRequestDataAttributes, + id: str, + type: IssueUpdateStateRequestDataType, + **kwargs, + ): + """ + Update issue state request. + + :param attributes: Object describing an issue state update request. + :type attributes: IssueUpdateStateRequestDataAttributes + + :param id: Issue identifier. + :type id: str + + :param type: Type of the object. + :type type: IssueUpdateStateRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_update_state_request_data_attributes.py b/src/datadog_api_client/v2/model/issue_update_state_request_data_attributes.py new file mode 100644 index 0000000000..56339ec9bc --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_state_request_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_state import IssueState + + +class IssueUpdateStateRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_state import IssueState + + return { + "state": (IssueState,), + } + + attribute_map = { + "state": "state", + } + + def __init__(self_, state: IssueState, **kwargs): + """ + Object describing an issue state update request. + + :param state: State of the issue + :type state: IssueState + """ + super().__init__(kwargs) + + self_.state = state diff --git a/src/datadog_api_client/v2/model/issue_update_state_request_data_type.py b/src/datadog_api_client/v2/model/issue_update_state_request_data_type.py new file mode 100644 index 0000000000..4b68c7b33b --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_update_state_request_data_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 IssueUpdateStateRequestDataType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "error_tracking_issue". Must be one of ["error_tracking_issue"]. + :type value: str + """ + + allowed_values = { + "error_tracking_issue", + } + ERROR_TRACKING_ISSUE: ClassVar["IssueUpdateStateRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueUpdateStateRequestDataType.ERROR_TRACKING_ISSUE = IssueUpdateStateRequestDataType("error_tracking_issue") diff --git a/src/datadog_api_client/v2/model/issue_user.py b/src/datadog_api_client/v2/model/issue_user.py new file mode 100644 index 0000000000..77be48226c --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_user.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_user_attributes import IssueUserAttributes + from datadog_api_client.v2.model.issue_user_type import IssueUserType + + +class IssueUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_user_attributes import IssueUserAttributes + from datadog_api_client.v2.model.issue_user_type import IssueUserType + + return { + "attributes": (IssueUserAttributes,), + "id": (str,), + "type": (IssueUserType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IssueUserAttributes, id: str, type: IssueUserType, **kwargs): + """ + The user to whom the issue is assigned. + + :param attributes: Object containing the information of a user. + :type attributes: IssueUserAttributes + + :param id: User identifier. + :type id: str + + :param type: Type of the object + :type type: IssueUserType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_user_attributes.py b/src/datadog_api_client/v2/model/issue_user_attributes.py new file mode 100644 index 0000000000..5c820049bf --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_user_attributes.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IssueUserAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + "handle": (str,), + "name": (str,), + } + + attribute_map = { + "email": "email", + "handle": "handle", + "name": "name", + } + + def __init__( + self_, + email: Union[str, UnsetType] = unset, + handle: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the information of a user. + + :param email: Email of the user. + :type email: str, optional + + :param handle: Handle of the user. + :type handle: str, optional + + :param name: Name of the user. + :type name: str, optional + """ + if email is not unset: + kwargs["email"] = email + if handle is not unset: + kwargs["handle"] = handle + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issue_user_reference.py b/src/datadog_api_client/v2/model/issue_user_reference.py new file mode 100644 index 0000000000..bdb5860d38 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_user_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_user_type import IssueUserType + + +class IssueUserReference(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_user_type import IssueUserType + + return { + "id": (str,), + "type": (IssueUserType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: IssueUserType, **kwargs): + """ + The user the issue is assigned to. + + :param id: User identifier. + :type id: str + + :param type: Type of the object + :type type: IssueUserType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/issue_user_type.py b/src/datadog_api_client/v2/model/issue_user_type.py new file mode 100644 index 0000000000..c41eff2fd6 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_user_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 IssueUserType(ModelSimple): + """ + Type of the object + + :param value: If omitted defaults to "user". Must be one of ["user"]. + :type value: str + """ + + allowed_values = { + "user", + } + USER: ClassVar["IssueUserType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueUserType.USER = IssueUserType("user") diff --git a/src/datadog_api_client/v2/model/issues_search_request.py b/src/datadog_api_client/v2/model/issues_search_request.py new file mode 100644 index 0000000000..4d44913e25 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData + + +class IssuesSearchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData + + return { + "data": (IssuesSearchRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssuesSearchRequestData, **kwargs): + """ + Search issues request payload. + + :param data: Search issues request. + :type data: IssuesSearchRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issues_search_request_data.py b/src/datadog_api_client/v2/model/issues_search_request_data.py new file mode 100644 index 0000000000..ea57cebd0c --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data.py @@ -0,0 +1,48 @@ +# 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.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes + from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType + + +class IssuesSearchRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes + from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType + + return { + "attributes": (IssuesSearchRequestDataAttributes,), + "type": (IssuesSearchRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: IssuesSearchRequestDataAttributes, type: IssuesSearchRequestDataType, **kwargs): + """ + Search issues request. + + :param attributes: Object describing a search issue request. + :type attributes: IssuesSearchRequestDataAttributes + + :param type: Type of the object. + :type type: IssuesSearchRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/issues_search_request_data_attributes.py b/src/datadog_api_client/v2/model/issues_search_request_data_attributes.py new file mode 100644 index 0000000000..b1285c60ac --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data_attributes.py @@ -0,0 +1,100 @@ +# 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.issues_search_request_data_attributes_order_by import ( + IssuesSearchRequestDataAttributesOrderBy, + ) + from datadog_api_client.v2.model.issues_search_request_data_attributes_persona import ( + IssuesSearchRequestDataAttributesPersona, + ) + from datadog_api_client.v2.model.issues_search_request_data_attributes_track import ( + IssuesSearchRequestDataAttributesTrack, + ) + + +class IssuesSearchRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_request_data_attributes_order_by import ( + IssuesSearchRequestDataAttributesOrderBy, + ) + from datadog_api_client.v2.model.issues_search_request_data_attributes_persona import ( + IssuesSearchRequestDataAttributesPersona, + ) + from datadog_api_client.v2.model.issues_search_request_data_attributes_track import ( + IssuesSearchRequestDataAttributesTrack, + ) + + return { + "_from": (int,), + "order_by": (IssuesSearchRequestDataAttributesOrderBy,), + "persona": (IssuesSearchRequestDataAttributesPersona,), + "query": (str,), + "to": (int,), + "track": (IssuesSearchRequestDataAttributesTrack,), + } + + attribute_map = { + "_from": "from", + "order_by": "order_by", + "persona": "persona", + "query": "query", + "to": "to", + "track": "track", + } + + def __init__( + self_, + _from: int, + query: str, + to: int, + order_by: Union[IssuesSearchRequestDataAttributesOrderBy, UnsetType] = unset, + persona: Union[IssuesSearchRequestDataAttributesPersona, UnsetType] = unset, + track: Union[IssuesSearchRequestDataAttributesTrack, UnsetType] = unset, + **kwargs, + ): + """ + Object describing a search issue request. + + :param _from: Start date (inclusive) of the query in milliseconds since the Unix epoch. + :type _from: int + + :param order_by: The attribute to sort the search results by. + :type order_by: IssuesSearchRequestDataAttributesOrderBy, optional + + :param persona: Persona for the search. Either track(s) or persona(s) must be specified. + :type persona: IssuesSearchRequestDataAttributesPersona, optional + + :param query: Search query following the event search syntax. + :type query: str + + :param to: End date (exclusive) of the query in milliseconds since the Unix epoch. + :type to: int + + :param track: Track of the events to query. Either track(s) or persona(s) must be specified. + :type track: IssuesSearchRequestDataAttributesTrack, optional + """ + if order_by is not unset: + kwargs["order_by"] = order_by + if persona is not unset: + kwargs["persona"] = persona + if track is not unset: + kwargs["track"] = track + super().__init__(kwargs) + + self_._from = _from + self_.query = query + self_.to = to diff --git a/src/datadog_api_client/v2/model/issues_search_request_data_attributes_order_by.py b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_order_by.py new file mode 100644 index 0000000000..c1f3be42b5 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_order_by.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IssuesSearchRequestDataAttributesOrderBy(ModelSimple): + """ + The attribute to sort the search results by. + + :param value: Must be one of ["TOTAL_COUNT", "FIRST_SEEN", "IMPACTED_SESSIONS", "PRIORITY"]. + :type value: str + """ + + allowed_values = { + "TOTAL_COUNT", + "FIRST_SEEN", + "IMPACTED_SESSIONS", + "PRIORITY", + } + TOTAL_COUNT: ClassVar["IssuesSearchRequestDataAttributesOrderBy"] + FIRST_SEEN: ClassVar["IssuesSearchRequestDataAttributesOrderBy"] + IMPACTED_SESSIONS: ClassVar["IssuesSearchRequestDataAttributesOrderBy"] + PRIORITY: ClassVar["IssuesSearchRequestDataAttributesOrderBy"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuesSearchRequestDataAttributesOrderBy.TOTAL_COUNT = IssuesSearchRequestDataAttributesOrderBy("TOTAL_COUNT") +IssuesSearchRequestDataAttributesOrderBy.FIRST_SEEN = IssuesSearchRequestDataAttributesOrderBy("FIRST_SEEN") +IssuesSearchRequestDataAttributesOrderBy.IMPACTED_SESSIONS = IssuesSearchRequestDataAttributesOrderBy( + "IMPACTED_SESSIONS" +) +IssuesSearchRequestDataAttributesOrderBy.PRIORITY = IssuesSearchRequestDataAttributesOrderBy("PRIORITY") diff --git a/src/datadog_api_client/v2/model/issues_search_request_data_attributes_persona.py b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_persona.py new file mode 100644 index 0000000000..34b25381f7 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_persona.py @@ -0,0 +1,44 @@ +# 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 IssuesSearchRequestDataAttributesPersona(ModelSimple): + """ + Persona for the search. Either track(s) or persona(s) must be specified. + + :param value: Must be one of ["all", "browser", "mobile", "backend"]. + :type value: str + """ + + allowed_values = { + "all", + "browser", + "mobile", + "backend", + } + ALL: ClassVar["IssuesSearchRequestDataAttributesPersona"] + BROWSER: ClassVar["IssuesSearchRequestDataAttributesPersona"] + MOBILE: ClassVar["IssuesSearchRequestDataAttributesPersona"] + BACKEND: ClassVar["IssuesSearchRequestDataAttributesPersona"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuesSearchRequestDataAttributesPersona.ALL = IssuesSearchRequestDataAttributesPersona("all") +IssuesSearchRequestDataAttributesPersona.BROWSER = IssuesSearchRequestDataAttributesPersona("browser") +IssuesSearchRequestDataAttributesPersona.MOBILE = IssuesSearchRequestDataAttributesPersona("mobile") +IssuesSearchRequestDataAttributesPersona.BACKEND = IssuesSearchRequestDataAttributesPersona("backend") diff --git a/src/datadog_api_client/v2/model/issues_search_request_data_attributes_track.py b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_track.py new file mode 100644 index 0000000000..e0383d3ecc --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data_attributes_track.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 IssuesSearchRequestDataAttributesTrack(ModelSimple): + """ + Track of the events to query. Either track(s) or persona(s) must be specified. + + :param value: Must be one of ["trace", "logs", "rum"]. + :type value: str + """ + + allowed_values = { + "trace", + "logs", + "rum", + } + TRACE: ClassVar["IssuesSearchRequestDataAttributesTrack"] + LOGS: ClassVar["IssuesSearchRequestDataAttributesTrack"] + RUM: ClassVar["IssuesSearchRequestDataAttributesTrack"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuesSearchRequestDataAttributesTrack.TRACE = IssuesSearchRequestDataAttributesTrack("trace") +IssuesSearchRequestDataAttributesTrack.LOGS = IssuesSearchRequestDataAttributesTrack("logs") +IssuesSearchRequestDataAttributesTrack.RUM = IssuesSearchRequestDataAttributesTrack("rum") diff --git a/src/datadog_api_client/v2/model/issues_search_request_data_type.py b/src/datadog_api_client/v2/model/issues_search_request_data_type.py new file mode 100644 index 0000000000..db1a6faf23 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_request_data_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 IssuesSearchRequestDataType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "search_request". Must be one of ["search_request"]. + :type value: str + """ + + allowed_values = { + "search_request", + } + SEARCH_REQUEST: ClassVar["IssuesSearchRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuesSearchRequestDataType.SEARCH_REQUEST = IssuesSearchRequestDataType("search_request") diff --git a/src/datadog_api_client/v2/model/issues_search_response.py b/src/datadog_api_client/v2/model/issues_search_response.py new file mode 100644 index 0000000000..50f2534edd --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_response.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issues_search_result import IssuesSearchResult + from datadog_api_client.v2.model.issues_search_result_included import IssuesSearchResultIncluded + from datadog_api_client.v2.model.issue import Issue + from datadog_api_client.v2.model.case import Case + from datadog_api_client.v2.model.issue_user import IssueUser + from datadog_api_client.v2.model.issue_team import IssueTeam + + +class IssuesSearchResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_result import IssuesSearchResult + from datadog_api_client.v2.model.issues_search_result_included import IssuesSearchResultIncluded + + return { + "data": ([IssuesSearchResult],), + "included": ([IssuesSearchResultIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: Union[List[IssuesSearchResult], UnsetType] = unset, + included: Union[List[Union[IssuesSearchResultIncluded, Issue, Case, IssueUser, IssueTeam]], UnsetType] = unset, + **kwargs, + ): + """ + Search issues response payload. + + :param data: Array of results matching the search query. + :type data: [IssuesSearchResult], optional + + :param included: Array of resources related to the search results. + :type included: [IssuesSearchResultIncluded], optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issues_search_result.py b/src/datadog_api_client/v2/model/issues_search_result.py new file mode 100644 index 0000000000..00527a752e --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issues_search_result_attributes import IssuesSearchResultAttributes + from datadog_api_client.v2.model.issues_search_result_relationships import IssuesSearchResultRelationships + from datadog_api_client.v2.model.issues_search_result_type import IssuesSearchResultType + + +class IssuesSearchResult(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_result_attributes import IssuesSearchResultAttributes + from datadog_api_client.v2.model.issues_search_result_relationships import IssuesSearchResultRelationships + from datadog_api_client.v2.model.issues_search_result_type import IssuesSearchResultType + + return { + "attributes": (IssuesSearchResultAttributes,), + "id": (str,), + "relationships": (IssuesSearchResultRelationships,), + "type": (IssuesSearchResultType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IssuesSearchResultAttributes, + id: str, + type: IssuesSearchResultType, + relationships: Union[IssuesSearchResultRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Result matching the search query. + + :param attributes: Object containing the information of a search result. + :type attributes: IssuesSearchResultAttributes + + :param id: Search result identifier (matches the nested issue's identifier). + :type id: str + + :param relationships: Relationships between the search result and other resources. + :type relationships: IssuesSearchResultRelationships, optional + + :param type: Type of the object. + :type type: IssuesSearchResultType + """ + 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/issues_search_result_attributes.py b/src/datadog_api_client/v2/model/issues_search_result_attributes.py new file mode 100644 index 0000000000..0d9811e9f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result_attributes.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IssuesSearchResultAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "impacted_sessions": (int,), + "impacted_users": (int,), + "total_count": (int,), + } + + attribute_map = { + "impacted_sessions": "impacted_sessions", + "impacted_users": "impacted_users", + "total_count": "total_count", + } + + def __init__( + self_, + impacted_sessions: Union[int, UnsetType] = unset, + impacted_users: Union[int, UnsetType] = unset, + total_count: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the information of a search result. + + :param impacted_sessions: Count of sessions impacted by the issue over the queried time window. + :type impacted_sessions: int, optional + + :param impacted_users: Count of users impacted by the issue over the queried time window. + :type impacted_users: int, optional + + :param total_count: Total count of errors that match the issue over the queried time window. + :type total_count: int, optional + """ + if impacted_sessions is not unset: + kwargs["impacted_sessions"] = impacted_sessions + if impacted_users is not unset: + kwargs["impacted_users"] = impacted_users + if total_count is not unset: + kwargs["total_count"] = total_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issues_search_result_included.py b/src/datadog_api_client/v2/model/issues_search_result_included.py new file mode 100644 index 0000000000..a94602e0eb --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result_included.py @@ -0,0 +1,53 @@ +# 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 IssuesSearchResultIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + An array of related resources, returned when the ``include`` query parameter is used. + + :param attributes: Object containing the information of an issue. + :type attributes: IssueAttributes + + :param id: Issue identifier. + :type id: str + + :param relationships: Relationship between the issue and an assignee, case and/or teams. + :type relationships: IssueRelationships, optional + + :param type: Type of the object. + :type type: IssueType + """ + 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 import Issue + from datadog_api_client.v2.model.case import Case + from datadog_api_client.v2.model.issue_user import IssueUser + from datadog_api_client.v2.model.issue_team import IssueTeam + + return { + "oneOf": [ + Issue, + Case, + IssueUser, + IssueTeam, + ], + } diff --git a/src/datadog_api_client/v2/model/issues_search_result_issue_relationship.py b/src/datadog_api_client/v2/model/issues_search_result_issue_relationship.py new file mode 100644 index 0000000000..d77e059904 --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result_issue_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_reference import IssueReference + + +class IssuesSearchResultIssueRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_reference import IssueReference + + return { + "data": (IssueReference,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IssueReference, **kwargs): + """ + Relationship between the search result and the corresponding issue. + + :param data: The issue the search result corresponds to. + :type data: IssueReference + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/issues_search_result_relationships.py b/src/datadog_api_client/v2/model/issues_search_result_relationships.py new file mode 100644 index 0000000000..247bd6550b --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result_relationships.py @@ -0,0 +1,44 @@ +# 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.issues_search_result_issue_relationship import IssuesSearchResultIssueRelationship + + +class IssuesSearchResultRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issues_search_result_issue_relationship import ( + IssuesSearchResultIssueRelationship, + ) + + return { + "issue": (IssuesSearchResultIssueRelationship,), + } + + attribute_map = { + "issue": "issue", + } + + def __init__(self_, issue: Union[IssuesSearchResultIssueRelationship, UnsetType] = unset, **kwargs): + """ + Relationships between the search result and other resources. + + :param issue: Relationship between the search result and the corresponding issue. + :type issue: IssuesSearchResultIssueRelationship, optional + """ + if issue is not unset: + kwargs["issue"] = issue + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/issues_search_result_type.py b/src/datadog_api_client/v2/model/issues_search_result_type.py new file mode 100644 index 0000000000..8ebdf2e91c --- /dev/null +++ b/src/datadog_api_client/v2/model/issues_search_result_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 IssuesSearchResultType(ModelSimple): + """ + Type of the object. + + :param value: If omitted defaults to "error_tracking_search_result". Must be one of ["error_tracking_search_result"]. + :type value: str + """ + + allowed_values = { + "error_tracking_search_result", + } + ERROR_TRACKING_SEARCH_RESULT: ClassVar["IssuesSearchResultType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssuesSearchResultType.ERROR_TRACKING_SEARCH_RESULT = IssuesSearchResultType("error_tracking_search_result") diff --git a/src/datadog_api_client/v2/model/search_issues_include_query_parameter_item.py b/src/datadog_api_client/v2/model/search_issues_include_query_parameter_item.py new file mode 100644 index 0000000000..eb349fb34a --- /dev/null +++ b/src/datadog_api_client/v2/model/search_issues_include_query_parameter_item.py @@ -0,0 +1,44 @@ +# 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 SearchIssuesIncludeQueryParameterItem(ModelSimple): + """ + Relationship object that should be included in the search response. + + :param value: Must be one of ["issue", "issue.assignee", "issue.case", "issue.team_owners"]. + :type value: str + """ + + allowed_values = { + "issue", + "issue.assignee", + "issue.case", + "issue.team_owners", + } + ISSUE: ClassVar["SearchIssuesIncludeQueryParameterItem"] + ISSUE_ASSIGNEE: ClassVar["SearchIssuesIncludeQueryParameterItem"] + ISSUE_CASE: ClassVar["SearchIssuesIncludeQueryParameterItem"] + ISSUE_TEAM_OWNERS: ClassVar["SearchIssuesIncludeQueryParameterItem"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SearchIssuesIncludeQueryParameterItem.ISSUE = SearchIssuesIncludeQueryParameterItem("issue") +SearchIssuesIncludeQueryParameterItem.ISSUE_ASSIGNEE = SearchIssuesIncludeQueryParameterItem("issue.assignee") +SearchIssuesIncludeQueryParameterItem.ISSUE_CASE = SearchIssuesIncludeQueryParameterItem("issue.case") +SearchIssuesIncludeQueryParameterItem.ISSUE_TEAM_OWNERS = SearchIssuesIncludeQueryParameterItem("issue.team_owners") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a370727c3b..771ff24efe 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1433,6 +1433,7 @@ from datadog_api_client.v2.model.get_finding_response import GetFindingResponse from datadog_api_client.v2.model.get_interfaces_data import GetInterfacesData from datadog_api_client.v2.model.get_interfaces_response import GetInterfacesResponse +from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem from datadog_api_client.v2.model.get_resource_evaluation_filters_response import GetResourceEvaluationFiltersResponse from datadog_api_client.v2.model.get_resource_evaluation_filters_response_data import ( GetResourceEvaluationFiltersResponseData, @@ -1677,6 +1678,55 @@ from datadog_api_client.v2.model.intake_payload_accepted import IntakePayloadAccepted from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus +from datadog_api_client.v2.model.issue import Issue +from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship +from datadog_api_client.v2.model.issue_attributes import IssueAttributes +from datadog_api_client.v2.model.issue_case_reference import IssueCaseReference +from datadog_api_client.v2.model.issue_case_relationship import IssueCaseRelationship +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_platform import IssuePlatform +from datadog_api_client.v2.model.issue_reference import IssueReference +from datadog_api_client.v2.model.issue_relationships import IssueRelationships +from datadog_api_client.v2.model.issue_response import IssueResponse +from datadog_api_client.v2.model.issue_state import IssueState +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 +from datadog_api_client.v2.model.issue_team_reference import IssueTeamReference +from datadog_api_client.v2.model.issue_team_type import IssueTeamType +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.issue_update_assignee_request import IssueUpdateAssigneeRequest +from datadog_api_client.v2.model.issue_update_assignee_request_data import IssueUpdateAssigneeRequestData +from datadog_api_client.v2.model.issue_update_assignee_request_data_type import IssueUpdateAssigneeRequestDataType +from datadog_api_client.v2.model.issue_update_state_request import IssueUpdateStateRequest +from datadog_api_client.v2.model.issue_update_state_request_data import IssueUpdateStateRequestData +from datadog_api_client.v2.model.issue_update_state_request_data_attributes import IssueUpdateStateRequestDataAttributes +from datadog_api_client.v2.model.issue_update_state_request_data_type import IssueUpdateStateRequestDataType +from datadog_api_client.v2.model.issue_user import IssueUser +from datadog_api_client.v2.model.issue_user_attributes import IssueUserAttributes +from datadog_api_client.v2.model.issue_user_reference import IssueUserReference +from datadog_api_client.v2.model.issue_user_type import IssueUserType +from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest +from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData +from datadog_api_client.v2.model.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes +from datadog_api_client.v2.model.issues_search_request_data_attributes_order_by import ( + IssuesSearchRequestDataAttributesOrderBy, +) +from datadog_api_client.v2.model.issues_search_request_data_attributes_persona import ( + IssuesSearchRequestDataAttributesPersona, +) +from datadog_api_client.v2.model.issues_search_request_data_attributes_track import ( + IssuesSearchRequestDataAttributesTrack, +) +from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType +from datadog_api_client.v2.model.issues_search_response import IssuesSearchResponse +from datadog_api_client.v2.model.issues_search_result import IssuesSearchResult +from datadog_api_client.v2.model.issues_search_result_attributes import IssuesSearchResultAttributes +from datadog_api_client.v2.model.issues_search_result_included import IssuesSearchResultIncluded +from datadog_api_client.v2.model.issues_search_result_issue_relationship import IssuesSearchResultIssueRelationship +from datadog_api_client.v2.model.issues_search_result_relationships import IssuesSearchResultRelationships +from datadog_api_client.v2.model.issues_search_result_type import IssuesSearchResultType from datadog_api_client.v2.model.jsonapi_error_item import JSONAPIErrorItem from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse @@ -3165,6 +3215,7 @@ from datadog_api_client.v2.model.schedule_user_attributes import ScheduleUserAttributes from datadog_api_client.v2.model.schedule_user_type import ScheduleUserType from datadog_api_client.v2.model.scorecard_type import ScorecardType +from datadog_api_client.v2.model.search_issues_include_query_parameter_item import SearchIssuesIncludeQueryParameterItem from datadog_api_client.v2.model.security_filter import SecurityFilter from datadog_api_client.v2.model.security_filter_attributes import SecurityFilterAttributes from datadog_api_client.v2.model.security_filter_create_attributes import SecurityFilterCreateAttributes @@ -5056,6 +5107,7 @@ "GetFindingResponse", "GetInterfacesData", "GetInterfacesResponse", + "GetIssueIncludeQueryParameterItem", "GetResourceEvaluationFiltersResponse", "GetResourceEvaluationFiltersResponseData", "GetRuleVersionHistoryData", @@ -5266,6 +5318,49 @@ "IntakePayloadAccepted", "InterfaceAttributes", "InterfaceAttributesStatus", + "Issue", + "IssueAssigneeRelationship", + "IssueAttributes", + "IssueCaseReference", + "IssueCaseRelationship", + "IssueIncluded", + "IssueLanguage", + "IssuePlatform", + "IssueReference", + "IssueRelationships", + "IssueResponse", + "IssueState", + "IssueTeam", + "IssueTeamAttributes", + "IssueTeamOwnersRelationship", + "IssueTeamReference", + "IssueTeamType", + "IssueType", + "IssueUpdateAssigneeRequest", + "IssueUpdateAssigneeRequestData", + "IssueUpdateAssigneeRequestDataType", + "IssueUpdateStateRequest", + "IssueUpdateStateRequestData", + "IssueUpdateStateRequestDataAttributes", + "IssueUpdateStateRequestDataType", + "IssueUser", + "IssueUserAttributes", + "IssueUserReference", + "IssueUserType", + "IssuesSearchRequest", + "IssuesSearchRequestData", + "IssuesSearchRequestDataAttributes", + "IssuesSearchRequestDataAttributesOrderBy", + "IssuesSearchRequestDataAttributesPersona", + "IssuesSearchRequestDataAttributesTrack", + "IssuesSearchRequestDataType", + "IssuesSearchResponse", + "IssuesSearchResult", + "IssuesSearchResultAttributes", + "IssuesSearchResultIncluded", + "IssuesSearchResultIssueRelationship", + "IssuesSearchResultRelationships", + "IssuesSearchResultType", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -6272,6 +6367,7 @@ "ScheduleUserAttributes", "ScheduleUserType", "ScorecardType", + "SearchIssuesIncludeQueryParameterItem", "SecurityFilter", "SecurityFilterAttributes", "SecurityFilterCreateAttributes", diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.frozen new file mode 100644 index 0000000000..918738d7aa --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:32.951Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.yaml new file mode 100644 index 0000000000..7ae4414475 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/%7Bissue_id%7D + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"issue id + is not an uuid"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.frozen new file mode 100644 index 0000000000..f06088aabc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.272Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.yaml new file mode 100644 index 0000000000..529025c5ac --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_not_found_response.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012813000,"query":"service:synthetics-browser","to":1756308813000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.frozen new file mode 100644 index 0000000000..ea355a6317 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.577Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.yaml new file mode 100644 index 0000000000..e66ff7250e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_an_error_tracking_issue_returns_ok_response.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012813000,"query":"service:synthetics-browser","to":1756308813000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002 + response: + body: + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.frozen new file mode 100644 index 0000000000..71e1817af4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.940Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.yaml new file mode 100644 index 0000000000..3024c914bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"unexpected + end of JSON input"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.frozen new file mode 100644 index 0000000000..866d87cbf0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.997Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.yaml new file mode 100644 index 0000000000..51bf444ada --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_search_error_tracking_issues_returns_ok_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1671612804000,"query":"service:orders-* AND + @language:go","to":1671620004000,"track":"trace"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.frozen new file mode 100644 index 0000000000..4cf35cdda2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:34.076Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.yaml new file mode 100644 index 0000000000..d25771fa78 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_bad_request_response.yaml @@ -0,0 +1,39 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012814000,"query":"service:synthetics-browser","to":1756308814000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"unexpected + end of JSON input"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.frozen new file mode 100644 index 0000000000..409dfdcd13 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:34.622Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.yaml new file mode 100644 index 0000000000..7d339639e0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"assignee"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/assignee + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.frozen new file mode 100644 index 0000000000..dd78c9df08 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:34.689Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.yaml new file mode 100644 index 0000000000..61a9f732fe --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_assignee_of_an_issue_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012814000,"query":"service:synthetics-browser","to":1756308814000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"assignee"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee + response: + body: + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}},"included":[{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case","attributes":{"closed_at":"2025-08-21T17:21:13.882831Z","created_at":"2025-08-21T17:20:22.807979Z","creation_source":"ERROR_TRACKING","description":"","insights":[{"type":"ERROR_TRACKING","ref":"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","resource_id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002"}],"key":"ET-1","modified_at":"2025-08-21T17:21:13.882831Z","priority":"NOT_DEFINED","status":"CLOSED","title":"Error: + HTTP error","type":"ERROR_TRACKING_ISSUE"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"384521ba-dc5f-481f-942d-15bd48428029","type":"project"}}}},{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user","attributes":{"email":"","handle":"","name":""}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.frozen new file mode 100644 index 0000000000..f505962d30 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.029Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.yaml new file mode 100644 index 0000000000..e274b16322 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_bad_request_response.yaml @@ -0,0 +1,39 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012815000,"query":"service:synthetics-browser","to":1756308815000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"state":"invalid-state"},"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_issue"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + json value for IssueState: \"invalid-state\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.frozen new file mode 100644 index 0000000000..4e11e96c74 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.373Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.yaml new file mode 100644 index 0000000000..214d44f523 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"state":"resolved"},"id":"67d80aa3-36ff-44b9-a694-c501a7591737","type":"error_tracking_issue"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/state + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.frozen new file mode 100644 index 0000000000..05ba9e0712 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.431Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.yaml new file mode 100644 index 0000000000..b09c9dcee8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_the_state_of_an_issue_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"data":{"attributes":{"from":1755012815000,"query":"service:synthetics-browser","to":1756308815000,"track":"rum"},"type":"search_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"state":"RESOLVED"},"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_issue"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state + response: + body: + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}},"included":[{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case","attributes":{"closed_at":"2025-08-21T17:21:13.882831Z","created_at":"2025-08-21T17:20:22.807979Z","creation_source":"ERROR_TRACKING","description":"","insights":[{"type":"ERROR_TRACKING","ref":"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","resource_id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002"}],"key":"ET-1","modified_at":"2025-08-21T17:21:13.882831Z","priority":"NOT_DEFINED","status":"CLOSED","title":"Error: + HTTP error","type":"ERROR_TRACKING_ISSUE"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"384521ba-dc5f-481f-942d-15bd48428029","type":"project"}}}},{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user","attributes":{"email":"","handle":"","name":""}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/error_tracking.feature b/tests/v2/features/error_tracking.feature new file mode 100644 index 0000000000..a9bd8edad1 --- /dev/null +++ b/tests/v2/features/error_tracking.feature @@ -0,0 +1,97 @@ +@endpoint(error-tracking) @endpoint(error-tracking-v2) +Feature: Error Tracking + View and manage issues within Error Tracking. See the [Error Tracking + page](https://docs.datadoghq.com/error_tracking/) for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ErrorTracking" API + + @team:DataDog/error-tracking + Scenario: Get the details of an error tracking issue returns "Bad Request" response + Given new "GetIssue" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/error-tracking + Scenario: Get the details of an error tracking issue returns "Not Found" response + Given new "GetIssue" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/error-tracking + Scenario: Get the details of an error tracking issue 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" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ issue.id }}" + + @team:DataDog/error-tracking + Scenario: Search error tracking issues returns "Bad Request" response + Given new "SearchIssues" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/error-tracking + Scenario: Search error tracking issues returns "OK" response + Given new "SearchIssues" request + And body with value {"data": {"attributes": {"query": "service:orders-* AND @language:go", "from": 1671612804000, "to": 1671620004000, "track": "trace"}, "type": "search_request"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/error-tracking + Scenario: Update the assignee of an issue returns "Bad Request" response + Given new "UpdateIssueAssignee" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/error-tracking + Scenario: Update the assignee of an issue returns "Not Found" response + Given new "UpdateIssueAssignee" request + And request contains "issue_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"id": "87cb11a0-278c-440a-99fe-701223c80296", "type": "assignee"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/error-tracking + Scenario: Update the assignee of an issue returns "OK" response + Given new "UpdateIssueAssignee" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And body with value {"data": {"id": "87cb11a0-278c-440a-99fe-701223c80296", "type": "assignee"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/error-tracking + Scenario: Update the state of an issue returns "Bad Request" response + Given new "UpdateIssueState" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And body with value {"data": {"attributes": {"state": "invalid-state"}, "id": "{{ issue.id }}", "type": "error_tracking_issue"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/error-tracking + Scenario: Update the state of an issue returns "Not Found" response + Given new "UpdateIssueState" request + And request contains "issue_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"state": "resolved"}, "id": "67d80aa3-36ff-44b9-a694-c501a7591737", "type": "error_tracking_issue"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/error-tracking + Scenario: Update the state of an issue returns "OK" response + Given new "UpdateIssueState" request + And there is a valid "issue" in the system + And request contains "issue_id" parameter from "issue.id" + And body with value {"data": {"attributes": {"state": "RESOLVED"}, "id": "{{ issue.id }}", "type": "error_tracking_issue"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.state" is equal to "RESOLVED" diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index b609709365..64f970e15a 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -217,6 +217,19 @@ "tag": "Downtimes", "operationId": "CreateDowntime" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"query\": \"service:synthetics-browser\",\n \"from\": {{ timestamp(\"now - 15d\") }}000,\n \"to\": {{ timestamp(\"now\") }}000,\n \"track\": \"rum\"\n },\n \"type\": \"search_request\"\n }\n}" + } + ], + "source": "data[0]", + "step": "there is a valid \"issue\" in the system", + "key": "issue", + "tag": "Error Tracking", + "operationId": "SearchIssues" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 9878d7a467..63425dae9a 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1016,6 +1016,30 @@ "type": "idempotent" } }, + "SearchIssues": { + "tag": "Error Tracking", + "undo": { + "type": "safe" + } + }, + "GetIssue": { + "tag": "Error Tracking", + "undo": { + "type": "safe" + } + }, + "UpdateIssueAssignee": { + "tag": "Error Tracking", + "undo": { + "type": "idempotent" + } + }, + "UpdateIssueState": { + "tag": "Error Tracking", + "undo": { + "type": "idempotent" + } + }, "ListEvents": { "tag": "Events", "undo": {