diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a0f0a2bd098..4d0c4849320 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 @@ -18263,6 +18293,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: @@ -21383,6 +21425,773 @@ 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 + IssueCase: + description: The case attached to the issue. + properties: + attributes: + $ref: '#/components/schemas/IssueCaseAttributes' + id: + description: Case identifier. + example: 2841440d-e780-4fe2-96cd-6a8c1d194da5 + type: string + relationships: + $ref: '#/components/schemas/IssueCaseRelationships' + type: + $ref: '#/components/schemas/IssueCaseResourceType' + required: + - id + - type + - attributes + type: object + IssueCaseAttributes: + description: Object containing the information of a case. + properties: + archived_at: + description: Timestamp of when the case was archived. + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + closed_at: + description: Timestamp of when the case was closed. + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + created_at: + description: Timestamp of when the case was created. + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + creation_source: + description: Source of the case creation. + example: ERROR_TRACKING + type: string + description: + description: Description of the case. + type: string + due_date: + description: Due date of the case. + example: '2025-01-01' + type: string + insights: + description: Insights of the case. + items: + $ref: '#/components/schemas/IssueCaseInsight' + type: array + jira_issue: + $ref: '#/components/schemas/IssueCaseJiraIssue' + key: + description: Key of the case. + example: ET-123 + type: string + modified_at: + description: Timestamp of when the case was last modified. + example: '2025-01-01T00:00:00Z' + format: date-time + type: string + priority: + $ref: '#/components/schemas/CasePriority' + status: + $ref: '#/components/schemas/CaseStatus' + title: + description: Title of the case. + example: 'Error: HTTP error' + type: string + type: + description: Type of the case. + example: ERROR_TRACKING_ISSUE + type: string + type: object + IssueCaseInsight: + description: Insight of the case. + properties: + ref: + description: Reference of the insight. + example: /error-tracking?issueId=2841440d-e780-4fe2-96cd-6a8c1d194da5 + type: string + resource_id: + description: Insight identifier. + example: 2841440d-e780-4fe2-96cd-6a8c1d194da5 + type: string + type: + description: Type of the insight. + example: ERROR_TRACKING + type: string + type: object + IssueCaseJiraIssue: + description: Jira issue of the case. + properties: + result: + $ref: '#/components/schemas/IssueCaseJiraIssueResult' + status: + description: Creation status of the Jira issue. + example: COMPLETED + type: string + type: object + IssueCaseJiraIssueResult: + description: Contains the identifiers and URL for a successfully created Jira + issue. + properties: + issue_id: + description: Jira issue identifier. + example: '1904866' + type: string + issue_key: + description: Jira issue key. + example: ET-123 + type: string + issue_url: + description: Jira issue URL. + example: https://your-jira-instance.atlassian.net/browse/ET-123 + type: string + project_key: + description: Jira project key. + example: ET + type: string + 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/IssueCaseResourceType' + required: + - id + - type + type: object + IssueCaseRelationship: + description: Relationship between the issue and case. + properties: + data: + $ref: '#/components/schemas/IssueCaseReference' + required: + - data + type: object + IssueCaseRelationships: + description: Resources related to a case. + properties: + assignee: + $ref: '#/components/schemas/NullableUserRelationship' + created_by: + $ref: '#/components/schemas/NullableUserRelationship' + modified_by: + $ref: '#/components/schemas/NullableUserRelationship' + project: + $ref: '#/components/schemas/ProjectRelationship' + type: object + IssueCaseResourceType: + description: Type of the object. + enum: + - case + example: case + type: string + x-enum-varnames: + - CASE + IssueIncluded: + description: An array of related resources, returned when the `include` query + parameter is used. + oneOf: + - $ref: '#/components/schemas/IssueCase' + - $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: @@ -36255,6 +37064,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: @@ -45713,6 +46536,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 @@ -52122,6 +52947,159 @@ 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 per request. + 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`. Use this endpoint to + move an issue between states such as `OPEN`, `RESOLVED`, or `IGNORED`. + 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. @@ -69190,6 +70168,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/examples/v2/error-tracking/GetIssue.java b/examples/v2/error-tracking/GetIssue.java new file mode 100644 index 00000000000..e6b7b25be79 --- /dev/null +++ b/examples/v2/error-tracking/GetIssue.java @@ -0,0 +1,27 @@ +// Get the details of an error tracking issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ErrorTrackingApi; +import com.datadog.api.client.v2.model.IssueResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient); + + // there is a valid "issue" in the system + String ISSUE_ID = System.getenv("ISSUE_ID"); + + try { + IssueResponse result = apiInstance.getIssue(ISSUE_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorTrackingApi#getIssue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/error-tracking/SearchIssues.java b/examples/v2/error-tracking/SearchIssues.java new file mode 100644 index 00000000000..2ead7e1c9bf --- /dev/null +++ b/examples/v2/error-tracking/SearchIssues.java @@ -0,0 +1,41 @@ +// Search error tracking issues returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ErrorTrackingApi; +import com.datadog.api.client.v2.model.IssuesSearchRequest; +import com.datadog.api.client.v2.model.IssuesSearchRequestData; +import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributes; +import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributesTrack; +import com.datadog.api.client.v2.model.IssuesSearchRequestDataType; +import com.datadog.api.client.v2.model.IssuesSearchResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient); + + IssuesSearchRequest body = + new IssuesSearchRequest() + .data( + new IssuesSearchRequestData() + .attributes( + new IssuesSearchRequestDataAttributes() + .query("service:orders-* AND @language:go") + .from(1671612804000L) + .to(1671620004000L) + .track(IssuesSearchRequestDataAttributesTrack.TRACE)) + .type(IssuesSearchRequestDataType.SEARCH_REQUEST)); + + try { + IssuesSearchResponse result = apiInstance.searchIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorTrackingApi#searchIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/error-tracking/UpdateIssueAssignee.java b/examples/v2/error-tracking/UpdateIssueAssignee.java new file mode 100644 index 00000000000..c7e530e6397 --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueAssignee.java @@ -0,0 +1,37 @@ +// Update the assignee of an issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ErrorTrackingApi; +import com.datadog.api.client.v2.model.IssueResponse; +import com.datadog.api.client.v2.model.IssueUpdateAssigneeRequest; +import com.datadog.api.client.v2.model.IssueUpdateAssigneeRequestData; +import com.datadog.api.client.v2.model.IssueUpdateAssigneeRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient); + + // there is a valid "issue" in the system + String ISSUE_ID = System.getenv("ISSUE_ID"); + + IssueUpdateAssigneeRequest body = + new IssueUpdateAssigneeRequest() + .data( + new IssueUpdateAssigneeRequestData() + .id("87cb11a0-278c-440a-99fe-701223c80296") + .type(IssueUpdateAssigneeRequestDataType.ASSIGNEE)); + + try { + IssueResponse result = apiInstance.updateIssueAssignee(ISSUE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorTrackingApi#updateIssueAssignee"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/error-tracking/UpdateIssueState.java b/examples/v2/error-tracking/UpdateIssueState.java new file mode 100644 index 00000000000..9d0c236b79a --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueState.java @@ -0,0 +1,41 @@ +// Update the state of an issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ErrorTrackingApi; +import com.datadog.api.client.v2.model.IssueResponse; +import com.datadog.api.client.v2.model.IssueState; +import com.datadog.api.client.v2.model.IssueUpdateStateRequest; +import com.datadog.api.client.v2.model.IssueUpdateStateRequestData; +import com.datadog.api.client.v2.model.IssueUpdateStateRequestDataAttributes; +import com.datadog.api.client.v2.model.IssueUpdateStateRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient); + + // there is a valid "issue" in the system + String ISSUE_ID = System.getenv("ISSUE_ID"); + + IssueUpdateStateRequest body = + new IssueUpdateStateRequest() + .data( + new IssueUpdateStateRequestData() + .attributes( + new IssueUpdateStateRequestDataAttributes().state(IssueState.RESOLVED)) + .id(ISSUE_ID) + .type(IssueUpdateStateRequestDataType.ERROR_TRACKING_ISSUE)); + + try { + IssueResponse result = apiInstance.updateIssueState(ISSUE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorTrackingApi#updateIssueState"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ErrorTrackingApi.java b/src/main/java/com/datadog/api/client/v2/api/ErrorTrackingApi.java new file mode 100644 index 00000000000..fcf0d92d4ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/ErrorTrackingApi.java @@ -0,0 +1,759 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GetIssueIncludeQueryParameterItem; +import com.datadog.api.client.v2.model.IssueResponse; +import com.datadog.api.client.v2.model.IssueUpdateAssigneeRequest; +import com.datadog.api.client.v2.model.IssueUpdateStateRequest; +import com.datadog.api.client.v2.model.IssuesSearchRequest; +import com.datadog.api.client.v2.model.IssuesSearchResponse; +import com.datadog.api.client.v2.model.SearchIssuesIncludeQueryParameterItem; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ErrorTrackingApi { + private ApiClient apiClient; + + public ErrorTrackingApi() { + this(ApiClient.getDefaultApiClient()); + } + + public ErrorTrackingApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** Manage optional parameters to getIssue. */ + public static class GetIssueOptionalParameters { + private List include; + + /** + * Set include. + * + * @param include Comma-separated list of relationship objects that should be included in the + * response. (optional) + * @return GetIssueOptionalParameters + */ + public GetIssueOptionalParameters include(List include) { + this.include = include; + return this; + } + } + + /** + * Get the details of an error tracking issue. + * + *

