From cbf48a18bac2ff01e851b250176d1d213cffaa7c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Dec 2025 12:43:38 +0000 Subject: [PATCH] Regenerate client from commit a204481 of spec repo --- .generator/schemas/v2/openapi.yaml | 1181 ++++++++++++++++- ...to-a-Jira-issue-returns-OK-response.frozen | 1 + ...ng-to-a-Jira-issue-returns-OK-response.yml | 26 + ...nding-to-a-case-returns-OK-response.frozen | 1 + ...-finding-to-a-case-returns-OK-response.yml | 26 + ...-issue-returns-Bad-Request-response.frozen | 1 + ...ira-issue-returns-Bad-Request-response.yml | 25 + ...ra-issue-returns-Not-Found-response.frozen | 1 + ...-Jira-issue-returns-Not-Found-response.yml | 25 + ...to-a-Jira-issue-returns-OK-response.frozen | 1 + ...gs-to-a-Jira-issue-returns-OK-response.yml | 26 + ...a-case-returns-Bad-Request-response.frozen | 1 + ...to-a-case-returns-Bad-Request-response.yml | 25 + ...o-a-case-returns-Not-Found-response.frozen | 1 + ...s-to-a-case-returns-Not-Found-response.yml | 25 + ...dings-to-a-case-returns-OK-response.frozen | 1 + ...findings-to-a-case-returns-OK-response.yml | 26 + ...ty-finding-returns-Created-response.frozen | 1 + ...urity-finding-returns-Created-response.yml | 47 + ...y-findings-returns-Created-response.frozen | 1 + ...rity-findings-returns-Created-response.yml | 47 + ...ndings-returns-Bad-Request-response.frozen | 1 + ...-findings-returns-Bad-Request-response.yml | 25 + ...y-findings-returns-Created-response.frozen | 1 + ...rity-findings-returns-Created-response.yml | 50 + ...findings-returns-Not-Found-response.frozen | 1 + ...ty-findings-returns-Not-Found-response.yml | 26 + ...ty-finding-returns-Created-response.frozen | 1 + ...urity-finding-returns-Created-response.yml | 46 + ...y-findings-returns-Created-response.frozen | 1 + ...rity-findings-returns-Created-response.yml | 46 + ...ndings-returns-Bad-Request-response.frozen | 1 + ...-findings-returns-Bad-Request-response.yml | 25 + ...y-findings-returns-Created-response.frozen | 1 + ...rity-findings-returns-Created-response.yml | 49 + ...findings-returns-Not-Found-response.frozen | 1 + ...ty-findings-returns-Not-Found-response.yml | 25 + ...r-case-returns-Bad-Request-response.frozen | 1 + ...heir-case-returns-Bad-Request-response.yml | 25 + ...ir-case-returns-No-Content-response.frozen | 1 + ...their-case-returns-No-Content-response.yml | 22 + ...eir-case-returns-Not-Found-response.frozen | 1 + ...-their-case-returns-Not-Found-response.yml | 25 + ...archy-link-returns-CREATED-response.frozen | 1 + ...ierarchy-link-returns-CREATED-response.yml | 116 ++ ...rchy-link-returns-Conflict-response.frozen | 1 + ...erarchy-link-returns-Conflict-response.yml | 142 ++ ...-hierarchy-link-returns-OK-response.frozen | 1 + ...eam-hierarchy-link-returns-OK-response.yml | 116 ++ ...archy-link-returns-SUCCESS-response.frozen | 1 + ...ierarchy-link-returns-SUCCESS-response.yml | 116 ++ ...returns-API-error-response-response.frozen | 1 + ...nk-returns-API-error-response-response.yml | 20 + ...-hierarchy-link-returns-OK-response.frozen | 1 + ...eam-hierarchy-link-returns-OK-response.yml | 134 ++ ...hierarchy-links-returns-OK-response.frozen | 1 + ...am-hierarchy-links-returns-OK-response.yml | 134 ++ ...returns-API-error-response-response.frozen | 1 + ...nk-returns-API-error-response-response.yml | 21 + ...hy-link-returns-No-Content-response.frozen | 1 + ...archy-link-returns-No-Content-response.yml | 135 ++ examples/v2/security-monitoring/AttachCase.rb | 26 + .../AttachCase_897782765.rb | 22 + .../v2/security-monitoring/AttachJiraIssue.rb | 34 + .../AttachJiraIssue_3042842144.rb | 30 + .../v2/security-monitoring/CreateCases.rb | 56 + .../CreateCases_2385516013.rb | 33 + .../CreateCases_2798851680.rb | 37 + .../security-monitoring/CreateJiraIssues.rb | 96 ++ .../CreateJiraIssues_379590688.rb | 56 + .../CreateJiraIssues_829823123.rb | 64 + examples/v2/security-monitoring/DetachCase.rb | 21 + examples/v2/teams/AddTeamHierarchyLink.rb | 31 + examples/v2/teams/GetTeamHierarchyLink.rb | 8 + examples/v2/teams/ListTeamHierarchyLinks.rb | 15 + .../ListTeamHierarchyLinks_3360757486.rb | 5 + examples/v2/teams/RemoveTeamHierarchyLink.rb | 8 + features/scenarios_model_mapping.rb | 31 + features/v2/given.json | 24 + features/v2/security_monitoring.feature | 239 +++- features/v2/teams.feature | 83 ++ features/v2/undo.json | 75 ++ lib/datadog_api_client/inflector.rb | 55 + .../v2/api/security_monitoring_api.rb | 342 ++++- lib/datadog_api_client/v2/api/teams_api.rb | 303 +++++ .../v2/models/attach_case_request.rb | 105 ++ .../v2/models/attach_case_request_data.rb | 154 +++ .../attach_case_request_data_relationships.rb | 123 ++ .../v2/models/attach_jira_issue_request.rb | 105 ++ .../models/attach_jira_issue_request_data.rb | 153 +++ ...tach_jira_issue_request_data_attributes.rb | 123 ++ ...h_jira_issue_request_data_relationships.rb | 144 ++ .../v2/models/case_data_type.rb | 26 + .../v2/models/case_insights_items.rb | 125 ++ .../v2/models/case_management_project.rb | 123 ++ .../v2/models/case_management_project_data.rb | 144 ++ .../case_management_project_data_type.rb | 26 + .../v2/models/create_case_request_array.rb | 125 ++ .../v2/models/create_case_request_data.rb | 153 +++ .../create_case_request_data_attributes.rb | 135 ++ .../create_case_request_data_relationships.rb | 144 ++ .../models/create_jira_issue_request_array.rb | 137 ++ ...reate_jira_issue_request_array_included.rb | 64 + .../models/create_jira_issue_request_data.rb | 153 +++ ...eate_jira_issue_request_data_attributes.rb | 105 ++ ...ra_issue_request_data_attributes_fields.rb | 105 ++ ...e_jira_issue_request_data_relationships.rb | 123 ++ ...a_issue_request_data_relationships_case.rb | 123 ++ ...ue_request_data_relationships_case_data.rb | 144 ++ .../v2/models/detach_case_request.rb | 105 ++ .../v2/models/detach_case_request_data.rb | 143 ++ .../detach_case_request_data_relationships.rb | 123 ++ .../v2/models/finding_case_response.rb | 105 ++ .../v2/models/finding_case_response_array.rb | 125 ++ .../v2/models/finding_case_response_data.rb | 153 +++ .../finding_case_response_data_attributes.rb | 277 ++++ ...inding_case_response_data_relationships.rb | 125 ++ .../v2/models/finding_data.rb | 144 ++ .../v2/models/finding_data_type.rb | 26 + .../v2/models/finding_jira_issue.rb | 125 ++ .../v2/models/finding_jira_issue_result.rb | 135 ++ lib/datadog_api_client/v2/models/findings.rb | 107 ++ .../v2/models/jira_issues_data_type.rb | 26 + .../relationship_to_user_team_permission.rb | 8 + .../v2/models/team_attributes.rb | 14 +- .../v2/models/team_hierarchy_link.rb | 175 +++ .../models/team_hierarchy_link_attributes.rb | 144 ++ .../v2/models/team_hierarchy_link_create.rb | 144 ++ ...eam_hierarchy_link_create_relationships.rb | 144 ++ .../team_hierarchy_link_create_request.rb | 123 ++ .../models/team_hierarchy_link_create_team.rb | 144 ++ ...hierarchy_link_create_team_relationship.rb | 123 ++ .../team_hierarchy_link_relationships.rb | 144 ++ .../v2/models/team_hierarchy_link_response.rb | 127 ++ .../v2/models/team_hierarchy_link_team.rb | 154 +++ .../team_hierarchy_link_team_attributes.rb | 223 ++++ .../team_hierarchy_link_team_relationship.rb | 123 ++ .../v2/models/team_hierarchy_link_type.rb | 26 + .../models/team_hierarchy_links_response.rb | 139 ++ .../teams_hierarchy_links_response_links.rb | 156 +++ .../teams_hierarchy_links_response_meta.rb | 105 ++ ...eams_hierarchy_links_response_meta_page.rb | 184 +++ 142 files changed, 11475 insertions(+), 7 deletions(-) create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml create mode 100644 examples/v2/security-monitoring/AttachCase.rb create mode 100644 examples/v2/security-monitoring/AttachCase_897782765.rb create mode 100644 examples/v2/security-monitoring/AttachJiraIssue.rb create mode 100644 examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb create mode 100644 examples/v2/security-monitoring/CreateCases.rb create mode 100644 examples/v2/security-monitoring/CreateCases_2385516013.rb create mode 100644 examples/v2/security-monitoring/CreateCases_2798851680.rb create mode 100644 examples/v2/security-monitoring/CreateJiraIssues.rb create mode 100644 examples/v2/security-monitoring/CreateJiraIssues_379590688.rb create mode 100644 examples/v2/security-monitoring/CreateJiraIssues_829823123.rb create mode 100644 examples/v2/security-monitoring/DetachCase.rb create mode 100644 examples/v2/teams/AddTeamHierarchyLink.rb create mode 100644 examples/v2/teams/GetTeamHierarchyLink.rb create mode 100644 examples/v2/teams/ListTeamHierarchyLinks.rb create mode 100644 examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb create mode 100644 examples/v2/teams/RemoveTeamHierarchyLink.rb create mode 100644 lib/datadog_api_client/v2/models/attach_case_request.rb create mode 100644 lib/datadog_api_client/v2/models/attach_case_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/attach_jira_issue_request.rb create mode 100644 lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/case_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/case_insights_items.rb create mode 100644 lib/datadog_api_client/v2/models/case_management_project.rb create mode 100644 lib/datadog_api_client/v2/models/case_management_project_data.rb create mode 100644 lib/datadog_api_client/v2/models/case_management_project_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/create_case_request_array.rb create mode 100644 lib/datadog_api_client/v2/models/create_case_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb create mode 100644 lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb create mode 100644 lib/datadog_api_client/v2/models/detach_case_request.rb create mode 100644 lib/datadog_api_client/v2/models/detach_case_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/finding_case_response.rb create mode 100644 lib/datadog_api_client/v2/models/finding_case_response_array.rb create mode 100644 lib/datadog_api_client/v2/models/finding_case_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/finding_data.rb create mode 100644 lib/datadog_api_client/v2/models/finding_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/finding_jira_issue.rb create mode 100644 lib/datadog_api_client/v2/models/finding_jira_issue_result.rb create mode 100644 lib/datadog_api_client/v2/models/findings.rb create mode 100644 lib/datadog_api_client/v2/models/jira_issues_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496a..d09adfa76206 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5249,6 +5249,79 @@ components: example: _latest type: string type: object + AttachCaseRequest: + description: Request for attaching security findings to a case. + properties: + data: + $ref: '#/components/schemas/AttachCaseRequestData' + type: object + AttachCaseRequestData: + description: Data of the case to attach security findings to. + properties: + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/AttachCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + - id + type: object + AttachCaseRequestDataRelationships: + description: Relationships of the case to attach security findings to. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings to attach to the case. + required: + - findings + type: object + AttachJiraIssueRequest: + description: Request for attaching security findings to a Jira issue. + properties: + data: + $ref: '#/components/schemas/AttachJiraIssueRequestData' + type: object + AttachJiraIssueRequestData: + description: Data of the Jira issue to attach security findings to. + properties: + attributes: + $ref: '#/components/schemas/AttachJiraIssueRequestDataAttributes' + id: + description: The unique identifier of the Jira issue attachment request. + example: j1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/AttachJiraIssueRequestDataRelationships' + type: + $ref: '#/components/schemas/JiraIssuesDataType' + required: + - type + type: object + AttachJiraIssueRequestDataAttributes: + description: Attributes of the Jira issue to attach security findings to. + properties: + jira_issue_url: + description: The URL of the Jira issue to attach security findings to. + example: https://domain.atlassian.net/browse/PROJ-123 + type: string + required: + - jira_issue_url + type: object + AttachJiraIssueRequestDataRelationships: + description: Relationships of the Jira issue to attach security findings to. + properties: + findings: + $ref: '#/components/schemas/Findings' + project: + $ref: '#/components/schemas/CaseManagementProject' + required: + - findings + - project + type: object AuditLogsEvent: description: Object description of an Audit Logs event after it is processed and stored by Datadog. @@ -8921,6 +8994,15 @@ components: required: - data type: object + CaseDataType: + default: cases + description: Cases resource type. + enum: + - cases + example: cases + type: string + x-enum-varnames: + - CASES CaseEmpty: description: Case empty request data properties: @@ -8937,6 +9019,53 @@ components: required: - data type: object + CaseInsightsItems: + description: An insight of the case. + properties: + ref: + description: The reference of the insight. + example: /security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static + type: string + resource_id: + description: The unique identifier of the resource. For example, the unique + identifier of a security finding. + example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: string + type: + description: The type of the resource. For example, the type of a security + finding is "SECURITY_FINDING". + example: SECURITY_FINDING + type: string + type: object + CaseManagementProject: + description: Case management project. + properties: + data: + $ref: '#/components/schemas/CaseManagementProjectData' + required: + - data + type: object + CaseManagementProjectData: + properties: + id: + description: The unique identifier of the case management project. + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/CaseManagementProjectDataType' + required: + - type + - id + type: object + CaseManagementProjectDataType: + default: projects + description: Projects resource type. + enum: + - projects + example: projects + type: string + x-enum-varnames: + - PROJECTS CaseObjectAttributes: additionalProperties: items: @@ -12581,6 +12710,68 @@ components: required: - type type: object + CreateCaseRequestArray: + description: List of requests to create cases for security findings. + properties: + data: + items: + $ref: '#/components/schemas/CreateCaseRequestData' + type: array + required: + - data + type: object + CreateCaseRequestData: + description: Data of the case to create. + properties: + attributes: + $ref: '#/components/schemas/CreateCaseRequestDataAttributes' + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/CreateCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + CreateCaseRequestDataAttributes: + description: Attributes of the case to create. + properties: + assignee_id: + description: The unique identifier of the user assigned to the case. + example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 + type: string + description: + description: The description of the case. If not provided, the description + will be automatically generated. + example: A description of the case. + type: string + priority: + $ref: '#/components/schemas/CasePriority' + description: The priority of the case. If not provided, the priority will + be automatically set to "NOT_DEFINED". + example: P4 + title: + description: The title of the case. If not provided, the title will be automatically + generated. + example: A title for the case. + type: string + type: object + CreateCaseRequestDataRelationships: + description: Relationships of the case to create. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings of the case to create. + project: + $ref: '#/components/schemas/CaseManagementProject' + description: Project of the case to create. + required: + - findings + - project + type: object CreateConnectionRequest: example: data: @@ -12852,6 +13043,89 @@ components: required: - data type: object + CreateJiraIssueRequestArray: + description: List of requests to create Jira issues for security findings. + properties: + data: + items: + $ref: '#/components/schemas/CreateJiraIssueRequestData' + type: array + included: + items: + $ref: '#/components/schemas/CreateJiraIssueRequestArrayIncluded' + type: array + required: + - data + type: object + CreateJiraIssueRequestArrayIncluded: + description: 'Attributes and relationships of the case linked to the Jira issue. + Should contain all of the following: case, project, and security findings.' + oneOf: + - $ref: '#/components/schemas/CreateCaseRequestData' + - $ref: '#/components/schemas/CaseManagementProjectData' + - $ref: '#/components/schemas/FindingData' + CreateJiraIssueRequestData: + description: Data of the Jira issue to create. + properties: + attributes: + $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributes' + id: + description: The unique identifier of the Jira issue creation request. + example: j1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationships' + type: + $ref: '#/components/schemas/JiraIssuesDataType' + required: + - type + type: object + CreateJiraIssueRequestDataAttributes: + description: Attributes of the Jira issue to create. + properties: + fields: + $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributesFields' + type: object + CreateJiraIssueRequestDataAttributesFields: + description: Custom fields of the Jira issue to create. For the list of available + fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + properties: + fields: + example: + customfield_10001: Value 1 + customfield_10002: + - Value 2 + - Value 3 + type: object + type: object + CreateJiraIssueRequestDataRelationships: + description: Relationships of the Jira issue to create. + properties: + case: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCase' + required: + - case + type: object + CreateJiraIssueRequestDataRelationshipsCase: + description: Case linked to the Jira issue. + properties: + data: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCaseData' + required: + - data + type: object + CreateJiraIssueRequestDataRelationshipsCaseData: + description: Case linked to the Jira issue. + properties: + id: + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + - id + type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. properties: @@ -16841,6 +17115,35 @@ components: oneOf: - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection' - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' + DetachCaseRequest: + description: Request for detaching security findings from their case. + properties: + data: + $ref: '#/components/schemas/DetachCaseRequestData' + type: object + DetachCaseRequestData: + description: Data for detaching security findings from their case. + properties: + id: + description: The unique identifier of the detachment request. + example: f8b9e3b1-24ec-4413-8be5-1b12b98533c6 + type: string + relationships: + $ref: '#/components/schemas/DetachCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + DetachCaseRequestDataRelationships: + description: Relationships detaching security findings from their case. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings to detach from their case. + required: + - findings + type: object DetailedFinding: description: A single finding with with message and resource configuration. properties: @@ -20691,6 +20994,153 @@ components: vulnerability_type: $ref: '#/components/schemas/FindingVulnerabilityType' type: object + FindingCaseResponse: + description: Case response. + properties: + data: + $ref: '#/components/schemas/FindingCaseResponseData' + type: object + FindingCaseResponseArray: + description: List of case responses. + properties: + data: + items: + $ref: '#/components/schemas/FindingCaseResponseData' + type: array + required: + - data + type: object + FindingCaseResponseData: + description: Data of the case. + properties: + attributes: + $ref: '#/components/schemas/FindingCaseResponseDataAttributes' + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/FindingCaseResponseDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + FindingCaseResponseDataAttributes: + description: Attributes of the case. + properties: + archived_at: + description: Timestamp of when the case was archived. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + assigned_to: + $ref: '#/components/schemas/RelationshipToUser' + description: User assigned to the case. + attributes: + additionalProperties: + items: + type: string + type: array + type: object + closed_at: + description: Timestamp of when the case was closed. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + created_at: + description: Timestamp of when the case was created. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + creation_source: + description: Source of the case creation. + example: CS_SECURITY_FINDING + type: string + description: + description: Description of the case. + example: A 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/CaseInsightsItems' + type: array + jira_issue: + $ref: '#/components/schemas/FindingJiraIssue' + description: Jira issue associated with the case. + key: + description: Key of the case. + example: PROJ-123 + type: string + modified_at: + description: Timestamp of when the case was last modified. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + priority: + description: Priority of the case. + example: P4 + type: string + status: + description: Status of the case. + example: OPEN + type: string + status_group: + description: Status group of the case. + example: SG_OPEN + type: string + status_name: + description: Status name of the case. + example: Open + type: string + title: + description: Title of the case. + example: A title for the case. + type: string + type: + description: Type of the case. For security cases, this is always "SECURITY". + example: SECURITY + type: string + type: object + FindingCaseResponseDataRelationships: + description: Relationships of the case. + properties: + created_by: + $ref: '#/components/schemas/RelationshipToUser' + description: User who created the case. + modified_by: + $ref: '#/components/schemas/RelationshipToUser' + description: User who last modified the case. + project: + $ref: '#/components/schemas/CaseManagementProject' + description: Project in which the case was created. + type: object + FindingData: + properties: + id: + description: The unique identifier of the security finding. + example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: string + type: + $ref: '#/components/schemas/FindingDataType' + required: + - type + - id + type: object + FindingDataType: + default: findings + description: Security findings resource type. + enum: + - findings + example: findings + type: string + x-enum-varnames: + - FINDINGS FindingDatadogLink: description: The Datadog relative link for this finding. example: /security/compliance?panels=cpfinding%7Cevent%7CruleId%3Adef-000-u5t%7CresourceId%3Ae8c9ab7c52ebd7bf2fdb4db641082d7d%7CtabId%3Aoverview @@ -20732,6 +21182,42 @@ components: description: The unique ID for this finding. example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== type: string + FindingJiraIssue: + description: Jira issue associated with the case. + properties: + error_message: + description: The error message if the Jira issue creation failed. + example: '{"errorMessages":["An error occured."],"errors":{}}' + type: string + result: + $ref: '#/components/schemas/FindingJiraIssueResult' + status: + description: The status of the Jira issue creation. Can be "COMPLETED" if + the Jira issue was created successfully, or "FAILED" if the Jira issue + creation failed. + example: COMPLETED + type: string + type: object + FindingJiraIssueResult: + description: Result of the Jira issue creation. + properties: + account_id: + description: The account ID of the Jira issue. + example: 463a8631-680e-455c-bfd3-3ed04d326eb7 + type: string + issue_id: + description: The unique identifier of the Jira issue. + example: '2871276' + type: string + issue_key: + description: The key of the Jira issue. + example: PROJ-123 + type: string + issue_url: + description: The URL of the Jira issue. + example: https://domain.atlassian.net/browse/PROJ-123 + type: string + type: object FindingMute: additionalProperties: false description: Information about the mute status of this finding. @@ -20857,6 +21343,14 @@ components: - ATTACK_PATH - IDENTITY_RISK - API_SECURITY + Findings: + description: A list of security findings. + properties: + data: + items: + $ref: '#/components/schemas/FindingData' + type: array + type: object FlakyTest: description: A flaky test object. properties: @@ -28274,6 +28768,15 @@ components: description: Jira project key type: string type: object + JiraIssuesDataType: + default: jira_issues + description: Jira issues resource type. + enum: + - jira_issues + example: jira_issues + type: string + x-enum-varnames: + - JIRA_ISSUES JobCreateResponse: description: Run a threat hunting job response. properties: @@ -41410,6 +41913,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -51804,7 +52308,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +52344,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52525,211 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Data provided when creating a team hierarchy link + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: The related teams that will be connected by the team hierarchy + link + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: This schema defines the attributes about each team that has to + be provided when creating a team hierarchy link + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Data about each team that will be connected by the team hierarchy + link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team hierarchy links connect different teams. This represents team + objects that are connected by the team hierarchy link. + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team hierarchy links connect different teams. This represents attributes + from teams that are connected by the team hierarchy link. + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53609,76 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: When querying team hierarchy links, a set of links for navigation + between different pages is included + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Metadata that is included in the response when querying the team + hierarchy links + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Metadata related to paging information that is included in the + response when querying the team hierarchy links + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -73566,10 +74350,16 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] + - AuthZ: [] summary: Mute or unmute a batch of findings tags: - Security Monitoring x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -77253,6 +78043,208 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read + /api/v2/security/findings/cases: + delete: + description: Detach security findings from their case. This operation dissociates + security findings from their associated cases without deleting the cases themselves. + You can detach security findings from multiple different cases in a single + request, with a limit of 50 security findings per request. Security findings + that are not currently attached to any case will be ignored. + operationId: DetachCase + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DetachCaseRequest' + required: true + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Detach security findings from their case + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + post: + description: Create cases for security findings. You can create up to 50 cases + per request and associate up to 50 security findings per case. Security findings + that are already attached to another case will be detached from their previous + case and attached to the newly created case. + operationId: CreateCases + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCaseRequestArray' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponseArray' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create cases for security findings + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + /api/v2/security/findings/cases/{case_id}: + patch: + description: Attach security findings to a case. You can attach up to 50 security + findings per case. Security findings that are already attached to another + case will be detached from their previous case and attached to the specified + case. + operationId: AttachCase + parameters: + - description: The unique identifier of the case to attach security findings + to + in: path + name: case_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AttachCaseRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a case + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + /api/v2/security/findings/jira_issues: + patch: + description: Attach security findings to a Jira issue by providing the Jira + issue URL. You can attach up to 50 security findings per Jira issue. If the + Jira issue is not linked to any case, this operation will create a case for + the security findings and link the Jira issue to the newly created case. Security + findings that are already attached to another Jira issue will be detached + from their previous Jira issue and attached to the specified Jira issue. + operationId: AttachJiraIssue + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AttachJiraIssueRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a Jira issue + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + post: + description: Create Jira issues for security findings. This operation creates + a case in Datadog and a Jira issue linked to that case for bidirectional sync + between Datadog and Jira. You can create up to 50 Jira issues per request + and associate up to 50 security findings per Jira issue. Security findings + that are already attached to another Jira issue will be detached from their + previous Jira issue and attached to the newly created Jira issue. + operationId: CreateJiraIssues + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJiraIssueRequestArray' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponseArray' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create Jira issues for security findings + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write /api/v2/security/sboms: get: description: 'Get a list of assets SBOMs for an organization. @@ -81999,6 +82991,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +83429,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +83488,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +83541,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +83592,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen new file mode 100644 index 000000000000..e21d532e446f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:49:48.969Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml new file mode 100644 index 000000000000..61f20be83b58 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:49:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:49:53.272293Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen new file mode 100644 index 000000000000..24c38af62ef1 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:20:46.726Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml new file mode 100644 index 000000000000..340e3ca13750 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:20:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:20:51.754979Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..7b6703448ace --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:53:19.037Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..07d0e2ab6b87 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:53:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + 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/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..4495f3bf05ae --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:59:56.064Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml new file mode 100644 index 000000000000..4d48ce4779f1 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:59:56 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding 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/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen new file mode 100644 index 000000000000..8a74e023fa9a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:52:21.664Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml new file mode 100644 index 000000000000..b5c5aa89855a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:52:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:52:25.368628Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..1adeacaf476f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:16:38.781Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..706e023b3627 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:16:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + 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/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..ed7d98397fd3 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:17:49.938Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..3deb34f3ef43 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:17:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"wrong-case-id","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/wrong-case-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"failed to + get case: case 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/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen new file mode 100644 index 000000000000..376033b3d930 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:23:42.957Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml new file mode 100644 index 000000000000..99e64134f1f0 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:23:42 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/2e336d846a2745499849778d969b56f8?detection=static","resource_id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:23:22.109092Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen new file mode 100644 index 000000000000..6c188712b924 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml new file mode 100644 index 000000000000..778a2ce2369d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 17:01:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases","attributes":{"created_at":"2025-11-19T17:01:15.21452Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2402037","issue_key":"CSMSEC-105473","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105473","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-461","modified_at":"2025-11-19T17:01:16.621974Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 17:01:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen new file mode 100644 index 000000000000..8bb7a59bf997 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml new file mode 100644 index 000000000000..3f20ab01173b --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Fri, 21 Nov 2025 14:49:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases","attributes":{"created_at":"2025-11-21T14:49:32.034826Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/f16db9b7fa42c8a047777b354d6ccfe7?detection=static","resource_id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/3510289f2aa284ab44f86b66e1f64cc7?detection=static","resource_id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2407744","issue_key":"CSMSEC-105481","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105481","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-468","modified_at":"2025-11-21T14:49:33.306003Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 21 Nov 2025 14:49:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ff98ffb1a133 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..2a68f07664eb --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 12:01:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","type":"cases"}}},"type":"jira_issues"}],"included":[{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + 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/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen new file mode 100644 index 000000000000..e5b6d0d76b32 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml new file mode 100644 index 000000000000..010a8f7eba68 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:32:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases"}}},"type":"jira_issues"},{"attributes":{},"relationships":{"case":{"data":{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","relationships":{"findings":{"data":[{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.777159Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404837","issue_key":"CSMSEC-105480","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105480","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-467","modified_at":"2025-11-20T15:32:25.088199Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.776904Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404836","issue_key":"CSMSEC-105479","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105479","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-466","modified_at":"2025-11-20T15:32:24.96456Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 20 Nov 2025 15:32:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..f0ed0dd3f183 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml new file mode 100644 index 000000000000..5595d0faa094 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:42:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"},{"id":"00000000-0000-0000-0000-000000000000","type":"projects"},{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project 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/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen new file mode 100644 index 000000000000..a6ccca66ab57 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:45:48.321Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml new file mode 100644 index 000000000000..5faeadee24a2 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:45:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","type":"cases","attributes":{"created_at":"2025-11-19T13:45:50.295906Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-454","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:45:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen new file mode 100644 index 000000000000..11d711428d3c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:07.661Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml new file mode 100644 index 000000000000..76df2324d891 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:46:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","type":"cases","attributes":{"created_at":"2025-11-19T13:46:09.874194Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-455","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:46:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..03dcf1623124 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:49.148Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..1a6534ef8e15 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:46:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"7f198869-c7ef-4afc-97cf-da5cdc13b5c3","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + 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/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen new file mode 100644 index 000000000000..d1e05ac25c0c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:54:20.603Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml new file mode 100644 index 000000000000..a9d014a2713c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:54:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"601cab78-ef04-4bdf-901a-55533afbde0b","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634552Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="}],"key":"CSMINV-458","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:54:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..331897b6e2e8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:47:19.797Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml new file mode 100644 index 000000000000..1c0b051c4f70 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:47:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project 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/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..48119112e5d7 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T16:07:27.292Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..621160572bdb --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 16:07:27 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + 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/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen new file mode 100644 index 000000000000..3e388493c639 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-11-21T13:41:10.798Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml new file mode 100644 index 000000000000..23d7921f1278 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Fri, 21 Nov 2025 13:41:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..72e1b275efed --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T16:06:53.415Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..749a69c7ac41 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 16:06:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding 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/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen new file mode 100644 index 000000000000..5ca151ab8b74 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen @@ -0,0 +1 @@ +2025-11-24T14:29:58.684Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml new file mode 100644 index 000000000000..58d94721e8ed --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-34095e00d70ee50a","name":"test-name-34095e00d70ee50a"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team","attributes":{"avatar":null,"banner":3,"created_at":"2025-11-24T14:29:59.195740+00:00","description":null,"handle":"test-handle-34095e00d70ee50a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T14:29:59.195740+00:00","name":"test-name-34095e00d70ee50a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-34095e00d70ee50a","name":"test-name-2-34095e00d70ee50a"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team","attributes":{"avatar":null,"banner":14,"created_at":"2025-11-24T14:29:59.754699+00:00","description":null,"handle":"test-handle-2-34095e00d70ee50a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T14:29:59.754699+00:00","name":"test-name-2-34095e00d70ee50a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team"}},"sub_team":{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c53bed14-1c0a-4895-b845-1c04be086ba0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T14:30:00.032477595Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team"}},"sub_team":{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team"}}}},"included":[{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team","attributes":{"avatar":null,"banner":3,"handle":"test-handle-34095e00d70ee50a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-34095e00d70ee50a","summary":null,"user_count":0}},{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team","attributes":{"avatar":null,"banner":14,"handle":"test-handle-2-34095e00d70ee50a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-34095e00d70ee50a","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen new file mode 100644 index 000000000000..4da94657eeb9 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2025-11-24T17:06:46.856Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml new file mode 100644 index 000000000000..04ec7e6559e3 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml @@ -0,0 +1,142 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-6c891437b748aea8","name":"test-name-6c891437b748aea8"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team","attributes":{"avatar":null,"banner":0,"created_at":"2025-11-24T17:06:47.453319+00:00","description":null,"handle":"test-handle-6c891437b748aea8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:06:47.453319+00:00","name":"test-name-6c891437b748aea8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-6c891437b748aea8","name":"test-name-2-6c891437b748aea8"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team","attributes":{"avatar":null,"banner":2,"created_at":"2025-11-24T17:06:48.020887+00:00","description":null,"handle":"test-handle-2-6c891437b748aea8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:06:48.020887+00:00","name":"test-name-2-6c891437b748aea8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"e980108e-d535-4bdf-84ca-5e8f84a68480","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:06:48.279316439Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}}},"included":[{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team","attributes":{"avatar":null,"banner":0,"handle":"test-handle-6c891437b748aea8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-6c891437b748aea8","summary":null,"user_count":0}},{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team","attributes":{"avatar":null,"banner":2,"handle":"test-handle-2-6c891437b748aea8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-6c891437b748aea8","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"errors":["Conflict: could not add team 21296c73-c9e2-4889-a33f-417d2974b2bd + as a member team of team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 in org 321813: + team hierarchy link between super team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 + and member team 21296c73-c9e2-4889-a33f-417d2974b2bd already exists in org + 321813"]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen new file mode 100644 index 000000000000..bf8a8d4fa45a --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-24T16:01:16.053Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml new file mode 100644 index 000000000000..410142736219 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-4d8084da4dfa4ed8","name":"test-name-4d8084da4dfa4ed8"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-24T16:01:16.149673+00:00","description":null,"handle":"test-handle-4d8084da4dfa4ed8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T16:01:16.149673+00:00","name":"test-name-4d8084da4dfa4ed8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-4d8084da4dfa4ed8","name":"test-name-2-4d8084da4dfa4ed8"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team","attributes":{"avatar":null,"banner":4,"created_at":"2025-11-24T16:01:16.315013+00:00","description":null,"handle":"test-handle-2-4d8084da4dfa4ed8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T16:01:16.315013+00:00","name":"test-name-2-4d8084da4dfa4ed8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team"}},"sub_team":{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"6cf86539-2c6e-497e-8cef-0b285ff05514","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T16:01:16.460042023Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team"}},"sub_team":{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team"}}}},"included":[{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-4d8084da4dfa4ed8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-4d8084da4dfa4ed8","summary":null,"user_count":0}},{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-4d8084da4dfa4ed8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-4d8084da4dfa4ed8","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen new file mode 100644 index 000000000000..e4ed51cc8673 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen @@ -0,0 +1 @@ +2025-11-24T15:48:39.900Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml new file mode 100644 index 000000000000..b32ea2b6611e --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-a75ee0b8b483d66f","name":"test-name-a75ee0b8b483d66f"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team","attributes":{"avatar":null,"banner":3,"created_at":"2025-11-24T15:48:40.359260+00:00","description":null,"handle":"test-handle-a75ee0b8b483d66f","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T15:48:40.359261+00:00","name":"test-name-a75ee0b8b483d66f","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-a75ee0b8b483d66f","name":"test-name-2-a75ee0b8b483d66f"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team","attributes":{"avatar":null,"banner":8,"created_at":"2025-11-24T15:48:40.893488+00:00","description":null,"handle":"test-handle-2-a75ee0b8b483d66f","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T15:48:40.893488+00:00","name":"test-name-2-a75ee0b8b483d66f","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team"}},"sub_team":{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fb94d43b-fe10-4c5f-ae7c-4ad745428651","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T15:48:41.150923395Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team"}},"sub_team":{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team"}}}},"included":[{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team","attributes":{"avatar":null,"banner":3,"handle":"test-handle-a75ee0b8b483d66f","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-a75ee0b8b483d66f","summary":null,"user_count":0}},{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team","attributes":{"avatar":null,"banner":8,"handle":"test-handle-2-a75ee0b8b483d66f","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-a75ee0b8b483d66f","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen new file mode 100644 index 000000000000..21b6221c0da9 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen @@ -0,0 +1 @@ +2025-11-24T13:19:11.816Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml new file mode 100644 index 000000000000..8b9d86a8ebd5 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 13:19:11 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + encoding: UTF-8 + string: '{"errors":["Not Found: team hierarchy link not found (linkId=aaa11111-aa11-aa11-aaaa-aaaaaa111111)"]}' + 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/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen new file mode 100644 index 000000000000..be8e0fd4a382 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-24T17:07:09.212Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml new file mode 100644 index 000000000000..bf537e795665 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml @@ -0,0 +1,134 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-ae3e76a23be3747a","name":"test-name-ae3e76a23be3747a"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-24T17:07:09.817794+00:00","description":null,"handle":"test-handle-ae3e76a23be3747a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:07:09.817794+00:00","name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-ae3e76a23be3747a","name":"test-name-2-ae3e76a23be3747a"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"created_at":"2025-11-24T17:07:10.381761+00:00","description":null,"handle":"test-handle-2-ae3e76a23be3747a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:07:10.381761+00:00","name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5401e712-de1b-4deb-ac35-2c6ee1943ad0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:07:10.643798843Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}}},"included":[{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-ae3e76a23be3747a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0}},{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-ae3e76a23be3747a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5401e712-de1b-4deb-ac35-2c6ee1943ad0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:07:10.643799Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}}},"links":{"self":"https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0"},"included":[{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-ae3e76a23be3747a","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0}},{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-ae3e76a23be3747a","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen new file mode 100644 index 000000000000..1d3731961ea6 --- /dev/null +++ b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-24T17:18:13.180Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml new file mode 100644 index 000000000000..4e524c0d9220 --- /dev/null +++ b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml @@ -0,0 +1,134 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-ab0ee85594ae1dfd","name":"test-name-ab0ee85594ae1dfd"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"created_at":"2025-11-24T17:18:13.814865+00:00","description":null,"handle":"test-handle-ab0ee85594ae1dfd","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:18:13.814865+00:00","name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-ab0ee85594ae1dfd","name":"test-name-2-ab0ee85594ae1dfd"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"created_at":"2025-11-24T17:18:14.383042+00:00","description":null,"handle":"test-handle-2-ab0ee85594ae1dfd","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:18:14.383042+00:00","name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"61509612-5bb0-42c5-a16e-bf4920acf473","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:18:14.635205462Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}}},"included":[{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0}},{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"handle":"test-handle-2-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef&filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d&page%5Bnumber%5D=0&page%5Bsize%5D=100 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"61509612-5bb0-42c5-a16e-bf4920acf473","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:18:14.635205Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}}}],"meta":{"page":{"type":"number_size","number":0,"size":100,"total":1,"first_number":0,"prev_number":null,"next_number":null,"last_number":0}},"links":{"self":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page%5Bnumber%5D=0\u0026page%5Bsize%5D=100","first":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page[number]=0\u0026page[size]=100","last":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page[number]=0\u0026page[size]=100"},"included":[{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"handle":"test-handle-2-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0}},{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen new file mode 100644 index 000000000000..73f686747b4d --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen @@ -0,0 +1 @@ +2025-11-24T13:14:20.481Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml new file mode 100644 index 000000000000..1a6617b84e3f --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 13:14:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + encoding: UTF-8 + string: '{"errors":["Not Found: link with id aaa11111-aa11-aa11-aaaa-aaaaaa111111 + 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/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen new file mode 100644 index 000000000000..be1311ed7c9b --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-11-24T17:08:01.196Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml new file mode 100644 index 000000000000..2e5dc20cd246 --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml @@ -0,0 +1,135 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-db31819631324305","name":"test-name-db31819631324305"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team","attributes":{"avatar":null,"banner":10,"created_at":"2025-11-24T17:08:01.930314+00:00","description":null,"handle":"test-handle-db31819631324305","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:08:01.930314+00:00","name":"test-name-db31819631324305","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-2-db31819631324305","name":"test-name-2-db31819631324305"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team","attributes":{"avatar":null,"banner":6,"created_at":"2025-11-24T17:08:02.174211+00:00","description":null,"handle":"test-handle-2-db31819631324305","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:08:02.174211+00:00","name":"test-name-2-db31819631324305","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"parent_team":{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team"}},"sub_team":{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"185446b8-1e88-419c-b266-3933f1411b6e","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:08:02.736655421Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team"}},"sub_team":{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team"}}}},"included":[{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team","attributes":{"avatar":null,"banner":10,"handle":"test-handle-db31819631324305","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-db31819631324305","summary":null,"user_count":0}},{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-2-db31819631324305","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-db31819631324305","summary":null,"user_count":0}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + encoding: UTF-8 + string: '{"errors":["Not Found: link with id 185446b8-1e88-419c-b266-3933f1411b6e + not found"]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/AttachCase.rb b/examples/v2/security-monitoring/AttachCase.rb new file mode 100644 index 000000000000..860653be0ef8 --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase.rb @@ -0,0 +1,26 @@ +# Attach security findings to a case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachCaseRequest.new({ + data: DatadogAPIClient::V2::AttachCaseRequestData.new({ + id: "7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships: DatadogAPIClient::V2::AttachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +p api_instance.attach_case("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body) diff --git a/examples/v2/security-monitoring/AttachCase_897782765.rb b/examples/v2/security-monitoring/AttachCase_897782765.rb new file mode 100644 index 000000000000..34f9e1bfeccf --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase_897782765.rb @@ -0,0 +1,22 @@ +# Attach security finding to a case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachCaseRequest.new({ + data: DatadogAPIClient::V2::AttachCaseRequestData.new({ + id: "7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships: DatadogAPIClient::V2::AttachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +p api_instance.attach_case("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body) diff --git a/examples/v2/security-monitoring/AttachJiraIssue.rb b/examples/v2/security-monitoring/AttachJiraIssue.rb new file mode 100644 index 000000000000..a44840d6b630 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue.rb @@ -0,0 +1,34 @@ +# Attach security findings to a Jira issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachJiraIssueRequest.new({ + data: DatadogAPIClient::V2::AttachJiraIssueRequestData.new({ + attributes: DatadogAPIClient::V2::AttachJiraIssueRequestDataAttributes.new({ + jira_issue_url: "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + }), + relationships: DatadogAPIClient::V2::AttachJiraIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + }), +}) +p api_instance.attach_jira_issue(body) diff --git a/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb new file mode 100644 index 000000000000..15d65393039f --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb @@ -0,0 +1,30 @@ +# Attach security finding to a Jira issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachJiraIssueRequest.new({ + data: DatadogAPIClient::V2::AttachJiraIssueRequestData.new({ + attributes: DatadogAPIClient::V2::AttachJiraIssueRequestDataAttributes.new({ + jira_issue_url: "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + }), + relationships: DatadogAPIClient::V2::AttachJiraIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + }), +}) +p api_instance.attach_jira_issue(body) diff --git a/examples/v2/security-monitoring/CreateCases.rb b/examples/v2/security-monitoring/CreateCases.rb new file mode 100644 index 000000000000..dd27ba421957 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases.rb @@ -0,0 +1,56 @@ +# Create cases for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.rb b/examples/v2/security-monitoring/CreateCases_2385516013.rb new file mode 100644 index 000000000000..eed17aefff91 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2385516013.rb @@ -0,0 +1,33 @@ +# Create case for security finding returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.rb b/examples/v2/security-monitoring/CreateCases_2798851680.rb new file mode 100644 index 000000000000..4e15675d31e8 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2798851680.rb @@ -0,0 +1,37 @@ +# Create case for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues.rb b/examples/v2/security-monitoring/CreateJiraIssues.rb new file mode 100644 index 000000000000..eb5188b1f5dd --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues.rb @@ -0,0 +1,96 @@ +# Create Jira issues for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "53e242c6-a7d6-46ad-9680-b8d14753f716", + }), + }), + }), + }), + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "195772b2-1f53-41d2-b81e-48c8e6c21d33", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + }), + ], + }), + }), + id: "53e242c6-a7d6-46ad-9680-b8d14753f716", + }), + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + }), + ], + }), + }), + id: "195772b2-1f53-41d2-b81e-48c8e6c21d33", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb b/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb new file mode 100644 index 000000000000..fd584f4c7632 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb @@ -0,0 +1,56 @@ +# Create Jira issue for security finding returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "6a773295-8729-4034-aada-53b64cbe02e7", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + }), + ], + }), + }), + id: "6a773295-8729-4034-aada-53b64cbe02e7", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb b/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb new file mode 100644 index 000000000000..174c004a087f --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb @@ -0,0 +1,64 @@ +# Create Jira issue for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "e469ceda-957a-4557-a607-9ff25032e9ca", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + ], + }), + }), + id: "e469ceda-957a-4557-a607-9ff25032e9ca", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/DetachCase.rb b/examples/v2/security-monitoring/DetachCase.rb new file mode 100644 index 000000000000..e39475a93e75 --- /dev/null +++ b/examples/v2/security-monitoring/DetachCase.rb @@ -0,0 +1,21 @@ +# Detach security findings from their case returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::DetachCaseRequest.new({ + data: DatadogAPIClient::V2::DetachCaseRequestData.new({ + relationships: DatadogAPIClient::V2::DetachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +api_instance.detach_case(body) diff --git a/examples/v2/teams/AddTeamHierarchyLink.rb b/examples/v2/teams/AddTeamHierarchyLink.rb new file mode 100644 index 000000000000..a30e768a798d --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.rb @@ -0,0 +1,31 @@ +# Create a team hierarchy link returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"] + +# there is a valid "dd_team_2" in the system +DD_TEAM_2_DATA_ID = ENV["DD_TEAM_2_DATA_ID"] + +body = DatadogAPIClient::V2::TeamHierarchyLinkCreateRequest.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreate.new({ + relationships: DatadogAPIClient::V2::TeamHierarchyLinkCreateRelationships.new({ + parent_team: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeamRelationship.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeam.new({ + id: DD_TEAM_DATA_ID, + type: DatadogAPIClient::V2::TeamType::TEAM, + }), + }), + sub_team: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeamRelationship.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeam.new({ + id: DD_TEAM_2_DATA_ID, + type: DatadogAPIClient::V2::TeamType::TEAM, + }), + }), + }), + type: DatadogAPIClient::V2::TeamHierarchyLinkType::TEAM_HIERARCHY_LINKS, + }), +}) +p api_instance.add_team_hierarchy_link(body) diff --git a/examples/v2/teams/GetTeamHierarchyLink.rb b/examples/v2/teams/GetTeamHierarchyLink.rb new file mode 100644 index 000000000000..66661f335fa1 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.rb @@ -0,0 +1,8 @@ +# Get a team hierarchy link returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_ID"] +p api_instance.get_team_hierarchy_link(TEAM_HIERARCHY_LINK_DATA_ID) diff --git a/examples/v2/teams/ListTeamHierarchyLinks.rb b/examples/v2/teams/ListTeamHierarchyLinks.rb new file mode 100644 index 000000000000..80ac140d5e15 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks.rb @@ -0,0 +1,15 @@ +# Get team hierarchy links returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID"] +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID"] +opts = { + filter_parent_team: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID, + filter_sub_team: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID, + page_number: 0, + page_size: 100, +} +p api_instance.list_team_hierarchy_links(opts) diff --git a/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb new file mode 100644 index 000000000000..3baec7cb0d3c --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb @@ -0,0 +1,5 @@ +# Get team hierarchy links returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new +api_instance.list_team_hierarchy_links_with_pagination() { |item| puts item } diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.rb b/examples/v2/teams/RemoveTeamHierarchyLink.rb new file mode 100644 index 000000000000..94c638a60ec1 --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.rb @@ -0,0 +1,8 @@ +# Remove a team hierarchy link returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_ID"] +api_instance.remove_team_hierarchy_link(TEAM_HIERARCHY_LINK_DATA_ID) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 15e1897d6c51..9e5a273d00e8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1372,6 +1372,22 @@ "finding_id" => "String", "snapshot_timestamp" => "Integer", }, + "v2.DetachCase" => { + "body" => "DetachCaseRequest", + }, + "v2.CreateCases" => { + "body" => "CreateCaseRequestArray", + }, + "v2.AttachCase" => { + "case_id" => "String", + "body" => "AttachCaseRequest", + }, + "v2.AttachJiraIssue" => { + "body" => "AttachJiraIssueRequest", + }, + "v2.CreateJiraIssues" => { + "body" => "CreateJiraIssueRequestArray", + }, "v2.ListAssetsSBOMs" => { "page_token" => "String", "page_number" => "Integer", @@ -3102,6 +3118,21 @@ "v2.CreateTeam" => { "body" => "TeamCreateRequest", }, + "v2.ListTeamHierarchyLinks" => { + "page_number" => "Integer", + "page_size" => "Integer", + "filter_parent_team" => "String", + "filter_sub_team" => "String", + }, + "v2.AddTeamHierarchyLink" => { + "body" => "TeamHierarchyLinkCreateRequest", + }, + "v2.RemoveTeamHierarchyLink" => { + "link_id" => "String", + }, + "v2.GetTeamHierarchyLink" => { + "link_id" => "String", + }, "v2.GetTeamSync" => { "filter_source" => "TeamSyncAttributesSource", }, diff --git a/features/v2/given.json b/features/v2/given.json index 198c7af1b51d..64b50d8057c8 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1169,6 +1169,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 531c84c19c11..5599d509afc2 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -5,9 +5,83 @@ Feature: Security Monitoring information. Background: - Given an instance of "SecurityMonitoring" API - And a valid "apiKeyAuth" key in the system + Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system + And an instance of "SecurityMonitoring" API + + @team:DataDog/k9-investigation + Scenario: Attach security finding to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-investigation + Scenario: Attach security finding to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "Bad Request" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "Not Found" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "Bad Request" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "Not Found" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "wrong-case-id" + And body with value {"data": {"id": "wrong-case-id", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=" @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response @@ -184,6 +258,78 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security finding returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Bad Request" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Not Found" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]} + When the request is sent + Then the response status is 404 Not Found + @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a cloud_configuration rule returns "OK" response Given new "CreateSecurityMonitoringRule" request @@ -408,6 +554,74 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @team:DataDog/k9-investigation + Scenario: Create case for security finding returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create case for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Bad Request" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "7f198869-c7ef-4afc-97cf-da5cdc13b5c3", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Not Found" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-cloud-security-platform Scenario: Delete a custom framework returns "Bad Request" response Given new "DeleteCustomFramework" request @@ -546,6 +760,27 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "Bad Request" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "No Content" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "Not Found" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled diff --git a/features/v2/teams.feature b/features/v2/teams.feature index bf11bd0316d6..faa1ca0889d5 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "ListTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "ListTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630d..a2fd0bca5da7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3597,6 +3597,50 @@ "type": "safe" } }, + "DetachCase": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateCases": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, + "AttachCase": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "AttachJiraIssue": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateJiraIssues": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, "ListAssetsSBOMs": { "tag": "Security Monitoring", "undo": { @@ -4345,6 +4389,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 427fdcf8659c..a6fdae3c7db8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1128,6 +1128,13 @@ def overrides "v2.asset_risks" => "AssetRisks", "v2.asset_type" => "AssetType", "v2.asset_version" => "AssetVersion", + "v2.attach_case_request" => "AttachCaseRequest", + "v2.attach_case_request_data" => "AttachCaseRequestData", + "v2.attach_case_request_data_relationships" => "AttachCaseRequestDataRelationships", + "v2.attach_jira_issue_request" => "AttachJiraIssueRequest", + "v2.attach_jira_issue_request_data" => "AttachJiraIssueRequestData", + "v2.attach_jira_issue_request_data_attributes" => "AttachJiraIssueRequestDataAttributes", + "v2.attach_jira_issue_request_data_relationships" => "AttachJiraIssueRequestDataRelationships", "v2.audit_logs_event" => "AuditLogsEvent", "v2.audit_logs_event_attributes" => "AuditLogsEventAttributes", "v2.audit_logs_events_response" => "AuditLogsEventsResponse", @@ -1347,8 +1354,13 @@ def overrides "v2.case_create_attributes" => "CaseCreateAttributes", "v2.case_create_relationships" => "CaseCreateRelationships", "v2.case_create_request" => "CaseCreateRequest", + "v2.case_data_type" => "CaseDataType", "v2.case_empty" => "CaseEmpty", "v2.case_empty_request" => "CaseEmptyRequest", + "v2.case_insights_items" => "CaseInsightsItems", + "v2.case_management_project" => "CaseManagementProject", + "v2.case_management_project_data" => "CaseManagementProjectData", + "v2.case_management_project_data_type" => "CaseManagementProjectDataType", "v2.case_priority" => "CasePriority", "v2.case_relationships" => "CaseRelationships", "v2.case_resource_type" => "CaseResourceType", @@ -1656,6 +1668,10 @@ def overrides "v2.create_apps_datastore_request_data_attributes_org_access" => "CreateAppsDatastoreRequestDataAttributesOrgAccess", "v2.create_apps_datastore_response" => "CreateAppsDatastoreResponse", "v2.create_apps_datastore_response_data" => "CreateAppsDatastoreResponseData", + "v2.create_case_request_array" => "CreateCaseRequestArray", + "v2.create_case_request_data" => "CreateCaseRequestData", + "v2.create_case_request_data_attributes" => "CreateCaseRequestDataAttributes", + "v2.create_case_request_data_relationships" => "CreateCaseRequestDataRelationships", "v2.create_connection_request" => "CreateConnectionRequest", "v2.create_connection_request_data" => "CreateConnectionRequestData", "v2.create_connection_request_data_attributes" => "CreateConnectionRequestDataAttributes", @@ -1675,6 +1691,14 @@ def overrides "v2.create_deployment_rule_params_data_attributes" => "CreateDeploymentRuleParamsDataAttributes", "v2.create_incident_notification_rule_request" => "CreateIncidentNotificationRuleRequest", "v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest", + "v2.create_jira_issue_request_array" => "CreateJiraIssueRequestArray", + "v2.create_jira_issue_request_array_included" => "CreateJiraIssueRequestArrayIncluded", + "v2.create_jira_issue_request_data" => "CreateJiraIssueRequestData", + "v2.create_jira_issue_request_data_attributes" => "CreateJiraIssueRequestDataAttributes", + "v2.create_jira_issue_request_data_attributes_fields" => "CreateJiraIssueRequestDataAttributesFields", + "v2.create_jira_issue_request_data_relationships" => "CreateJiraIssueRequestDataRelationships", + "v2.create_jira_issue_request_data_relationships_case" => "CreateJiraIssueRequestDataRelationshipsCase", + "v2.create_jira_issue_request_data_relationships_case_data" => "CreateJiraIssueRequestDataRelationshipsCaseData", "v2.create_notification_rule_parameters" => "CreateNotificationRuleParameters", "v2.create_notification_rule_parameters_data" => "CreateNotificationRuleParametersData", "v2.create_notification_rule_parameters_data_attributes" => "CreateNotificationRuleParametersDataAttributes", @@ -1905,6 +1929,9 @@ def overrides "v2.deployment_rule_response_data_attributes_type" => "DeploymentRuleResponseDataAttributesType", "v2.deployment_rule_response_data_attributes_updated_by" => "DeploymentRuleResponseDataAttributesUpdatedBy", "v2.deployment_rules_options" => "DeploymentRulesOptions", + "v2.detach_case_request" => "DetachCaseRequest", + "v2.detach_case_request_data" => "DetachCaseRequestData", + "v2.detach_case_request_data_relationships" => "DetachCaseRequestDataRelationships", "v2.detailed_finding" => "DetailedFinding", "v2.detailed_finding_attributes" => "DetailedFindingAttributes", "v2.detailed_finding_type" => "DetailedFindingType", @@ -2189,10 +2216,20 @@ def overrides "v2.filters_per_product" => "FiltersPerProduct", "v2.finding" => "Finding", "v2.finding_attributes" => "FindingAttributes", + "v2.finding_case_response" => "FindingCaseResponse", + "v2.finding_case_response_array" => "FindingCaseResponseArray", + "v2.finding_case_response_data" => "FindingCaseResponseData", + "v2.finding_case_response_data_attributes" => "FindingCaseResponseDataAttributes", + "v2.finding_case_response_data_relationships" => "FindingCaseResponseDataRelationships", + "v2.finding_data" => "FindingData", + "v2.finding_data_type" => "FindingDataType", "v2.finding_evaluation" => "FindingEvaluation", + "v2.finding_jira_issue" => "FindingJiraIssue", + "v2.finding_jira_issue_result" => "FindingJiraIssueResult", "v2.finding_mute" => "FindingMute", "v2.finding_mute_reason" => "FindingMuteReason", "v2.finding_rule" => "FindingRule", + "v2.findings" => "Findings", "v2.finding_status" => "FindingStatus", "v2.finding_type" => "FindingType", "v2.finding_vulnerability_type" => "FindingVulnerabilityType", @@ -2669,6 +2706,7 @@ def overrides "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", "v2.jira_issue_result" => "JiraIssueResult", + "v2.jira_issues_data_type" => "JiraIssuesDataType", "v2.job_create_response" => "JobCreateResponse", "v2.job_create_response_data" => "JobCreateResponseData", "v2.job_definition" => "JobDefinition", @@ -4212,6 +4250,20 @@ def overrides "v2.team_create_attributes" => "TeamCreateAttributes", "v2.team_create_relationships" => "TeamCreateRelationships", "v2.team_create_request" => "TeamCreateRequest", + "v2.team_hierarchy_link" => "TeamHierarchyLink", + "v2.team_hierarchy_link_attributes" => "TeamHierarchyLinkAttributes", + "v2.team_hierarchy_link_create" => "TeamHierarchyLinkCreate", + "v2.team_hierarchy_link_create_relationships" => "TeamHierarchyLinkCreateRelationships", + "v2.team_hierarchy_link_create_request" => "TeamHierarchyLinkCreateRequest", + "v2.team_hierarchy_link_create_team" => "TeamHierarchyLinkCreateTeam", + "v2.team_hierarchy_link_create_team_relationship" => "TeamHierarchyLinkCreateTeamRelationship", + "v2.team_hierarchy_link_relationships" => "TeamHierarchyLinkRelationships", + "v2.team_hierarchy_link_response" => "TeamHierarchyLinkResponse", + "v2.team_hierarchy_links_response" => "TeamHierarchyLinksResponse", + "v2.team_hierarchy_link_team" => "TeamHierarchyLinkTeam", + "v2.team_hierarchy_link_team_attributes" => "TeamHierarchyLinkTeamAttributes", + "v2.team_hierarchy_link_team_relationship" => "TeamHierarchyLinkTeamRelationship", + "v2.team_hierarchy_link_type" => "TeamHierarchyLinkType", "v2.team_included" => "TeamIncluded", "v2.team_link" => "TeamLink", "v2.team_link_attributes" => "TeamLinkAttributes", @@ -4264,6 +4316,9 @@ def overrides "v2.team_routing_rules_request_data_type" => "TeamRoutingRulesRequestDataType", "v2.team_routing_rules_request_rule" => "TeamRoutingRulesRequestRule", "v2.teams_field" => "TeamsField", + "v2.teams_hierarchy_links_response_links" => "TeamsHierarchyLinksResponseLinks", + "v2.teams_hierarchy_links_response_meta" => "TeamsHierarchyLinksResponseMeta", + "v2.teams_hierarchy_links_response_meta_page" => "TeamsHierarchyLinksResponseMetaPage", "v2.teams_response" => "TeamsResponse", "v2.teams_response_links" => "TeamsResponseLinks", "v2.teams_response_meta" => "TeamsResponseMeta", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 0a17ce5a0c60..233f52de4f78 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -23,6 +23,145 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Attach security findings to a case. + # + # @see #attach_case_with_http_info + def attach_case(case_id, body, opts = {}) + data, _status_code, _headers = attach_case_with_http_info(case_id, body, opts) + data + end + + # Attach security findings to a case. + # + # Attach security findings to a case. You can attach up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the specified case. + # + # @param case_id [String] The unique identifier of the case to attach security findings to + # @param body [AttachCaseRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers + def attach_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling SecurityMonitoringAPI.attach_case" + 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 SecurityMonitoringAPI.attach_case" + end + # resource path + local_var_path = '/api/v2/security/findings/cases/{case_id}'.sub('{case_id}', CGI.escape(case_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] || 'FindingCaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :attach_case, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#attach_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Attach security findings to a Jira issue. + # + # @see #attach_jira_issue_with_http_info + def attach_jira_issue(body, opts = {}) + data, _status_code, _headers = attach_jira_issue_with_http_info(body, opts) + data + end + + # Attach security findings to a Jira issue. + # + # Attach security findings to a Jira issue by providing the Jira issue URL. You can attach up to 50 security findings per Jira issue. If the Jira issue is not linked to any case, this operation will create a case for the security findings and link the Jira issue to the newly created case. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the specified Jira issue. + # + # @param body [AttachJiraIssueRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers + def attach_jira_issue_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_jira_issue ...' + 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 SecurityMonitoringAPI.attach_jira_issue" + end + # resource path + local_var_path = '/api/v2/security/findings/jira_issues' + + # 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] || 'FindingCaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :attach_jira_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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#attach_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Cancel a threat hunting job. # # @see #cancel_threat_hunting_job_with_http_info @@ -311,6 +450,73 @@ def convert_security_monitoring_rule_from_json_to_terraform_with_http_info(body, return data, status_code, headers end + # Create cases for security findings. + # + # @see #create_cases_with_http_info + def create_cases(body, opts = {}) + data, _status_code, _headers = create_cases_with_http_info(body, opts) + data + end + + # Create cases for security findings. + # + # Create cases for security findings. You can create up to 50 cases per request and associate up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the newly created case. + # + # @param body [CreateCaseRequestArray] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers + def create_cases_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_cases ...' + 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 SecurityMonitoringAPI.create_cases" + end + # resource path + local_var_path = '/api/v2/security/findings/cases' + + # 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] || 'FindingCaseResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_cases, + :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: SecurityMonitoringAPI#create_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a custom framework. # # @see #create_custom_framework_with_http_info @@ -378,6 +584,73 @@ def create_custom_framework_with_http_info(body, opts = {}) return data, status_code, headers end + # Create Jira issues for security findings. + # + # @see #create_jira_issues_with_http_info + def create_jira_issues(body, opts = {}) + data, _status_code, _headers = create_jira_issues_with_http_info(body, opts) + data + end + + # Create Jira issues for security findings. + # + # Create Jira issues for security findings. This operation creates a case in Datadog and a Jira issue linked to that case for bidirectional sync between Datadog and Jira. You can create up to 50 Jira issues per request and associate up to 50 security findings per Jira issue. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the newly created Jira issue. + # + # @param body [CreateJiraIssueRequestArray] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers + def create_jira_issues_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_jira_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 SecurityMonitoringAPI.create_jira_issues" + end + # resource path + local_var_path = '/api/v2/security/findings/jira_issues' + + # 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] || 'FindingCaseResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_jira_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: SecurityMonitoringAPI#create_jira_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a security filter. # # @see #create_security_filter_with_http_info @@ -1182,6 +1455,73 @@ def delete_vulnerability_notification_rule_with_http_info(id, opts = {}) return data, status_code, headers end + # Detach security findings from their case. + # + # @see #detach_case_with_http_info + def detach_case(body, opts = {}) + detach_case_with_http_info(body, opts) + nil + end + + # Detach security findings from their case. + # + # Detach security findings from their case. This operation dissociates security findings from their associated cases without deleting the cases themselves. You can detach security findings from multiple different cases in a single request, with a limit of 50 security findings per request. Security findings that are not currently attached to any case will be ignored. + # + # @param body [DetachCaseRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def detach_case_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.detach_case ...' + 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 SecurityMonitoringAPI.detach_case" + end + # resource path + local_var_path = '/api/v2/security/findings/cases' + + # 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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :detach_case, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#detach_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Modify the triage assignee of a security signal. # # @see #edit_security_monitoring_signal_assignee_with_http_info @@ -4112,7 +4452,7 @@ def mute_findings_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'BulkMuteFindingsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :mute_findings, diff --git a/lib/datadog_api_client/v2/api/teams_api.rb b/lib/datadog_api_client/v2/api/teams_api.rb index 96bff506dfd9..f33f44e17753 100644 --- a/lib/datadog_api_client/v2/api/teams_api.rb +++ b/lib/datadog_api_client/v2/api/teams_api.rb @@ -36,11 +36,16 @@ def add_member_team(super_team_id, body, opts = {}) # Add a member team. # Adds the team given by the `id` in the body as a member team of the super team. # + # **Note**: This API is deprecated. For creating team hierarchy links, use the team hierarchy links API: `POST /api/v2/team-hierarchy-links`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param body [AddMemberTeamRequest] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def add_member_team_with_http_info(super_team_id, body, opts = {}) + warn "[DEPRECATION] `AddMemberTeam` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.add_member_team".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_member_team") @@ -102,6 +107,73 @@ def add_member_team_with_http_info(super_team_id, body, opts = {}) return data, status_code, headers end + # Create a team hierarchy link. + # + # @see #add_team_hierarchy_link_with_http_info + def add_team_hierarchy_link(body, opts = {}) + data, _status_code, _headers = add_team_hierarchy_link_with_http_info(body, opts) + data + end + + # Create a team hierarchy link. + # + # Create a new team hierarchy link between a parent team and a sub team. + # + # @param body [TeamHierarchyLinkCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TeamHierarchyLinkResponse, Integer, Hash)>] TeamHierarchyLinkResponse data, response status code and response headers + def add_team_hierarchy_link_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.add_team_hierarchy_link ...' + 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 TeamsAPI.add_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links' + + # 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] || 'TeamHierarchyLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :add_team_hierarchy_link, + :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: TeamsAPI#add_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a team. # # @see #create_team_with_http_info @@ -584,6 +656,71 @@ def get_team_with_http_info(team_id, opts = {}) return data, status_code, headers end + # Get a team hierarchy link. + # + # @see #get_team_hierarchy_link_with_http_info + def get_team_hierarchy_link(link_id, opts = {}) + data, _status_code, _headers = get_team_hierarchy_link_with_http_info(link_id, opts) + data + end + + # Get a team hierarchy link. + # + # Get a single team hierarchy link for the given link_id. + # + # @param link_id [String] The team hierarchy link's identifier + # @param opts [Hash] the optional parameters + # @return [Array<(TeamHierarchyLinkResponse, Integer, Hash)>] TeamHierarchyLinkResponse data, response status code and response headers + def get_team_hierarchy_link_with_http_info(link_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_hierarchy_link ...' + end + # verify the required parameter 'link_id' is set + if @api_client.config.client_side_validation && link_id.nil? + fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.get_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.sub('{link_id}', CGI.escape(link_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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamHierarchyLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_team_hierarchy_link, + :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: TeamsAPI#get_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a team link. # # @see #get_team_link_with_http_info @@ -1038,6 +1175,11 @@ def list_member_teams(super_team_id, opts = {}) # # Get all member teams. # + # **Note**: This API is deprecated. For team hierarchy relationships (parent-child + # teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. @@ -1045,6 +1187,7 @@ def list_member_teams(super_team_id, opts = {}) # @option opts [Array] :fields_team List of fields that need to be fetched. # @return [Array<(TeamsResponse, Integer, Hash)>] TeamsResponse data, response status code and response headers def list_member_teams_with_http_info(super_team_id, opts = {}) + warn "[DEPRECATION] `ListMemberTeams` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.list_member_teams".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_member_teams") @@ -1125,6 +1268,96 @@ def list_member_teams_with_pagination(super_team_id, opts = {}) end end + # Get team hierarchy links. + # + # @see #list_team_hierarchy_links_with_http_info + def list_team_hierarchy_links(opts = {}) + data, _status_code, _headers = list_team_hierarchy_links_with_http_info(opts) + data + end + + # Get team hierarchy links. + # + # List all team hierarchy links that match the provided filters. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [String] :filter_parent_team Filter by parent team ID + # @option opts [String] :filter_sub_team Filter by sub team ID + # @return [Array<(TeamHierarchyLinksResponse, Integer, Hash)>] TeamHierarchyLinksResponse data, response status code and response headers + def list_team_hierarchy_links_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.list_team_hierarchy_links ...' + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'filter[parent_team]'] = opts[:'filter_parent_team'] if !opts[:'filter_parent_team'].nil? + query_params[:'filter[sub_team]'] = opts[:'filter_sub_team'] if !opts[:'filter_sub_team'].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] || 'TeamHierarchyLinksResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_team_hierarchy_links, + :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: TeamsAPI#list_team_hierarchy_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get team hierarchy links. + # + # Provide a paginated version of {#list_team_hierarchy_links}, returning all items. + # + # To use it you need to use a block: list_team_hierarchy_links_with_pagination { |item| p item } + # + # @yield [TeamHierarchyLink] Paginated items + def list_team_hierarchy_links_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_team_hierarchy_links(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + # Get all teams. # # @see #list_teams_with_http_info @@ -1239,11 +1472,16 @@ def remove_member_team(super_team_id, member_team_id, opts = {}) # # Remove a super team's member team identified by `member_team_id`. # + # **Note**: This API is deprecated. For deleting team hierarchy links, use the team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param member_team_id [String] None # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {}) + warn "[DEPRECATION] `RemoveMemberTeam` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.remove_member_team".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_member_team") @@ -1303,6 +1541,71 @@ def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {}) return data, status_code, headers end + # Remove a team hierarchy link. + # + # @see #remove_team_hierarchy_link_with_http_info + def remove_team_hierarchy_link(link_id, opts = {}) + remove_team_hierarchy_link_with_http_info(link_id, opts) + nil + end + + # Remove a team hierarchy link. + # + # Remove a team hierarchy link by the given link_id. + # + # @param link_id [String] The team hierarchy link's identifier + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_team_hierarchy_link_with_http_info(link_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.remove_team_hierarchy_link ...' + end + # verify the required parameter 'link_id' is set + if @api_client.config.client_side_validation && link_id.nil? + fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.remove_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.sub('{link_id}', CGI.escape(link_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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :remove_team_hierarchy_link, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsAPI#remove_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Link Teams with GitHub Teams. # # @see #sync_teams_with_http_info diff --git a/lib/datadog_api_client/v2/models/attach_case_request.rb b/lib/datadog_api_client/v2/models/attach_case_request.rb new file mode 100644 index 000000000000..5cd24d96ce43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request.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 + # Request for attaching security findings to a case. + class AttachCaseRequest + include BaseGenericModel + + # Data of the case to attach security findings to. + attr_accessor :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' => :'AttachCaseRequestData' + } + 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::AttachCaseRequest` 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 + + # 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/attach_case_request_data.rb b/lib/datadog_api_client/v2/models/attach_case_request_data.rb new file mode 100644 index 000000000000..bea13b72a2e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request_data.rb @@ -0,0 +1,154 @@ +=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 + # Data of the case to attach security findings to. + class AttachCaseRequestData + include BaseGenericModel + + # The unique identifier of the case. + attr_reader :id + + # Relationships of the case to attach security findings to. + attr_accessor :relationships + + # Cases resource type. + 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', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'relationships' => :'AttachCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + 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::AttachCaseRequestData` 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?(:'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 @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 && + 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 + [id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb new file mode 100644 index 000000000000..12cc004a17e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.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 + # Relationships of the case to attach security findings to. + class AttachCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings' + } + 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::AttachCaseRequestDataRelationships` 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?(:'findings') + self.findings = attributes[:'findings'] + 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 @findings.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + 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 && + findings == o.findings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb new file mode 100644 index 000000000000..0a3bf2b831df --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request.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 + # Request for attaching security findings to a Jira issue. + class AttachJiraIssueRequest + include BaseGenericModel + + # Data of the Jira issue to attach security findings to. + attr_accessor :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' => :'AttachJiraIssueRequestData' + } + 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::AttachJiraIssueRequest` 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 + + # 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/attach_jira_issue_request_data.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb new file mode 100644 index 000000000000..0ab8a9d76e5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb @@ -0,0 +1,153 @@ +=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 + # Data of the Jira issue to attach security findings to. + class AttachJiraIssueRequestData + include BaseGenericModel + + # Attributes of the Jira issue to attach security findings to. + attr_accessor :attributes + + # The unique identifier of the Jira issue attachment request. + attr_accessor :id + + # Relationships of the Jira issue to attach security findings to. + attr_accessor :relationships + + # Jira issues resource type. + 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' => :'AttachJiraIssueRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'AttachJiraIssueRequestDataRelationships', + :'type' => :'JiraIssuesDataType' + } + 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::AttachJiraIssueRequestData` 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 @type.nil? + true + 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/attach_jira_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb new file mode 100644 index 000000000000..e2536e5f50bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_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 + # Attributes of the Jira issue to attach security findings to. + class AttachJiraIssueRequestDataAttributes + include BaseGenericModel + + # The URL of the Jira issue to attach security findings to. + attr_reader :jira_issue_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'jira_issue_url' => :'jira_issue_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'jira_issue_url' => :'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::AttachJiraIssueRequestDataAttributes` 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?(:'jira_issue_url') + self.jira_issue_url = attributes[:'jira_issue_url'] + 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 @jira_issue_url.nil? + true + end + + # Custom attribute writer method with validation + # @param jira_issue_url [Object] Object to be assigned + # @!visibility private + def jira_issue_url=(jira_issue_url) + if jira_issue_url.nil? + fail ArgumentError, 'invalid value for "jira_issue_url", jira_issue_url cannot be nil.' + end + @jira_issue_url = jira_issue_url + 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 && + jira_issue_url == o.jira_issue_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [jira_issue_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb new file mode 100644 index 000000000000..73c39ed4dcf7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.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 + # Relationships of the Jira issue to attach security findings to. + class AttachJiraIssueRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + 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::AttachJiraIssueRequestDataRelationships` 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?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + 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 @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + 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 && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_data_type.rb b/lib/datadog_api_client/v2/models/case_data_type.rb new file mode 100644 index 000000000000..f116d5d50a4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_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 + # Cases resource type. + class CaseDataType + include BaseEnumModel + + CASES = "cases".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_insights_items.rb b/lib/datadog_api_client/v2/models/case_insights_items.rb new file mode 100644 index 000000000000..e5a4560e5102 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_insights_items.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 + # An insight of the case. + class CaseInsightsItems + include BaseGenericModel + + # The reference of the insight. + attr_accessor :ref + + # The unique identifier of the resource. For example, the unique identifier of a security finding. + attr_accessor :resource_id + + # The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + 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::CaseInsightsItems` 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/case_management_project.rb b/lib/datadog_api_client/v2/models/case_management_project.rb new file mode 100644 index 000000000000..28b2b140fb01 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project.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 + # Case management project. + class CaseManagementProject + include BaseGenericModel + + # + 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' => :'CaseManagementProjectData' + } + 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::CaseManagementProject` 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/case_management_project_data.rb b/lib/datadog_api_client/v2/models/case_management_project_data.rb new file mode 100644 index 000000000000..c5b053664ac6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project_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 + # + class CaseManagementProjectData + include BaseGenericModel + + # The unique identifier of the case management project. + attr_reader :id + + # Projects resource type. + 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' => :'CaseManagementProjectDataType' + } + 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::CaseManagementProjectData` 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/case_management_project_data_type.rb b/lib/datadog_api_client/v2/models/case_management_project_data_type.rb new file mode 100644 index 000000000000..cb31496ff461 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project_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 + # Projects resource type. + class CaseManagementProjectDataType + include BaseEnumModel + + PROJECTS = "projects".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_array.rb b/lib/datadog_api_client/v2/models/create_case_request_array.rb new file mode 100644 index 000000000000..007e91d8cd9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_array.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 + # List of requests to create cases for security findings. + class CreateCaseRequestArray + include BaseGenericModel + + # + 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::CreateCaseRequestArray` 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/create_case_request_data.rb b/lib/datadog_api_client/v2/models/create_case_request_data.rb new file mode 100644 index 000000000000..9e1d63288eed --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data.rb @@ -0,0 +1,153 @@ +=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 + # Data of the case to create. + class CreateCaseRequestData + include BaseGenericModel + + # Attributes of the case to create. + attr_accessor :attributes + + # The unique identifier of the case. + attr_accessor :id + + # Relationships of the case to create. + attr_accessor :relationships + + # Cases resource type. + 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' => :'CreateCaseRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'CreateCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + 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::CreateCaseRequestData` 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 @type.nil? + true + 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/create_case_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb new file mode 100644 index 000000000000..f5a8e41c39a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data_attributes.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 + # Attributes of the case to create. + class CreateCaseRequestDataAttributes + include BaseGenericModel + + # The unique identifier of the user assigned to the case. + attr_accessor :assignee_id + + # The description of the case. If not provided, the description will be automatically generated. + attr_accessor :description + + # Case priority + attr_accessor :priority + + # The title of the case. If not provided, the title will be automatically generated. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id', + :'description' => :'description', + :'priority' => :'priority', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'String', + :'description' => :'String', + :'priority' => :'CasePriority', + :'title' => :'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::CreateCaseRequestDataAttributes` 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_id') + self.assignee_id = attributes[:'assignee_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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_id == o.assignee_id && + description == o.description && + priority == o.priority && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id, description, priority, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb new file mode 100644 index 000000000000..3aafd4a3ae35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data_relationships.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 + # Relationships of the case to create. + class CreateCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + 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::CreateCaseRequestDataRelationships` 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?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + 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 @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + 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 && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb new file mode 100644 index 000000000000..c8b60c69ca43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb @@ -0,0 +1,137 @@ +=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 + # List of requests to create Jira issues for security findings. + class CreateJiraIssueRequestArray + include BaseGenericModel + + # + attr_reader :data + + # + 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::CreateJiraIssueRequestArray` 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 + + # 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 && + 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/create_jira_issue_request_array_included.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb new file mode 100644 index 000000000000..91c485b3fca6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_array_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 + # Attributes and relationships of the case linked to the Jira issue. Should contain all of the following: case, project, and security findings. + module CreateJiraIssueRequestArrayIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CreateCaseRequestData', + :'CaseManagementProjectData', + :'FindingData' + ] + 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/create_jira_issue_request_data.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb new file mode 100644 index 000000000000..489f97d6d3ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb @@ -0,0 +1,153 @@ +=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 + # Data of the Jira issue to create. + class CreateJiraIssueRequestData + include BaseGenericModel + + # Attributes of the Jira issue to create. + attr_accessor :attributes + + # The unique identifier of the Jira issue creation request. + attr_accessor :id + + # Relationships of the Jira issue to create. + attr_accessor :relationships + + # Jira issues resource type. + 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' => :'CreateJiraIssueRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'CreateJiraIssueRequestDataRelationships', + :'type' => :'JiraIssuesDataType' + } + 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::CreateJiraIssueRequestData` 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 @type.nil? + true + 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/create_jira_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb new file mode 100644 index 000000000000..37a0be54e252 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.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 + # Attributes of the Jira issue to create. + class CreateJiraIssueRequestDataAttributes + include BaseGenericModel + + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + attr_accessor :fields + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'CreateJiraIssueRequestDataAttributesFields' + } + 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::CreateJiraIssueRequestDataAttributes` 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?(:'fields') + self.fields = attributes[:'fields'] + 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 && + fields == o.fields && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb new file mode 100644 index 000000000000..22bd1a63655c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.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 + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + class CreateJiraIssueRequestDataAttributesFields + include BaseGenericModel + + # + attr_accessor :fields + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Object' + } + 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::CreateJiraIssueRequestDataAttributesFields` 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?(:'fields') + self.fields = attributes[:'fields'] + 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 && + fields == o.fields && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb new file mode 100644 index 000000000000..f00cceb992c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.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 + # Relationships of the Jira issue to create. + class CreateJiraIssueRequestDataRelationships + include BaseGenericModel + + # Case linked to the Jira issue. + attr_reader :_case + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_case' => :'case' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_case' => :'CreateJiraIssueRequestDataRelationshipsCase' + } + 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::CreateJiraIssueRequestDataRelationships` 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?(:'_case') + self._case = attributes[:'_case'] + 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 @_case.nil? + true + end + + # Custom attribute writer method with validation + # @param _case [Object] Object to be assigned + # @!visibility private + def _case=(_case) + if _case.nil? + fail ArgumentError, 'invalid value for "_case", _case cannot be nil.' + end + @_case = _case + 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 && + _case == o._case && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_case, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb new file mode 100644 index 000000000000..9e138df5908f --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.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 + # Case linked to the Jira issue. + class CreateJiraIssueRequestDataRelationshipsCase + include BaseGenericModel + + # Case linked to the Jira 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' => :'CreateJiraIssueRequestDataRelationshipsCaseData' + } + 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::CreateJiraIssueRequestDataRelationshipsCase` 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/create_jira_issue_request_data_relationships_case_data.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb new file mode 100644 index 000000000000..23323ec510bd --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_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 + # Case linked to the Jira issue. + class CreateJiraIssueRequestDataRelationshipsCaseData + include BaseGenericModel + + # + attr_reader :id + + # Cases resource type. + 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' => :'CaseDataType' + } + 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::CreateJiraIssueRequestDataRelationshipsCaseData` 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/detach_case_request.rb b/lib/datadog_api_client/v2/models/detach_case_request.rb new file mode 100644 index 000000000000..28bebfa5887a --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request.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 + # Request for detaching security findings from their case. + class DetachCaseRequest + include BaseGenericModel + + # Data for detaching security findings from their case. + attr_accessor :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' => :'DetachCaseRequestData' + } + 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::DetachCaseRequest` 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 + + # 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/detach_case_request_data.rb b/lib/datadog_api_client/v2/models/detach_case_request_data.rb new file mode 100644 index 000000000000..9533236e76a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request_data.rb @@ -0,0 +1,143 @@ +=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 + # Data for detaching security findings from their case. + class DetachCaseRequestData + include BaseGenericModel + + # The unique identifier of the detachment request. + attr_accessor :id + + # Relationships detaching security findings from their case. + attr_accessor :relationships + + # Cases resource type. + 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', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'relationships' => :'DetachCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + 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::DetachCaseRequestData` 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?(:'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 @type.nil? + true + 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 && + 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 + [id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb new file mode 100644 index 000000000000..2f086541b1ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.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 + # Relationships detaching security findings from their case. + class DetachCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings' + } + 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::DetachCaseRequestDataRelationships` 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?(:'findings') + self.findings = attributes[:'findings'] + 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 @findings.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + 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 && + findings == o.findings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response.rb b/lib/datadog_api_client/v2/models/finding_case_response.rb new file mode 100644 index 000000000000..c3024fb06151 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response.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 + # Case response. + class FindingCaseResponse + include BaseGenericModel + + # Data of the case. + attr_accessor :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' => :'FindingCaseResponseData' + } + 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::FindingCaseResponse` 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 + + # 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/finding_case_response_array.rb b/lib/datadog_api_client/v2/models/finding_case_response_array.rb new file mode 100644 index 000000000000..d57f9fcb81b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_array.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 + # List of case responses. + class FindingCaseResponseArray + include BaseGenericModel + + # + 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::FindingCaseResponseArray` 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/finding_case_response_data.rb b/lib/datadog_api_client/v2/models/finding_case_response_data.rb new file mode 100644 index 000000000000..b1693b8449c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data.rb @@ -0,0 +1,153 @@ +=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 + # Data of the case. + class FindingCaseResponseData + include BaseGenericModel + + # Attributes of the case. + attr_accessor :attributes + + # The unique identifier of the case. + attr_accessor :id + + # Relationships of the case. + attr_accessor :relationships + + # Cases resource type. + 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' => :'FindingCaseResponseDataAttributes', + :'id' => :'String', + :'relationships' => :'FindingCaseResponseDataRelationships', + :'type' => :'CaseDataType' + } + 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::FindingCaseResponseData` 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 @type.nil? + true + 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/finding_case_response_data_attributes.rb b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb new file mode 100644 index 000000000000..59cac2045980 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb @@ -0,0 +1,277 @@ +=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 + # Attributes of the case. + class FindingCaseResponseDataAttributes + include BaseGenericModel + + # Timestamp of when the case was archived. + attr_accessor :archived_at + + # Relationship to user. + attr_accessor :assigned_to + + # + attr_accessor :attributes + + # 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 associated with 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 + + # Priority of the case. + attr_accessor :priority + + # Status of the case. + attr_accessor :status + + # Status group of the case. + attr_accessor :status_group + + # Status name of the case. + attr_accessor :status_name + + # Title of the case. + attr_accessor :title + + # Type of the case. For security cases, this is always "SECURITY". + 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', + :'assigned_to' => :'assigned_to', + :'attributes' => :'attributes', + :'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', + :'status_group' => :'status_group', + :'status_name' => :'status_name', + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'archived_at' => :'Time', + :'assigned_to' => :'RelationshipToUser', + :'attributes' => :'Hash>', + :'closed_at' => :'Time', + :'created_at' => :'Time', + :'creation_source' => :'String', + :'description' => :'String', + :'due_date' => :'String', + :'insights' => :'Array', + :'jira_issue' => :'FindingJiraIssue', + :'key' => :'String', + :'modified_at' => :'Time', + :'priority' => :'String', + :'status' => :'String', + :'status_group' => :'String', + :'status_name' => :'String', + :'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::FindingCaseResponseDataAttributes` 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?(:'assigned_to') + self.assigned_to = attributes[:'assigned_to'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + 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?(:'status_group') + self.status_group = attributes[:'status_group'] + end + + if attributes.key?(:'status_name') + self.status_name = attributes[:'status_name'] + 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 && + assigned_to == o.assigned_to && + attributes == o.attributes && + 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 && + status_group == o.status_group && + status_name == o.status_name && + 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, assigned_to, attributes, closed_at, created_at, creation_source, description, due_date, insights, jira_issue, key, modified_at, priority, status, status_group, status_name, title, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb b/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb new file mode 100644 index 000000000000..b6d172aa8262 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data_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 + # Relationships of the case. + class FindingCaseResponseDataRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by + + # Relationship to user. + attr_accessor :modified_by + + # Case management project. + attr_accessor :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'modified_by' => :'modified_by', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'RelationshipToUser', + :'modified_by' => :'RelationshipToUser', + :'project' => :'CaseManagementProject' + } + 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::FindingCaseResponseDataRelationships` 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?(:'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 && + 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 + [created_by, modified_by, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_data.rb b/lib/datadog_api_client/v2/models/finding_data.rb new file mode 100644 index 000000000000..8f2b42346cea --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_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 + # + class FindingData + include BaseGenericModel + + # The unique identifier of the security finding. + attr_reader :id + + # Security findings resource type. + 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' => :'FindingDataType' + } + 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::FindingData` 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/finding_data_type.rb b/lib/datadog_api_client/v2/models/finding_data_type.rb new file mode 100644 index 000000000000..24ae286db515 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_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 + # Security findings resource type. + class FindingDataType + include BaseEnumModel + + FINDINGS = "findings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/finding_jira_issue.rb b/lib/datadog_api_client/v2/models/finding_jira_issue.rb new file mode 100644 index 000000000000..44d8ae777091 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_jira_issue.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 + # Jira issue associated with the case. + class FindingJiraIssue + include BaseGenericModel + + # The error message if the Jira issue creation failed. + attr_accessor :error_message + + # Result of the Jira issue creation. + attr_accessor :result + + # The status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created successfully, or "FAILED" if the Jira issue creation failed. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error_message' => :'error_message', + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error_message' => :'String', + :'result' => :'FindingJiraIssueResult', + :'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::FindingJiraIssue` 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?(:'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 && + error_message == o.error_message && + 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 + [error_message, result, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb b/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb new file mode 100644 index 000000000000..2eacfe86542f --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_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 + # Result of the Jira issue creation. + class FindingJiraIssueResult + include BaseGenericModel + + # The account ID of the Jira issue. + attr_accessor :account_id + + # The unique identifier of the Jira issue. + attr_accessor :issue_id + + # The key of the Jira issue. + attr_accessor :issue_key + + # The URL of the Jira issue. + attr_accessor :issue_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'issue_id' => :'issue_id', + :'issue_key' => :'issue_key', + :'issue_url' => :'issue_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'issue_id' => :'String', + :'issue_key' => :'String', + :'issue_url' => :'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::FindingJiraIssueResult` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + 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 + 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 && + account_id == o.account_id && + issue_id == o.issue_id && + issue_key == o.issue_key && + issue_url == o.issue_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, issue_id, issue_key, issue_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/findings.rb b/lib/datadog_api_client/v2/models/findings.rb new file mode 100644 index 000000000000..be8322d06d56 --- /dev/null +++ b/lib/datadog_api_client/v2/models/findings.rb @@ -0,0 +1,107 @@ +=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 list of security findings. + class Findings + include BaseGenericModel + + # + attr_accessor :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::Findings` 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 + + # 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/jira_issues_data_type.rb b/lib/datadog_api_client/v2/models/jira_issues_data_type.rb new file mode 100644 index 000000000000..c02ca66d1ed4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issues_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 + # Jira issues resource type. + class JiraIssuesDataType + include BaseEnumModel + + JIRA_ISSUES = "jira_issues".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb b/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb index eece02fd4e80..a2abda5524e2 100644 --- a/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb +++ b/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb @@ -47,6 +47,14 @@ def self.openapi_types } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/team_attributes.rb b/lib/datadog_api_client/v2/models/team_attributes.rb index 0e1b15cb3811..ce7277f30711 100644 --- a/lib/datadog_api_client/v2/models/team_attributes.rb +++ b/lib/datadog_api_client/v2/models/team_attributes.rb @@ -39,6 +39,9 @@ class TeamAttributes # Collection of hidden modules for the team attr_accessor :hidden_modules + # Whether the team is managed from an external source + attr_accessor :is_managed + # The number of links belonging to the team attr_reader :link_count @@ -69,6 +72,7 @@ def self.attribute_map :'description' => :'description', :'handle' => :'handle', :'hidden_modules' => :'hidden_modules', + :'is_managed' => :'is_managed', :'link_count' => :'link_count', :'modified_at' => :'modified_at', :'name' => :'name', @@ -88,6 +92,7 @@ def self.openapi_types :'description' => :'String', :'handle' => :'String', :'hidden_modules' => :'Array', + :'is_managed' => :'Boolean', :'link_count' => :'Integer', :'modified_at' => :'Time', :'name' => :'String', @@ -104,7 +109,9 @@ def self.openapi_nullable :'avatar', :'banner', :'description', + :'hidden_modules', :'summary', + :'visible_modules', ]) end @@ -152,6 +159,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + if attributes.key?(:'link_count') self.link_count = attributes[:'link_count'] end @@ -281,6 +292,7 @@ def ==(o) description == o.description && handle == o.handle && hidden_modules == o.hidden_modules && + is_managed == o.is_managed && link_count == o.link_count && modified_at == o.modified_at && name == o.name && @@ -294,7 +306,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [avatar, banner, created_at, description, handle, hidden_modules, link_count, modified_at, name, summary, user_count, visible_modules, additional_properties].hash + [avatar, banner, created_at, description, handle, hidden_modules, is_managed, link_count, modified_at, name, summary, user_count, visible_modules, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link.rb new file mode 100644 index 000000000000..6a123133872f --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link.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 + # Team hierarchy link + class TeamHierarchyLink + include BaseGenericModel + + # Team hierarchy link attributes + attr_reader :attributes + + # The team hierarchy link's identifier + attr_reader :id + + # Team hierarchy link relationships + attr_accessor :relationships + + # Team hierarchy link type + 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' => :'TeamHierarchyLinkAttributes', + :'id' => :'String', + :'relationships' => :'TeamHierarchyLinkRelationships', + :'type' => :'TeamHierarchyLinkType' + } + 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::TeamHierarchyLink` 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/team_hierarchy_link_attributes.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb new file mode 100644 index 000000000000..e6dc55c80135 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.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 + # Team hierarchy link attributes + class TeamHierarchyLinkAttributes + include BaseGenericModel + + # Timestamp when the team hierarchy link was created + attr_reader :created_at + + # The provisioner of the team hierarchy link + attr_reader :provisioned_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'provisioned_by' => :'provisioned_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'provisioned_by' => :'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::TeamHierarchyLinkAttributes` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'provisioned_by') + self.provisioned_by = attributes[:'provisioned_by'] + 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 @created_at.nil? + return false if @provisioned_by.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param provisioned_by [Object] Object to be assigned + # @!visibility private + def provisioned_by=(provisioned_by) + if provisioned_by.nil? + fail ArgumentError, 'invalid value for "provisioned_by", provisioned_by cannot be nil.' + end + @provisioned_by = provisioned_by + 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 && + created_at == o.created_at && + provisioned_by == o.provisioned_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, provisioned_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb new file mode 100644 index 000000000000..4fd53aafd4ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create.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 + # Data provided when creating a team hierarchy link + class TeamHierarchyLinkCreate + include BaseGenericModel + + # The related teams that will be connected by the team hierarchy link + attr_reader :relationships + + # Team hierarchy link type + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'relationships' => :'TeamHierarchyLinkCreateRelationships', + :'type' => :'TeamHierarchyLinkType' + } + 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::TeamHierarchyLinkCreate` 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?(:'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 @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + 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 && + 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 + [relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb new file mode 100644 index 000000000000..bba599d772d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.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 related teams that will be connected by the team hierarchy link + class TeamHierarchyLinkCreateRelationships + include BaseGenericModel + + # Data about each team that will be connected by the team hierarchy link + attr_reader :parent_team + + # Data about each team that will be connected by the team hierarchy link + attr_reader :sub_team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'parent_team' => :'parent_team', + :'sub_team' => :'sub_team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'parent_team' => :'TeamHierarchyLinkCreateTeamRelationship', + :'sub_team' => :'TeamHierarchyLinkCreateTeamRelationship' + } + 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::TeamHierarchyLinkCreateRelationships` 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?(:'parent_team') + self.parent_team = attributes[:'parent_team'] + end + + if attributes.key?(:'sub_team') + self.sub_team = attributes[:'sub_team'] + 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 @parent_team.nil? + return false if @sub_team.nil? + true + end + + # Custom attribute writer method with validation + # @param parent_team [Object] Object to be assigned + # @!visibility private + def parent_team=(parent_team) + if parent_team.nil? + fail ArgumentError, 'invalid value for "parent_team", parent_team cannot be nil.' + end + @parent_team = parent_team + end + + # Custom attribute writer method with validation + # @param sub_team [Object] Object to be assigned + # @!visibility private + def sub_team=(sub_team) + if sub_team.nil? + fail ArgumentError, 'invalid value for "sub_team", sub_team cannot be nil.' + end + @sub_team = sub_team + 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 && + parent_team == o.parent_team && + sub_team == o.sub_team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [parent_team, sub_team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb new file mode 100644 index 000000000000..7a6330c0da03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_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 + # Request to create a team hierarchy link + class TeamHierarchyLinkCreateRequest + include BaseGenericModel + + # Data provided when creating a team hierarchy link + 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' => :'TeamHierarchyLinkCreate' + } + 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::TeamHierarchyLinkCreateRequest` 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/team_hierarchy_link_create_team.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb new file mode 100644 index 000000000000..7eec7efad6fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.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 + # This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + class TeamHierarchyLinkCreateTeam + include BaseGenericModel + + # The team's identifier + attr_reader :id + + # Team type + 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' => :'TeamType' + } + 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::TeamHierarchyLinkCreateTeam` 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/team_hierarchy_link_create_team_relationship.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb new file mode 100644 index 000000000000..5a47a57c246e --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_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 + # Data about each team that will be connected by the team hierarchy link + class TeamHierarchyLinkCreateTeamRelationship + include BaseGenericModel + + # This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + 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' => :'TeamHierarchyLinkCreateTeam' + } + 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::TeamHierarchyLinkCreateTeamRelationship` 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/team_hierarchy_link_relationships.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb new file mode 100644 index 000000000000..18da59b263d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.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 + # Team hierarchy link relationships + class TeamHierarchyLinkRelationships + include BaseGenericModel + + # Team hierarchy link team relationship + attr_reader :parent_team + + # Team hierarchy link team relationship + attr_reader :sub_team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'parent_team' => :'parent_team', + :'sub_team' => :'sub_team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'parent_team' => :'TeamHierarchyLinkTeamRelationship', + :'sub_team' => :'TeamHierarchyLinkTeamRelationship' + } + 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::TeamHierarchyLinkRelationships` 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?(:'parent_team') + self.parent_team = attributes[:'parent_team'] + end + + if attributes.key?(:'sub_team') + self.sub_team = attributes[:'sub_team'] + 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 @parent_team.nil? + return false if @sub_team.nil? + true + end + + # Custom attribute writer method with validation + # @param parent_team [Object] Object to be assigned + # @!visibility private + def parent_team=(parent_team) + if parent_team.nil? + fail ArgumentError, 'invalid value for "parent_team", parent_team cannot be nil.' + end + @parent_team = parent_team + end + + # Custom attribute writer method with validation + # @param sub_team [Object] Object to be assigned + # @!visibility private + def sub_team=(sub_team) + if sub_team.nil? + fail ArgumentError, 'invalid value for "sub_team", sub_team cannot be nil.' + end + @sub_team = sub_team + 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 && + parent_team == o.parent_team && + sub_team == o.sub_team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [parent_team, sub_team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb new file mode 100644 index 000000000000..98bd6b23cc84 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb @@ -0,0 +1,127 @@ +=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 + # Team hierarchy link response + class TeamHierarchyLinkResponse + include BaseGenericModel + + # Team hierarchy link + attr_accessor :data + + # Included teams + attr_accessor :included + + # When querying team hierarchy links, a set of links for navigation between different pages is included + attr_accessor :links + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'links' => :'links' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamHierarchyLink', + :'included' => :'Array', + :'links' => :'TeamsHierarchyLinksResponseLinks' + } + 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::TeamHierarchyLinkResponse` 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 + + if attributes.key?(:'links') + self.links = attributes[:'links'] + 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 && + links == o.links && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, links, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb new file mode 100644 index 000000000000..b64ea5d59f79 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb @@ -0,0 +1,154 @@ +=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 + # Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + class TeamHierarchyLinkTeam + include BaseGenericModel + + # Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + attr_accessor :attributes + + # The team's identifier + attr_reader :id + + # Team type + 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' => :'TeamHierarchyLinkTeamAttributes', + :'id' => :'String', + :'type' => :'TeamType' + } + 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::TeamHierarchyLinkTeam` 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 @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 && + 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/team_hierarchy_link_team_attributes.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb new file mode 100644 index 000000000000..85d6d36b0bbb --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb @@ -0,0 +1,223 @@ +=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 + # Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + class TeamHierarchyLinkTeamAttributes + include BaseGenericModel + + # The team's avatar + attr_accessor :avatar + + # The team's banner + attr_accessor :banner + + # The team's handle + attr_reader :handle + + # Whether the team is managed + attr_accessor :is_managed + + # Whether the team has open membership + attr_accessor :is_open_membership + + # The number of links for the team + attr_accessor :link_count + + # The team's name + attr_reader :name + + # The team's summary + attr_accessor :summary + + # The number of users in the team + attr_accessor :user_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'avatar' => :'avatar', + :'banner' => :'banner', + :'handle' => :'handle', + :'is_managed' => :'is_managed', + :'is_open_membership' => :'is_open_membership', + :'link_count' => :'link_count', + :'name' => :'name', + :'summary' => :'summary', + :'user_count' => :'user_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'avatar' => :'String', + :'banner' => :'Integer', + :'handle' => :'String', + :'is_managed' => :'Boolean', + :'is_open_membership' => :'Boolean', + :'link_count' => :'Integer', + :'name' => :'String', + :'summary' => :'String', + :'user_count' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'avatar', + :'summary', + ]) + 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::TeamHierarchyLinkTeamAttributes` 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?(:'avatar') + self.avatar = attributes[:'avatar'] + end + + if attributes.key?(:'banner') + self.banner = attributes[:'banner'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + + if attributes.key?(:'is_open_membership') + self.is_open_membership = attributes[:'is_open_membership'] + end + + if attributes.key?(:'link_count') + self.link_count = attributes[:'link_count'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + + if attributes.key?(:'user_count') + self.user_count = attributes[:'user_count'] + 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 @handle.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + avatar == o.avatar && + banner == o.banner && + handle == o.handle && + is_managed == o.is_managed && + is_open_membership == o.is_open_membership && + link_count == o.link_count && + name == o.name && + summary == o.summary && + user_count == o.user_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [avatar, banner, handle, is_managed, is_open_membership, link_count, name, summary, user_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb new file mode 100644 index 000000000000..3b5e43f12cb4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_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 + # Team hierarchy link team relationship + class TeamHierarchyLinkTeamRelationship + include BaseGenericModel + + # Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + 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' => :'TeamHierarchyLinkTeam' + } + 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::TeamHierarchyLinkTeamRelationship` 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/team_hierarchy_link_type.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb new file mode 100644 index 000000000000..aedf483f2c5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_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 + # Team hierarchy link type + class TeamHierarchyLinkType + include BaseEnumModel + + TEAM_HIERARCHY_LINKS = "team_hierarchy_links".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb b/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb new file mode 100644 index 000000000000..fc471c36d3c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb @@ -0,0 +1,139 @@ +=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 + # Team hierarchy links response + class TeamHierarchyLinksResponse + include BaseGenericModel + + # Team hierarchy links response data + attr_accessor :data + + # Included teams + attr_accessor :included + + # When querying team hierarchy links, a set of links for navigation between different pages is included + attr_accessor :links + + # Metadata that is included in the response when querying the team hierarchy links + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array', + :'links' => :'TeamsHierarchyLinksResponseLinks', + :'meta' => :'TeamsHierarchyLinksResponseMeta' + } + 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::TeamHierarchyLinksResponse` 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 + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + 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 && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb new file mode 100644 index 000000000000..ac7be7445f9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb @@ -0,0 +1,156 @@ +=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 + # When querying team hierarchy links, a set of links for navigation between different pages is included + class TeamsHierarchyLinksResponseLinks + include BaseGenericModel + + # Link to the first page. + attr_accessor :first + + # Link to the last page. + attr_accessor :last + + # Link to the next page. + attr_accessor :_next + + # Link to the previous page. + attr_accessor :prev + + # Link to the current object. + attr_accessor :_self + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first' => :'first', + :'last' => :'last', + :'_next' => :'next', + :'prev' => :'prev', + :'_self' => :'self' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first' => :'String', + :'last' => :'String', + :'_next' => :'String', + :'prev' => :'String', + :'_self' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'first', + :'last', + :'_next', + :'prev', + ]) + 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::TeamsHierarchyLinksResponseLinks` 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?(:'first') + self.first = attributes[:'first'] + end + + if attributes.key?(:'last') + self.last = attributes[:'last'] + end + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + + if attributes.key?(:'prev') + self.prev = attributes[:'prev'] + end + + if attributes.key?(:'_self') + self._self = attributes[:'_self'] + 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 && + first == o.first && + last == o.last && + _next == o._next && + prev == o.prev && + _self == o._self && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first, last, _next, prev, _self, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb new file mode 100644 index 000000000000..a312d0c1798d --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.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 + # Metadata that is included in the response when querying the team hierarchy links + class TeamsHierarchyLinksResponseMeta + include BaseGenericModel + + # Metadata related to paging information that is included in the response when querying the team hierarchy links + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'TeamsHierarchyLinksResponseMetaPage' + } + 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::TeamsHierarchyLinksResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb new file mode 100644 index 000000000000..4269a2ee1f51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb @@ -0,0 +1,184 @@ +=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 + # Metadata related to paging information that is included in the response when querying the team hierarchy links + class TeamsHierarchyLinksResponseMetaPage + include BaseGenericModel + + # First page number. + attr_accessor :first_number + + # Last page number. + attr_accessor :last_number + + # Next page number. + attr_accessor :next_number + + # Page number. + attr_accessor :number + + # Previous page number. + attr_accessor :prev_number + + # Page size. + attr_accessor :size + + # Total number of results. + attr_accessor :total + + # Pagination type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first_number' => :'first_number', + :'last_number' => :'last_number', + :'next_number' => :'next_number', + :'number' => :'number', + :'prev_number' => :'prev_number', + :'size' => :'size', + :'total' => :'total', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first_number' => :'Integer', + :'last_number' => :'Integer', + :'next_number' => :'Integer', + :'number' => :'Integer', + :'prev_number' => :'Integer', + :'size' => :'Integer', + :'total' => :'Integer', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_number', + :'prev_number', + ]) + 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::TeamsHierarchyLinksResponseMetaPage` 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?(:'first_number') + self.first_number = attributes[:'first_number'] + end + + if attributes.key?(:'last_number') + self.last_number = attributes[:'last_number'] + end + + if attributes.key?(:'next_number') + self.next_number = attributes[:'next_number'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'prev_number') + self.prev_number = attributes[:'prev_number'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + 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 && + first_number == o.first_number && + last_number == o.last_number && + next_number == o.next_number && + number == o.number && + prev_number == o.prev_number && + size == o.size && + total == o.total && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first_number, last_number, next_number, number, prev_number, size, total, type, additional_properties].hash + end + end +end