From 353332830ba9c790c2d119bc1389a1e6becde172 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Sep 2025 10:20:27 +0000 Subject: [PATCH] Regenerate client from commit 5168f2e of spec repo --- .generator/schemas/v2/openapi.yaml | 981 ++++++++++++++++++ ...-issue-returns-Bad-Request-response.frozen | 1 + ...ing-issue-returns-Bad-Request-response.yml | 21 + ...ng-issue-returns-Not-Found-response.frozen | 1 + ...cking-issue-returns-Not-Found-response.yml | 43 + ...-tracking-issue-returns-OK-response.frozen | 1 + ...ror-tracking-issue-returns-OK-response.yml | 43 + ...issues-returns-Bad-Request-response.frozen | 1 + ...ng-issues-returns-Bad-Request-response.yml | 26 + ...tracking-issues-returns-OK-response.frozen | 1 + ...or-tracking-issues-returns-OK-response.yml | 25 + ...-issue-returns-Bad-Request-response.frozen | 1 + ...-an-issue-returns-Bad-Request-response.yml | 47 + ...an-issue-returns-Not-Found-response.frozen | 1 + ...of-an-issue-returns-Not-Found-response.yml | 25 + ...nee-of-an-issue-returns-OK-response.frozen | 1 + ...signee-of-an-issue-returns-OK-response.yml | 48 + ...-issue-returns-Bad-Request-response.frozen | 1 + ...-an-issue-returns-Bad-Request-response.yml | 47 + ...an-issue-returns-Not-Found-response.frozen | 1 + ...of-an-issue-returns-Not-Found-response.yml | 25 + ...ate-of-an-issue-returns-OK-response.frozen | 1 + ...-state-of-an-issue-returns-OK-response.yml | 48 + examples/v2/error-tracking/GetIssue.rb | 8 + examples/v2/error-tracking/SearchIssues.rb | 17 + .../v2/error-tracking/UpdateIssueAssignee.rb | 15 + .../v2/error-tracking/UpdateIssueState.rb | 18 + features/scenarios_model_mapping.rb | 16 + features/v2/error_tracking.feature | 100 ++ features/v2/given.json | 13 + features/v2/undo.json | 24 + lib/datadog_api_client/inflector.rb | 53 + .../v2/api/error_tracking_api.rb | 306 ++++++ .../get_issue_include_query_parameter_item.rb | 28 + lib/datadog_api_client/v2/models/issue.rb | 175 ++++ .../v2/models/issue_assignee_relationship.rb | 123 +++ .../v2/models/issue_attributes.rb | 227 ++++ .../v2/models/issue_case.rb | 175 ++++ .../v2/models/issue_case_attributes.rb | 237 +++++ .../v2/models/issue_case_insight.rb | 125 +++ .../v2/models/issue_case_jira_issue.rb | 115 ++ .../v2/models/issue_case_jira_issue_result.rb | 135 +++ .../v2/models/issue_case_reference.rb | 144 +++ .../v2/models/issue_case_relationship.rb | 123 +++ .../v2/models/issue_case_relationships.rb | 145 +++ .../v2/models/issue_case_resource_type.rb | 26 + .../v2/models/issue_included.rb | 64 ++ .../v2/models/issue_language.rb | 52 + .../v2/models/issue_platform.rb | 33 + .../v2/models/issue_reference.rb | 144 +++ .../v2/models/issue_relationships.rb | 125 +++ .../v2/models/issue_response.rb | 117 +++ .../v2/models/issue_state.rb | 30 + .../v2/models/issue_team.rb | 165 +++ .../v2/models/issue_team_attributes.rb | 125 +++ .../models/issue_team_owners_relationship.rb | 125 +++ .../v2/models/issue_team_reference.rb | 144 +++ .../v2/models/issue_team_type.rb | 26 + .../v2/models/issue_type.rb | 26 + .../models/issue_update_assignee_request.rb | 123 +++ .../issue_update_assignee_request_data.rb | 144 +++ ...issue_update_assignee_request_data_type.rb | 26 + .../v2/models/issue_update_state_request.rb | 123 +++ .../models/issue_update_state_request_data.rb | 165 +++ ...ue_update_state_request_data_attributes.rb | 123 +++ .../issue_update_state_request_data_type.rb | 26 + .../v2/models/issue_user.rb | 165 +++ .../v2/models/issue_user_attributes.rb | 125 +++ .../v2/models/issue_user_reference.rb | 144 +++ .../v2/models/issue_user_type.rb | 26 + .../v2/models/issues_search_request.rb | 123 +++ .../v2/models/issues_search_request_data.rb | 144 +++ .../issues_search_request_data_attributes.rb | 195 ++++ ...search_request_data_attributes_order_by.rb | 29 + ..._search_request_data_attributes_persona.rb | 29 + ...es_search_request_data_attributes_track.rb | 28 + .../models/issues_search_request_data_type.rb | 26 + .../v2/models/issues_search_response.rb | 119 +++ .../v2/models/issues_search_result.rb | 175 ++++ .../models/issues_search_result_attributes.rb | 125 +++ .../models/issues_search_result_included.rb | 65 ++ ...issues_search_result_issue_relationship.rb | 123 +++ .../issues_search_result_relationships.rb | 105 ++ .../v2/models/issues_search_result_type.rb | 26 + ...rch_issues_include_query_parameter_item.rb | 29 + 85 files changed, 7445 insertions(+) create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.yml create mode 100644 cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.frozen create mode 100644 cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.yml create mode 100644 examples/v2/error-tracking/GetIssue.rb create mode 100644 examples/v2/error-tracking/SearchIssues.rb create mode 100644 examples/v2/error-tracking/UpdateIssueAssignee.rb create mode 100644 examples/v2/error-tracking/UpdateIssueState.rb create mode 100644 features/v2/error_tracking.feature create mode 100644 lib/datadog_api_client/v2/api/error_tracking_api.rb create mode 100644 lib/datadog_api_client/v2/models/get_issue_include_query_parameter_item.rb create mode 100644 lib/datadog_api_client/v2/models/issue.rb create mode 100644 lib/datadog_api_client/v2/models/issue_assignee_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/issue_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_insight.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_jira_issue.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_jira_issue_result.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_reference.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/issue_case_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/issue_included.rb create mode 100644 lib/datadog_api_client/v2/models/issue_language.rb create mode 100644 lib/datadog_api_client/v2/models/issue_platform.rb create mode 100644 lib/datadog_api_client/v2/models/issue_reference.rb create mode 100644 lib/datadog_api_client/v2/models/issue_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/issue_response.rb create mode 100644 lib/datadog_api_client/v2/models/issue_state.rb create mode 100644 lib/datadog_api_client/v2/models/issue_team.rb create mode 100644 lib/datadog_api_client/v2/models/issue_team_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issue_team_owners_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/issue_team_reference.rb create mode 100644 lib/datadog_api_client/v2/models/issue_team_type.rb create mode 100644 lib/datadog_api_client/v2/models/issue_type.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_assignee_request.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_assignee_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_assignee_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_state_request.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_state_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_state_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issue_update_state_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/issue_user.rb create mode 100644 lib/datadog_api_client/v2/models/issue_user_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issue_user_reference.rb create mode 100644 lib/datadog_api_client/v2/models/issue_user_type.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data_attributes_order_by.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data_attributes_persona.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data_attributes_track.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_response.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result_included.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result_issue_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/issues_search_result_type.rb create mode 100644 lib/datadog_api_client/v2/models/search_issues_include_query_parameter_item.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a0f0a2bd0980..4d0c4849320a 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/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.frozen b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ed3ceb52afc8 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-29T12:19:16.262Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.yml b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..ee1d436c8ec6 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Fri, 29 Aug 2025 12:19:16 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/invalid-issue-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"issue id + is not an uuid"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.frozen b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..f06088aabcb2 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.272Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.yml b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.yml new file mode 100644 index 000000000000..c846549d6c91 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-Not-Found-response.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755012813000,"query":"service:synthetics-browser","to":1756308813000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 Aug 2025 15:33:33 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.frozen b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.frozen new file mode 100644 index 000000000000..ea355a631729 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.577Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.yml b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.yml new file mode 100644 index 000000000000..a34d32b21084 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Get-the-details-of-an-error-tracking-issue-returns-OK-response.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755012813000,"query":"service:synthetics-browser","to":1756308813000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 Aug 2025 15:33:33 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.frozen b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..1620da15c2f7 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-29T12:59:23.045Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.yml b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..f8a67824e83c --- /dev/null +++ b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Fri, 29 Aug 2025 12:59:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1671612804000,"query":"service:orders-* + AND @language:go","to":1671620004000,"track":"invalid-track"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + json value for TrackType: invalid-track"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.frozen b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.frozen new file mode 100644 index 000000000000..866d87cbf01d --- /dev/null +++ b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:33.997Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.yml b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.yml new file mode 100644 index 000000000000..1279f9abee25 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Search-error-tracking-issues-returns-OK-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1671612804000,"query":"service:orders-* + AND @language:go","to":1671620004000,"track":"trace"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.frozen b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..18402a42a977 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-29T12:59:23.349Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.yml b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..b3cb01516766 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Bad-Request-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Fri, 29 Aug 2025 12:59:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755176363000,"query":"service:synthetics-browser","to":1756472363000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 29 Aug 2025 12:59:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"invalid-id","type":"assignee"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + UUID length: 10"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.frozen b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..409dfdcd13f6 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:34.622Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.yml b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.yml new file mode 100644 index 000000000000..36105785a838 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:34 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"assignee"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/assignee + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.frozen b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.frozen new file mode 100644 index 000000000000..dd78c9df0883 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:34.689Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.yml b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.yml new file mode 100644 index 000000000000..37fbc0ba1aac --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-assignee-of-an-issue-returns-OK-response.yml @@ -0,0 +1,48 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:34 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755012814000,"query":"service:synthetics-browser","to":1756308814000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 Aug 2025 15:33:34 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"assignee"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/assignee + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}},"included":[{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case","attributes":{"closed_at":"2025-08-21T17:21:13.882831Z","created_at":"2025-08-21T17:20:22.807979Z","creation_source":"ERROR_TRACKING","description":"","insights":[{"type":"ERROR_TRACKING","ref":"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","resource_id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002"}],"key":"ET-1","modified_at":"2025-08-21T17:21:13.882831Z","priority":"NOT_DEFINED","status":"CLOSED","title":"Error: + HTTP error","type":"ERROR_TRACKING_ISSUE"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"384521ba-dc5f-481f-942d-15bd48428029","type":"project"}}}},{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user","attributes":{"email":"","handle":"","name":""}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.frozen b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..f505962d3073 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.029Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.yml b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..e2bd234493a4 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Bad-Request-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755012815000,"query":"service:synthetics-browser","to":1756308815000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 Aug 2025 15:33:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"state":"invalid-state"},"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_issue"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + json value for IssueState: \"invalid-state\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.frozen b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..4e11e96c74b3 --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.373Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.yml b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.yml new file mode 100644 index 000000000000..af9b8dd275fb --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"state":"resolved"},"id":"67d80aa3-36ff-44b9-a694-c501a7591737","type":"error_tracking_issue"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/67d80aa3-36ff-44b9-a694-c501a7591737/state + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"issue not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.frozen b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.frozen new file mode 100644 index 000000000000..05ba9e07125b --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-08-27T15:33:35.431Z \ No newline at end of file diff --git a/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.yml b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.yml new file mode 100644 index 000000000000..180b2e1f952a --- /dev/null +++ b/cassettes/features/v2/error_tracking/Update-the-state-of-an-issue-returns-OK-response.yml @@ -0,0 +1,48 @@ +http_interactions: +- recorded_at: Wed, 27 Aug 2025 15:33:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":1755012815000,"query":"service:synthetics-browser","to":1756308815000,"track":"rum"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/search + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_search_result","attributes":{"impacted_sessions":1,"total_count":1},"relationships":{"issue":{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 Aug 2025 15:33:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"state":"RESOLVED"},"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"error_tracking_issue"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/error-tracking/issues/5f8ebd5c-6dd9-11f0-8a28-da7ad0900002/state + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","type":"issue","attributes":{"error_message":"HTTP + error","error_type":"Error","file_path":"","first_seen":1753944082256,"first_seen_version":"","function_name":"","is_crash":false,"languages":["JAVASCRIPT"],"last_seen":1755686259367,"last_seen_version":"","platform":"BROWSER","service":"synthetics-browser","state":"RESOLVED"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"case":{"data":{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case"}}}},"included":[{"id":"f1b32a47-621d-4c57-9642-045aeb83891e","type":"case","attributes":{"closed_at":"2025-08-21T17:21:13.882831Z","created_at":"2025-08-21T17:20:22.807979Z","creation_source":"ERROR_TRACKING","description":"","insights":[{"type":"ERROR_TRACKING","ref":"/error-tracking?issueId=5f8ebd5c-6dd9-11f0-8a28-da7ad0900002","resource_id":"5f8ebd5c-6dd9-11f0-8a28-da7ad0900002"}],"key":"ET-1","modified_at":"2025-08-21T17:21:13.882831Z","priority":"NOT_DEFINED","status":"CLOSED","title":"Error: + HTTP error","type":"ERROR_TRACKING_ISSUE"},"relationships":{"assignee":{"data":{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"384521ba-dc5f-481f-942d-15bd48428029","type":"project"}}}},{"id":"87cb11a0-278c-440a-99fe-701223c80296","type":"user","attributes":{"email":"","handle":"","name":""}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/error-tracking/GetIssue.rb b/examples/v2/error-tracking/GetIssue.rb new file mode 100644 index 000000000000..0179e6b4499f --- /dev/null +++ b/examples/v2/error-tracking/GetIssue.rb @@ -0,0 +1,8 @@ +# Get the details of an error tracking issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new + +# there is a valid "issue" in the system +ISSUE_ID = ENV["ISSUE_ID"] +p api_instance.get_issue(ISSUE_ID) diff --git a/examples/v2/error-tracking/SearchIssues.rb b/examples/v2/error-tracking/SearchIssues.rb new file mode 100644 index 000000000000..346d6c34f1bc --- /dev/null +++ b/examples/v2/error-tracking/SearchIssues.rb @@ -0,0 +1,17 @@ +# Search error tracking issues returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new + +body = DatadogAPIClient::V2::IssuesSearchRequest.new({ + data: DatadogAPIClient::V2::IssuesSearchRequestData.new({ + attributes: DatadogAPIClient::V2::IssuesSearchRequestDataAttributes.new({ + query: "service:orders-* AND @language:go", + from: 1671612804000, + to: 1671620004000, + track: DatadogAPIClient::V2::IssuesSearchRequestDataAttributesTrack::TRACE, + }), + type: DatadogAPIClient::V2::IssuesSearchRequestDataType::SEARCH_REQUEST, + }), +}) +p api_instance.search_issues(body) diff --git a/examples/v2/error-tracking/UpdateIssueAssignee.rb b/examples/v2/error-tracking/UpdateIssueAssignee.rb new file mode 100644 index 000000000000..06cca011179b --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueAssignee.rb @@ -0,0 +1,15 @@ +# Update the assignee of an issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new + +# there is a valid "issue" in the system +ISSUE_ID = ENV["ISSUE_ID"] + +body = DatadogAPIClient::V2::IssueUpdateAssigneeRequest.new({ + data: DatadogAPIClient::V2::IssueUpdateAssigneeRequestData.new({ + id: "87cb11a0-278c-440a-99fe-701223c80296", + type: DatadogAPIClient::V2::IssueUpdateAssigneeRequestDataType::ASSIGNEE, + }), +}) +p api_instance.update_issue_assignee(ISSUE_ID, body) diff --git a/examples/v2/error-tracking/UpdateIssueState.rb b/examples/v2/error-tracking/UpdateIssueState.rb new file mode 100644 index 000000000000..505f62b95549 --- /dev/null +++ b/examples/v2/error-tracking/UpdateIssueState.rb @@ -0,0 +1,18 @@ +# Update the state of an issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new + +# there is a valid "issue" in the system +ISSUE_ID = ENV["ISSUE_ID"] + +body = DatadogAPIClient::V2::IssueUpdateStateRequest.new({ + data: DatadogAPIClient::V2::IssueUpdateStateRequestData.new({ + attributes: DatadogAPIClient::V2::IssueUpdateStateRequestDataAttributes.new({ + state: DatadogAPIClient::V2::IssueState::RESOLVED, + }), + id: ISSUE_ID, + type: DatadogAPIClient::V2::IssueUpdateStateRequestDataType::ERROR_TRACKING_ISSUE, + }), +}) +p api_instance.update_issue_state(ISSUE_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 93b43d1c1d96..45b4bc5a77d6 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1679,6 +1679,22 @@ "page_offset" => "Integer", "page_limit" => "Integer", }, + "v2.SearchIssues" => { + "include" => "Array", + "body" => "IssuesSearchRequest", + }, + "v2.GetIssue" => { + "issue_id" => "String", + "include" => "Array", + }, + "v2.UpdateIssueAssignee" => { + "issue_id" => "String", + "body" => "IssueUpdateAssigneeRequest", + }, + "v2.UpdateIssueState" => { + "issue_id" => "String", + "body" => "IssueUpdateStateRequest", + }, "v2.ListEvents" => { "filter_query" => "String", "filter_from" => "String", diff --git a/features/v2/error_tracking.feature b/features/v2/error_tracking.feature new file mode 100644 index 000000000000..97f8ceeedd93 --- /dev/null +++ b/features/v2/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/features/v2/given.json b/features/v2/given.json index fbeea567872f..79e6d4c45d2c 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index ec94e15e11da..fb630772c1cb 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d23ae42738fb..08215a2111f3 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2042,6 +2042,7 @@ def overrides "v2.get_finding_response" => "GetFindingResponse", "v2.get_interfaces_data" => "GetInterfacesData", "v2.get_interfaces_response" => "GetInterfacesResponse", + "v2.get_issue_include_query_parameter_item" => "GetIssueIncludeQueryParameterItem", "v2.get_resource_evaluation_filters_response" => "GetResourceEvaluationFiltersResponse", "v2.get_resource_evaluation_filters_response_data" => "GetResourceEvaluationFiltersResponseData", "v2.get_rule_version_history_data" => "GetRuleVersionHistoryData", @@ -2249,6 +2250,56 @@ def overrides "v2.ip_allowlist_response" => "IPAllowlistResponse", "v2.ip_allowlist_type" => "IPAllowlistType", "v2.ip_allowlist_update_request" => "IPAllowlistUpdateRequest", + "v2.issue" => "Issue", + "v2.issue_assignee_relationship" => "IssueAssigneeRelationship", + "v2.issue_attributes" => "IssueAttributes", + "v2.issue_case" => "IssueCase", + "v2.issue_case_attributes" => "IssueCaseAttributes", + "v2.issue_case_insight" => "IssueCaseInsight", + "v2.issue_case_jira_issue" => "IssueCaseJiraIssue", + "v2.issue_case_jira_issue_result" => "IssueCaseJiraIssueResult", + "v2.issue_case_reference" => "IssueCaseReference", + "v2.issue_case_relationship" => "IssueCaseRelationship", + "v2.issue_case_relationships" => "IssueCaseRelationships", + "v2.issue_case_resource_type" => "IssueCaseResourceType", + "v2.issue_included" => "IssueIncluded", + "v2.issue_language" => "IssueLanguage", + "v2.issue_platform" => "IssuePlatform", + "v2.issue_reference" => "IssueReference", + "v2.issue_relationships" => "IssueRelationships", + "v2.issue_response" => "IssueResponse", + "v2.issues_search_request" => "IssuesSearchRequest", + "v2.issues_search_request_data" => "IssuesSearchRequestData", + "v2.issues_search_request_data_attributes" => "IssuesSearchRequestDataAttributes", + "v2.issues_search_request_data_attributes_order_by" => "IssuesSearchRequestDataAttributesOrderBy", + "v2.issues_search_request_data_attributes_persona" => "IssuesSearchRequestDataAttributesPersona", + "v2.issues_search_request_data_attributes_track" => "IssuesSearchRequestDataAttributesTrack", + "v2.issues_search_request_data_type" => "IssuesSearchRequestDataType", + "v2.issues_search_response" => "IssuesSearchResponse", + "v2.issues_search_result" => "IssuesSearchResult", + "v2.issues_search_result_attributes" => "IssuesSearchResultAttributes", + "v2.issues_search_result_included" => "IssuesSearchResultIncluded", + "v2.issues_search_result_issue_relationship" => "IssuesSearchResultIssueRelationship", + "v2.issues_search_result_relationships" => "IssuesSearchResultRelationships", + "v2.issues_search_result_type" => "IssuesSearchResultType", + "v2.issue_state" => "IssueState", + "v2.issue_team" => "IssueTeam", + "v2.issue_team_attributes" => "IssueTeamAttributes", + "v2.issue_team_owners_relationship" => "IssueTeamOwnersRelationship", + "v2.issue_team_reference" => "IssueTeamReference", + "v2.issue_team_type" => "IssueTeamType", + "v2.issue_type" => "IssueType", + "v2.issue_update_assignee_request" => "IssueUpdateAssigneeRequest", + "v2.issue_update_assignee_request_data" => "IssueUpdateAssigneeRequestData", + "v2.issue_update_assignee_request_data_type" => "IssueUpdateAssigneeRequestDataType", + "v2.issue_update_state_request" => "IssueUpdateStateRequest", + "v2.issue_update_state_request_data" => "IssueUpdateStateRequestData", + "v2.issue_update_state_request_data_attributes" => "IssueUpdateStateRequestDataAttributes", + "v2.issue_update_state_request_data_type" => "IssueUpdateStateRequestDataType", + "v2.issue_user" => "IssueUser", + "v2.issue_user_attributes" => "IssueUserAttributes", + "v2.issue_user_reference" => "IssueUserReference", + "v2.issue_user_type" => "IssueUserType", "v2.jira_integration_metadata" => "JiraIntegrationMetadata", "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", @@ -3241,6 +3292,7 @@ def overrides "v2.schedule_user_attributes" => "ScheduleUserAttributes", "v2.schedule_user_type" => "ScheduleUserType", "v2.scorecard_type" => "ScorecardType", + "v2.search_issues_include_query_parameter_item" => "SearchIssuesIncludeQueryParameterItem", "v2.security_filter" => "SecurityFilter", "v2.security_filter_attributes" => "SecurityFilterAttributes", "v2.security_filter_create_attributes" => "SecurityFilterCreateAttributes", @@ -3901,6 +3953,7 @@ def overrides "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", "v2.downtimes_api" => "DowntimesAPI", + "v2.error_tracking_api" => "ErrorTrackingAPI", "v2.events_api" => "EventsAPI", "v2.fastly_integration_api" => "FastlyIntegrationAPI", "v2.gcp_integration_api" => "GCPIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/error_tracking_api.rb b/lib/datadog_api_client/v2/api/error_tracking_api.rb new file mode 100644 index 000000000000..0952915cb832 --- /dev/null +++ b/lib/datadog_api_client/v2/api/error_tracking_api.rb @@ -0,0 +1,306 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class ErrorTrackingAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get the details of an error tracking issue. + # + # @see #get_issue_with_http_info + def get_issue(issue_id, opts = {}) + data, _status_code, _headers = get_issue_with_http_info(issue_id, opts) + data + end + + # Get the details of an error tracking issue. + # + # Retrieve the full details for a specific error tracking issue, including attributes and relationships. + # + # @param issue_id [String] The identifier of the issue. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Comma-separated list of relationship objects that should be included in the response. + # @return [Array<(IssueResponse, Integer, Hash)>] IssueResponse data, response status code and response headers + def get_issue_with_http_info(issue_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ErrorTrackingAPI.get_issue ...' + end + # verify the required parameter 'issue_id' is set + if @api_client.config.client_side_validation && issue_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_id' when calling ErrorTrackingAPI.get_issue" + end + # resource path + local_var_path = '/api/v2/error-tracking/issues/{issue_id}'.sub('{issue_id}', CGI.escape(issue_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IssueResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_issue, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ErrorTrackingAPI#get_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search error tracking issues. + # + # @see #search_issues_with_http_info + def search_issues(body, opts = {}) + data, _status_code, _headers = search_issues_with_http_info(body, opts) + data + end + + # Search error tracking issues. + # + # Search issues endpoint allows you to programmatically search for issues within your organization. This endpoint returns a list of issues that match a given search query, following the event search syntax. The search results are limited to a maximum of 100 issues per request. + # + # @param body [IssuesSearchRequest] Search issues request payload. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Comma-separated list of relationship objects that should be included in the response. + # @return [Array<(IssuesSearchResponse, Integer, Hash)>] IssuesSearchResponse data, response status code and response headers + def search_issues_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ErrorTrackingAPI.search_issues ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ErrorTrackingAPI.search_issues" + end + # resource path + local_var_path = '/api/v2/error-tracking/issues/search' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IssuesSearchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :search_issues, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ErrorTrackingAPI#search_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update the assignee of an issue. + # + # @see #update_issue_assignee_with_http_info + def update_issue_assignee(issue_id, body, opts = {}) + data, _status_code, _headers = update_issue_assignee_with_http_info(issue_id, body, opts) + data + end + + # Update the assignee of an issue. + # + # Update the assignee of an issue by `issue_id`. + # + # @param issue_id [String] The identifier of the issue. + # @param body [IssueUpdateAssigneeRequest] Update issue assignee request payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IssueResponse, Integer, Hash)>] IssueResponse data, response status code and response headers + def update_issue_assignee_with_http_info(issue_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ErrorTrackingAPI.update_issue_assignee ...' + end + # verify the required parameter 'issue_id' is set + if @api_client.config.client_side_validation && issue_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_id' when calling ErrorTrackingAPI.update_issue_assignee" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ErrorTrackingAPI.update_issue_assignee" + end + # resource path + local_var_path = '/api/v2/error-tracking/issues/{issue_id}/assignee'.sub('{issue_id}', CGI.escape(issue_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IssueResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_issue_assignee, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ErrorTrackingAPI#update_issue_assignee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update the state of an issue. + # + # @see #update_issue_state_with_http_info + def update_issue_state(issue_id, body, opts = {}) + data, _status_code, _headers = update_issue_state_with_http_info(issue_id, body, opts) + data + end + + # Update the state of an issue. + # + # 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 issue_id [String] The identifier of the issue. + # @param body [IssueUpdateStateRequest] Update issue state request payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IssueResponse, Integer, Hash)>] IssueResponse data, response status code and response headers + def update_issue_state_with_http_info(issue_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ErrorTrackingAPI.update_issue_state ...' + end + # verify the required parameter 'issue_id' is set + if @api_client.config.client_side_validation && issue_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_id' when calling ErrorTrackingAPI.update_issue_state" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ErrorTrackingAPI.update_issue_state" + end + # resource path + local_var_path = '/api/v2/error-tracking/issues/{issue_id}/state'.sub('{issue_id}', CGI.escape(issue_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IssueResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_issue_state, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ErrorTrackingAPI#update_issue_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_issue_include_query_parameter_item.rb b/lib/datadog_api_client/v2/models/get_issue_include_query_parameter_item.rb new file mode 100644 index 000000000000..637e3982c3b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_issue_include_query_parameter_item.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship object that should be included in the response. + class GetIssueIncludeQueryParameterItem + include BaseEnumModel + + ASSIGNEE = "assignee".freeze + CASE = "case".freeze + TEAM_OWNERS = "team_owners".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue.rb b/lib/datadog_api_client/v2/models/issue.rb new file mode 100644 index 000000000000..83bf8ee01d9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The issue matching the request. + class Issue + include BaseGenericModel + + # Object containing the information of an issue. + attr_reader :attributes + + # Issue identifier. + attr_reader :id + + # Relationship between the issue and an assignee, case and/or teams. + attr_accessor :relationships + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssueAttributes', + :'id' => :'String', + :'relationships' => :'IssueRelationships', + :'type' => :'IssueType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Issue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_assignee_relationship.rb b/lib/datadog_api_client/v2/models/issue_assignee_relationship.rb new file mode 100644 index 000000000000..4a56a8ca2db4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_assignee_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship between the issue and assignee. + class IssueAssigneeRelationship + include BaseGenericModel + + # The user the issue is assigned to. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssueUserReference' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueAssigneeRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_attributes.rb b/lib/datadog_api_client/v2/models/issue_attributes.rb new file mode 100644 index 000000000000..55e5661930fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_attributes.rb @@ -0,0 +1,227 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the information of an issue. + class IssueAttributes + include BaseGenericModel + + # Error message associated with the issue. + attr_accessor :error_message + + # Type of the error that matches the issue. + attr_accessor :error_type + + # Path of the file where the issue occurred. + attr_accessor :file_path + + # Timestamp of the first seen error in milliseconds since the Unix epoch. + attr_accessor :first_seen + + # The application version (for example, git commit hash) where the issue was first observed. + attr_accessor :first_seen_version + + # Name of the function where the issue occurred. + attr_accessor :function_name + + # Error is a crash. + attr_accessor :is_crash + + # Array of programming languages associated with the issue. + attr_accessor :languages + + # Timestamp of the last seen error in milliseconds since the Unix epoch. + attr_accessor :last_seen + + # The application version (for example, git commit hash) where the issue was last observed. + attr_accessor :last_seen_version + + # Platform associated with the issue. + attr_accessor :platform + + # Service name. + attr_accessor :service + + # State of the issue + attr_accessor :state + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error_message' => :'error_message', + :'error_type' => :'error_type', + :'file_path' => :'file_path', + :'first_seen' => :'first_seen', + :'first_seen_version' => :'first_seen_version', + :'function_name' => :'function_name', + :'is_crash' => :'is_crash', + :'languages' => :'languages', + :'last_seen' => :'last_seen', + :'last_seen_version' => :'last_seen_version', + :'platform' => :'platform', + :'service' => :'service', + :'state' => :'state' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error_message' => :'String', + :'error_type' => :'String', + :'file_path' => :'String', + :'first_seen' => :'Integer', + :'first_seen_version' => :'String', + :'function_name' => :'String', + :'is_crash' => :'Boolean', + :'languages' => :'Array', + :'last_seen' => :'Integer', + :'last_seen_version' => :'String', + :'platform' => :'IssuePlatform', + :'service' => :'String', + :'state' => :'IssueState' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_type') + self.error_type = attributes[:'error_type'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'first_seen') + self.first_seen = attributes[:'first_seen'] + end + + if attributes.key?(:'first_seen_version') + self.first_seen_version = attributes[:'first_seen_version'] + end + + if attributes.key?(:'function_name') + self.function_name = attributes[:'function_name'] + end + + if attributes.key?(:'is_crash') + self.is_crash = attributes[:'is_crash'] + end + + if attributes.key?(:'languages') + if (value = attributes[:'languages']).is_a?(Array) + self.languages = value + end + end + + if attributes.key?(:'last_seen') + self.last_seen = attributes[:'last_seen'] + end + + if attributes.key?(:'last_seen_version') + self.last_seen_version = attributes[:'last_seen_version'] + end + + if attributes.key?(:'platform') + self.platform = attributes[:'platform'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_message == o.error_message && + error_type == o.error_type && + file_path == o.file_path && + first_seen == o.first_seen && + first_seen_version == o.first_seen_version && + function_name == o.function_name && + is_crash == o.is_crash && + languages == o.languages && + last_seen == o.last_seen && + last_seen_version == o.last_seen_version && + platform == o.platform && + service == o.service && + state == o.state && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error_message, error_type, file_path, first_seen, first_seen_version, function_name, is_crash, languages, last_seen, last_seen_version, platform, service, state, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case.rb b/lib/datadog_api_client/v2/models/issue_case.rb new file mode 100644 index 000000000000..56e560b7ea0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The case attached to the issue. + class IssueCase + include BaseGenericModel + + # Object containing the information of a case. + attr_reader :attributes + + # Case identifier. + attr_reader :id + + # Resources related to a case. + attr_accessor :relationships + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssueCaseAttributes', + :'id' => :'String', + :'relationships' => :'IssueCaseRelationships', + :'type' => :'IssueCaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCase` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_attributes.rb b/lib/datadog_api_client/v2/models/issue_case_attributes.rb new file mode 100644 index 000000000000..bf40017fdc4e --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_attributes.rb @@ -0,0 +1,237 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the information of a case. + class IssueCaseAttributes + include BaseGenericModel + + # Timestamp of when the case was archived. + attr_accessor :archived_at + + # Timestamp of when the case was closed. + attr_accessor :closed_at + + # Timestamp of when the case was created. + attr_accessor :created_at + + # Source of the case creation. + attr_accessor :creation_source + + # Description of the case. + attr_accessor :description + + # Due date of the case. + attr_accessor :due_date + + # Insights of the case. + attr_accessor :insights + + # Jira issue of the case. + attr_accessor :jira_issue + + # Key of the case. + attr_accessor :key + + # Timestamp of when the case was last modified. + attr_accessor :modified_at + + # Case priority + attr_accessor :priority + + # Case status + attr_accessor :status + + # Title of the case. + attr_accessor :title + + # Type of the case. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'archived_at' => :'archived_at', + :'closed_at' => :'closed_at', + :'created_at' => :'created_at', + :'creation_source' => :'creation_source', + :'description' => :'description', + :'due_date' => :'due_date', + :'insights' => :'insights', + :'jira_issue' => :'jira_issue', + :'key' => :'key', + :'modified_at' => :'modified_at', + :'priority' => :'priority', + :'status' => :'status', + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'archived_at' => :'Time', + :'closed_at' => :'Time', + :'created_at' => :'Time', + :'creation_source' => :'String', + :'description' => :'String', + :'due_date' => :'String', + :'insights' => :'Array', + :'jira_issue' => :'IssueCaseJiraIssue', + :'key' => :'String', + :'modified_at' => :'Time', + :'priority' => :'CasePriority', + :'status' => :'CaseStatus', + :'title' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'archived_at') + self.archived_at = attributes[:'archived_at'] + end + + if attributes.key?(:'closed_at') + self.closed_at = attributes[:'closed_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'creation_source') + self.creation_source = attributes[:'creation_source'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'insights') + if (value = attributes[:'insights']).is_a?(Array) + self.insights = value + end + end + + if attributes.key?(:'jira_issue') + self.jira_issue = attributes[:'jira_issue'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + archived_at == o.archived_at && + closed_at == o.closed_at && + created_at == o.created_at && + creation_source == o.creation_source && + description == o.description && + due_date == o.due_date && + insights == o.insights && + jira_issue == o.jira_issue && + key == o.key && + modified_at == o.modified_at && + priority == o.priority && + status == o.status && + title == o.title && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [archived_at, closed_at, created_at, creation_source, description, due_date, insights, jira_issue, key, modified_at, priority, status, title, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_insight.rb b/lib/datadog_api_client/v2/models/issue_case_insight.rb new file mode 100644 index 000000000000..ff9fc2c96838 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_insight.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Insight of the case. + class IssueCaseInsight + include BaseGenericModel + + # Reference of the insight. + attr_accessor :ref + + # Insight identifier. + attr_accessor :resource_id + + # Type of the insight. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ref' => :'ref', + :'resource_id' => :'resource_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ref' => :'String', + :'resource_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseInsight` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ref') + self.ref = attributes[:'ref'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ref == o.ref && + resource_id == o.resource_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ref, resource_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_jira_issue.rb b/lib/datadog_api_client/v2/models/issue_case_jira_issue.rb new file mode 100644 index 000000000000..627029abccda --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_jira_issue.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jira issue of the case. + class IssueCaseJiraIssue + include BaseGenericModel + + # Contains the identifiers and URL for a successfully created Jira issue. + attr_accessor :result + + # Creation status of the Jira issue. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'result' => :'IssueCaseJiraIssueResult', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseJiraIssue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + result == o.result && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [result, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_jira_issue_result.rb b/lib/datadog_api_client/v2/models/issue_case_jira_issue_result.rb new file mode 100644 index 000000000000..6d5d4ac3069e --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_jira_issue_result.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Contains the identifiers and URL for a successfully created Jira issue. + class IssueCaseJiraIssueResult + include BaseGenericModel + + # Jira issue identifier. + attr_accessor :issue_id + + # Jira issue key. + attr_accessor :issue_key + + # Jira issue URL. + attr_accessor :issue_url + + # Jira project key. + attr_accessor :project_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'issue_id' => :'issue_id', + :'issue_key' => :'issue_key', + :'issue_url' => :'issue_url', + :'project_key' => :'project_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'issue_id' => :'String', + :'issue_key' => :'String', + :'issue_url' => :'String', + :'project_key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseJiraIssueResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'issue_id') + self.issue_id = attributes[:'issue_id'] + end + + if attributes.key?(:'issue_key') + self.issue_key = attributes[:'issue_key'] + end + + if attributes.key?(:'issue_url') + self.issue_url = attributes[:'issue_url'] + end + + if attributes.key?(:'project_key') + self.project_key = attributes[:'project_key'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + issue_id == o.issue_id && + issue_key == o.issue_key && + issue_url == o.issue_url && + project_key == o.project_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [issue_id, issue_key, issue_url, project_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_reference.rb b/lib/datadog_api_client/v2/models/issue_case_reference.rb new file mode 100644 index 000000000000..d134c8d1fbc3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_reference.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The case the issue is attached to. + class IssueCaseReference + include BaseGenericModel + + # Case identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IssueCaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_relationship.rb b/lib/datadog_api_client/v2/models/issue_case_relationship.rb new file mode 100644 index 000000000000..1da4cc514c0d --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship between the issue and case. + class IssueCaseRelationship + include BaseGenericModel + + # The case the issue is attached to. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssueCaseReference' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_relationships.rb b/lib/datadog_api_client/v2/models/issue_case_relationships.rb new file mode 100644 index 000000000000..fb94bd403550 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_relationships.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resources related to a case. + class IssueCaseRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :assignee + + # Relationship to user. + attr_accessor :created_by + + # Relationship to user. + attr_accessor :modified_by + + # Relationship to project + attr_accessor :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee' => :'assignee', + :'created_by' => :'created_by', + :'modified_by' => :'modified_by', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee' => :'NullableUserRelationship', + :'created_by' => :'NullableUserRelationship', + :'modified_by' => :'NullableUserRelationship', + :'project' => :'ProjectRelationship' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assignee', + :'created_by', + :'modified_by', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueCaseRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee == o.assignee && + created_by == o.created_by && + modified_by == o.modified_by && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee, created_by, modified_by, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_case_resource_type.rb b/lib/datadog_api_client/v2/models/issue_case_resource_type.rb new file mode 100644 index 000000000000..86d0386a5326 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_case_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssueCaseResourceType + include BaseEnumModel + + CASE = "case".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_included.rb b/lib/datadog_api_client/v2/models/issue_included.rb new file mode 100644 index 000000000000..8ad0da152c66 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_included.rb @@ -0,0 +1,64 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An array of related resources, returned when the `include` query parameter is used. + module IssueIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IssueCase', + :'IssueUser', + :'IssueTeam' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_language.rb b/lib/datadog_api_client/v2/models/issue_language.rb new file mode 100644 index 000000000000..44a1d4a2ded3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_language.rb @@ -0,0 +1,52 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Programming language associated with the issue. + class IssueLanguage + include BaseEnumModel + + BRIGHTSCRIPT = "BRIGHTSCRIPT".freeze + C = "C".freeze + C_PLUS_PLUS = "C_PLUS_PLUS".freeze + C_SHARP = "C_SHARP".freeze + CLOJURE = "CLOJURE".freeze + DOT_NET = "DOT_NET".freeze + ELIXIR = "ELIXIR".freeze + ERLANG = "ERLANG".freeze + GO = "GO".freeze + GROOVY = "GROOVY".freeze + HASKELL = "HASKELL".freeze + HCL = "HCL".freeze + JAVA = "JAVA".freeze + JAVASCRIPT = "JAVASCRIPT".freeze + JVM = "JVM".freeze + KOTLIN = "KOTLIN".freeze + OBJECTIVE_C = "OBJECTIVE_C".freeze + PERL = "PERL".freeze + PHP = "PHP".freeze + PYTHON = "PYTHON".freeze + RUBY = "RUBY".freeze + RUST = "RUST".freeze + SCALA = "SCALA".freeze + SWIFT = "SWIFT".freeze + TERRAFORM = "TERRAFORM".freeze + TYPESCRIPT = "TYPESCRIPT".freeze + UNKNOWN = "UNKNOWN".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_platform.rb b/lib/datadog_api_client/v2/models/issue_platform.rb new file mode 100644 index 000000000000..77b3488a9e3b --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_platform.rb @@ -0,0 +1,33 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Platform associated with the issue. + class IssuePlatform + include BaseEnumModel + + ANDROID = "ANDROID".freeze + BACKEND = "BACKEND".freeze + BROWSER = "BROWSER".freeze + FLUTTER = "FLUTTER".freeze + IOS = "IOS".freeze + REACT_NATIVE = "REACT_NATIVE".freeze + ROKU = "ROKU".freeze + UNKNOWN = "UNKNOWN".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_reference.rb b/lib/datadog_api_client/v2/models/issue_reference.rb new file mode 100644 index 000000000000..4bb643aa1092 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_reference.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The issue the search result corresponds to. + class IssueReference + include BaseGenericModel + + # Issue identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IssueType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_relationships.rb b/lib/datadog_api_client/v2/models/issue_relationships.rb new file mode 100644 index 000000000000..e6b32eba4d74 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship between the issue and an assignee, case and/or teams. + class IssueRelationships + include BaseGenericModel + + # Relationship between the issue and assignee. + attr_accessor :assignee + + # Relationship between the issue and case. + attr_accessor :_case + + # Relationship between the issue and teams. + attr_accessor :team_owners + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee' => :'assignee', + :'_case' => :'case', + :'team_owners' => :'team_owners' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee' => :'IssueAssigneeRelationship', + :'_case' => :'IssueCaseRelationship', + :'team_owners' => :'IssueTeamOwnersRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'_case') + self._case = attributes[:'_case'] + end + + if attributes.key?(:'team_owners') + self.team_owners = attributes[:'team_owners'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee == o.assignee && + _case == o._case && + team_owners == o.team_owners && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee, _case, team_owners, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_response.rb b/lib/datadog_api_client/v2/models/issue_response.rb new file mode 100644 index 000000000000..2d70d827fbde --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing error tracking issue data. + class IssueResponse + include BaseGenericModel + + # The issue matching the request. + attr_accessor :data + + # Array of resources related to the issue. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Issue', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_state.rb b/lib/datadog_api_client/v2/models/issue_state.rb new file mode 100644 index 000000000000..d16cba7374ee --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_state.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # State of the issue + class IssueState + include BaseEnumModel + + OPEN = "OPEN".freeze + ACKNOWLEDGED = "ACKNOWLEDGED".freeze + RESOLVED = "RESOLVED".freeze + IGNORED = "IGNORED".freeze + EXCLUDED = "EXCLUDED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_team.rb b/lib/datadog_api_client/v2/models/issue_team.rb new file mode 100644 index 000000000000..d3b6296b8d44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_team.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A team that owns an issue. + class IssueTeam + include BaseGenericModel + + # Object containing the information of a team. + attr_reader :attributes + + # Team identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssueTeamAttributes', + :'id' => :'String', + :'type' => :'IssueTeamType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueTeam` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_team_attributes.rb b/lib/datadog_api_client/v2/models/issue_team_attributes.rb new file mode 100644 index 000000000000..fc55738911f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_team_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the information of a team. + class IssueTeamAttributes + include BaseGenericModel + + # The team's identifier. + attr_accessor :handle + + # The name of the team. + attr_accessor :name + + # A brief summary of the team, derived from its description. + attr_accessor :summary + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handle' => :'handle', + :'name' => :'name', + :'summary' => :'summary' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handle' => :'String', + :'name' => :'String', + :'summary' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueTeamAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + handle == o.handle && + name == o.name && + summary == o.summary && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handle, name, summary, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_team_owners_relationship.rb b/lib/datadog_api_client/v2/models/issue_team_owners_relationship.rb new file mode 100644 index 000000000000..7fb0ac94b2a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_team_owners_relationship.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship between the issue and teams. + class IssueTeamOwnersRelationship + include BaseGenericModel + + # Array of teams that are owners of the issue. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueTeamOwnersRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_team_reference.rb b/lib/datadog_api_client/v2/models/issue_team_reference.rb new file mode 100644 index 000000000000..5dbd01b683f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_team_reference.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A team that owns the issue. + class IssueTeamReference + include BaseGenericModel + + # Team identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IssueTeamType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueTeamReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_team_type.rb b/lib/datadog_api_client/v2/models/issue_team_type.rb new file mode 100644 index 000000000000..953dd517c616 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_team_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssueTeamType + include BaseEnumModel + + TEAM = "team".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_type.rb b/lib/datadog_api_client/v2/models/issue_type.rb new file mode 100644 index 000000000000..86731d6f1196 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssueType + include BaseEnumModel + + ISSUE = "issue".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_assignee_request.rb b/lib/datadog_api_client/v2/models/issue_update_assignee_request.rb new file mode 100644 index 000000000000..3033a9015334 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_assignee_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update issue assignee request payload. + class IssueUpdateAssigneeRequest + include BaseGenericModel + + # Update issue assignee request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssueUpdateAssigneeRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUpdateAssigneeRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_assignee_request_data.rb b/lib/datadog_api_client/v2/models/issue_update_assignee_request_data.rb new file mode 100644 index 000000000000..f3da95d5986e --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_assignee_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update issue assignee request. + class IssueUpdateAssigneeRequestData + include BaseGenericModel + + # User identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IssueUpdateAssigneeRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUpdateAssigneeRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_assignee_request_data_type.rb b/lib/datadog_api_client/v2/models/issue_update_assignee_request_data_type.rb new file mode 100644 index 000000000000..5ae5bc96f059 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_assignee_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssueUpdateAssigneeRequestDataType + include BaseEnumModel + + ASSIGNEE = "assignee".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_state_request.rb b/lib/datadog_api_client/v2/models/issue_update_state_request.rb new file mode 100644 index 000000000000..08e595316921 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_state_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update issue state request payload. + class IssueUpdateStateRequest + include BaseGenericModel + + # Update issue state request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssueUpdateStateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUpdateStateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_state_request_data.rb b/lib/datadog_api_client/v2/models/issue_update_state_request_data.rb new file mode 100644 index 000000000000..5a5d61f58336 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_state_request_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update issue state request. + class IssueUpdateStateRequestData + include BaseGenericModel + + # Object describing an issue state update request. + attr_reader :attributes + + # Issue identifier. + attr_reader :id + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssueUpdateStateRequestDataAttributes', + :'id' => :'String', + :'type' => :'IssueUpdateStateRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUpdateStateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_state_request_data_attributes.rb b/lib/datadog_api_client/v2/models/issue_update_state_request_data_attributes.rb new file mode 100644 index 000000000000..af3153d8a5ab --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_state_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing an issue state update request. + class IssueUpdateStateRequestDataAttributes + include BaseGenericModel + + # State of the issue + attr_reader :state + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'state' => :'state' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'state' => :'IssueState' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUpdateStateRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @state.nil? + true + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state == o.state && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [state, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_update_state_request_data_type.rb b/lib/datadog_api_client/v2/models/issue_update_state_request_data_type.rb new file mode 100644 index 000000000000..0bd481be9698 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_update_state_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssueUpdateStateRequestDataType + include BaseEnumModel + + ERROR_TRACKING_ISSUE = "error_tracking_issue".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_user.rb b/lib/datadog_api_client/v2/models/issue_user.rb new file mode 100644 index 000000000000..21bcd1a925ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_user.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The user to whom the issue is assigned. + class IssueUser + include BaseGenericModel + + # Object containing the information of a user. + attr_reader :attributes + + # User identifier. + attr_reader :id + + # Type of the object + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssueUserAttributes', + :'id' => :'String', + :'type' => :'IssueUserType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_user_attributes.rb b/lib/datadog_api_client/v2/models/issue_user_attributes.rb new file mode 100644 index 000000000000..3ebfc5c4b5e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_user_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the information of a user. + class IssueUserAttributes + include BaseGenericModel + + # Email of the user. + attr_accessor :email + + # Handle of the user. + attr_accessor :handle + + # Name of the user. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUserAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email == o.email && + handle == o.handle && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_user_reference.rb b/lib/datadog_api_client/v2/models/issue_user_reference.rb new file mode 100644 index 000000000000..0f489f22dd1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_user_reference.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The user the issue is assigned to. + class IssueUserReference + include BaseGenericModel + + # User identifier. + attr_reader :id + + # Type of the object + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IssueUserType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssueUserReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issue_user_type.rb b/lib/datadog_api_client/v2/models/issue_user_type.rb new file mode 100644 index 000000000000..a466f39939fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_user_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object + class IssueUserType + include BaseEnumModel + + USER = "user".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request.rb b/lib/datadog_api_client/v2/models/issues_search_request.rb new file mode 100644 index 000000000000..ccbd5d7ba37b --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Search issues request payload. + class IssuesSearchRequest + include BaseGenericModel + + # Search issues request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssuesSearchRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data.rb b/lib/datadog_api_client/v2/models/issues_search_request_data.rb new file mode 100644 index 000000000000..a966828047e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Search issues request. + class IssuesSearchRequestData + include BaseGenericModel + + # Object describing a search issue request. + attr_reader :attributes + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssuesSearchRequestDataAttributes', + :'type' => :'IssuesSearchRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data_attributes.rb b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes.rb new file mode 100644 index 000000000000..2618fe2a15ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes.rb @@ -0,0 +1,195 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing a search issue request. + class IssuesSearchRequestDataAttributes + include BaseGenericModel + + # Start date (inclusive) of the query in milliseconds since the Unix epoch. + attr_reader :from + + # The attribute to sort the search results by. + attr_accessor :order_by + + # Persona for the search. Either track(s) or persona(s) must be specified. + attr_accessor :persona + + # Search query following the event search syntax. + attr_reader :query + + # End date (exclusive) of the query in milliseconds since the Unix epoch. + attr_reader :to + + # Track of the events to query. Either track(s) or persona(s) must be specified. + attr_accessor :track + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'from' => :'from', + :'order_by' => :'order_by', + :'persona' => :'persona', + :'query' => :'query', + :'to' => :'to', + :'track' => :'track' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'from' => :'Integer', + :'order_by' => :'IssuesSearchRequestDataAttributesOrderBy', + :'persona' => :'IssuesSearchRequestDataAttributesPersona', + :'query' => :'String', + :'to' => :'Integer', + :'track' => :'IssuesSearchRequestDataAttributesTrack' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'order_by') + self.order_by = attributes[:'order_by'] + end + + if attributes.key?(:'persona') + self.persona = attributes[:'persona'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'track') + self.track = attributes[:'track'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @from.nil? + return false if @query.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from == o.from && + order_by == o.order_by && + persona == o.persona && + query == o.query && + to == o.to && + track == o.track && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [from, order_by, persona, query, to, track, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_order_by.rb b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_order_by.rb new file mode 100644 index 000000000000..ca5cec3b3048 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_order_by.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attribute to sort the search results by. + class IssuesSearchRequestDataAttributesOrderBy + include BaseEnumModel + + TOTAL_COUNT = "TOTAL_COUNT".freeze + FIRST_SEEN = "FIRST_SEEN".freeze + IMPACTED_SESSIONS = "IMPACTED_SESSIONS".freeze + PRIORITY = "PRIORITY".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_persona.rb b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_persona.rb new file mode 100644 index 000000000000..12f092db5946 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_persona.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Persona for the search. Either track(s) or persona(s) must be specified. + class IssuesSearchRequestDataAttributesPersona + include BaseEnumModel + + ALL = "ALL".freeze + BROWSER = "BROWSER".freeze + MOBILE = "MOBILE".freeze + BACKEND = "BACKEND".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_track.rb b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_track.rb new file mode 100644 index 000000000000..32642d0324c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data_attributes_track.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Track of the events to query. Either track(s) or persona(s) must be specified. + class IssuesSearchRequestDataAttributesTrack + include BaseEnumModel + + TRACE = "trace".freeze + LOGS = "logs".freeze + RUM = "rum".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_request_data_type.rb b/lib/datadog_api_client/v2/models/issues_search_request_data_type.rb new file mode 100644 index 000000000000..088490f42548 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssuesSearchRequestDataType + include BaseEnumModel + + SEARCH_REQUEST = "search_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_response.rb b/lib/datadog_api_client/v2/models/issues_search_response.rb new file mode 100644 index 000000000000..d060a8ef1699 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_response.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Search issues response payload. + class IssuesSearchResponse + include BaseGenericModel + + # Array of results matching the search query. + attr_accessor :data + + # Array of resources related to the search results. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result.rb b/lib/datadog_api_client/v2/models/issues_search_result.rb new file mode 100644 index 000000000000..57f0fca4dcba --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Result matching the search query. + class IssuesSearchResult + include BaseGenericModel + + # Object containing the information of a search result. + attr_reader :attributes + + # Search result identifier (matches the nested issue's identifier). + attr_reader :id + + # Relationships between the search result and other resources. + attr_accessor :relationships + + # Type of the object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IssuesSearchResultAttributes', + :'id' => :'String', + :'relationships' => :'IssuesSearchResultRelationships', + :'type' => :'IssuesSearchResultType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result_attributes.rb b/lib/datadog_api_client/v2/models/issues_search_result_attributes.rb new file mode 100644 index 000000000000..e2a82cc9b757 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the information of a search result. + class IssuesSearchResultAttributes + include BaseGenericModel + + # Count of sessions impacted by the issue over the queried time window. + attr_accessor :impacted_sessions + + # Count of users impacted by the issue over the queried time window. + attr_accessor :impacted_users + + # Total count of errors that match the issue over the queried time window. + attr_accessor :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'impacted_sessions' => :'impacted_sessions', + :'impacted_users' => :'impacted_users', + :'total_count' => :'total_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'impacted_sessions' => :'Integer', + :'impacted_users' => :'Integer', + :'total_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchResultAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'impacted_sessions') + self.impacted_sessions = attributes[:'impacted_sessions'] + end + + if attributes.key?(:'impacted_users') + self.impacted_users = attributes[:'impacted_users'] + end + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + impacted_sessions == o.impacted_sessions && + impacted_users == o.impacted_users && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [impacted_sessions, impacted_users, total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result_included.rb b/lib/datadog_api_client/v2/models/issues_search_result_included.rb new file mode 100644 index 000000000000..61d41d8337c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result_included.rb @@ -0,0 +1,65 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An array of related resources, returned when the `include` query parameter is used. + module IssuesSearchResultIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Issue', + :'Case', + :'IssueUser', + :'IssueTeam' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result_issue_relationship.rb b/lib/datadog_api_client/v2/models/issues_search_result_issue_relationship.rb new file mode 100644 index 000000000000..b75b48bc6157 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result_issue_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship between the search result and the corresponding issue. + class IssuesSearchResultIssueRelationship + include BaseGenericModel + + # The issue the search result corresponds to. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IssueReference' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchResultIssueRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result_relationships.rb b/lib/datadog_api_client/v2/models/issues_search_result_relationships.rb new file mode 100644 index 000000000000..93d6a222c43a --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships between the search result and other resources. + class IssuesSearchResultRelationships + include BaseGenericModel + + # Relationship between the search result and the corresponding issue. + attr_accessor :issue + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'issue' => :'issue' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'issue' => :'IssuesSearchResultIssueRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IssuesSearchResultRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'issue') + self.issue = attributes[:'issue'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + issue == o.issue && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [issue, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/issues_search_result_type.rb b/lib/datadog_api_client/v2/models/issues_search_result_type.rb new file mode 100644 index 000000000000..60581f93cf25 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issues_search_result_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the object. + class IssuesSearchResultType + include BaseEnumModel + + ERROR_TRACKING_SEARCH_RESULT = "error_tracking_search_result".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/search_issues_include_query_parameter_item.rb b/lib/datadog_api_client/v2/models/search_issues_include_query_parameter_item.rb new file mode 100644 index 000000000000..f38c138ce60b --- /dev/null +++ b/lib/datadog_api_client/v2/models/search_issues_include_query_parameter_item.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship object that should be included in the search response. + class SearchIssuesIncludeQueryParameterItem + include BaseEnumModel + + ISSUE = "issue".freeze + ISSUE_ASSIGNEE = "issue.assignee".freeze + ISSUE_CASE = "issue.case".freeze + ISSUE_TEAM_OWNERS = "issue.team_owners".freeze + end +end