See {@link #getIssueWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @return IssueResponse + * @throws ApiException if fails to make API call + */ + public IssueResponse getIssue(String issueId) throws ApiException { + return getIssueWithHttpInfo(issueId, new GetIssueOptionalParameters()).getData(); + } + + /** + * Get the details of an error tracking issue. + * + *

See {@link #getIssueWithHttpInfoAsync}. + * + * @param issueId The identifier of the issue. (required) + * @return CompletableFuture<IssueResponse> + */ + public CompletableFuture getIssueAsync(String issueId) { + return getIssueWithHttpInfoAsync(issueId, new GetIssueOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of an error tracking issue. + * + *

See {@link #getIssueWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param parameters Optional parameters for the request. + * @return IssueResponse + * @throws ApiException if fails to make API call + */ + public IssueResponse getIssue(String issueId, GetIssueOptionalParameters parameters) + throws ApiException { + return getIssueWithHttpInfo(issueId, parameters).getData(); + } + + /** + * Get the details of an error tracking issue. + * + *

See {@link #getIssueWithHttpInfoAsync}. + * + * @param issueId The identifier of the issue. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IssueResponse> + */ + public CompletableFuture getIssueAsync( + String issueId, GetIssueOptionalParameters parameters) { + return getIssueWithHttpInfoAsync(issueId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the full details for a specific error tracking issue, including attributes and + * relationships. + * + * @param issueId The identifier of the issue. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IssueResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getIssueWithHttpInfo( + String issueId, GetIssueOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + throw new ApiException(400, "Missing the required parameter 'issueId' when calling getIssue"); + } + List include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.getIssue", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of an error tracking issue. + * + *

See {@link #getIssueWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IssueResponse>> + */ + public CompletableFuture> getIssueWithHttpInfoAsync( + String issueId, GetIssueOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'issueId' when calling getIssue")); + return result; + } + List include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.getIssue", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to searchIssues. */ + public static class SearchIssuesOptionalParameters { + private List include; + + /** + * Set include. + * + * @param include Comma-separated list of relationship objects that should be included in the + * response. (optional) + * @return SearchIssuesOptionalParameters + */ + public SearchIssuesOptionalParameters include( + List include) { + this.include = include; + return this; + } + } + + /** + * Search error tracking issues. + * + *

See {@link #searchIssuesWithHttpInfo}. + * + * @param body Search issues request payload. (required) + * @return IssuesSearchResponse + * @throws ApiException if fails to make API call + */ + public IssuesSearchResponse searchIssues(IssuesSearchRequest body) throws ApiException { + return searchIssuesWithHttpInfo(body, new SearchIssuesOptionalParameters()).getData(); + } + + /** + * Search error tracking issues. + * + *

See {@link #searchIssuesWithHttpInfoAsync}. + * + * @param body Search issues request payload. (required) + * @return CompletableFuture<IssuesSearchResponse> + */ + public CompletableFuture searchIssuesAsync(IssuesSearchRequest body) { + return searchIssuesWithHttpInfoAsync(body, new SearchIssuesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search error tracking issues. + * + *

See {@link #searchIssuesWithHttpInfo}. + * + * @param body Search issues request payload. (required) + * @param parameters Optional parameters for the request. + * @return IssuesSearchResponse + * @throws ApiException if fails to make API call + */ + public IssuesSearchResponse searchIssues( + IssuesSearchRequest body, SearchIssuesOptionalParameters parameters) throws ApiException { + return searchIssuesWithHttpInfo(body, parameters).getData(); + } + + /** + * Search error tracking issues. + * + *

See {@link #searchIssuesWithHttpInfoAsync}. + * + * @param body Search issues request payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IssuesSearchResponse> + */ + public CompletableFuture searchIssuesAsync( + IssuesSearchRequest body, SearchIssuesOptionalParameters parameters) { + return searchIssuesWithHttpInfoAsync(body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 per request. + * + * @param body Search issues request payload. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IssuesSearchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse searchIssuesWithHttpInfo( + IssuesSearchRequest body, SearchIssuesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling searchIssues"); + } + List include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/error-tracking/issues/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.searchIssues", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Search error tracking issues. + * + *

See {@link #searchIssuesWithHttpInfo}. + * + * @param body Search issues request payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IssuesSearchResponse>> + */ + public CompletableFuture> searchIssuesWithHttpInfoAsync( + IssuesSearchRequest body, SearchIssuesOptionalParameters parameters) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling searchIssues")); + return result; + } + List include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/error-tracking/issues/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.searchIssues", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update the assignee of an issue. + * + *

See {@link #updateIssueAssigneeWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue assignee request payload. (required) + * @return IssueResponse + * @throws ApiException if fails to make API call + */ + public IssueResponse updateIssueAssignee(String issueId, IssueUpdateAssigneeRequest body) + throws ApiException { + return updateIssueAssigneeWithHttpInfo(issueId, body).getData(); + } + + /** + * Update the assignee of an issue. + * + *

See {@link #updateIssueAssigneeWithHttpInfoAsync}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue assignee request payload. (required) + * @return CompletableFuture<IssueResponse> + */ + public CompletableFuture updateIssueAssigneeAsync( + String issueId, IssueUpdateAssigneeRequest body) { + return updateIssueAssigneeWithHttpInfoAsync(issueId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the assignee of an issue by issue_id. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue assignee request payload. (required) + * @return ApiResponse<IssueResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateIssueAssigneeWithHttpInfo( + String issueId, IssueUpdateAssigneeRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + throw new ApiException( + 400, "Missing the required parameter 'issueId' when calling updateIssueAssignee"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateIssueAssignee"); + } + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}/assignee" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.updateIssueAssignee", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update the assignee of an issue. + * + *

See {@link #updateIssueAssigneeWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue assignee request payload. (required) + * @return CompletableFuture<ApiResponse<IssueResponse>> + */ + public CompletableFuture> updateIssueAssigneeWithHttpInfoAsync( + String issueId, IssueUpdateAssigneeRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'issueId' when calling updateIssueAssignee")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateIssueAssignee")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}/assignee" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.updateIssueAssignee", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update the state of an issue. + * + *

See {@link #updateIssueStateWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue state request payload. (required) + * @return IssueResponse + * @throws ApiException if fails to make API call + */ + public IssueResponse updateIssueState(String issueId, IssueUpdateStateRequest body) + throws ApiException { + return updateIssueStateWithHttpInfo(issueId, body).getData(); + } + + /** + * Update the state of an issue. + * + *

See {@link #updateIssueStateWithHttpInfoAsync}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue state request payload. (required) + * @return CompletableFuture<IssueResponse> + */ + public CompletableFuture updateIssueStateAsync( + String issueId, IssueUpdateStateRequest body) { + return updateIssueStateWithHttpInfoAsync(issueId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the state of an issue by issue_id. Use this endpoint to move an issue + * between states such as OPEN, RESOLVED, or IGNORED. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue state request payload. (required) + * @return ApiResponse<IssueResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateIssueStateWithHttpInfo( + String issueId, IssueUpdateStateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + throw new ApiException( + 400, "Missing the required parameter 'issueId' when calling updateIssueState"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateIssueState"); + } + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}/state" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.updateIssueState", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update the state of an issue. + * + *

See {@link #updateIssueStateWithHttpInfo}. + * + * @param issueId The identifier of the issue. (required) + * @param body Update issue state request payload. (required) + * @return CompletableFuture<ApiResponse<IssueResponse>> + */ + public CompletableFuture> updateIssueStateWithHttpInfoAsync( + String issueId, IssueUpdateStateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'issueId' is set + if (issueId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'issueId' when calling updateIssueState")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateIssueState")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/error-tracking/issues/{issue_id}/state" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ErrorTrackingApi.updateIssueState", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetIssueIncludeQueryParameterItem.java b/src/main/java/com/datadog/api/client/v2/model/GetIssueIncludeQueryParameterItem.java new file mode 100644 index 00000000000..45b5e4765b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetIssueIncludeQueryParameterItem.java @@ -0,0 +1,62 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Relationship object that should be included in the response. */ +@JsonSerialize( + using = GetIssueIncludeQueryParameterItem.GetIssueIncludeQueryParameterItemSerializer.class) +public class GetIssueIncludeQueryParameterItem extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("assignee", "case", "team_owners")); + + public static final GetIssueIncludeQueryParameterItem ASSIGNEE = + new GetIssueIncludeQueryParameterItem("assignee"); + public static final GetIssueIncludeQueryParameterItem CASE = + new GetIssueIncludeQueryParameterItem("case"); + public static final GetIssueIncludeQueryParameterItem TEAM_OWNERS = + new GetIssueIncludeQueryParameterItem("team_owners"); + + GetIssueIncludeQueryParameterItem(String value) { + super(value, allowedValues); + } + + public static class GetIssueIncludeQueryParameterItemSerializer + extends StdSerializer { + public GetIssueIncludeQueryParameterItemSerializer(Class t) { + super(t); + } + + public GetIssueIncludeQueryParameterItemSerializer() { + this(null); + } + + @Override + public void serialize( + GetIssueIncludeQueryParameterItem value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GetIssueIncludeQueryParameterItem fromValue(String value) { + return new GetIssueIncludeQueryParameterItem(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Issue.java b/src/main/java/com/datadog/api/client/v2/model/Issue.java new file mode 100644 index 00000000000..0d2fcca76ae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Issue.java @@ -0,0 +1,236 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The issue matching the request. */ +@JsonPropertyOrder({ + Issue.JSON_PROPERTY_ATTRIBUTES, + Issue.JSON_PROPERTY_ID, + Issue.JSON_PROPERTY_RELATIONSHIPS, + Issue.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Issue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IssueRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueType type; + + public Issue() {} + + @JsonCreator + public Issue( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) IssueAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Issue attributes(IssueAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing the information of an issue. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueAttributes attributes) { + this.attributes = attributes; + } + + public Issue id(String id) { + this.id = id; + return this; + } + + /** + * Issue identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Issue relationships(IssueRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationship between the issue and an assignee, case and/or teams. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IssueRelationships relationships) { + this.relationships = relationships; + } + + public Issue type(IssueType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueType getType() { + return type; + } + + public void setType(IssueType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Issue + */ + @JsonAnySetter + public Issue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Issue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Issue issue = (Issue) o; + return Objects.equals(this.attributes, issue.attributes) + && Objects.equals(this.id, issue.id) + && Objects.equals(this.relationships, issue.relationships) + && Objects.equals(this.type, issue.type) + && Objects.equals(this.additionalProperties, issue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Issue {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueAssigneeRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IssueAssigneeRelationship.java new file mode 100644 index 00000000000..522b7dc3024 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueAssigneeRelationship.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship between the issue and assignee. */ +@JsonPropertyOrder({IssueAssigneeRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueAssigneeRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssueUserReference data; + + public IssueAssigneeRelationship() {} + + @JsonCreator + public IssueAssigneeRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IssueUserReference data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssueAssigneeRelationship data(IssueUserReference data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The user the issue is assigned to. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUserReference getData() { + return data; + } + + public void setData(IssueUserReference data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueAssigneeRelationship + */ + @JsonAnySetter + public IssueAssigneeRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueAssigneeRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueAssigneeRelationship issueAssigneeRelationship = (IssueAssigneeRelationship) o; + return Objects.equals(this.data, issueAssigneeRelationship.data) + && Objects.equals( + this.additionalProperties, issueAssigneeRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueAssigneeRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueAttributes.java new file mode 100644 index 00000000000..03c806dc43e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueAttributes.java @@ -0,0 +1,494 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Object containing the information of an issue. */ +@JsonPropertyOrder({ + IssueAttributes.JSON_PROPERTY_ERROR_MESSAGE, + IssueAttributes.JSON_PROPERTY_ERROR_TYPE, + IssueAttributes.JSON_PROPERTY_FILE_PATH, + IssueAttributes.JSON_PROPERTY_FIRST_SEEN, + IssueAttributes.JSON_PROPERTY_FIRST_SEEN_VERSION, + IssueAttributes.JSON_PROPERTY_FUNCTION_NAME, + IssueAttributes.JSON_PROPERTY_IS_CRASH, + IssueAttributes.JSON_PROPERTY_LANGUAGES, + IssueAttributes.JSON_PROPERTY_LAST_SEEN, + IssueAttributes.JSON_PROPERTY_LAST_SEEN_VERSION, + IssueAttributes.JSON_PROPERTY_PLATFORM, + IssueAttributes.JSON_PROPERTY_SERVICE, + IssueAttributes.JSON_PROPERTY_STATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message"; + private String errorMessage; + + public static final String JSON_PROPERTY_ERROR_TYPE = "error_type"; + private String errorType; + + public static final String JSON_PROPERTY_FILE_PATH = "file_path"; + private String filePath; + + public static final String JSON_PROPERTY_FIRST_SEEN = "first_seen"; + private Long firstSeen; + + public static final String JSON_PROPERTY_FIRST_SEEN_VERSION = "first_seen_version"; + private String firstSeenVersion; + + public static final String JSON_PROPERTY_FUNCTION_NAME = "function_name"; + private String functionName; + + public static final String JSON_PROPERTY_IS_CRASH = "is_crash"; + private Boolean isCrash; + + public static final String JSON_PROPERTY_LANGUAGES = "languages"; + private List languages = null; + + public static final String JSON_PROPERTY_LAST_SEEN = "last_seen"; + private Long lastSeen; + + public static final String JSON_PROPERTY_LAST_SEEN_VERSION = "last_seen_version"; + private String lastSeenVersion; + + public static final String JSON_PROPERTY_PLATFORM = "platform"; + private IssuePlatform platform; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_STATE = "state"; + private IssueState state; + + public IssueAttributes errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Error message associated with the issue. + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public IssueAttributes errorType(String errorType) { + this.errorType = errorType; + return this; + } + + /** + * Type of the error that matches the issue. + * + * @return errorType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorType() { + return errorType; + } + + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + public IssueAttributes filePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Path of the file where the issue occurred. + * + * @return filePath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public IssueAttributes firstSeen(Long firstSeen) { + this.firstSeen = firstSeen; + return this; + } + + /** + * Timestamp of the first seen error in milliseconds since the Unix epoch. + * + * @return firstSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstSeen() { + return firstSeen; + } + + public void setFirstSeen(Long firstSeen) { + this.firstSeen = firstSeen; + } + + public IssueAttributes firstSeenVersion(String firstSeenVersion) { + this.firstSeenVersion = firstSeenVersion; + return this; + } + + /** + * The application version (for example, git commit hash) where the issue was first observed. + * + * @return firstSeenVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstSeenVersion() { + return firstSeenVersion; + } + + public void setFirstSeenVersion(String firstSeenVersion) { + this.firstSeenVersion = firstSeenVersion; + } + + public IssueAttributes functionName(String functionName) { + this.functionName = functionName; + return this; + } + + /** + * Name of the function where the issue occurred. + * + * @return functionName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FUNCTION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFunctionName() { + return functionName; + } + + public void setFunctionName(String functionName) { + this.functionName = functionName; + } + + public IssueAttributes isCrash(Boolean isCrash) { + this.isCrash = isCrash; + return this; + } + + /** + * Error is a crash. + * + * @return isCrash + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CRASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsCrash() { + return isCrash; + } + + public void setIsCrash(Boolean isCrash) { + this.isCrash = isCrash; + } + + public IssueAttributes languages(List languages) { + this.languages = languages; + return this; + } + + public IssueAttributes addLanguagesItem(IssueLanguage languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + this.unparsed |= !languagesItem.isValid(); + return this; + } + + /** + * Array of programming languages associated with the issue. + * + * @return languages + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLanguages() { + return languages; + } + + public void setLanguages(List languages) { + this.languages = languages; + } + + public IssueAttributes lastSeen(Long lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Timestamp of the last seen error in milliseconds since the Unix epoch. + * + * @return lastSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLastSeen() { + return lastSeen; + } + + public void setLastSeen(Long lastSeen) { + this.lastSeen = lastSeen; + } + + public IssueAttributes lastSeenVersion(String lastSeenVersion) { + this.lastSeenVersion = lastSeenVersion; + return this; + } + + /** + * The application version (for example, git commit hash) where the issue was last observed. + * + * @return lastSeenVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastSeenVersion() { + return lastSeenVersion; + } + + public void setLastSeenVersion(String lastSeenVersion) { + this.lastSeenVersion = lastSeenVersion; + } + + public IssueAttributes platform(IssuePlatform platform) { + this.platform = platform; + this.unparsed |= !platform.isValid(); + return this; + } + + /** + * Platform associated with the issue. + * + * @return platform + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuePlatform getPlatform() { + return platform; + } + + public void setPlatform(IssuePlatform platform) { + if (!platform.isValid()) { + this.unparsed = true; + } + this.platform = platform; + } + + public IssueAttributes service(String service) { + this.service = service; + return this; + } + + /** + * Service name. + * + * @return service + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public IssueAttributes state(IssueState state) { + this.state = state; + this.unparsed |= !state.isValid(); + return this; + } + + /** + * State of the issue + * + * @return state + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueState getState() { + return state; + } + + public void setState(IssueState state) { + if (!state.isValid()) { + this.unparsed = true; + } + this.state = state; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueAttributes + */ + @JsonAnySetter + public IssueAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueAttributes issueAttributes = (IssueAttributes) o; + return Objects.equals(this.errorMessage, issueAttributes.errorMessage) + && Objects.equals(this.errorType, issueAttributes.errorType) + && Objects.equals(this.filePath, issueAttributes.filePath) + && Objects.equals(this.firstSeen, issueAttributes.firstSeen) + && Objects.equals(this.firstSeenVersion, issueAttributes.firstSeenVersion) + && Objects.equals(this.functionName, issueAttributes.functionName) + && Objects.equals(this.isCrash, issueAttributes.isCrash) + && Objects.equals(this.languages, issueAttributes.languages) + && Objects.equals(this.lastSeen, issueAttributes.lastSeen) + && Objects.equals(this.lastSeenVersion, issueAttributes.lastSeenVersion) + && Objects.equals(this.platform, issueAttributes.platform) + && Objects.equals(this.service, issueAttributes.service) + && Objects.equals(this.state, issueAttributes.state) + && Objects.equals(this.additionalProperties, issueAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + errorMessage, + errorType, + filePath, + firstSeen, + firstSeenVersion, + functionName, + isCrash, + languages, + lastSeen, + lastSeenVersion, + platform, + service, + state, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueAttributes {\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" firstSeen: ").append(toIndentedString(firstSeen)).append("\n"); + sb.append(" firstSeenVersion: ").append(toIndentedString(firstSeenVersion)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" isCrash: ").append(toIndentedString(isCrash)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" lastSeen: ").append(toIndentedString(lastSeen)).append("\n"); + sb.append(" lastSeenVersion: ").append(toIndentedString(lastSeenVersion)).append("\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCase.java b/src/main/java/com/datadog/api/client/v2/model/IssueCase.java new file mode 100644 index 00000000000..3d00d3db863 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCase.java @@ -0,0 +1,237 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The case attached to the issue. */ +@JsonPropertyOrder({ + IssueCase.JSON_PROPERTY_ATTRIBUTES, + IssueCase.JSON_PROPERTY_ID, + IssueCase.JSON_PROPERTY_RELATIONSHIPS, + IssueCase.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCase { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueCaseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IssueCaseRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueCaseResourceType type; + + public IssueCase() {} + + @JsonCreator + public IssueCase( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssueCaseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueCaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueCase attributes(IssueCaseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing the information of a case. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueCaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueCaseAttributes attributes) { + this.attributes = attributes; + } + + public IssueCase id(String id) { + this.id = id; + return this; + } + + /** + * Case identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueCase relationships(IssueCaseRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to a case. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueCaseRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IssueCaseRelationships relationships) { + this.relationships = relationships; + } + + public IssueCase type(IssueCaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueCaseResourceType getType() { + return type; + } + + public void setType(IssueCaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCase + */ + @JsonAnySetter + public IssueCase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCase issueCase = (IssueCase) o; + return Objects.equals(this.attributes, issueCase.attributes) + && Objects.equals(this.id, issueCase.id) + && Objects.equals(this.relationships, issueCase.relationships) + && Objects.equals(this.type, issueCase.type) + && Objects.equals(this.additionalProperties, issueCase.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCase {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseAttributes.java new file mode 100644 index 00000000000..59e733ce5cb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseAttributes.java @@ -0,0 +1,527 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Object containing the information of a case. */ +@JsonPropertyOrder({ + IssueCaseAttributes.JSON_PROPERTY_ARCHIVED_AT, + IssueCaseAttributes.JSON_PROPERTY_CLOSED_AT, + IssueCaseAttributes.JSON_PROPERTY_CREATED_AT, + IssueCaseAttributes.JSON_PROPERTY_CREATION_SOURCE, + IssueCaseAttributes.JSON_PROPERTY_DESCRIPTION, + IssueCaseAttributes.JSON_PROPERTY_DUE_DATE, + IssueCaseAttributes.JSON_PROPERTY_INSIGHTS, + IssueCaseAttributes.JSON_PROPERTY_JIRA_ISSUE, + IssueCaseAttributes.JSON_PROPERTY_KEY, + IssueCaseAttributes.JSON_PROPERTY_MODIFIED_AT, + IssueCaseAttributes.JSON_PROPERTY_PRIORITY, + IssueCaseAttributes.JSON_PROPERTY_STATUS, + IssueCaseAttributes.JSON_PROPERTY_TITLE, + IssueCaseAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARCHIVED_AT = "archived_at"; + private OffsetDateTime archivedAt; + + public static final String JSON_PROPERTY_CLOSED_AT = "closed_at"; + private OffsetDateTime closedAt; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATION_SOURCE = "creation_source"; + private String creationSource; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private String dueDate; + + public static final String JSON_PROPERTY_INSIGHTS = "insights"; + private List insights = null; + + public static final String JSON_PROPERTY_JIRA_ISSUE = "jira_issue"; + private IssueCaseJiraIssue jiraIssue; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CaseStatus status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IssueCaseAttributes archivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + return this; + } + + /** + * Timestamp of when the case was archived. + * + * @return archivedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getArchivedAt() { + return archivedAt; + } + + public void setArchivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + } + + public IssueCaseAttributes closedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + return this; + } + + /** + * Timestamp of when the case was closed. + * + * @return closedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getClosedAt() { + return closedAt; + } + + public void setClosedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + } + + public IssueCaseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp of when the case was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public IssueCaseAttributes creationSource(String creationSource) { + this.creationSource = creationSource; + return this; + } + + /** + * Source of the case creation. + * + * @return creationSource + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATION_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreationSource() { + return creationSource; + } + + public void setCreationSource(String creationSource) { + this.creationSource = creationSource; + } + + public IssueCaseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the case. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public IssueCaseAttributes dueDate(String dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * Due date of the case. + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDueDate() { + return dueDate; + } + + public void setDueDate(String dueDate) { + this.dueDate = dueDate; + } + + public IssueCaseAttributes insights(List insights) { + this.insights = insights; + for (IssueCaseInsight item : insights) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssueCaseAttributes addInsightsItem(IssueCaseInsight insightsItem) { + if (this.insights == null) { + this.insights = new ArrayList<>(); + } + this.insights.add(insightsItem); + this.unparsed |= insightsItem.unparsed; + return this; + } + + /** + * Insights of the case. + * + * @return insights + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSIGHTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInsights() { + return insights; + } + + public void setInsights(List insights) { + this.insights = insights; + } + + public IssueCaseAttributes jiraIssue(IssueCaseJiraIssue jiraIssue) { + this.jiraIssue = jiraIssue; + this.unparsed |= jiraIssue.unparsed; + return this; + } + + /** + * Jira issue of the case. + * + * @return jiraIssue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueCaseJiraIssue getJiraIssue() { + return jiraIssue; + } + + public void setJiraIssue(IssueCaseJiraIssue jiraIssue) { + this.jiraIssue = jiraIssue; + } + + public IssueCaseAttributes key(String key) { + this.key = key; + return this; + } + + /** + * Key of the case. + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public IssueCaseAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp of when the case was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public IssueCaseAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + public IssueCaseAttributes status(CaseStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Case status + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseStatus getStatus() { + return status; + } + + public void setStatus(CaseStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public IssueCaseAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title of the case. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public IssueCaseAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Type of the case. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseAttributes + */ + @JsonAnySetter + public IssueCaseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseAttributes issueCaseAttributes = (IssueCaseAttributes) o; + return Objects.equals(this.archivedAt, issueCaseAttributes.archivedAt) + && Objects.equals(this.closedAt, issueCaseAttributes.closedAt) + && Objects.equals(this.createdAt, issueCaseAttributes.createdAt) + && Objects.equals(this.creationSource, issueCaseAttributes.creationSource) + && Objects.equals(this.description, issueCaseAttributes.description) + && Objects.equals(this.dueDate, issueCaseAttributes.dueDate) + && Objects.equals(this.insights, issueCaseAttributes.insights) + && Objects.equals(this.jiraIssue, issueCaseAttributes.jiraIssue) + && Objects.equals(this.key, issueCaseAttributes.key) + && Objects.equals(this.modifiedAt, issueCaseAttributes.modifiedAt) + && Objects.equals(this.priority, issueCaseAttributes.priority) + && Objects.equals(this.status, issueCaseAttributes.status) + && Objects.equals(this.title, issueCaseAttributes.title) + && Objects.equals(this.type, issueCaseAttributes.type) + && Objects.equals(this.additionalProperties, issueCaseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + archivedAt, + closedAt, + createdAt, + creationSource, + description, + dueDate, + insights, + jiraIssue, + key, + modifiedAt, + priority, + status, + title, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseAttributes {\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" creationSource: ").append(toIndentedString(creationSource)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" insights: ").append(toIndentedString(insights)).append("\n"); + sb.append(" jiraIssue: ").append(toIndentedString(jiraIssue)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseInsight.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseInsight.java new file mode 100644 index 00000000000..95b38c08f9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseInsight.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Insight of the case. */ +@JsonPropertyOrder({ + IssueCaseInsight.JSON_PROPERTY_REF, + IssueCaseInsight.JSON_PROPERTY_RESOURCE_ID, + IssueCaseInsight.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseInsight { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REF = "ref"; + private String ref; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IssueCaseInsight ref(String ref) { + this.ref = ref; + return this; + } + + /** + * Reference of the insight. + * + * @return ref + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public IssueCaseInsight resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Insight identifier. + * + * @return resourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public IssueCaseInsight type(String type) { + this.type = type; + return this; + } + + /** + * Type of the insight. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseInsight + */ + @JsonAnySetter + public IssueCaseInsight putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseInsight object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseInsight issueCaseInsight = (IssueCaseInsight) o; + return Objects.equals(this.ref, issueCaseInsight.ref) + && Objects.equals(this.resourceId, issueCaseInsight.resourceId) + && Objects.equals(this.type, issueCaseInsight.type) + && Objects.equals(this.additionalProperties, issueCaseInsight.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ref, resourceId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseInsight {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssue.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssue.java new file mode 100644 index 00000000000..2bed92ad4f0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssue.java @@ -0,0 +1,165 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue of the case. */ +@JsonPropertyOrder({ + IssueCaseJiraIssue.JSON_PROPERTY_RESULT, + IssueCaseJiraIssue.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseJiraIssue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESULT = "result"; + private IssueCaseJiraIssueResult result; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public IssueCaseJiraIssue result(IssueCaseJiraIssueResult result) { + this.result = result; + this.unparsed |= result.unparsed; + return this; + } + + /** + * Contains the identifiers and URL for a successfully created Jira issue. + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueCaseJiraIssueResult getResult() { + return result; + } + + public void setResult(IssueCaseJiraIssueResult result) { + this.result = result; + } + + public IssueCaseJiraIssue status(String status) { + this.status = status; + return this; + } + + /** + * Creation status of the Jira issue. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseJiraIssue + */ + @JsonAnySetter + public IssueCaseJiraIssue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseJiraIssue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseJiraIssue issueCaseJiraIssue = (IssueCaseJiraIssue) o; + return Objects.equals(this.result, issueCaseJiraIssue.result) + && Objects.equals(this.status, issueCaseJiraIssue.status) + && Objects.equals(this.additionalProperties, issueCaseJiraIssue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(result, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseJiraIssue {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssueResult.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssueResult.java new file mode 100644 index 00000000000..9a121c4e4d9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseJiraIssueResult.java @@ -0,0 +1,218 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Contains the identifiers and URL for a successfully created Jira issue. */ +@JsonPropertyOrder({ + IssueCaseJiraIssueResult.JSON_PROPERTY_ISSUE_ID, + IssueCaseJiraIssueResult.JSON_PROPERTY_ISSUE_KEY, + IssueCaseJiraIssueResult.JSON_PROPERTY_ISSUE_URL, + IssueCaseJiraIssueResult.JSON_PROPERTY_PROJECT_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseJiraIssueResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ISSUE_ID = "issue_id"; + private String issueId; + + public static final String JSON_PROPERTY_ISSUE_KEY = "issue_key"; + private String issueKey; + + public static final String JSON_PROPERTY_ISSUE_URL = "issue_url"; + private String issueUrl; + + public static final String JSON_PROPERTY_PROJECT_KEY = "project_key"; + private String projectKey; + + public IssueCaseJiraIssueResult issueId(String issueId) { + this.issueId = issueId; + return this; + } + + /** + * Jira issue identifier. + * + * @return issueId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueId() { + return issueId; + } + + public void setIssueId(String issueId) { + this.issueId = issueId; + } + + public IssueCaseJiraIssueResult issueKey(String issueKey) { + this.issueKey = issueKey; + return this; + } + + /** + * Jira issue key. + * + * @return issueKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueKey() { + return issueKey; + } + + public void setIssueKey(String issueKey) { + this.issueKey = issueKey; + } + + public IssueCaseJiraIssueResult issueUrl(String issueUrl) { + this.issueUrl = issueUrl; + return this; + } + + /** + * Jira issue URL. + * + * @return issueUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueUrl() { + return issueUrl; + } + + public void setIssueUrl(String issueUrl) { + this.issueUrl = issueUrl; + } + + public IssueCaseJiraIssueResult projectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + + /** + * Jira project key. + * + * @return projectKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectKey() { + return projectKey; + } + + public void setProjectKey(String projectKey) { + this.projectKey = projectKey; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseJiraIssueResult + */ + @JsonAnySetter + public IssueCaseJiraIssueResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseJiraIssueResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseJiraIssueResult issueCaseJiraIssueResult = (IssueCaseJiraIssueResult) o; + return Objects.equals(this.issueId, issueCaseJiraIssueResult.issueId) + && Objects.equals(this.issueKey, issueCaseJiraIssueResult.issueKey) + && Objects.equals(this.issueUrl, issueCaseJiraIssueResult.issueUrl) + && Objects.equals(this.projectKey, issueCaseJiraIssueResult.projectKey) + && Objects.equals(this.additionalProperties, issueCaseJiraIssueResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issueId, issueKey, issueUrl, projectKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseJiraIssueResult {\n"); + sb.append(" issueId: ").append(toIndentedString(issueId)).append("\n"); + sb.append(" issueKey: ").append(toIndentedString(issueKey)).append("\n"); + sb.append(" issueUrl: ").append(toIndentedString(issueUrl)).append("\n"); + sb.append(" projectKey: ").append(toIndentedString(projectKey)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseReference.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseReference.java new file mode 100644 index 00000000000..cd1b3e0e394 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseReference.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The case the issue is attached to. */ +@JsonPropertyOrder({IssueCaseReference.JSON_PROPERTY_ID, IssueCaseReference.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueCaseResourceType type; + + public IssueCaseReference() {} + + @JsonCreator + public IssueCaseReference( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueCaseResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueCaseReference id(String id) { + this.id = id; + return this; + } + + /** + * Case identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueCaseReference type(IssueCaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueCaseResourceType getType() { + return type; + } + + public void setType(IssueCaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseReference + */ + @JsonAnySetter + public IssueCaseReference putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseReference issueCaseReference = (IssueCaseReference) o; + return Objects.equals(this.id, issueCaseReference.id) + && Objects.equals(this.type, issueCaseReference.type) + && Objects.equals(this.additionalProperties, issueCaseReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationship.java new file mode 100644 index 00000000000..667d35a8f9e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationship.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship between the issue and case. */ +@JsonPropertyOrder({IssueCaseRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssueCaseReference data; + + public IssueCaseRelationship() {} + + @JsonCreator + public IssueCaseRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IssueCaseReference data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssueCaseRelationship data(IssueCaseReference data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The case the issue is attached to. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueCaseReference getData() { + return data; + } + + public void setData(IssueCaseReference data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseRelationship + */ + @JsonAnySetter + public IssueCaseRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseRelationship issueCaseRelationship = (IssueCaseRelationship) o; + return Objects.equals(this.data, issueCaseRelationship.data) + && Objects.equals(this.additionalProperties, issueCaseRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationships.java new file mode 100644 index 00000000000..c6f7a39deb0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseRelationships.java @@ -0,0 +1,253 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Resources related to a case. */ +@JsonPropertyOrder({ + IssueCaseRelationships.JSON_PROPERTY_ASSIGNEE, + IssueCaseRelationships.JSON_PROPERTY_CREATED_BY, + IssueCaseRelationships.JSON_PROPERTY_MODIFIED_BY, + IssueCaseRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueCaseRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE = "assignee"; + private JsonNullable assignee = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private JsonNullable createdBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private JsonNullable modifiedBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PROJECT = "project"; + private ProjectRelationship project; + + public IssueCaseRelationships assignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + return this; + } + + /** + * Relationship to user. + * + * @return assignee + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getAssignee() { + return assignee.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAssignee_JsonNullable() { + return assignee; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + public void setAssignee_JsonNullable(JsonNullable assignee) { + this.assignee = assignee; + } + + public void setAssignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + } + + public IssueCaseRelationships createdBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + return this; + } + + /** + * Relationship to user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getCreatedBy() { + return createdBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCreatedBy_JsonNullable() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + public void setCreatedBy_JsonNullable(JsonNullable createdBy) { + this.createdBy = createdBy; + } + + public void setCreatedBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + } + + public IssueCaseRelationships modifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + return this; + } + + /** + * Relationship to user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getModifiedBy() { + return modifiedBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedBy_JsonNullable() { + return modifiedBy; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + public void setModifiedBy_JsonNullable(JsonNullable modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public void setModifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + } + + public IssueCaseRelationships project(ProjectRelationship project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Relationship to project + * + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectRelationship getProject() { + return project; + } + + public void setProject(ProjectRelationship project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueCaseRelationships + */ + @JsonAnySetter + public IssueCaseRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueCaseRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueCaseRelationships issueCaseRelationships = (IssueCaseRelationships) o; + return Objects.equals(this.assignee, issueCaseRelationships.assignee) + && Objects.equals(this.createdBy, issueCaseRelationships.createdBy) + && Objects.equals(this.modifiedBy, issueCaseRelationships.modifiedBy) + && Objects.equals(this.project, issueCaseRelationships.project) + && Objects.equals(this.additionalProperties, issueCaseRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assignee, createdBy, modifiedBy, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueCaseRelationships {\n"); + sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueCaseResourceType.java b/src/main/java/com/datadog/api/client/v2/model/IssueCaseResourceType.java new file mode 100644 index 00000000000..2619a05db74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueCaseResourceType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize(using = IssueCaseResourceType.IssueCaseResourceTypeSerializer.class) +public class IssueCaseResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("case")); + + public static final IssueCaseResourceType CASE = new IssueCaseResourceType("case"); + + IssueCaseResourceType(String value) { + super(value, allowedValues); + } + + public static class IssueCaseResourceTypeSerializer extends StdSerializer { + public IssueCaseResourceTypeSerializer(Class t) { + super(t); + } + + public IssueCaseResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssueCaseResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueCaseResourceType fromValue(String value) { + return new IssueCaseResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueIncluded.java b/src/main/java/com/datadog/api/client/v2/model/IssueIncluded.java new file mode 100644 index 00000000000..d904676758c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueIncluded.java @@ -0,0 +1,332 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = IssueIncluded.IssueIncludedDeserializer.class) +@JsonSerialize(using = IssueIncluded.IssueIncludedSerializer.class) +public class IssueIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IssueIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class IssueIncludedSerializer extends StdSerializer { + public IssueIncludedSerializer(Class t) { + super(t); + } + + public IssueIncludedSerializer() { + this(null); + } + + @Override + public void serialize(IssueIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class IssueIncludedDeserializer extends StdDeserializer { + public IssueIncludedDeserializer() { + this(IssueIncluded.class); + } + + public IssueIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public IssueIncluded deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize IssueCase + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IssueCase.class.equals(Integer.class) + || IssueCase.class.equals(Long.class) + || IssueCase.class.equals(Float.class) + || IssueCase.class.equals(Double.class) + || IssueCase.class.equals(Boolean.class) + || IssueCase.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IssueCase.class.equals(Integer.class) || IssueCase.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IssueCase.class.equals(Float.class) || IssueCase.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IssueCase.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IssueCase.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IssueCase.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IssueCase) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IssueCase'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IssueCase'", e); + } + + // deserialize IssueUser + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IssueUser.class.equals(Integer.class) + || IssueUser.class.equals(Long.class) + || IssueUser.class.equals(Float.class) + || IssueUser.class.equals(Double.class) + || IssueUser.class.equals(Boolean.class) + || IssueUser.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IssueUser.class.equals(Integer.class) || IssueUser.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IssueUser.class.equals(Float.class) || IssueUser.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IssueUser.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IssueUser.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IssueUser.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IssueUser) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IssueUser'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IssueUser'", e); + } + + // deserialize IssueTeam + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IssueTeam.class.equals(Integer.class) + || IssueTeam.class.equals(Long.class) + || IssueTeam.class.equals(Float.class) + || IssueTeam.class.equals(Double.class) + || IssueTeam.class.equals(Boolean.class) + || IssueTeam.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IssueTeam.class.equals(Integer.class) || IssueTeam.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IssueTeam.class.equals(Float.class) || IssueTeam.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IssueTeam.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IssueTeam.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IssueTeam.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IssueTeam) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IssueTeam'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IssueTeam'", e); + } + + IssueIncluded ret = new IssueIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public IssueIncluded getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "IssueIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IssueIncluded() { + super("oneOf", Boolean.FALSE); + } + + public IssueIncluded(IssueCase o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IssueIncluded(IssueUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IssueIncluded(IssueTeam o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IssueCase", new GenericType() {}); + schemas.put("IssueUser", new GenericType() {}); + schemas.put("IssueTeam", new GenericType() {}); + JSON.registerDescendants(IssueIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return IssueIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IssueCase, IssueUser, IssueTeam + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(IssueCase.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IssueUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IssueTeam.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be IssueCase, IssueUser, IssueTeam"); + } + + /** + * Get the actual instance, which can be the following: IssueCase, IssueUser, IssueTeam + * + * @return The actual instance (IssueCase, IssueUser, IssueTeam) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IssueCase`. If the actual instance is not `IssueCase`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `IssueCase` + * @throws ClassCastException if the instance is not `IssueCase` + */ + public IssueCase getIssueCase() throws ClassCastException { + return (IssueCase) super.getActualInstance(); + } + + /** + * Get the actual instance of `IssueUser`. If the actual instance is not `IssueUser`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `IssueUser` + * @throws ClassCastException if the instance is not `IssueUser` + */ + public IssueUser getIssueUser() throws ClassCastException { + return (IssueUser) super.getActualInstance(); + } + + /** + * Get the actual instance of `IssueTeam`. If the actual instance is not `IssueTeam`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `IssueTeam` + * @throws ClassCastException if the instance is not `IssueTeam` + */ + public IssueTeam getIssueTeam() throws ClassCastException { + return (IssueTeam) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueLanguage.java b/src/main/java/com/datadog/api/client/v2/model/IssueLanguage.java new file mode 100644 index 00000000000..a946bb37eab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueLanguage.java @@ -0,0 +1,108 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Programming language associated with the issue. */ +@JsonSerialize(using = IssueLanguage.IssueLanguageSerializer.class) +public class IssueLanguage extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "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")); + + public static final IssueLanguage BRIGHTSCRIPT = new IssueLanguage("BRIGHTSCRIPT"); + public static final IssueLanguage C = new IssueLanguage("C"); + public static final IssueLanguage C_PLUS_PLUS = new IssueLanguage("C_PLUS_PLUS"); + public static final IssueLanguage C_SHARP = new IssueLanguage("C_SHARP"); + public static final IssueLanguage CLOJURE = new IssueLanguage("CLOJURE"); + public static final IssueLanguage DOT_NET = new IssueLanguage("DOT_NET"); + public static final IssueLanguage ELIXIR = new IssueLanguage("ELIXIR"); + public static final IssueLanguage ERLANG = new IssueLanguage("ERLANG"); + public static final IssueLanguage GO = new IssueLanguage("GO"); + public static final IssueLanguage GROOVY = new IssueLanguage("GROOVY"); + public static final IssueLanguage HASKELL = new IssueLanguage("HASKELL"); + public static final IssueLanguage HCL = new IssueLanguage("HCL"); + public static final IssueLanguage JAVA = new IssueLanguage("JAVA"); + public static final IssueLanguage JAVASCRIPT = new IssueLanguage("JAVASCRIPT"); + public static final IssueLanguage JVM = new IssueLanguage("JVM"); + public static final IssueLanguage KOTLIN = new IssueLanguage("KOTLIN"); + public static final IssueLanguage OBJECTIVE_C = new IssueLanguage("OBJECTIVE_C"); + public static final IssueLanguage PERL = new IssueLanguage("PERL"); + public static final IssueLanguage PHP = new IssueLanguage("PHP"); + public static final IssueLanguage PYTHON = new IssueLanguage("PYTHON"); + public static final IssueLanguage RUBY = new IssueLanguage("RUBY"); + public static final IssueLanguage RUST = new IssueLanguage("RUST"); + public static final IssueLanguage SCALA = new IssueLanguage("SCALA"); + public static final IssueLanguage SWIFT = new IssueLanguage("SWIFT"); + public static final IssueLanguage TERRAFORM = new IssueLanguage("TERRAFORM"); + public static final IssueLanguage TYPESCRIPT = new IssueLanguage("TYPESCRIPT"); + public static final IssueLanguage UNKNOWN = new IssueLanguage("UNKNOWN"); + + IssueLanguage(String value) { + super(value, allowedValues); + } + + public static class IssueLanguageSerializer extends StdSerializer { + public IssueLanguageSerializer(Class t) { + super(t); + } + + public IssueLanguageSerializer() { + this(null); + } + + @Override + public void serialize(IssueLanguage value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueLanguage fromValue(String value) { + return new IssueLanguage(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuePlatform.java b/src/main/java/com/datadog/api/client/v2/model/IssuePlatform.java new file mode 100644 index 00000000000..853d35f1355 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuePlatform.java @@ -0,0 +1,70 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Platform associated with the issue. */ +@JsonSerialize(using = IssuePlatform.IssuePlatformSerializer.class) +public class IssuePlatform extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "ANDROID", + "BACKEND", + "BROWSER", + "FLUTTER", + "IOS", + "REACT_NATIVE", + "ROKU", + "UNKNOWN")); + + public static final IssuePlatform ANDROID = new IssuePlatform("ANDROID"); + public static final IssuePlatform BACKEND = new IssuePlatform("BACKEND"); + public static final IssuePlatform BROWSER = new IssuePlatform("BROWSER"); + public static final IssuePlatform FLUTTER = new IssuePlatform("FLUTTER"); + public static final IssuePlatform IOS = new IssuePlatform("IOS"); + public static final IssuePlatform REACT_NATIVE = new IssuePlatform("REACT_NATIVE"); + public static final IssuePlatform ROKU = new IssuePlatform("ROKU"); + public static final IssuePlatform UNKNOWN = new IssuePlatform("UNKNOWN"); + + IssuePlatform(String value) { + super(value, allowedValues); + } + + public static class IssuePlatformSerializer extends StdSerializer { + public IssuePlatformSerializer(Class t) { + super(t); + } + + public IssuePlatformSerializer() { + this(null); + } + + @Override + public void serialize(IssuePlatform value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuePlatform fromValue(String value) { + return new IssuePlatform(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueReference.java b/src/main/java/com/datadog/api/client/v2/model/IssueReference.java new file mode 100644 index 00000000000..594c6b8290f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueReference.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The issue the search result corresponds to. */ +@JsonPropertyOrder({IssueReference.JSON_PROPERTY_ID, IssueReference.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueType type; + + public IssueReference() {} + + @JsonCreator + public IssueReference( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueReference id(String id) { + this.id = id; + return this; + } + + /** + * Issue identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueReference type(IssueType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueType getType() { + return type; + } + + public void setType(IssueType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueReference + */ + @JsonAnySetter + public IssueReference putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueReference issueReference = (IssueReference) o; + return Objects.equals(this.id, issueReference.id) + && Objects.equals(this.type, issueReference.type) + && Objects.equals(this.additionalProperties, issueReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IssueRelationships.java new file mode 100644 index 00000000000..422c969d774 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueRelationships.java @@ -0,0 +1,194 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship between the issue and an assignee, case and/or teams. */ +@JsonPropertyOrder({ + IssueRelationships.JSON_PROPERTY_ASSIGNEE, + IssueRelationships.JSON_PROPERTY_CASE, + IssueRelationships.JSON_PROPERTY_TEAM_OWNERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE = "assignee"; + private IssueAssigneeRelationship assignee; + + public static final String JSON_PROPERTY_CASE = "case"; + private IssueCaseRelationship _case; + + public static final String JSON_PROPERTY_TEAM_OWNERS = "team_owners"; + private IssueTeamOwnersRelationship teamOwners; + + public IssueRelationships assignee(IssueAssigneeRelationship assignee) { + this.assignee = assignee; + this.unparsed |= assignee.unparsed; + return this; + } + + /** + * Relationship between the issue and assignee. + * + * @return assignee + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueAssigneeRelationship getAssignee() { + return assignee; + } + + public void setAssignee(IssueAssigneeRelationship assignee) { + this.assignee = assignee; + } + + public IssueRelationships _case(IssueCaseRelationship _case) { + this._case = _case; + this.unparsed |= _case.unparsed; + return this; + } + + /** + * Relationship between the issue and case. + * + * @return _case + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueCaseRelationship getCase() { + return _case; + } + + public void setCase(IssueCaseRelationship _case) { + this._case = _case; + } + + public IssueRelationships teamOwners(IssueTeamOwnersRelationship teamOwners) { + this.teamOwners = teamOwners; + this.unparsed |= teamOwners.unparsed; + return this; + } + + /** + * Relationship between the issue and teams. + * + * @return teamOwners + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_OWNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssueTeamOwnersRelationship getTeamOwners() { + return teamOwners; + } + + public void setTeamOwners(IssueTeamOwnersRelationship teamOwners) { + this.teamOwners = teamOwners; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueRelationships + */ + @JsonAnySetter + public IssueRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueRelationships issueRelationships = (IssueRelationships) o; + return Objects.equals(this.assignee, issueRelationships.assignee) + && Objects.equals(this._case, issueRelationships._case) + && Objects.equals(this.teamOwners, issueRelationships.teamOwners) + && Objects.equals(this.additionalProperties, issueRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assignee, _case, teamOwners, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueRelationships {\n"); + sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); + sb.append(" _case: ").append(toIndentedString(_case)).append("\n"); + sb.append(" teamOwners: ").append(toIndentedString(teamOwners)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueResponse.java b/src/main/java/com/datadog/api/client/v2/model/IssueResponse.java new file mode 100644 index 00000000000..784a7c6cc8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueResponse.java @@ -0,0 +1,176 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing error tracking issue data. */ +@JsonPropertyOrder({IssueResponse.JSON_PROPERTY_DATA, IssueResponse.JSON_PROPERTY_INCLUDED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private Issue data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IssueResponse data(Issue data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The issue matching the request. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Issue getData() { + return data; + } + + public void setData(Issue data) { + this.data = data; + } + + public IssueResponse included(List included) { + this.included = included; + for (IssueIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssueResponse addIncludedItem(IssueIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Array of resources related to the issue. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueResponse + */ + @JsonAnySetter + public IssueResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueResponse issueResponse = (IssueResponse) o; + return Objects.equals(this.data, issueResponse.data) + && Objects.equals(this.included, issueResponse.included) + && Objects.equals(this.additionalProperties, issueResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueState.java b/src/main/java/com/datadog/api/client/v2/model/IssueState.java new file mode 100644 index 00000000000..3687dde421d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueState.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** State of the issue */ +@JsonSerialize(using = IssueState.IssueStateSerializer.class) +public class IssueState extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("OPEN", "ACKNOWLEDGED", "RESOLVED", "IGNORED", "EXCLUDED")); + + public static final IssueState OPEN = new IssueState("OPEN"); + public static final IssueState ACKNOWLEDGED = new IssueState("ACKNOWLEDGED"); + public static final IssueState RESOLVED = new IssueState("RESOLVED"); + public static final IssueState IGNORED = new IssueState("IGNORED"); + public static final IssueState EXCLUDED = new IssueState("EXCLUDED"); + + IssueState(String value) { + super(value, allowedValues); + } + + public static class IssueStateSerializer extends StdSerializer { + public IssueStateSerializer(Class t) { + super(t); + } + + public IssueStateSerializer() { + this(null); + } + + @Override + public void serialize(IssueState value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueState fromValue(String value) { + return new IssueState(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueTeam.java b/src/main/java/com/datadog/api/client/v2/model/IssueTeam.java new file mode 100644 index 00000000000..90e6b27e362 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueTeam.java @@ -0,0 +1,209 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A team that owns an issue. */ +@JsonPropertyOrder({ + IssueTeam.JSON_PROPERTY_ATTRIBUTES, + IssueTeam.JSON_PROPERTY_ID, + IssueTeam.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueTeam { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueTeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueTeamType type; + + public IssueTeam() {} + + @JsonCreator + public IssueTeam( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssueTeamAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueTeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueTeam attributes(IssueTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing the information of a team. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueTeamAttributes attributes) { + this.attributes = attributes; + } + + public IssueTeam id(String id) { + this.id = id; + return this; + } + + /** + * Team identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueTeam type(IssueTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueTeamType getType() { + return type; + } + + public void setType(IssueTeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueTeam + */ + @JsonAnySetter + public IssueTeam putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueTeam object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueTeam issueTeam = (IssueTeam) o; + return Objects.equals(this.attributes, issueTeam.attributes) + && Objects.equals(this.id, issueTeam.id) + && Objects.equals(this.type, issueTeam.type) + && Objects.equals(this.additionalProperties, issueTeam.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueTeam {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueTeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueTeamAttributes.java new file mode 100644 index 00000000000..04f2dd866b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueTeamAttributes.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object containing the information of a team. */ +@JsonPropertyOrder({ + IssueTeamAttributes.JSON_PROPERTY_HANDLE, + IssueTeamAttributes.JSON_PROPERTY_NAME, + IssueTeamAttributes.JSON_PROPERTY_SUMMARY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueTeamAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public IssueTeamAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The team's identifier. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public IssueTeamAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the team. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IssueTeamAttributes summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A brief summary of the team, derived from its description. + * + * @return summary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueTeamAttributes + */ + @JsonAnySetter + public IssueTeamAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueTeamAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueTeamAttributes issueTeamAttributes = (IssueTeamAttributes) o; + return Objects.equals(this.handle, issueTeamAttributes.handle) + && Objects.equals(this.name, issueTeamAttributes.name) + && Objects.equals(this.summary, issueTeamAttributes.summary) + && Objects.equals(this.additionalProperties, issueTeamAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, summary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueTeamAttributes {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueTeamOwnersRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IssueTeamOwnersRelationship.java new file mode 100644 index 00000000000..00bcd245a77 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueTeamOwnersRelationship.java @@ -0,0 +1,155 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Relationship between the issue and teams. */ +@JsonPropertyOrder({IssueTeamOwnersRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueTeamOwnersRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public IssueTeamOwnersRelationship() {} + + @JsonCreator + public IssueTeamOwnersRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public IssueTeamOwnersRelationship data(List data) { + this.data = data; + for (IssueTeamReference item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssueTeamOwnersRelationship addDataItem(IssueTeamReference dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of teams that are owners of the issue. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueTeamOwnersRelationship + */ + @JsonAnySetter + public IssueTeamOwnersRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueTeamOwnersRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueTeamOwnersRelationship issueTeamOwnersRelationship = (IssueTeamOwnersRelationship) o; + return Objects.equals(this.data, issueTeamOwnersRelationship.data) + && Objects.equals( + this.additionalProperties, issueTeamOwnersRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueTeamOwnersRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueTeamReference.java b/src/main/java/com/datadog/api/client/v2/model/IssueTeamReference.java new file mode 100644 index 00000000000..708c106c248 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueTeamReference.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A team that owns the issue. */ +@JsonPropertyOrder({IssueTeamReference.JSON_PROPERTY_ID, IssueTeamReference.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueTeamReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueTeamType type; + + public IssueTeamReference() {} + + @JsonCreator + public IssueTeamReference( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueTeamType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueTeamReference id(String id) { + this.id = id; + return this; + } + + /** + * Team identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueTeamReference type(IssueTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueTeamType getType() { + return type; + } + + public void setType(IssueTeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueTeamReference + */ + @JsonAnySetter + public IssueTeamReference putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueTeamReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueTeamReference issueTeamReference = (IssueTeamReference) o; + return Objects.equals(this.id, issueTeamReference.id) + && Objects.equals(this.type, issueTeamReference.type) + && Objects.equals(this.additionalProperties, issueTeamReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueTeamReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueTeamType.java b/src/main/java/com/datadog/api/client/v2/model/IssueTeamType.java new file mode 100644 index 00000000000..927028362fa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueTeamType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize(using = IssueTeamType.IssueTeamTypeSerializer.class) +public class IssueTeamType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("team")); + + public static final IssueTeamType TEAM = new IssueTeamType("team"); + + IssueTeamType(String value) { + super(value, allowedValues); + } + + public static class IssueTeamTypeSerializer extends StdSerializer { + public IssueTeamTypeSerializer(Class t) { + super(t); + } + + public IssueTeamTypeSerializer() { + this(null); + } + + @Override + public void serialize(IssueTeamType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueTeamType fromValue(String value) { + return new IssueTeamType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueType.java b/src/main/java/com/datadog/api/client/v2/model/IssueType.java new file mode 100644 index 00000000000..76020368650 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize(using = IssueType.IssueTypeSerializer.class) +public class IssueType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("issue")); + + public static final IssueType ISSUE = new IssueType("issue"); + + IssueType(String value) { + super(value, allowedValues); + } + + public static class IssueTypeSerializer extends StdSerializer { + public IssueTypeSerializer(Class t) { + super(t); + } + + public IssueTypeSerializer() { + this(null); + } + + @Override + public void serialize(IssueType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueType fromValue(String value) { + return new IssueType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequest.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequest.java new file mode 100644 index 00000000000..743aa42bfdf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequest.java @@ -0,0 +1,147 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update issue assignee request payload. */ +@JsonPropertyOrder({IssueUpdateAssigneeRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUpdateAssigneeRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssueUpdateAssigneeRequestData data; + + public IssueUpdateAssigneeRequest() {} + + @JsonCreator + public IssueUpdateAssigneeRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IssueUpdateAssigneeRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssueUpdateAssigneeRequest data(IssueUpdateAssigneeRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Update issue assignee request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUpdateAssigneeRequestData getData() { + return data; + } + + public void setData(IssueUpdateAssigneeRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUpdateAssigneeRequest + */ + @JsonAnySetter + public IssueUpdateAssigneeRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUpdateAssigneeRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUpdateAssigneeRequest issueUpdateAssigneeRequest = (IssueUpdateAssigneeRequest) o; + return Objects.equals(this.data, issueUpdateAssigneeRequest.data) + && Objects.equals( + this.additionalProperties, issueUpdateAssigneeRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUpdateAssigneeRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestData.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestData.java new file mode 100644 index 00000000000..99f63e4bf3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestData.java @@ -0,0 +1,181 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update issue assignee request. */ +@JsonPropertyOrder({ + IssueUpdateAssigneeRequestData.JSON_PROPERTY_ID, + IssueUpdateAssigneeRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUpdateAssigneeRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueUpdateAssigneeRequestDataType type; + + public IssueUpdateAssigneeRequestData() {} + + @JsonCreator + public IssueUpdateAssigneeRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IssueUpdateAssigneeRequestDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueUpdateAssigneeRequestData id(String id) { + this.id = id; + return this; + } + + /** + * User identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueUpdateAssigneeRequestData type(IssueUpdateAssigneeRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUpdateAssigneeRequestDataType getType() { + return type; + } + + public void setType(IssueUpdateAssigneeRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUpdateAssigneeRequestData + */ + @JsonAnySetter + public IssueUpdateAssigneeRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUpdateAssigneeRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUpdateAssigneeRequestData issueUpdateAssigneeRequestData = + (IssueUpdateAssigneeRequestData) o; + return Objects.equals(this.id, issueUpdateAssigneeRequestData.id) + && Objects.equals(this.type, issueUpdateAssigneeRequestData.type) + && Objects.equals( + this.additionalProperties, issueUpdateAssigneeRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUpdateAssigneeRequestData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestDataType.java new file mode 100644 index 00000000000..e1b06acb108 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateAssigneeRequestDataType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize( + using = IssueUpdateAssigneeRequestDataType.IssueUpdateAssigneeRequestDataTypeSerializer.class) +public class IssueUpdateAssigneeRequestDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("assignee")); + + public static final IssueUpdateAssigneeRequestDataType ASSIGNEE = + new IssueUpdateAssigneeRequestDataType("assignee"); + + IssueUpdateAssigneeRequestDataType(String value) { + super(value, allowedValues); + } + + public static class IssueUpdateAssigneeRequestDataTypeSerializer + extends StdSerializer { + public IssueUpdateAssigneeRequestDataTypeSerializer( + Class t) { + super(t); + } + + public IssueUpdateAssigneeRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssueUpdateAssigneeRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueUpdateAssigneeRequestDataType fromValue(String value) { + return new IssueUpdateAssigneeRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequest.java new file mode 100644 index 00000000000..016f535a002 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequest.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update issue state request payload. */ +@JsonPropertyOrder({IssueUpdateStateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUpdateStateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssueUpdateStateRequestData data; + + public IssueUpdateStateRequest() {} + + @JsonCreator + public IssueUpdateStateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IssueUpdateStateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssueUpdateStateRequest data(IssueUpdateStateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Update issue state request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUpdateStateRequestData getData() { + return data; + } + + public void setData(IssueUpdateStateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUpdateStateRequest + */ + @JsonAnySetter + public IssueUpdateStateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUpdateStateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUpdateStateRequest issueUpdateStateRequest = (IssueUpdateStateRequest) o; + return Objects.equals(this.data, issueUpdateStateRequest.data) + && Objects.equals(this.additionalProperties, issueUpdateStateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUpdateStateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestData.java new file mode 100644 index 00000000000..9237c323a66 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestData.java @@ -0,0 +1,211 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update issue state request. */ +@JsonPropertyOrder({ + IssueUpdateStateRequestData.JSON_PROPERTY_ATTRIBUTES, + IssueUpdateStateRequestData.JSON_PROPERTY_ID, + IssueUpdateStateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUpdateStateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueUpdateStateRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueUpdateStateRequestDataType type; + + public IssueUpdateStateRequestData() {} + + @JsonCreator + public IssueUpdateStateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssueUpdateStateRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IssueUpdateStateRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueUpdateStateRequestData attributes(IssueUpdateStateRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object describing an issue state update request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUpdateStateRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueUpdateStateRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public IssueUpdateStateRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Issue identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueUpdateStateRequestData type(IssueUpdateStateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUpdateStateRequestDataType getType() { + return type; + } + + public void setType(IssueUpdateStateRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUpdateStateRequestData + */ + @JsonAnySetter + public IssueUpdateStateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUpdateStateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUpdateStateRequestData issueUpdateStateRequestData = (IssueUpdateStateRequestData) o; + return Objects.equals(this.attributes, issueUpdateStateRequestData.attributes) + && Objects.equals(this.id, issueUpdateStateRequestData.id) + && Objects.equals(this.type, issueUpdateStateRequestData.type) + && Objects.equals( + this.additionalProperties, issueUpdateStateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUpdateStateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataAttributes.java new file mode 100644 index 00000000000..6d7eba5d94d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataAttributes.java @@ -0,0 +1,150 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing an issue state update request. */ +@JsonPropertyOrder({IssueUpdateStateRequestDataAttributes.JSON_PROPERTY_STATE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUpdateStateRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_STATE = "state"; + private IssueState state; + + public IssueUpdateStateRequestDataAttributes() {} + + @JsonCreator + public IssueUpdateStateRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATE) IssueState state) { + this.state = state; + this.unparsed |= !state.isValid(); + } + + public IssueUpdateStateRequestDataAttributes state(IssueState state) { + this.state = state; + this.unparsed |= !state.isValid(); + return this; + } + + /** + * State of the issue + * + * @return state + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueState getState() { + return state; + } + + public void setState(IssueState state) { + if (!state.isValid()) { + this.unparsed = true; + } + this.state = state; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUpdateStateRequestDataAttributes + */ + @JsonAnySetter + public IssueUpdateStateRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUpdateStateRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUpdateStateRequestDataAttributes issueUpdateStateRequestDataAttributes = + (IssueUpdateStateRequestDataAttributes) o; + return Objects.equals(this.state, issueUpdateStateRequestDataAttributes.state) + && Objects.equals( + this.additionalProperties, issueUpdateStateRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUpdateStateRequestDataAttributes {\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataType.java new file mode 100644 index 00000000000..f8325f4b8be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUpdateStateRequestDataType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize( + using = IssueUpdateStateRequestDataType.IssueUpdateStateRequestDataTypeSerializer.class) +public class IssueUpdateStateRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("error_tracking_issue")); + + public static final IssueUpdateStateRequestDataType ERROR_TRACKING_ISSUE = + new IssueUpdateStateRequestDataType("error_tracking_issue"); + + IssueUpdateStateRequestDataType(String value) { + super(value, allowedValues); + } + + public static class IssueUpdateStateRequestDataTypeSerializer + extends StdSerializer { + public IssueUpdateStateRequestDataTypeSerializer(Class t) { + super(t); + } + + public IssueUpdateStateRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssueUpdateStateRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueUpdateStateRequestDataType fromValue(String value) { + return new IssueUpdateStateRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUser.java b/src/main/java/com/datadog/api/client/v2/model/IssueUser.java new file mode 100644 index 00000000000..ce8d7054556 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUser.java @@ -0,0 +1,209 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The user to whom the issue is assigned. */ +@JsonPropertyOrder({ + IssueUser.JSON_PROPERTY_ATTRIBUTES, + IssueUser.JSON_PROPERTY_ID, + IssueUser.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssueUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueUserType type; + + public IssueUser() {} + + @JsonCreator + public IssueUser( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssueUserAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueUserType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueUser attributes(IssueUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing the information of a user. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssueUserAttributes attributes) { + this.attributes = attributes; + } + + public IssueUser id(String id) { + this.id = id; + return this; + } + + /** + * User identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueUser type(IssueUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUserType getType() { + return type; + } + + public void setType(IssueUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUser + */ + @JsonAnySetter + public IssueUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUser issueUser = (IssueUser) o; + return Objects.equals(this.attributes, issueUser.attributes) + && Objects.equals(this.id, issueUser.id) + && Objects.equals(this.type, issueUser.type) + && Objects.equals(this.additionalProperties, issueUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUser {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssueUserAttributes.java new file mode 100644 index 00000000000..b7f0f3d855c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUserAttributes.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object containing the information of a user. */ +@JsonPropertyOrder({ + IssueUserAttributes.JSON_PROPERTY_EMAIL, + IssueUserAttributes.JSON_PROPERTY_HANDLE, + IssueUserAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public IssueUserAttributes email(String email) { + this.email = email; + return this; + } + + /** + * Email of the user. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public IssueUserAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * Handle of the user. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public IssueUserAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the user. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUserAttributes + */ + @JsonAnySetter + public IssueUserAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUserAttributes issueUserAttributes = (IssueUserAttributes) o; + return Objects.equals(this.email, issueUserAttributes.email) + && Objects.equals(this.handle, issueUserAttributes.handle) + && Objects.equals(this.name, issueUserAttributes.name) + && Objects.equals(this.additionalProperties, issueUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUserAttributes {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUserReference.java b/src/main/java/com/datadog/api/client/v2/model/IssueUserReference.java new file mode 100644 index 00000000000..eb9caa94a46 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUserReference.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The user the issue is assigned to. */ +@JsonPropertyOrder({IssueUserReference.JSON_PROPERTY_ID, IssueUserReference.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssueUserReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssueUserType type; + + public IssueUserReference() {} + + @JsonCreator + public IssueUserReference( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssueUserType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssueUserReference id(String id) { + this.id = id; + return this; + } + + /** + * User identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueUserReference type(IssueUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueUserType getType() { + return type; + } + + public void setType(IssueUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssueUserReference + */ + @JsonAnySetter + public IssueUserReference putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssueUserReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueUserReference issueUserReference = (IssueUserReference) o; + return Objects.equals(this.id, issueUserReference.id) + && Objects.equals(this.type, issueUserReference.type) + && Objects.equals(this.additionalProperties, issueUserReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueUserReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueUserType.java b/src/main/java/com/datadog/api/client/v2/model/IssueUserType.java new file mode 100644 index 00000000000..7f1ab26f02c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueUserType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object */ +@JsonSerialize(using = IssueUserType.IssueUserTypeSerializer.class) +public class IssueUserType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("user")); + + public static final IssueUserType USER = new IssueUserType("user"); + + IssueUserType(String value) { + super(value, allowedValues); + } + + public static class IssueUserTypeSerializer extends StdSerializer { + public IssueUserTypeSerializer(Class t) { + super(t); + } + + public IssueUserTypeSerializer() { + this(null); + } + + @Override + public void serialize(IssueUserType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueUserType fromValue(String value) { + return new IssueUserType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequest.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequest.java new file mode 100644 index 00000000000..f80df4e2781 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequest.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Search issues request payload. */ +@JsonPropertyOrder({IssuesSearchRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssuesSearchRequestData data; + + public IssuesSearchRequest() {} + + @JsonCreator + public IssuesSearchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IssuesSearchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssuesSearchRequest data(IssuesSearchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Search issues request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssuesSearchRequestData getData() { + return data; + } + + public void setData(IssuesSearchRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchRequest + */ + @JsonAnySetter + public IssuesSearchRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchRequest issuesSearchRequest = (IssuesSearchRequest) o; + return Objects.equals(this.data, issuesSearchRequest.data) + && Objects.equals(this.additionalProperties, issuesSearchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestData.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestData.java new file mode 100644 index 00000000000..2935bd7454a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestData.java @@ -0,0 +1,181 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Search issues request. */ +@JsonPropertyOrder({ + IssuesSearchRequestData.JSON_PROPERTY_ATTRIBUTES, + IssuesSearchRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssuesSearchRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssuesSearchRequestDataType type; + + public IssuesSearchRequestData() {} + + @JsonCreator + public IssuesSearchRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssuesSearchRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssuesSearchRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssuesSearchRequestData attributes(IssuesSearchRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object describing a search issue request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssuesSearchRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssuesSearchRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public IssuesSearchRequestData type(IssuesSearchRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssuesSearchRequestDataType getType() { + return type; + } + + public void setType(IssuesSearchRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchRequestData + */ + @JsonAnySetter + public IssuesSearchRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchRequestData issuesSearchRequestData = (IssuesSearchRequestData) o; + return Objects.equals(this.attributes, issuesSearchRequestData.attributes) + && Objects.equals(this.type, issuesSearchRequestData.type) + && Objects.equals(this.additionalProperties, issuesSearchRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributes.java new file mode 100644 index 00000000000..25256acdc2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributes.java @@ -0,0 +1,298 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing a search issue request. */ +@JsonPropertyOrder({ + IssuesSearchRequestDataAttributes.JSON_PROPERTY_FROM, + IssuesSearchRequestDataAttributes.JSON_PROPERTY_ORDER_BY, + IssuesSearchRequestDataAttributes.JSON_PROPERTY_PERSONA, + IssuesSearchRequestDataAttributes.JSON_PROPERTY_QUERY, + IssuesSearchRequestDataAttributes.JSON_PROPERTY_TO, + IssuesSearchRequestDataAttributes.JSON_PROPERTY_TRACK +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_ORDER_BY = "order_by"; + private IssuesSearchRequestDataAttributesOrderBy orderBy; + + public static final String JSON_PROPERTY_PERSONA = "persona"; + private IssuesSearchRequestDataAttributesPersona persona; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public static final String JSON_PROPERTY_TRACK = "track"; + private IssuesSearchRequestDataAttributesTrack track; + + public IssuesSearchRequestDataAttributes() {} + + @JsonCreator + public IssuesSearchRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.to = to; + } + + public IssuesSearchRequestDataAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start date (inclusive) of the query in milliseconds since the Unix epoch. + * + * @return from + */ + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public IssuesSearchRequestDataAttributes orderBy( + IssuesSearchRequestDataAttributesOrderBy orderBy) { + this.orderBy = orderBy; + this.unparsed |= !orderBy.isValid(); + return this; + } + + /** + * The attribute to sort the search results by. + * + * @return orderBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuesSearchRequestDataAttributesOrderBy getOrderBy() { + return orderBy; + } + + public void setOrderBy(IssuesSearchRequestDataAttributesOrderBy orderBy) { + if (!orderBy.isValid()) { + this.unparsed = true; + } + this.orderBy = orderBy; + } + + public IssuesSearchRequestDataAttributes persona( + IssuesSearchRequestDataAttributesPersona persona) { + this.persona = persona; + this.unparsed |= !persona.isValid(); + return this; + } + + /** + * Persona for the search. Either track(s) or persona(s) must be specified. + * + * @return persona + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERSONA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuesSearchRequestDataAttributesPersona getPersona() { + return persona; + } + + public void setPersona(IssuesSearchRequestDataAttributesPersona persona) { + if (!persona.isValid()) { + this.unparsed = true; + } + this.persona = persona; + } + + public IssuesSearchRequestDataAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Search query following the event search syntax. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public IssuesSearchRequestDataAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End date (exclusive) of the query in milliseconds since the Unix epoch. + * + * @return to + */ + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + public IssuesSearchRequestDataAttributes track(IssuesSearchRequestDataAttributesTrack track) { + this.track = track; + this.unparsed |= !track.isValid(); + return this; + } + + /** + * Track of the events to query. Either track(s) or persona(s) must be specified. + * + * @return track + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuesSearchRequestDataAttributesTrack getTrack() { + return track; + } + + public void setTrack(IssuesSearchRequestDataAttributesTrack track) { + if (!track.isValid()) { + this.unparsed = true; + } + this.track = track; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchRequestDataAttributes + */ + @JsonAnySetter + public IssuesSearchRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchRequestDataAttributes issuesSearchRequestDataAttributes = + (IssuesSearchRequestDataAttributes) o; + return Objects.equals(this.from, issuesSearchRequestDataAttributes.from) + && Objects.equals(this.orderBy, issuesSearchRequestDataAttributes.orderBy) + && Objects.equals(this.persona, issuesSearchRequestDataAttributes.persona) + && Objects.equals(this.query, issuesSearchRequestDataAttributes.query) + && Objects.equals(this.to, issuesSearchRequestDataAttributes.to) + && Objects.equals(this.track, issuesSearchRequestDataAttributes.track) + && Objects.equals( + this.additionalProperties, issuesSearchRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, orderBy, persona, query, to, track, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchRequestDataAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" orderBy: ").append(toIndentedString(orderBy)).append("\n"); + sb.append(" persona: ").append(toIndentedString(persona)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" track: ").append(toIndentedString(track)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesOrderBy.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesOrderBy.java new file mode 100644 index 00000000000..d8c2ceb2e63 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesOrderBy.java @@ -0,0 +1,70 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The attribute to sort the search results by. */ +@JsonSerialize( + using = + IssuesSearchRequestDataAttributesOrderBy.IssuesSearchRequestDataAttributesOrderBySerializer + .class) +public class IssuesSearchRequestDataAttributesOrderBy extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("TOTAL_COUNT", "FIRST_SEEN", "IMPACTED_SESSIONS", "PRIORITY")); + + public static final IssuesSearchRequestDataAttributesOrderBy TOTAL_COUNT = + new IssuesSearchRequestDataAttributesOrderBy("TOTAL_COUNT"); + public static final IssuesSearchRequestDataAttributesOrderBy FIRST_SEEN = + new IssuesSearchRequestDataAttributesOrderBy("FIRST_SEEN"); + public static final IssuesSearchRequestDataAttributesOrderBy IMPACTED_SESSIONS = + new IssuesSearchRequestDataAttributesOrderBy("IMPACTED_SESSIONS"); + public static final IssuesSearchRequestDataAttributesOrderBy PRIORITY = + new IssuesSearchRequestDataAttributesOrderBy("PRIORITY"); + + IssuesSearchRequestDataAttributesOrderBy(String value) { + super(value, allowedValues); + } + + public static class IssuesSearchRequestDataAttributesOrderBySerializer + extends StdSerializer { + public IssuesSearchRequestDataAttributesOrderBySerializer( + Class t) { + super(t); + } + + public IssuesSearchRequestDataAttributesOrderBySerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchRequestDataAttributesOrderBy value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuesSearchRequestDataAttributesOrderBy fromValue(String value) { + return new IssuesSearchRequestDataAttributesOrderBy(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesPersona.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesPersona.java new file mode 100644 index 00000000000..a88f4f75762 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesPersona.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Persona for the search. Either track(s) or persona(s) must be specified. */ +@JsonSerialize( + using = + IssuesSearchRequestDataAttributesPersona.IssuesSearchRequestDataAttributesPersonaSerializer + .class) +public class IssuesSearchRequestDataAttributesPersona extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("ALL", "BROWSER", "MOBILE", "BACKEND")); + + public static final IssuesSearchRequestDataAttributesPersona ALL = + new IssuesSearchRequestDataAttributesPersona("ALL"); + public static final IssuesSearchRequestDataAttributesPersona BROWSER = + new IssuesSearchRequestDataAttributesPersona("BROWSER"); + public static final IssuesSearchRequestDataAttributesPersona MOBILE = + new IssuesSearchRequestDataAttributesPersona("MOBILE"); + public static final IssuesSearchRequestDataAttributesPersona BACKEND = + new IssuesSearchRequestDataAttributesPersona("BACKEND"); + + IssuesSearchRequestDataAttributesPersona(String value) { + super(value, allowedValues); + } + + public static class IssuesSearchRequestDataAttributesPersonaSerializer + extends StdSerializer { + public IssuesSearchRequestDataAttributesPersonaSerializer( + Class t) { + super(t); + } + + public IssuesSearchRequestDataAttributesPersonaSerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchRequestDataAttributesPersona value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuesSearchRequestDataAttributesPersona fromValue(String value) { + return new IssuesSearchRequestDataAttributesPersona(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesTrack.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesTrack.java new file mode 100644 index 00000000000..da3882b459e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataAttributesTrack.java @@ -0,0 +1,67 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Track of the events to query. Either track(s) or persona(s) must be specified. */ +@JsonSerialize( + using = + IssuesSearchRequestDataAttributesTrack.IssuesSearchRequestDataAttributesTrackSerializer + .class) +public class IssuesSearchRequestDataAttributesTrack extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("trace", "logs", "rum")); + + public static final IssuesSearchRequestDataAttributesTrack TRACE = + new IssuesSearchRequestDataAttributesTrack("trace"); + public static final IssuesSearchRequestDataAttributesTrack LOGS = + new IssuesSearchRequestDataAttributesTrack("logs"); + public static final IssuesSearchRequestDataAttributesTrack RUM = + new IssuesSearchRequestDataAttributesTrack("rum"); + + IssuesSearchRequestDataAttributesTrack(String value) { + super(value, allowedValues); + } + + public static class IssuesSearchRequestDataAttributesTrackSerializer + extends StdSerializer { + public IssuesSearchRequestDataAttributesTrackSerializer( + Class t) { + super(t); + } + + public IssuesSearchRequestDataAttributesTrackSerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchRequestDataAttributesTrack value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuesSearchRequestDataAttributesTrack fromValue(String value) { + return new IssuesSearchRequestDataAttributesTrack(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataType.java new file mode 100644 index 00000000000..7d1cd768bc0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchRequestDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize(using = IssuesSearchRequestDataType.IssuesSearchRequestDataTypeSerializer.class) +public class IssuesSearchRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("search_request")); + + public static final IssuesSearchRequestDataType SEARCH_REQUEST = + new IssuesSearchRequestDataType("search_request"); + + IssuesSearchRequestDataType(String value) { + super(value, allowedValues); + } + + public static class IssuesSearchRequestDataTypeSerializer + extends StdSerializer { + public IssuesSearchRequestDataTypeSerializer(Class t) { + super(t); + } + + public IssuesSearchRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuesSearchRequestDataType fromValue(String value) { + return new IssuesSearchRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResponse.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResponse.java new file mode 100644 index 00000000000..5e26696ac97 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResponse.java @@ -0,0 +1,190 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Search issues response payload. */ +@JsonPropertyOrder({ + IssuesSearchResponse.JSON_PROPERTY_DATA, + IssuesSearchResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IssuesSearchResponse data(List data) { + this.data = data; + for (IssuesSearchResult item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssuesSearchResponse addDataItem(IssuesSearchResult dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of results matching the search query. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IssuesSearchResponse included(List included) { + this.included = included; + for (IssuesSearchResultIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IssuesSearchResponse addIncludedItem(IssuesSearchResultIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Array of resources related to the search results. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchResponse + */ + @JsonAnySetter + public IssuesSearchResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchResponse issuesSearchResponse = (IssuesSearchResponse) o; + return Objects.equals(this.data, issuesSearchResponse.data) + && Objects.equals(this.included, issuesSearchResponse.included) + && Objects.equals(this.additionalProperties, issuesSearchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResult.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResult.java new file mode 100644 index 00000000000..6fea15bdc28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResult.java @@ -0,0 +1,237 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Result matching the search query. */ +@JsonPropertyOrder({ + IssuesSearchResult.JSON_PROPERTY_ATTRIBUTES, + IssuesSearchResult.JSON_PROPERTY_ID, + IssuesSearchResult.JSON_PROPERTY_RELATIONSHIPS, + IssuesSearchResult.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IssuesSearchResultAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IssuesSearchResultRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IssuesSearchResultType type; + + public IssuesSearchResult() {} + + @JsonCreator + public IssuesSearchResult( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IssuesSearchResultAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IssuesSearchResultType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IssuesSearchResult attributes(IssuesSearchResultAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing the information of a search result. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssuesSearchResultAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IssuesSearchResultAttributes attributes) { + this.attributes = attributes; + } + + public IssuesSearchResult id(String id) { + this.id = id; + return this; + } + + /** + * Search result identifier (matches the nested issue's identifier). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssuesSearchResult relationships(IssuesSearchResultRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships between the search result and other resources. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuesSearchResultRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IssuesSearchResultRelationships relationships) { + this.relationships = relationships; + } + + public IssuesSearchResult type(IssuesSearchResultType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssuesSearchResultType getType() { + return type; + } + + public void setType(IssuesSearchResultType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchResult + */ + @JsonAnySetter + public IssuesSearchResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchResult issuesSearchResult = (IssuesSearchResult) o; + return Objects.equals(this.attributes, issuesSearchResult.attributes) + && Objects.equals(this.id, issuesSearchResult.id) + && Objects.equals(this.relationships, issuesSearchResult.relationships) + && Objects.equals(this.type, issuesSearchResult.type) + && Objects.equals(this.additionalProperties, issuesSearchResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchResult {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultAttributes.java new file mode 100644 index 00000000000..2d97d14e71c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultAttributes.java @@ -0,0 +1,192 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object containing the information of a search result. */ +@JsonPropertyOrder({ + IssuesSearchResultAttributes.JSON_PROPERTY_IMPACTED_SESSIONS, + IssuesSearchResultAttributes.JSON_PROPERTY_IMPACTED_USERS, + IssuesSearchResultAttributes.JSON_PROPERTY_TOTAL_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchResultAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IMPACTED_SESSIONS = "impacted_sessions"; + private Long impactedSessions; + + public static final String JSON_PROPERTY_IMPACTED_USERS = "impacted_users"; + private Long impactedUsers; + + public static final String JSON_PROPERTY_TOTAL_COUNT = "total_count"; + private Long totalCount; + + public IssuesSearchResultAttributes impactedSessions(Long impactedSessions) { + this.impactedSessions = impactedSessions; + return this; + } + + /** + * Count of sessions impacted by the issue over the queried time window. + * + * @return impactedSessions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMPACTED_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getImpactedSessions() { + return impactedSessions; + } + + public void setImpactedSessions(Long impactedSessions) { + this.impactedSessions = impactedSessions; + } + + public IssuesSearchResultAttributes impactedUsers(Long impactedUsers) { + this.impactedUsers = impactedUsers; + return this; + } + + /** + * Count of users impacted by the issue over the queried time window. + * + * @return impactedUsers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMPACTED_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getImpactedUsers() { + return impactedUsers; + } + + public void setImpactedUsers(Long impactedUsers) { + this.impactedUsers = impactedUsers; + } + + public IssuesSearchResultAttributes totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total count of errors that match the issue over the queried time window. + * + * @return totalCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchResultAttributes + */ + @JsonAnySetter + public IssuesSearchResultAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchResultAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchResultAttributes issuesSearchResultAttributes = (IssuesSearchResultAttributes) o; + return Objects.equals(this.impactedSessions, issuesSearchResultAttributes.impactedSessions) + && Objects.equals(this.impactedUsers, issuesSearchResultAttributes.impactedUsers) + && Objects.equals(this.totalCount, issuesSearchResultAttributes.totalCount) + && Objects.equals( + this.additionalProperties, issuesSearchResultAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(impactedSessions, impactedUsers, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchResultAttributes {\n"); + sb.append(" impactedSessions: ").append(toIndentedString(impactedSessions)).append("\n"); + sb.append(" impactedUsers: ").append(toIndentedString(impactedUsers)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIncluded.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIncluded.java new file mode 100644 index 00000000000..f361b8ec7d9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIncluded.java @@ -0,0 +1,398 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = IssuesSearchResultIncluded.IssuesSearchResultIncludedDeserializer.class) +@JsonSerialize(using = IssuesSearchResultIncluded.IssuesSearchResultIncludedSerializer.class) +public class IssuesSearchResultIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IssuesSearchResultIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class IssuesSearchResultIncludedSerializer + extends StdSerializer { + public IssuesSearchResultIncludedSerializer(Class t) { + super(t); + } + + public IssuesSearchResultIncludedSerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchResultIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class IssuesSearchResultIncludedDeserializer + extends StdDeserializer { + public IssuesSearchResultIncludedDeserializer() { + this(IssuesSearchResultIncluded.class); + } + + public IssuesSearchResultIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public IssuesSearchResultIncluded deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Issue + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Issue.class.equals(Integer.class) + || Issue.class.equals(Long.class) + || Issue.class.equals(Float.class) + || Issue.class.equals(Double.class) + || Issue.class.equals(Boolean.class) + || Issue.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Issue.class.equals(Integer.class) || Issue.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Issue.class.equals(Float.class) || Issue.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Issue.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Issue.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Issue.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((Issue) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'Issue'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Issue'", e); + } + + // deserialize Case + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Case.class.equals(Integer.class) + || Case.class.equals(Long.class) + || Case.class.equals(Float.class) + || Case.class.equals(Double.class) + || Case.class.equals(Boolean.class) + || Case.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Case.class.equals(Integer.class) || Case.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Case.class.equals(Float.class) || Case.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Case.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Case.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Case.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((Case) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'Case'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Case'", e); + } + + // deserialize IssueUser + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IssueUser.class.equals(Integer.class) + || IssueUser.class.equals(Long.class) + || IssueUser.class.equals(Float.class) + || IssueUser.class.equals(Double.class) + || IssueUser.class.equals(Boolean.class) + || IssueUser.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IssueUser.class.equals(Integer.class) || IssueUser.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IssueUser.class.equals(Float.class) || IssueUser.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IssueUser.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IssueUser.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IssueUser.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IssueUser) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IssueUser'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IssueUser'", e); + } + + // deserialize IssueTeam + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IssueTeam.class.equals(Integer.class) + || IssueTeam.class.equals(Long.class) + || IssueTeam.class.equals(Float.class) + || IssueTeam.class.equals(Double.class) + || IssueTeam.class.equals(Boolean.class) + || IssueTeam.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IssueTeam.class.equals(Integer.class) || IssueTeam.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IssueTeam.class.equals(Float.class) || IssueTeam.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IssueTeam.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IssueTeam.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IssueTeam.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IssueTeam) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IssueTeam'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IssueTeam'", e); + } + + IssuesSearchResultIncluded ret = new IssuesSearchResultIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public IssuesSearchResultIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "IssuesSearchResultIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IssuesSearchResultIncluded() { + super("oneOf", Boolean.FALSE); + } + + public IssuesSearchResultIncluded(Issue o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IssuesSearchResultIncluded(Case o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IssuesSearchResultIncluded(IssueUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IssuesSearchResultIncluded(IssueTeam o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Issue", new GenericType() {}); + schemas.put("Case", new GenericType() {}); + schemas.put("IssueUser", new GenericType() {}); + schemas.put("IssueTeam", new GenericType() {}); + JSON.registerDescendants( + IssuesSearchResultIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return IssuesSearchResultIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Issue, Case, IssueUser, IssueTeam + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Issue.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Case.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IssueUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IssueTeam.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be Issue, Case, IssueUser, IssueTeam"); + } + + /** + * Get the actual instance, which can be the following: Issue, Case, IssueUser, IssueTeam + * + * @return The actual instance (Issue, Case, IssueUser, IssueTeam) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Issue`. If the actual instance is not `Issue`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Issue` + * @throws ClassCastException if the instance is not `Issue` + */ + public Issue getIssue() throws ClassCastException { + return (Issue) super.getActualInstance(); + } + + /** + * Get the actual instance of `Case`. If the actual instance is not `Case`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `Case` + * @throws ClassCastException if the instance is not `Case` + */ + public Case getCase() throws ClassCastException { + return (Case) super.getActualInstance(); + } + + /** + * Get the actual instance of `IssueUser`. If the actual instance is not `IssueUser`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `IssueUser` + * @throws ClassCastException if the instance is not `IssueUser` + */ + public IssueUser getIssueUser() throws ClassCastException { + return (IssueUser) super.getActualInstance(); + } + + /** + * Get the actual instance of `IssueTeam`. If the actual instance is not `IssueTeam`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `IssueTeam` + * @throws ClassCastException if the instance is not `IssueTeam` + */ + public IssueTeam getIssueTeam() throws ClassCastException { + return (IssueTeam) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIssueRelationship.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIssueRelationship.java new file mode 100644 index 00000000000..ae4e284187a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultIssueRelationship.java @@ -0,0 +1,147 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship between the search result and the corresponding issue. */ +@JsonPropertyOrder({IssuesSearchResultIssueRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchResultIssueRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IssueReference data; + + public IssuesSearchResultIssueRelationship() {} + + @JsonCreator + public IssuesSearchResultIssueRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IssueReference data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IssuesSearchResultIssueRelationship data(IssueReference data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The issue the search result corresponds to. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueReference getData() { + return data; + } + + public void setData(IssueReference data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchResultIssueRelationship + */ + @JsonAnySetter + public IssuesSearchResultIssueRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchResultIssueRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchResultIssueRelationship issuesSearchResultIssueRelationship = + (IssuesSearchResultIssueRelationship) o; + return Objects.equals(this.data, issuesSearchResultIssueRelationship.data) + && Objects.equals( + this.additionalProperties, issuesSearchResultIssueRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchResultIssueRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultRelationships.java new file mode 100644 index 00000000000..fc82e10cf2e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultRelationships.java @@ -0,0 +1,138 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships between the search result and other resources. */ +@JsonPropertyOrder({IssuesSearchResultRelationships.JSON_PROPERTY_ISSUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IssuesSearchResultRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ISSUE = "issue"; + private IssuesSearchResultIssueRelationship issue; + + public IssuesSearchResultRelationships issue(IssuesSearchResultIssueRelationship issue) { + this.issue = issue; + this.unparsed |= issue.unparsed; + return this; + } + + /** + * Relationship between the search result and the corresponding issue. + * + * @return issue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IssuesSearchResultIssueRelationship getIssue() { + return issue; + } + + public void setIssue(IssuesSearchResultIssueRelationship issue) { + this.issue = issue; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IssuesSearchResultRelationships + */ + @JsonAnySetter + public IssuesSearchResultRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IssuesSearchResultRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssuesSearchResultRelationships issuesSearchResultRelationships = + (IssuesSearchResultRelationships) o; + return Objects.equals(this.issue, issuesSearchResultRelationships.issue) + && Objects.equals( + this.additionalProperties, issuesSearchResultRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssuesSearchResultRelationships {\n"); + sb.append(" issue: ").append(toIndentedString(issue)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultType.java b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultType.java new file mode 100644 index 00000000000..af050efaaf4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssuesSearchResultType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the object. */ +@JsonSerialize(using = IssuesSearchResultType.IssuesSearchResultTypeSerializer.class) +public class IssuesSearchResultType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("error_tracking_search_result")); + + public static final IssuesSearchResultType ERROR_TRACKING_SEARCH_RESULT = + new IssuesSearchResultType("error_tracking_search_result"); + + IssuesSearchResultType(String value) { + super(value, allowedValues); + } + + public static class IssuesSearchResultTypeSerializer + extends StdSerializer { + public IssuesSearchResultTypeSerializer(Class t) { + super(t); + } + + public IssuesSearchResultTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IssuesSearchResultType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssuesSearchResultType fromValue(String value) { + return new IssuesSearchResultType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SearchIssuesIncludeQueryParameterItem.java b/src/main/java/com/datadog/api/client/v2/model/SearchIssuesIncludeQueryParameterItem.java new file mode 100644 index 00000000000..86c2f19e2e1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SearchIssuesIncludeQueryParameterItem.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Relationship object that should be included in the search response. */ +@JsonSerialize( + using = + SearchIssuesIncludeQueryParameterItem.SearchIssuesIncludeQueryParameterItemSerializer.class) +public class SearchIssuesIncludeQueryParameterItem extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("issue", "issue.assignee", "issue.case", "issue.team_owners")); + + public static final SearchIssuesIncludeQueryParameterItem ISSUE = + new SearchIssuesIncludeQueryParameterItem("issue"); + public static final SearchIssuesIncludeQueryParameterItem ISSUE_ASSIGNEE = + new SearchIssuesIncludeQueryParameterItem("issue.assignee"); + public static final SearchIssuesIncludeQueryParameterItem ISSUE_CASE = + new SearchIssuesIncludeQueryParameterItem("issue.case"); + public static final SearchIssuesIncludeQueryParameterItem ISSUE_TEAM_OWNERS = + new SearchIssuesIncludeQueryParameterItem("issue.team_owners"); + + SearchIssuesIncludeQueryParameterItem(String value) { + super(value, allowedValues); + } + + public static class SearchIssuesIncludeQueryParameterItemSerializer + extends StdSerializer { + public SearchIssuesIncludeQueryParameterItemSerializer( + Class t) { + super(t); + } + + public SearchIssuesIncludeQueryParameterItemSerializer() { + this(null); + } + + @Override + public void serialize( + SearchIssuesIncludeQueryParameterItem value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SearchIssuesIncludeQueryParameterItem fromValue(String value) { + return new SearchIssuesIncludeQueryParameterItem(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ed3ceb52afc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-08-29T12:19:16.262Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.json new file mode 100644 index 00000000000..b1ede6d59ec --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/error-tracking/issues/invalid-issue-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"issue id is not an uuid\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3f7077b8-a95b-25a1-0d3e-6e0bb0aee38b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..f06088aabcb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:33.272Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.json new file mode 100644 index 00000000000..cc6c1703e9a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_Not_Found_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755012813000,\"query\":\"service:synthetics-browser\",\"to\":1756308813000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "16438026-1168-3bfa-3763-949697b01fe9" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"issue not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2f974d45-57e6-e947-cf7c-58467c80daf3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.freeze new file mode 100644 index 00000000000..ea355a63172 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:33.577Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.json new file mode 100644 index 00000000000..c0406058bb1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_an_error_tracking_issue_returns_OK_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755012813000,\"query\":\"service:synthetics-browser\",\"to\":1756308813000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "16438026-1168-3bfa-3763-949697b01fea" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "88486635-766f-155f-79ad-653f5ba278e7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..1620da15c2f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-08-29T12:59:23.045Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.json new file mode 100644 index 00000000000..dee2b680863 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1671612804000,\"query\":\"service:orders-* AND @language:go\",\"to\":1671620004000,\"track\":\"invalid-track\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"invalid json value for TrackType: invalid-track\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "473d324c-18e1-2196-062e-eaecfb529074" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.freeze new file mode 100644 index 00000000000..866d87cbf01 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:33.997Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.json new file mode 100644 index 00000000000..b15f7e5d865 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Search_error_tracking_issues_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1671612804000,\"query\":\"service:orders-* AND @language:go\",\"to\":1671620004000,\"track\":\"trace\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f46fc451-b537-346f-3e77-8e7e2bc6d0c7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..18402a42a97 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-08-29T12:59:23.349Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.json new file mode 100644 index 00000000000..d32d871abe7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755176363000,\"query\":\"service:synthetics-browser\",\"to\":1756472363000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "64dd10e3-cd36-8dd3-f7ba-55da10f5ba95" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"invalid-id\",\"type\":\"assignee\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"invalid UUID length: 10\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b63fee9-f9a2-f475-7a0d-f3e86bf172e5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..409dfdcd13f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:34.622Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.json new file mode 100644 index 00000000000..af783717cd7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"assignee\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/assignee", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"issue not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f2d10dd7-fea2-80fc-938a-31ddb708af8c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.freeze new file mode 100644 index 00000000000..dd78c9df088 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:34.689Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.json new file mode 100644 index 00000000000..7ab30b78f72 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_assignee_of_an_issue_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755012814000,\"query\":\"service:synthetics-browser\",\"to\":1756308814000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c6544eaf-d97c-ca46-8dbc-3ab382c0f9d1" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"87cb11a0-278c-440a-99fe-701223c80296\",\"type\":\"assignee\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "489740da-6e9f-fd6a-502a-2571355215bc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..f505962d307 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:35.029Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.json new file mode 100644 index 00000000000..4a27cd1e9d6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755012815000,\"query\":\"service:synthetics-browser\",\"to\":1756308815000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a2c05b3b-bab5-013b-200d-7dc622c1b35f" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"state\":\"invalid-state\"},\"id\":\"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\",\"type\":\"error_tracking_issue\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"invalid json value for IssueState: \\\"invalid-state\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3a29d1b-0e26-1d5c-93c7-a945a88390d7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..4e11e96c74b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:35.373Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.json new file mode 100644 index 00000000000..1a021f93937 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"state\":\"resolved\"},\"id\":\"67d80aa3-36ff-44b9-a694-c501a7591737\",\"type\":\"error_tracking_issue\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/state", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"issue not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "866bc50f-69f9-077a-3f97-0b6bf60e2186" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.freeze new file mode 100644 index 00000000000..05ba9e07125 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-08-27T15:33:35.431Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.json new file mode 100644 index 00000000000..6078cbf29e3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_the_state_of_an_issue_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":1755012815000,\"query\":\"service:synthetics-browser\",\"to\":1756308815000,\"track\":\"rum\"},\"type\":\"search_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/error-tracking/issues/search", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a2c05b3b-bab5-013b-200d-7dc622c1b35e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"state\":\"RESOLVED\"},\"id\":\"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002\",\"type\":\"error_tracking_issue\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1e4178cc-8a6d-6911-1332-b52fd96657b2" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/error_tracking.feature b/src/test/resources/com/datadog/api/client/v2/api/error_tracking.feature new file mode 100644 index 00000000000..97f8ceeedd9 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/error_tracking.feature @@ -0,0 +1,100 @@ +@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 + And request contains "issue_id" parameter with value "invalid-issue-id" + 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 + And body with value {"data": {"attributes": {"query": "service:orders-* AND @language:go", "from": 1671612804000, "to": 1671620004000, "track": "invalid-track"}, "type": "search_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" + And body with value {"data": {"id": "invalid-id", "type": "assignee"}} + 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/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index fbeea567872..79e6d4c45d2 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -224,6 +224,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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index ec94e15e11d..fb630772c1c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1022,6 +1022,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": {